Merge branch 'master' of atrey:/akce/MaM/MaMweb/mamweb

* 'master' of atrey:/akce/MaM/MaMweb/mamweb:
  Zakladni kostra Aktualniho zadani
  Reseni prav pri nasazovani na server
This commit is contained in:
Tomas Gavenciak 2015-03-28 15:38:43 +01:00
commit 15ffbbad3f
4 changed files with 29 additions and 4 deletions

View file

@ -76,8 +76,8 @@ push_test:
cp mamweb/settings_test.py mamweb/settings.py && \ cp mamweb/settings_test.py mamweb/settings.py && \
make install && \ make install && \
./manage.py migrate --noinput && \ ./manage.py migrate --noinput && \
chown -R :mam . && \ (chown -Rf :mam . || true ) && \
chmod -R g+w . && \ (chmod -Rf g+w . || true ) && \
echo Done." echo Done."
@echo "Test deployed at ${TEST_SERVER}:${TEST_DIR} successfully." @echo "Test deployed at ${TEST_SERVER}:${TEST_DIR} successfully."

View file

@ -0,0 +1,18 @@
{% extends "base.html" %}
{% load staticfiles sekizai_tags %}
{% block content %}
<div>
<h2>Aktuální zadání</h2>
{% for problem in nastaveni.aktualni_cislo.zadane_problemy.all %}
Problém {{problem}} <br>
{% autoescape off %}{{problem.text_problemu}}{% endautoescape %}
<hr>
{% empty %}
Aktuálně nejsou zadané žádné úlohy k řešení.
{% endfor %}
</div>
{% endblock content %}

View file

@ -4,4 +4,5 @@ from . import views
urlpatterns = patterns('', urlpatterns = patterns('',
url(r'^problem/(?P<pk>\d+)/$', views.ProblemView.as_view(), name='problem'), url(r'^problem/(?P<pk>\d+)/$', views.ProblemView.as_view(), name='problem'),
url(r'^cislo/(?P<pk>\d+)/$', views.CisloView.as_view(), name='cislo'), url(r'^cislo/(?P<pk>\d+)/$', views.CisloView.as_view(), name='cislo'),
url(r'^zadani/$', 'seminar.views.AktualZadaniView'),
) )

View file

@ -2,9 +2,15 @@ from django.shortcuts import get_object_or_404, render
from django.http import HttpResponseRedirect from django.http import HttpResponseRedirect
from django.core.urlresolvers import reverse from django.core.urlresolvers import reverse
from django.views import generic from django.views import generic
from .models import Problem, Cislo, Reseni, VysledkyKCislu from .models import Problem, Cislo, Reseni, VysledkyKCislu, Nastaveni
# Create your views here.
def AktualZadaniView(request):
nastaveni = get_object_or_404(Nastaveni)
return render(request, 'seminar/AktualZadani.html',
{'nastaveni' : nastaveni,
},
)
class ProblemView(generic.DetailView): class ProblemView(generic.DetailView):
model = Problem model = Problem