Skip to content

Commit

Permalink
Merge pull request #153 from loviuz/master
Browse files Browse the repository at this point in the history
  • Loading branch information
lilioid authored Jan 6, 2024
2 parents d113e68 + 252f46b commit d338d96
Show file tree
Hide file tree
Showing 9 changed files with 2,516 additions and 11 deletions.
2 changes: 2 additions & 0 deletions bitpoll/base/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@
<button name="language" value="de" class="btn-link lang-btn" type="submit">Deutsch</button>
&middot;
<button name="language" value="en" class="btn-link lang-btn" type="submit">English</button>
&middot;
<button name="language" value="it" class="btn-link lang-btn" type="submit">Italiano</button>
</p>
</form>

Expand Down
2 changes: 1 addition & 1 deletion bitpoll/base/templates/base/about.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ <h2>{% trans 'Thanks' %}</h2>
<p>{% blocktrans %}We would like to thank the students of the Department of Informatics from the University of Hamburg for their testing
of BitPoll{% endblocktrans %}</p>

<h2>Contributing</h2>
<h2>{% blocktrans %}Contributing{% endblocktrans %}</h2>
<p>{% blocktrans %}If you would like to contribute, you can create issues and / or pull requests at
<a href="https://github.com/fsinfuhh/BitPoll">GitHub</a>.{% endblocktrans %}</p>
</div>
Expand Down
2 changes: 1 addition & 1 deletion bitpoll/base/templates/base/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ <h1>{% trans 'Create a poll' %}</h1>
<button id="slug-randomize" class="action small script-only"><i class="fa-solid fa-random"></i><span>{% trans 'Randomize Now' %}</span>
</button>
</div>
<label for="slug">URL name</label>
<label for="slug">{% trans 'URL name' %}</label>
<div class="input-group"><span class="input-group-addon">{% value_from_settings BASE_URL %}/poll/</span>
<input class="form-control" id="slug-input" name="{{ poll_form.url.name }}" type="text"
value="{{ poll_form.url.value|default_if_none:random_url }}" maxlength="80">
Expand Down
9 changes: 5 additions & 4 deletions bitpoll/base/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
from django.core import signing
from django.conf import settings

from django.utils.translation import gettext_lazy as _

def index(request):
"""
Expand Down Expand Up @@ -53,10 +54,10 @@ def index(request):
current_poll.save()
# TODO: lazy translation
# TODO: load from config
ChoiceValue(title="yes", icon="check", color="90db46", weight=1, poll=current_poll).save()
ChoiceValue(title="no", icon="ban", color="c43131", weight=0, poll=current_poll).save()
ChoiceValue(title="maybe", icon="question", color="ffe800", weight=0.5, poll=current_poll).save()
ChoiceValue(title="rather not", icon="thumbs-down", color="B0E", weight=0.25, poll=current_poll).save()
ChoiceValue(title=_("yes"), icon="check", color="90db46", weight=1, poll=current_poll).save()
ChoiceValue(title=_("no"), icon="ban", color="c43131", weight=0, poll=current_poll).save()
ChoiceValue(title=_("maybe"), icon="question", color="ffe800", weight=0.5, poll=current_poll).save()
ChoiceValue(title=_("rather not"), icon="thumbs-down", color="B0E", weight=0.25, poll=current_poll).save()

if current_poll.type == 'universal': # TODO: heir könnte auch auf die algemeine edit url weitergeleitet werden
return redirect('poll_editUniversalChoice', current_poll.url)
Expand Down
2 changes: 1 addition & 1 deletion bitpoll/poll/templates/poll/choicevalue.html
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ <h2>{% trans 'Add choice value' %}</h2>
<input class="action primary" type="submit" value="{% trans 'Add' %}">
{% endif %}

<h3>Available icons</h3>
<h3>{% trans 'Available icons' %}</h3>
<p class="script-only icon-script-insert">{% trans 'Click icon to insert it into the form.' %}</p>

</form>
Expand Down
6 changes: 3 additions & 3 deletions bitpoll/poll/templates/poll/settings.html
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,10 @@
<label for="vote_show_score_in_summary">{% trans 'Show score instead of percentage' %}</label>
</div>
<div class="">
Sort results by:
{% trans 'Sort results by:' %}
{# TODO: use enum values #}
<input type="radio" name="{{ form.sorting.name }}" value="0" id="sorting_date" {% if form.sorting.value == 0 %} checked {% endif %}><label for="sorting_date">Date</label>
<input type="radio" name="{{ form.sorting.name }}" value="1" id="sorting_name" {% if form.sorting.value == 1 %} checked {% endif %}><label for="sorting_name">Name</label>
<input type="radio" name="{{ form.sorting.name }}" value="0" id="sorting_date" {% if form.sorting.value == 0 %} checked {% endif %}><label for="sorting_date">&nbsp;{% trans 'Date' %}</label>
<input type="radio" name="{{ form.sorting.name }}" value="1" id="sorting_name" {% if form.sorting.value == 1 %} checked {% endif %}><label for="sorting_name">&nbsp;{% trans 'Name' %}</label>
</div>
<div class="help-block">
{% blocktrans %}
Expand Down
2 changes: 1 addition & 1 deletion bitpoll/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@
LANGUAGES = (
('de', 'Deutsch'),
('en', 'English'),
#('fr', 'Français'),
('it', 'Italiano'),
)

REGISTER_ENABLED = True
Expand Down
1 change: 1 addition & 0 deletions bitpoll/settings_local.sample.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
# ('de', 'Deutsch'),
# ('en', 'English'),
# #('fr', 'Français'),
# ('it', 'Italiano'),
#)

#REGISTER_ENABLED = True
Expand Down
Loading

0 comments on commit d338d96

Please sign in to comment.