aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFilipp Lepalaan <filipp@mac.com>2021-05-13 10:48:37 +0300
committerFilipp Lepalaan <filipp@mac.com>2021-05-13 10:48:37 +0300
commit0deeb6bbecd35f672c55382bc32d596e642e346e (patch)
tree7a05c466bdfc11661d9e074907f3475624d82063
parentdbc4aff747b6d8e2bc817f91878b4f02458c30ae (diff)
downloadServo-0deeb6bbecd35f672c55382bc32d596e642e346e.tar.gz
Servo-0deeb6bbecd35f672c55382bc32d596e642e346e.tar.bz2
Servo-0deeb6bbecd35f672c55382bc32d596e642e346e.zip
Only show check-in button on login when feature enabled.
-rw-r--r--servo/models/queue.py1
-rwxr-xr-xservo/templates/accounts/login.html4
-rw-r--r--servo/views/account.py4
3 files changed, 8 insertions, 1 deletions
diff --git a/servo/models/queue.py b/servo/models/queue.py
index 8eefab6..28d04c3 100644
--- a/servo/models/queue.py
+++ b/servo/models/queue.py
@@ -28,6 +28,7 @@ class Queue(models.Model):
locations = models.ManyToManyField(
Location,
+ null=True,
verbose_name=_('locations'),
help_text=_("Pick the locations you want this queue to appear in.")
)
diff --git a/servo/templates/accounts/login.html b/servo/templates/accounts/login.html
index ea71bcc..e77c753 100755
--- a/servo/templates/accounts/login.html
+++ b/servo/templates/accounts/login.html
@@ -15,7 +15,11 @@
</div>
<br/>
<div class="pull-right">
+ {% if show_checkin %}
<a class="btn btn" href="{% url 'checkin-index' %}">{% trans "Check-in" %}</a>
+ {% else %}
+ <a class="btn btn disabled" href="#">{% trans "Check-in" %}</a>
+ {% endif %}
<button class="btn btn-primary" type="submit">{% trans "Login" %}</button>
</div>
</form>
diff --git a/servo/views/account.py b/servo/views/account.py
index a2e979b..0b894e0 100644
--- a/servo/views/account.py
+++ b/servo/views/account.py
@@ -17,7 +17,7 @@ from django.shortcuts import redirect, render, get_object_or_404
from servo.lib.utils import paginate
from servo.views.order import prepare_list_view
-from servo.models import Order, User
+from servo.models import Order, User, Configuration
from servo.forms.account import ProfileForm, RegistrationForm, LoginForm
@@ -81,8 +81,10 @@ def orders(request):
def login(request):
"""User trying to log in."""
+
title = _("Sign In")
form = LoginForm()
+ show_checkin = Configuration.checkin_enabled()
if 'username' in request.POST: