Commit 32bb2df3 authored by chris's avatar chris

big css rewrite and various fixes

parent 63c3a6ab
import os import os
from django.db import models from django.db import models
from django.utils.translation import ugettext_lazy as _ #from django.utils.translation import ugettext_lazy as _
from binascii import hexlify from binascii import hexlify
def _createId(): def _createId():
...@@ -41,7 +41,7 @@ class NodateChoice(models.Model): ...@@ -41,7 +41,7 @@ class NodateChoice(models.Model):
class Bulletin(models.Model): class Bulletin(models.Model):
poll = models.ForeignKey(Poll,editable=False) poll = models.ForeignKey(Poll,editable=False)
voter = models.CharField(_('Your name'),max_length=40) voter = models.CharField("",max_length=40)
def __unicode__(self): def __unicode__(self):
return self.voter return self.voter
...@@ -49,7 +49,7 @@ class Bulletin(models.Model): ...@@ -49,7 +49,7 @@ class Bulletin(models.Model):
class Vote(models.Model): class Vote(models.Model):
choice = models.ForeignKey(Choice) choice = models.ForeignKey(Choice)
bulletin = models.ForeignKey(Bulletin) bulletin = models.ForeignKey(Bulletin)
voice = models.BooleanField(blank=True) voice = models.BooleanField()
comment = models.CharField(max_length=80,blank=True) comment = models.CharField(max_length=80,blank=True)
def __unicode__(self): def __unicode__(self):
......
...@@ -199,7 +199,6 @@ def vote(request, poll_id): ...@@ -199,7 +199,6 @@ def vote(request, poll_id):
old.comment = vorm.cleaned_data['comment'] old.comment = vorm.cleaned_data['comment']
old.save() old.save()
error_message = "Your vote has been updated, thank you." error_message = "Your vote has been updated, thank you."
else: else:
error_message = 'Did you forget to provide your name?' error_message = 'Did you forget to provide your name?'
else: else:
...@@ -234,7 +233,7 @@ def vote(request, poll_id): ...@@ -234,7 +233,7 @@ def vote(request, poll_id):
except: except:
pass pass
else: else:
#voter = 'your name' voter = ''
error_message = "Login let you modify your vote anytime." error_message = "Login let you modify your vote anytime."
key = 'has_voted-' + poll.id key = 'has_voted-' + poll.id
if request.session.get(key, False): if request.session.get(key, False):
...@@ -255,8 +254,8 @@ def vote(request, poll_id): ...@@ -255,8 +254,8 @@ def vote(request, poll_id):
except: except:
pass pass
#form = BulletinForm(instance=poll,initial={'voter': voter}) form = BulletinForm(instance=poll,initial={'voter': voter})
form = BulletinForm(instance=poll) #form = BulletinForm(instance=poll)
current_site = settings.SITE + poll.id current_site = settings.SITE + poll.id
return render_to_response('sondage/poll_detail.html', {'object': poll, 'form': form, 'vforms':vforms, 'error_message':error_message, 'current_site': current_site}, context_instance=RequestContext(request)) return render_to_response('sondage/poll_detail.html', {'object': poll, 'form': form, 'vforms':vforms, 'error_message':error_message, 'current_site': current_site}, context_instance=RequestContext(request))
......
/*
body { body {
background-image: url('/static/images/nu5.png'); background-image: url('/static/images/nu5.png');
background-repeat:no-repeat; background-repeat:no-repeat;
} }
*/
a:link, a:active, a:visited { a:link, a:active, a:visited {
text-decoration:none; text-decoration:none;
...@@ -11,17 +12,15 @@ a:link, a:active, a:visited { ...@@ -11,17 +12,15 @@ a:link, a:active, a:visited {
a:hover {color:#044bcd;} a:hover {color:#044bcd;}
h3 {color: #555;} h2, h3, h4 {color: #555;}
h2 {color: #555;} td, thead, th, tr {
border: 0px; /* override django default */
}
td { td {
vertical-align: middle; vertical-align: middle;
height: 30px; height: 29px;
}
thead, th, tr {
border: 0px;
} }
form label { form label {
...@@ -30,82 +29,36 @@ form label { ...@@ -30,82 +29,36 @@ form label {
} }
#nheader { #nheader {
background-color: #efefff; background-color: #f2f1f0;
height: 20px; height: 5px;
padding-top: 6px;
border-bottom: 1px solid #efefff;
} }
#nheader select { #nheader select {
border: 1px solid #fafaff; border: 0px;
-moz-border-radius: 7px; /*
-webkit-border-radius: 7px;
}
#footer {
//color: #667;
font-size: 10px;
text-align: right;
width: 780px;
margin-left: 10%;
}
#footer span {
//border: 1px solid #eef;
padding: 3px;
-moz-border-radius: 7px; -moz-border-radius: 7px;
-webkit-border-radius: 7px; -webkit-border-radius: 7px;
background-color: #fff; */
}
.left {
float: left;
}
.right {
float: right;
padding-right: 8%;
font-size: 9px;
} }
#chapeau { #chapeau {
margin-top: 37px; margin-top: 33px;
margin-left: 12%; margin-left: 12%;
width: 720px; margin-bottom: 28px;
} }
#content { #content {
margin-left: 14%; margin-left: 14%;
margin-bottom: 150px; margin-bottom: 64px;
width: 720px; /*width: 740px;*/
}
.menu {
/*text-align: right;*/
padding-left: 7px;
font-size:9pt;
color: #779;
padding-top: 3px;
border-bottom: 1px solid #fff;
}
.menu a {
background-color: #fff;
-moz-border-radius: 7px;
-webkit-border-radius: 7px;
padding: 3px;
}
#notify {
display: inline;
} }
#notify img { .cell {
opacity: 0.5; width: 34px;
filter: alpha(opacity=40);
} }
.comment { .comment {
width: 26px; width: 26px;
} }
...@@ -126,45 +79,65 @@ form label { ...@@ -126,45 +79,65 @@ form label {
border: 0px solid #fff; border: 0px solid #fff;
} }
.tip { .instructions {
top: 5px; margin-left: 14px;
margin-right: 50px;
color: #667; color: #667;
font-size: 11px; background-color: #efefff;
padding: 5px; -moz-border-radius: 9px;
-moz-border-radius: 15px; -webkit-border-radius: 9px;
-webkit-border-radius: 15px; }
.instructions td {
font-size: 11.5px;
width:190px;
border: 0px;
padding: 12px;
-moz-border-radius: 9px;
-webkit-border-radius: 9px;
}
.menu {
width: 910px;
text-align: right;
}
.menu a {
background-color: #fff; background-color: #fff;
background-image: url('/static/images/back2.png'); -moz-border-radius: 9px;
-webkit-border-radius: 9px;
padding: 4px;
border: 1px solid #efefff;
}
.menu a:hover {
background-color: #f7f7ff;
} }
.tipp { .notify {
color: #667;
font-size: 11px; font-size: 11px;
padding: 3px; padding: 4px;
color: #779; -moz-border-radius: 9px;
-moz-border-radius: 17px; -webkit-border-radius: 9px;
-webkit-border-radius: 17px; background-color: #fff;
border: 1px solid #efefff;
} }
.blue { .blue {
color: #99a; color: #99a;
} }
.cell {
width: 34px;
}
.helper { .helper {
width: 155px; width: 155px;
display: none; display: none;
position: absolute; position: absolute;
margin-top: 12px; //margin-top: 16px;
margin-left: 12%; margin-left: 12%;
padding: 8px; padding: 8px;
-moz-border-radius: 5px; -moz-border-radius: 8px;
-webkit-border-radius: 5px; -webkit-border-radius: 8px;
border: 1px solid #fafaff; background-color: #f4f4ff;
background-color: #efefff;
text-align: right; text-align: right;
font-size: 11px; font-size: 11px;
} }
...@@ -199,7 +172,8 @@ form label { ...@@ -199,7 +172,8 @@ form label {
float: none; float: none;
font-size:10pt; font-size:10pt;
color: #335; color: #335;
padding: 9px; padding: 10px;
width: 500px;
-moz-border-radius: 15px; -moz-border-radius: 15px;
-webkit-border-radius: 15px; -webkit-border-radius: 15px;
background-color: #fff; background-color: #fff;
...@@ -215,7 +189,7 @@ form label { ...@@ -215,7 +189,7 @@ form label {
} }
.False, .True { .False, .True {
margin-left: 25%; margin-left: 22%;
background-color: #fbb; background-color: #fbb;
width: 19px; width: 19px;
height: 19px; height: 19px;
...@@ -229,6 +203,13 @@ form label { ...@@ -229,6 +203,13 @@ form label {
background-color: #bfb; background-color: #bfb;
} }
.left {
float: left;
}
.right {
float: right;
}
/* /*
.datepick { .datepick {
......
...@@ -20,31 +20,32 @@ ...@@ -20,31 +20,32 @@
<body> <body>
<div id="nheader"> <div id="nheader">
<div class="menu"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <div class="menu">
<a href="/">Nuages</a> &nbsp; <a href="/">Nuages</a>&nbsp;
{% if user.is_authenticated %} {% if user.is_authenticated %}
<a href="/user/logout/">logout</a> <a href="/user/logout/">Logout</a>
{% else %} {% else %}
<a href="/user/login/">Login</a> <a href="/user/login/">Login</a>
{% endif %} {% endif %}&nbsp;
{% block menu %}{% endblock %} {% block menu %}{% endblock %}
{% if error_message %} &nbsp;&nbsp;&nbsp; <span class="notify">
<div id="notify"><!--img src="/static/images/info.png" alt="info" "-->&nbsp; <span class="tip">{{ error_message }} </span></div> {% if error_message %}
<!--img src="/static/images/info.png" alt="info" "-->&nbsp; {{ error_message }}
{% endif %} {% endif %}
<span class="right"><form style="display:nline" name="langForm" action="/i18n/setlang/" method="post"> <form style="display:inline" name="langForm" action="/i18n/setlang/" method="post">
<input name="next" type="hidden" value="/" /> <input name="next" type="hidden" value="" />
<!--option value="">Language </option!--> <select name="language" onChange="langForm.submit()" />
<select name="language" onChange="langForm.submit()" /> <option value="#" /></option>
<option value="#" /></option> {% for lang in LANGUAGES %}
{% for lang in LANGUAGES %} <option value="{{ lang.0 }}" />{{ lang.0 }}</option>
<option value="{{ lang.0 }}" />{{ lang.0 }}</option> {% endfor %}
{% endfor %} </select>
</select> </form>
</form></span> </span>
</div> </div>
</div> </div>
...@@ -58,9 +59,9 @@ ...@@ -58,9 +59,9 @@
{% block content %}{% endblock %} {% block content %}{% endblock %}
</div> </div>
<div id="footer"> <div class="menu">
{% block footer %}{% endblock %} {% block footer %}{% endblock %}
<span >{% trans "Nuages is brought to you by" %} <a href="http://www.domainepublic.net">Domaine Public</a>.</span> <span class="notify">{% trans "Nuages is brought to you by" %} <a href="http://www.domainepublic.net">Domaine Public</a></span>
</div> </div>
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
{% block chapeau %} {% block chapeau %}
<h3>{{object}}</h3> <h3>{{object}}</h3>
<p class="info"> <p class="info">
{{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;" /> <i> {{object.description}} </i> <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> </p>
{% endblock %} {% endblock %}
...@@ -19,15 +19,9 @@ ...@@ -19,15 +19,9 @@
<tr><td class='names'></td> <tr><td class='names'></td>
{% for choice in object.choice_set.all %} {% 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|date:"d-m" }} </td> <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 %} {% endfor %}
<td></td> <td></td>
<td></td>
<td>
<div class="blue" style="text-align:left">
<small>{% trans "Point colums to see choice details and comments" %}</small><br/>
</div>
</td>
</tr> </tr>
...@@ -36,6 +30,7 @@ ...@@ -36,6 +30,7 @@
{% for vote in bulletin.vote_set.all %} {% for vote in bulletin.vote_set.all %}
<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> <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 %} {% endfor %}
</tr> </tr>
{% endfor %} {% endfor %}
...@@ -57,21 +52,19 @@ ...@@ -57,21 +52,19 @@
<table> <table>
<tr><td class='names' title="Fill in your name"> <tr><td class='names' title="Fill in your name">
<div class="blue">{% trans "Your name" %}</div>
{{ form.as_p }} {{ form.as_p }}
</td> </td>
{% for forms in vforms %} {% for forms in vforms %}
{{ vforms.management_form }} {{ vforms.management_form }}
{% for form in forms %} {% for form in forms %}
<td class='cell' title='Check the boxes to add a positive answer, you may provide a comment for each choice.' /> <td class='cell' title='{% trans "Check the boxes to add a positive answer, you may provide a comment for each choice." %}' />
{{ form.voice }} {{ form.voice }}
{{ form.comment }} {{ form.comment }}
<div class="hide"> <div class="hide">
{{ form.choice }} {{ form.choice }}
{{ form.voter }}
{% for hidden in form.hidden_fields %}{{ hidden }}{% endfor %} {% for hidden in form.hidden_fields %}{{ hidden }}{% endfor %}
</div> </div>
{{ field.errors }} {{ field.errors }}
...@@ -80,22 +73,31 @@ ...@@ -80,22 +73,31 @@
{% endfor %} {% endfor %}
{% endfor %} {% endfor %}
<td></td> <td></td>
<td></td>
<td>
<div class="blue" style="text-align:left">
<small>{% trans "Check the boxes for positive answers, you may provide a comment for each choice" %}</small><br/>
<input type="submit" value="vote" />
</div>
</td>
</tr> </tr>
</table> </table>
</form>
</td></tr> </td></tr>
</table> </table>
</td></tr></table>
<br />
<h4>Instructions</h4>
<table class="instructions">
<tr>
<td>1. {% trans "Point colums to see choice details and comments" %} </td>
<td style="border-left: 1px solid #fff;">2. {% trans "Check the boxes for positive answers. " %} {%trans "You may provide a comment for each choice." %}</td>
<td style="background-color:#fff;"><div style="text-align:center;"><input type="submit" value="Vote" style="padding:5px;margin-right: 5px;width: 70px" /></td><td style="width:1px"></td>
</tr>
</table>
</form>
<script type="text/javascript"> <script type="text/javascript">
<!-- <!--
function toggle_visibility(id) { function toggle_visibility(id) {
...@@ -125,7 +127,7 @@ ...@@ -125,7 +127,7 @@
{% for vote in bulletin.vote_set.all %} {% for vote in bulletin.vote_set.all %}
{% ifequal choice vote.choice %} {% ifequal choice vote.choice %}
{% if vote.comment %} {% if vote.comment %}
<br /><code>{{ bulletin.voter }}</code>: {{ vote.comment }} &nbsp</span> <br /><span><code>{{ bulletin.voter }}</code>: {{ vote.comment }} &nbsp</span>
{% endif %} {% endif %}
{% endifequal %} {% endifequal %}
{% endfor %} {% endfor %}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment