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
Incidents
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
d6d3efaf
Commit
d6d3efaf
authored
Jun 23, 2010
by
christophe siraut
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Travail de fond sur les dates
parent
6a598147
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
17 additions
and
9 deletions
+17
-9
sondage/forms.py
sondage/forms.py
+1
-1
sondage/models.py
sondage/models.py
+11
-2
sondage/views.py
sondage/views.py
+0
-1
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/forms.py
View file @
d6d3efaf
...
...
@@ -8,7 +8,7 @@ class PollForm(forms.ModelForm):
fields
=
(
'title'
,
'description'
)
class
ChoiceForm
(
forms
.
ModelForm
):
choice
=
forms
.
CharField
(
widget
=
forms
.
TextInput
(
attrs
=
{
'class'
:
'hasdatepicker'
,
'size'
:
'10'
,})
)
choice
=
forms
.
DateField
(
widget
=
forms
.
DateTimeInput
(
format
=
'%d-%m-%Y'
,
attrs
=
{
'class'
:
'hasdatepicker'
,
'size'
:
'12'
,}),
input_formats
=
[
'%d-%m-%Y'
]
)
details
=
forms
.
CharField
(
required
=
False
,
widget
=
forms
.
TextInput
(
attrs
=
{
'size'
:
'32'
,}))
class
Meta
:
model
=
Choice
...
...
sondage/models.py
View file @
d6d3efaf
...
...
@@ -22,8 +22,17 @@ class Poll(models.Model):
class
Choice
(
models
.
Model
):
poll
=
models
.
ForeignKey
(
Poll
)
choice
=
models
.
CharField
(
max_length
=
20
)
details
=
models
.
CharField
(
max_length
=
30
,
blank
=
True
)
choice
=
models
.
DateField
()
details
=
models
.
CharField
(
max_length
=
120
,
blank
=
True
)
votecount
=
models
.
IntegerField
(
default
=
0
,
blank
=
True
)
def
__unicode__
(
self
):
return
str
(
self
.
choice
)
# hacky?
class
NodateChoice
(
models
.
Model
):
poll
=
models
.
ForeignKey
(
Poll
)
choice
=
models
.
CharField
(
max_length
=
80
)
details
=
models
.
CharField
(
max_length
=
120
,
blank
=
True
)
votecount
=
models
.
IntegerField
(
default
=
0
,
blank
=
True
)
def
__unicode__
(
self
):
...
...
sondage/views.py
View file @
d6d3efaf
...
...
@@ -4,7 +4,6 @@ import datetime
from
django.http
import
HttpResponse
,
HttpResponseRedirect
from
django.shortcuts
import
get_object_or_404
,
render_to_response
from
django.core.urlresolvers
import
reverse
#from django.template import Context, loader, RequestContext
from
django.template
import
RequestContext
from
django.forms.formsets
import
formset_factory
from
django.forms.models
import
inlineformset_factory
,
BaseInlineFormSet
...
...
templates/sondage/choice_form.html
View file @
d6d3efaf
...
...
@@ -23,9 +23,9 @@
$
(
this
).
removeClass
(
'
hasdatepicker
'
);
// remove hasDatepicker class
// re-init datepicker
$
(
this
).
datepicker
({
dateFormat
:
'
dd-mm
'
,
dateFormat
:
'
dd-mm
-yy
'
,
//showButtonPanel: true,
showOn
:
'
b
oth
'
,
//'button
',
showOn
:
'
b
utton
'
,
//'both
',
buttonImage
:
'
/static/images/calendar.png
'
,
buttonImageOnly
:
true
,
minDate
:
'
+1d
'
,
...
...
templates/sondage/poll_detail.html
View file @
d6d3efaf
...
...
@@ -6,7 +6,7 @@
{% block chapeau %}
<h3>
{{object}}
</h3>
<p
class=
"info"
>
{{object.description}}
<br
/>
{% trans "Posted by" %}
<code>
{{object.author}}
</code>
{% trans "on" %}
<code>
{{object.pub_date
}}
</code>
<br
/>
{% trans "Shared address" %}:
<input
type=
"text"
name=
"link"
value=
"{{ current_site }}"
readonly=
"readonly"
class=
'adresse'
style=
"border: 1px solid #efefff;"
/>
{{object.description}}
<br
/>
{% trans "Posted by" %}
<code>
{{object.author}}
</code>
{% trans "on" %}
<code>
{{object.pub_date
|date:"d F"}}
</code>
.
<br
/>
{% trans "Shared address" %}:
<input
type=
"text"
name=
"link"
value=
"{{ current_site }}"
readonly=
"readonly"
class=
'adresse'
style=
"border: 1px solid #efefff;"
/>
</p>
{% endblock %}
...
...
@@ -19,7 +19,7 @@
<tr><td
class=
'names'
></td>
{% for choice in object.choice_set.all %}
<td
class=
'cell'
title=
"{{ choice.details }}"
onmouseover=
"toggle_visibility('info-{{ choice }}');"
onmouseout=
"toggle_visibility('info-{{ choice }}');"
>
{{ choice.choice }}
</td>
<td
class=
'cell'
title=
"{{ choice.details }}"
onmouseover=
"toggle_visibility('info-{{ choice }}');"
onmouseout=
"toggle_visibility('info-{{ choice }}');"
>
{{ choice.choice
|date:"d-m"
}}
</td>
{% endfor %}
<td></td>
<td></td>
...
...
@@ -121,7 +121,7 @@
{% block helper %}
{% for choice in object.choice_set.all %}
<p
class=
'helper'
id=
'info-{{ choice }}'
>
<b>
{{ choice
}}
</b>
<br
/>
<span
class=
"blue"
>
{{ choice.details }}
</span>
<br
/>
<b>
{{ choice
.choice|date:"l d F"
}}
</b>
<br
/>
<span
class=
"blue"
>
{{ choice.details }}
</span>
<br
/>
{% for bulletin in object.bulletin_set.all %}
{% for vote in bulletin.vote_set.all %}
...
...
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