Skip to content

Commit

Permalink
Allow configuring a mastodon instance for contact
Browse files Browse the repository at this point in the history
  • Loading branch information
rolandgeider committed Nov 19, 2023
1 parent c53b4aa commit b4bd6fa
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 55 deletions.
26 changes: 11 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# wger

<img src="https://raw.githubusercontent.com/wger-project/wger/master/wger/core/static/images/logos/logo.png" width="100" height="100" />

wger (ˈvɛɡɐ) Workout Manager is a free, open source web application that helps
Expand All @@ -10,15 +11,14 @@ For a live system, refer to the project's site: <https://wger.de/>

![Workout plan](https://raw.githubusercontent.com/wger-project/wger/master/wger/software/static/images/workout.png)


## Mobile app

[<img src="https://play.google.com/intl/en_us/badges/images/generic/en-play-badge.png"
alt="Get it on Google Play"
height="80">](https://play.google.com/store/apps/details?id=de.wger.flutter)
alt="Get it on Google Play"
height="80">](https://play.google.com/store/apps/details?id=de.wger.flutter)
[<img src="https://fdroid.gitlab.io/artwork/badge/get-it-on.png"
alt="Get it on F-Droid"
height="80">](https://f-droid.org/packages/de.wger.flutter/)

alt="Get it on F-Droid"
height="80">](https://f-droid.org/packages/de.wger.flutter/)

## Installation

Expand All @@ -30,7 +30,6 @@ as an administration guide available at <https://wger.readthedocs.io> or in the
Please consult the commands' help for further information and available
parameters.


### Production

If you want to host your own instance, take a look at the provided docker
Expand Down Expand Up @@ -67,7 +66,7 @@ docker run -ti \
Then just open <http://localhost:8000> and log in as: **admin**, password **adminadmin**

For more info, check the [README in wger/extras/developemt](
./extras/docker/development/README.md
./extras/docker/development/README.md
).

Alternatively you can use the production compose file for development as well,
Expand All @@ -79,32 +78,29 @@ file for details). You will also probably want to set `DJANGO_DEBUG to false
If you prefer a local installation, consult the
[development documentation](https://wger.readthedocs.io/en/latest/development.html)


## Contact

Feel free to contact us if you found this useful or if there was something that
didn't behave as you expected. We can't fix what we don't know about, so please
report liberally. If you're not sure if something is a bug or not, feel free to
file a bug anyway.

* **discord:** <https://discord.gg/rPWFv6W>
* **issue tracker:** <https://github.com/wger-project/wger/issues>
* **twitter:** <https://twitter.com/wger_project>

* **Discord:** <https://discord.gg/rPWFv6W>
* **Issue tracker:** <https://github.com/wger-project/wger/issues>
* **Mastodon:** <https://fosstodon.org/@wger>

## Sources

All the code and the content is available on github:

<https://github.com/wger-project/wger>


## Translation

Translate the app to your language on [Weblate](https://hosted.weblate.org/engage/wger/).

[![translation status](https://hosted.weblate.org/widgets/wger/-/multi-blue.svg)](https://hosted.weblate.org/engage/wger/)


## License

The application is licensed under the Affero GNU General Public License 3 or
Expand Down
4 changes: 2 additions & 2 deletions wger/core/models/profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -523,8 +523,8 @@ def user_bodyweight(self, weight):
"""
if (
not WeightEntry.objects.filter(user=self.user).exists() or (
datetime.date.today() - WeightEntry.objects.filter(user=self.user).latest().date
> datetime.timedelta(days=3)
datetime.date.today() - WeightEntry.objects.filter(user=self.user).latest().date >
datetime.timedelta(days=3)
)
):
entry = WeightEntry()
Expand Down
8 changes: 4 additions & 4 deletions wger/settings_global.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
from wger import get_version
from wger.utils.constants import DOWNLOAD_INGREDIENT_WGER


"""
This file contains the global settings that don't usually need to be changed.
For a full list of options, visit:
Expand Down Expand Up @@ -172,7 +171,7 @@
'django.template.loaders.app_directories.Loader',
],
'debug':
False
False
},
},
]
Expand Down Expand Up @@ -257,7 +256,7 @@
LANGUAGE_CODE = 'en'

# All translation files are in one place
LOCALE_PATHS = (os.path.join(SITE_ROOT, 'locale'), )
LOCALE_PATHS = (os.path.join(SITE_ROOT, 'locale'),)

# Primary keys are AutoFields
DEFAULT_AUTO_FIELD = 'django.db.models.AutoField'
Expand Down Expand Up @@ -498,7 +497,7 @@
#
# Ignore these URLs if they cause 404
#
IGNORABLE_404_URLS = (re.compile(r'^/favicon\.ico$'), )
IGNORABLE_404_URLS = (re.compile(r'^/favicon\.ico$'),)

#
# Password rules
Expand Down Expand Up @@ -537,6 +536,7 @@
'SYNC_EXERCISE_IMAGES_CELERY': False,
'SYNC_EXERCISE_VIDEOS_CELERY': False,
'TWITTER': False,
'MASTODON': 'https://fosstodon.org/@wger',
'USE_CELERY': False,
'USE_RECAPTCHA': False,
'WGER_INSTANCE': 'https://wger.de',
Expand Down
17 changes: 13 additions & 4 deletions wger/software/templates/features.html
Original file line number Diff line number Diff line change
Expand Up @@ -519,10 +519,19 @@ <h1 class="fs-5 text-white">
rel="noopener noreferrer">
<i class="fab fa-discord px-2"></i>
</a>
<a href="https://twitter.com/wger_project" target="_blank"
rel="noopener noreferrer">
<i class="fab fa-twitter px-2" aria-hidden="true"></i>
</a>
{% if twitter %}
<a href="https://twitter.com/{{ twitter }}" target="_blank"
rel="noopener noreferrer">
<i class="fab fa-twitter px-2" aria-hidden="true"></i>
</a>
{% endif %}

{% if mastodon %}
<a href="{{ mastodon }}" target="_blank"
rel="noopener noreferrer">
<i class="fab fa-mastodon px-2" aria-hidden="true"></i>
</a>
{% endif %}
</h1>
</li>
<li class="list-group-item bg-transparent border-0">
Expand Down
49 changes: 19 additions & 30 deletions wger/utils/context_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,59 +35,48 @@ def processor(request):
for lang in settings.AVAILABLE_LANGUAGES:
i18n_path[lang[0]] = '/{0}/{1}'.format(lang[0], '/'.join(full_path.split('/')[2:]))

# yapf: disable
context = {
# Twitter handle for this instance
'twitter':
settings.WGER_SETTINGS['TWITTER'],
'mastodon': settings.WGER_SETTINGS['MASTODON'],
'twitter': settings.WGER_SETTINGS['TWITTER'],

# Languages
'i18n_language':
get_language_data(
(get_language(), languages_dict.get(get_language(), ENGLISH_SHORT_NAME)),
),
'languages':
settings.AVAILABLE_LANGUAGES,
get_language_data(
(get_language(), languages_dict.get(get_language(), ENGLISH_SHORT_NAME)),
),
'languages': settings.AVAILABLE_LANGUAGES,

# The current path
'request_full_path':
full_path,
'request_full_path': full_path,

# The current full path with host
'request_absolute_path':
request.build_absolute_uri(),
'image_absolute_path':
request.build_absolute_uri(static_path),
'request_absolute_path': request.build_absolute_uri(),
'image_absolute_path': request.build_absolute_uri(static_path),

# Translation links
'i18n_path':
i18n_path,
'is_api_path':
'/api/' in request.build_absolute_uri(),
'i18n_path': i18n_path,
'is_api_path': '/api/' in request.build_absolute_uri(),

# Flag for guest users
'has_demo_data':
request.session.get('has_demo_data', False),
'has_demo_data': request.session.get('has_demo_data', False),

# Don't show messages on AJAX requests (they are deleted if shown)
'no_messages':
request.META.get('HTTP_X_WGER_NO_MESSAGES', False),
'no_messages': request.META.get('HTTP_X_WGER_NO_MESSAGES', False),

# Default cache time for template fragment caching
'cache_timeout':
settings.CACHES['default']['TIMEOUT'],
'cache_timeout': settings.CACHES['default']['TIMEOUT'],

# Used for logged in trainers
'trainer_identity':
request.session.get('trainer.identity'),
'trainer_identity': request.session.get('trainer.identity'),

# current gym, if available
'custom_header':
get_custom_header(request),
'custom_header': get_custom_header(request),

# Template to extend in forms, kinda ugly but will be removed in the future
'extend_template':
'base_empty.html' if is_ajax else 'base.html'
'extend_template': 'base_empty.html' if is_ajax else 'base.html',
}
# yapf: enable

# Pseudo-intelligent navigation here
if '/software/' in request.get_full_path() \
Expand Down

0 comments on commit b4bd6fa

Please sign in to comment.