Tomas "Jethro" Pokorny
9 years ago
7 changed files with 84 additions and 32 deletions
@ -0,0 +1,33 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
from __future__ import unicode_literals |
||||
|
|
||||
|
from django.db import models, migrations |
||||
|
import korektury.models |
||||
|
|
||||
|
|
||||
|
class Migration(migrations.Migration): |
||||
|
|
||||
|
dependencies = [ |
||||
|
('korektury', '0006_oprava_pdf'), |
||||
|
] |
||||
|
|
||||
|
operations = [ |
||||
|
migrations.AddField( |
||||
|
model_name='korekturovanepdf', |
||||
|
name='status', |
||||
|
field=models.CharField(default=b'pridavani', max_length=16, verbose_name='stav PDF', choices=[(b'pridavani', 'P\u0159id\xe1v\xe1n\xed korektur'), (b'zanaseni', 'Korektury jsou zan\xe1\u0161eny'), (b'zastarale', 'Star\xe1 verze, nekorigovat')]), |
||||
|
preserve_default=True, |
||||
|
), |
||||
|
migrations.AlterField( |
||||
|
model_name='korekturovanepdf', |
||||
|
name='pdf', |
||||
|
field=models.FileField(upload_to=korektury.models.generate_filename, verbose_name='PDF'), |
||||
|
preserve_default=True, |
||||
|
), |
||||
|
migrations.AlterField( |
||||
|
model_name='oprava', |
||||
|
name='status', |
||||
|
field=models.CharField(default=b'k_oprave', max_length=16, verbose_name='stav opravy', choices=[(b'k_oprave', 'K oprav\u011b'), (b'opraveno', 'Opraveno'), (b'neni_chyba', 'Nen\xed chyba'), (b'k_reakci', 'K reakci autora textu'), (b'smazano', 'Smaz\xe1no')]), |
||||
|
preserve_default=True, |
||||
|
), |
||||
|
] |
@ -0,0 +1,9 @@ |
|||||
|
{% extends "base.html" %} |
||||
|
|
||||
|
{% block content %} |
||||
|
{# blok do kterého se nacita text, v pripade jinyhc templatu obalit vlastnim blokem #} |
||||
|
{% endblock %} |
||||
|
|
||||
|
{% block title %} |
||||
|
{# blok pro titulek stranky #} |
||||
|
{% endblock %} |
@ -1,9 +1,12 @@ |
|||||
from django.conf.urls import * # NOQA |
from django.conf.urls import * # NOQA |
||||
from django.conf.urls import patterns, url |
from django.conf.urls import patterns, url |
||||
from django.contrib.auth.decorators import permission_required |
from django.contrib.auth.decorators import user_passes_test |
||||
from . import views |
from . import views |
||||
|
|
||||
|
staff_member_required = user_passes_test(lambda u: u.is_staff) |
||||
|
|
||||
urlpatterns = patterns('', |
urlpatterns = patterns('', |
||||
url(r'^korektury$',permission_required('is_staff')(views.KorekturyListView.as_view()),name='korektury-list'), |
url(r'^korektury/$', staff_member_required(views.KorekturyListView.as_view()), name='korektury-list'), |
||||
url(r'^korektury/(?P<pdf>\d+)$', permission_required('is_staff')(views.KorekturyView.as_view()), name='korektury'), |
url(r'^korektury/(?P<pdf>\d+)/$', staff_member_required(views.KorekturyView.as_view()), name='korektury'), |
||||
|
url(r'^korektury/help/', staff_member_required(views.KorekturyHelpView.as_view()), name='korektury-help'), |
||||
) |
) |
||||
|
Loading…
Reference in new issue