fnp
/
edumed.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
40fc4c4
)
stage 2: message on save
author
Jan Szejko
<janek37@gmail.com>
Thu, 3 Jan 2019 15:22:51 +0000
(16:22 +0100)
committer
Jan Szejko
<janek37@gmail.com>
Thu, 3 Jan 2019 15:22:51 +0000
(16:22 +0100)
edumed/static/css/base.css
patch
|
blob
|
history
edumed/static/css/base.scss
patch
|
blob
|
history
stage2/templates/stage2/participant.html
patch
|
blob
|
history
stage2/views.py
patch
|
blob
|
history
diff --git
a/edumed/static/css/base.css
b/edumed/static/css/base.css
index
d9d5479
..
07cf233
100644
(file)
--- a/
edumed/static/css/base.css
+++ b/
edumed/static/css/base.css
@@
-220,15
+220,19
@@
footer.main {
ul.messages {
list-style: none; }
ul.messages {
list-style: none; }
-.messages
.error
{
+.messages
li
{
top: 20px;
left: 20px;
top: 20px;
left: 20px;
- border: 1px solid black;
- background: red;
border-radius: 0.938em;
padding: 5px 2px;
color: white;
text-align: center;
font-weight: bold; }
border-radius: 0.938em;
padding: 5px 2px;
color: white;
text-align: center;
font-weight: bold; }
+ .messages li.error {
+ background: red;
+ border: 1px solid black; }
+ .messages li.info {
+ background: #ed7831;
+ border: none; }
/*# sourceMappingURL=base.css.map */
/*# sourceMappingURL=base.css.map */
diff --git
a/edumed/static/css/base.scss
b/edumed/static/css/base.scss
index
c1390aa
..
9896a5f
100644
(file)
--- a/
edumed/static/css/base.scss
+++ b/
edumed/static/css/base.scss
@@
-279,11
+279,17
@@
ul.messages {
list-style: none;
}
list-style: none;
}
-.messages
.error
{
+.messages
li
{
top: 20px;
left: 20px;
top: 20px;
left: 20px;
- border: 1px solid black;
- background: red;
+ &.error {
+ background: red;
+ border: 1px solid black;
+ }
+ &.info {
+ background: #ed7831;
+ border: none;
+ }
border-radius: 0.938em;
padding: 5px 2px;
color: white;
border-radius: 0.938em;
padding: 5px 2px;
color: white;
diff --git
a/stage2/templates/stage2/participant.html
b/stage2/templates/stage2/participant.html
index
2b5e3d4
..
130dda6
100644
(file)
--- a/
stage2/templates/stage2/participant.html
+++ b/
stage2/templates/stage2/participant.html
@@
-7,6
+7,14
@@
{% block body %}
<h1>II etap Olimpiady Cyfrowej</h1>
{% block body %}
<h1>II etap Olimpiady Cyfrowej</h1>
+ {% if messages %}
+ <ul class="messages">
+ {% for message in messages %}
+ <li{% if message.tags %} class="{{ message.tags }}"{% endif %}>{{ message }}</li>
+ {% endfor %}
+ </ul>
+ {% endif %}
+
{% chunk 'stage2_header' %}
{% for assignment in assignments %}
{% chunk 'stage2_header' %}
{% for assignment in assignments %}
diff --git
a/stage2/views.py
b/stage2/views.py
index
3b05eb0
..
d14e638
100644
(file)
--- a/
stage2/views.py
+++ b/
stage2/views.py
@@
-1,4
+1,5
@@
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
+from django.contrib import messages
from django.contrib.auth.decorators import login_required
from django.core.urlresolvers import reverse
from django.http import Http404
from django.contrib.auth.decorators import login_required
from django.core.urlresolvers import reverse
from django.http import Http404
@@
-60,6
+61,7
@@
def participant_view(request, participant_id, key):
# trzeba by znaleźć sensowny sposób odrózniania błędnego pliku od braku pliku.
# na szczęście pliki walidujemy też javascriptem, więc jakoś ujdzie
if fields_valid:
# trzeba by znaleźć sensowny sposób odrózniania błędnego pliku od braku pliku.
# na szczęście pliki walidujemy też javascriptem, więc jakoś ujdzie
if fields_valid:
+ messages.info(request, u'Dane zostały poprawnie zapisane na serwerze')
return HttpResponseRedirect(reverse('stage2_participant', args=(participant_id, key)))
else:
sent_forms = (assignment, field_forms, attachment_forms)
return HttpResponseRedirect(reverse('stage2_participant', args=(participant_id, key)))
else:
sent_forms = (assignment, field_forms, attachment_forms)