Merge branch 'jethro'
This commit is contained in:
commit
d788396c94
4 changed files with 54 additions and 3 deletions
13
korektury/static/korektury/opraf-list.css
Normal file
13
korektury/static/korektury/opraf-list.css
Normal file
|
@ -0,0 +1,13 @@
|
|||
.adding-text{
|
||||
color: black;
|
||||
}
|
||||
.comitting-text
|
||||
{
|
||||
color: yellow;
|
||||
}
|
||||
.deprecated-text {
|
||||
color: red;
|
||||
text-decoration: line-through;
|
||||
}
|
||||
|
||||
|
|
@ -1,4 +1,9 @@
|
|||
{% extends "korektury/base.html" %}
|
||||
{% load staticfiles %}
|
||||
|
||||
{% block script%}
|
||||
<link rel="stylesheet" type="text/css" media="screen, projection" href="{% static "korektury/opraf-list.css" %}" />
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
|
@ -12,7 +17,7 @@
|
|||
|
||||
<ul>
|
||||
{% for pdf in object_list %}
|
||||
<li> <b>{{ pdf.nazev }}</b> <i>{{pdf.komentar}}</i> <a href="/korektury/{{pdf.id}}">{{pdf.pdf.name}}</a> </li>
|
||||
<li><span {% if pdf.status = 'zanaseni'%} class="comitting-text" {% elif pdf.status = 'zastarale' %} class="deprecated-text" {% endif %}> <b>{{ pdf.nazev }}</b> <i>{{pdf.komentar}}</i> <a href="/korektury/{{pdf.id}}">{{pdf.pdf.name}}</a> </span> </li>
|
||||
{% empty %}
|
||||
<li> Nejsou žádné dokumenty ke korekturování.
|
||||
{% endfor %}
|
||||
|
|
|
@ -73,4 +73,9 @@ urlpatterns = [
|
|||
|
||||
url(r'^tex-upload/login/$', views.LoginView, name='seminar_login'),
|
||||
url(r'^tex-upload/$', staff_member_required(views.texUploadView), name='seminar_tex_upload'),
|
||||
|
||||
# Ceka na autocomplete v3
|
||||
#url(r'^autocomplete/organizatori/$', staff_member_required(views.OrganizatorAutocomplete.as_view()), name='seminar_autocomplete_organizator')
|
||||
|
||||
|
||||
]
|
||||
|
|
|
@ -123,11 +123,16 @@ class StareNovinkyView(generic.ListView):
|
|||
### Co je M&M
|
||||
|
||||
## Organizatori
|
||||
def aktivniOrganizatori(rok=date.today().year):
|
||||
return Organizator.objects.exclude(
|
||||
organizuje_do_roku__isnull=False,
|
||||
organizuje_do_roku__lt=rok
|
||||
).order_by('user__first_name')
|
||||
|
||||
class CojemamOrganizatoriView(generic.ListView):
|
||||
model = Organizator
|
||||
template_name='seminar/cojemam/organizatori.html'
|
||||
queryset = Organizator.objects.exclude(organizuje_do_roku__isnull=False, organizuje_do_roku__lt=date.today().year).order_by('user__first_name')
|
||||
queryset = aktivniOrganizatori()
|
||||
def get_context_data(self, **kwargs):
|
||||
context = super(CojemamOrganizatoriView, self).get_context_data(**kwargs)
|
||||
context['aktivni'] = True
|
||||
|
@ -136,7 +141,7 @@ class CojemamOrganizatoriView(generic.ListView):
|
|||
class CojemamOrganizatoriStariView(generic.ListView):
|
||||
model = Organizator
|
||||
template_name='seminar/cojemam/organizatori.html'
|
||||
queryset = Organizator.objects.filter(organizuje_do_roku__isnull=False, organizuje_do_roku__lt=date.today().year).order_by('-organizuje_do_roku')
|
||||
queryset = aktivniOrganizatori().order_by('-organizuje_do_roku')
|
||||
|
||||
### Archiv
|
||||
|
||||
|
@ -782,3 +787,26 @@ def texDownloadView(request, rocnik, cislo):
|
|||
],
|
||||
}
|
||||
return JsonResponse(response)
|
||||
|
||||
|
||||
|
||||
# Ceka na autocomplete v3
|
||||
#class OrganizatorAutocomplete(autocomplete.Select2QuerySetView):
|
||||
# def get_queryset(self):
|
||||
# if not self.request.user.is_authenticated():
|
||||
# return Organizator.objects.none()
|
||||
#
|
||||
# qs = aktivniOrganizatori()
|
||||
#
|
||||
# if self.q:
|
||||
# if self.q[0] == "!":
|
||||
# qs = Organizator.objects.all()
|
||||
# query = self.q[1:]
|
||||
# else:
|
||||
# query = self.q
|
||||
# qs = qs.filter(
|
||||
# Q(prezdivka__isstartswith=query)|
|
||||
# Q(user__first_name__isstartswith=query)|
|
||||
# Q(user__last_name__isstartswith=query))
|
||||
#
|
||||
# return qs
|
||||
|
|
Loading…
Reference in a new issue