diff --git a/core/lookups.py b/core/lookups.py index 1e061674..5649f7c3 100644 --- a/core/lookups.py +++ b/core/lookups.py @@ -1,7 +1,8 @@ from ajax_select import register, LookupChannel from core.views.site import search_user -from core.models import User +from core.models import User, Group +from club.models import Club from counter.models import Product, Counter @register('users') @@ -17,6 +18,32 @@ class UsersLookup(LookupChannel): def format_item_display(self, item): return item.get_display_name() +@register('groups') +class GroupsLookup(LookupChannel): + model = Group + + def get_query(self, q, request): + return self.model.objects.filter(name__icontains=q)[:50] + + def format_match(self, obj): + return obj.name + + def format_item_display(self, item): + return item.name + +@register('clubs') +class ClubLookup(LookupChannel): + model = Club + + def get_query(self, q, request): + return self.model.objects.filter(name__icontains=q)[:50] + + def format_match(self, obj): + return obj.name + + def format_item_display(self, item): + return item.name + @register('counters') class CountersLookup(LookupChannel): model = Counter diff --git a/core/models.py b/core/models.py index 40323810..c3d3d772 100644 --- a/core/models.py +++ b/core/models.py @@ -368,7 +368,7 @@ class User(AbstractBaseUser): %s """ % ( - self.profile_pict.get_download_url() if self.profile_pict else staticfiles_storage.url("core/img/na.gif"), + self.profile_pict.get_download_url() if self.profile_pict else staticfiles_storage.url("core/img/unknown.jpg"), _("Profile"), escape(self.get_display_name()), ) diff --git a/core/static/core/img/unknown.jpg b/core/static/core/img/unknown.jpg new file mode 100644 index 00000000..9761a585 Binary files /dev/null and b/core/static/core/img/unknown.jpg differ diff --git a/core/static/core/img/yug.jpg b/core/static/core/img/yug.jpg new file mode 100644 index 00000000..c4da7887 Binary files /dev/null and b/core/static/core/img/yug.jpg differ diff --git a/core/static/core/style.css b/core/static/core/style.css index 6a43701c..019eacfc 100644 --- a/core/static/core/style.css +++ b/core/static/core/style.css @@ -183,10 +183,10 @@ tbody>tr:hover { } #user_profile h4 { border-bottom: 1px solid grey; max-width: 60%; } #user_profile #left_column { - max-width: 59%; + width: 59%; } #user_profile #right_column { - max-width: 40%; + width: 40%; float: right; font-style: italic; } diff --git a/core/templates/core/base.jinja b/core/templates/core/base.jinja index 832ea758..f6677ef8 100644 --- a/core/templates/core/base.jinja +++ b/core/templates/core/base.jinja @@ -25,7 +25,7 @@ {% trans %}Tools{% endtrans %} | {% trans %}Logout{% endtrans %}
{% endif %} @@ -94,6 +94,13 @@ $('.select_date').datepicker({ monthNamesShort: $.datepicker.regional[ "{{ request.LANGUAGE_CODE }}" ].monthNamesShort, monthNames: $.datepicker.regional[ "{{ request.LANGUAGE_CODE }}" ].monthNames, }).datepicker( $.datepicker.regional[ "{{ request.LANGUAGE_CODE }}"] ); +$(document).keydown(function (e) { + if ($(e.target).is('input')) { return } + if (e.keyCode == 83) { + $("#search").focus(); + return false; + } +}); {% endblock %}