Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
nuages
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etch
nuages
Commits
fe56165b
Commit
fe56165b
authored
Oct 07, 2010
by
chris
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Correctif: dates en désordre (bug 611)
parent
16e3ce0e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
8 deletions
+14
-8
sondage/userviews.py
sondage/userviews.py
+1
-1
sondage/views.py
sondage/views.py
+8
-2
templates/sondage/choice_form.html
templates/sondage/choice_form.html
+2
-2
templates/sondage/poll_detail.html
templates/sondage/poll_detail.html
+3
-3
No files found.
sondage/userviews.py
View file @
fe56165b
...
...
@@ -19,6 +19,6 @@ def register(request):
def
clear_cookie
(
request
,
poll_id
):
request
.
session
.
clear
()
return
HttpResponseRedirect
(
reverse
(
'
nuages.
sondage.views.vote'
,
args
=
(
poll_id
,)))
return
HttpResponseRedirect
(
reverse
(
'sondage.views.vote'
,
args
=
(
poll_id
,)))
sondage/views.py
View file @
fe56165b
...
...
@@ -79,7 +79,6 @@ def editchoices(request, poll_id):
instances
=
OrderedItemFormset
(
request
.
POST
,
instance
=
poll
)
if
instances
.
is_valid
():
for
instance
in
instances
.
cleaned_data
:
try
:
this_choice
=
instance
[
'choice'
]
if
not
instance
.
get
(
'DELETE'
):
...
...
@@ -91,6 +90,12 @@ def editchoices(request, poll_id):
except
(
KeyError
,
Choice
.
DoesNotExist
):
choice
=
Choice
(
poll
=
poll
,
choice
=
instance
[
'choice'
],
details
=
instance
[
'details'
])
choice
.
save
()
# If bulletins for this poll existed before edition
# add an 'false' vote child to them for newly created choice.
# This makes template computation easier
for
bulletin
in
Bulletin
.
objects
.
filter
(
poll
=
poll
):
nvote
=
Vote
(
choice
=
choice
,
bulletin
=
bulletin
,
voice
=
False
)
nvote
.
save
()
else
:
try
:
choice
=
Choice
.
objects
.
get
(
poll
=
poll
,
choice
=
this_choice
)
...
...
@@ -104,7 +109,8 @@ def editchoices(request, poll_id):
except
:
pass
except
:
pass
# probably an empty datefield?
pass
redir
=
'/'
+
str
(
poll
.
id
)
+
'/'
return
HttpResponseRedirect
(
redir
)
else
:
...
...
templates/sondage/choice_form.html
View file @
fe56165b
...
...
@@ -89,12 +89,12 @@
</tr>
</thead>
<!-- vforms.management_form -->
{% for v in vforms.forms %}
<tr
id=
"{{ v.prefix }}-row"
>
<td>
{
{ v.management_form }
}
{
% for hidden in v.hidden_fields %} {{ hidden }} {% endfor %
}
{% if v.instance.pk %}{{ v.DELETE }}{% endif %}
{{ v.choice.errors }}{{ v.choice }}
</td>
...
...
templates/sondage/poll_detail.html
View file @
fe56165b
...
...
@@ -24,7 +24,7 @@
<table>
<tr><td
class=
'names'
></td>
{% for choice in object.choice_set.all %}
{% for choice in object.choice_set.all
|dictsort:'choice'
%}
<td
class=
'cell'
title=
"{{ choice.choice|date:"
l
d
F
"}}{{
choice.details
}}"
onmouseover=
"toggle_visibility('info-{{ choice }}');"
onmouseout=
"toggle_visibility('info-{{ choice }}');"
>
{{ choice.choice|date:"d-m" }}
</td>
{% endfor %}
<td></td>
...
...
@@ -33,7 +33,7 @@
{% for bulletin in object.bulletin_set.all %}
<tr
><td
class=
'names'
>
{{ bulletin.voter }}
</td>
{% for vote in bulletin.vote_set.all %}
{% for vote in bulletin.vote_set.all
|dictsort:'choice.choice'
%}
<td
class=
'cell'
title=
"{{ vote.comment }}"
onmouseover=
"toggle_visibility('info-{{ vote.choice }}');"
onmouseout=
"toggle_visibility('info-{{ vote.choice }}');"
><div
class=
"{{ vote.voice }}"
>
{% if vote.comment %} ° {% endif %}
</div></td>
{% endfor %}
...
...
@@ -43,7 +43,7 @@
<tr><td
class=
'names'
></td>
{% for choice in object.choice_set.all %}
{% for choice in object.choice_set.all
|dictsort:'choice'
%}
<td
class=
'cell'
title=
"{{ choice }}"
>
{{ choice.votecount }}
</td>
{% endfor %}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment