Commit 32bb2df3 authored by chris's avatar chris

big css rewrite and various fixes

parent 63c3a6ab
import os
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
def _createId():
......@@ -41,7 +41,7 @@ class NodateChoice(models.Model):
class Bulletin(models.Model):
poll = models.ForeignKey(Poll,editable=False)
voter = models.CharField(_('Your name'),max_length=40)
voter = models.CharField("",max_length=40)
def __unicode__(self):
return self.voter
......@@ -49,7 +49,7 @@ class Bulletin(models.Model):
class Vote(models.Model):
choice = models.ForeignKey(Choice)
bulletin = models.ForeignKey(Bulletin)
voice = models.BooleanField(blank=True)
voice = models.BooleanField()
comment = models.CharField(max_length=80,blank=True)
def __unicode__(self):
......
......@@ -199,7 +199,6 @@ def vote(request, poll_id):
old.comment = vorm.cleaned_data['comment']
old.save()
error_message = "Your vote has been updated, thank you."
else:
error_message = 'Did you forget to provide your name?'
else:
......@@ -234,7 +233,7 @@ def vote(request, poll_id):
except:
pass
else:
#voter = 'your name'
voter = ''
error_message = "Login let you modify your vote anytime."
key = 'has_voted-' + poll.id
if request.session.get(key, False):
......@@ -255,8 +254,8 @@ def vote(request, poll_id):
except:
pass
#form = BulletinForm(instance=poll,initial={'voter': voter})
form = BulletinForm(instance=poll)
form = BulletinForm(instance=poll,initial={'voter': voter})
#form = BulletinForm(instance=poll)
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))
......
/*
body {
background-image: url('/static/images/nu5.png');
background-repeat:no-repeat;
}
*/
a:link, a:active, a:visited {
text-decoration:none;
......@@ -11,17 +12,15 @@ a:link, a:active, a:visited {
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 {
vertical-align: middle;
height: 30px;
}
thead, th, tr {
border: 0px;
height: 29px;
}
form label {
......@@ -30,82 +29,36 @@ form label {
}
#nheader {
background-color: #efefff;
height: 20px;
background-color: #f2f1f0;
height: 5px;
padding-top: 6px;
border-bottom: 1px solid #efefff;
}
#nheader select {
border: 1px solid #fafaff;
-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;
border: 0px;
/*
-moz-border-radius: 7px;
-webkit-border-radius: 7px;
background-color: #fff;
}
.left {
float: left;
}
.right {
float: right;
padding-right: 8%;
font-size: 9px;
*/
}
#chapeau {
margin-top: 37px;
margin-top: 33px;
margin-left: 12%;
width: 720px;
margin-bottom: 28px;
}
#content {
margin-left: 14%;
margin-bottom: 150px;
width: 720px;
}
.menu {
/*text-align: right;*/
padding-left: 7px;
font-size:9pt;
color: #779;
padding-top: 3px;
border-bottom: 1px solid #fff;
margin-bottom: 64px;
/*width: 740px;*/
}
.menu a {
background-color: #fff;
-moz-border-radius: 7px;
-webkit-border-radius: 7px;
padding: 3px;
}
#notify {
display: inline;
}
#notify img {
opacity: 0.5;
filter: alpha(opacity=40);
.cell {
width: 34px;
}
.comment {
width: 26px;
}
......@@ -126,45 +79,65 @@ form label {
border: 0px solid #fff;
}
.tip {
top: 5px;
.instructions {
margin-left: 14px;
margin-right: 50px;
color: #667;
font-size: 11px;
padding: 5px;
-moz-border-radius: 15px;
-webkit-border-radius: 15px;
background-color: #efefff;
-moz-border-radius: 9px;
-webkit-border-radius: 9px;
}
.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-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;
padding: 3px;
color: #779;
-moz-border-radius: 17px;
-webkit-border-radius: 17px;
padding: 4px;
-moz-border-radius: 9px;
-webkit-border-radius: 9px;
background-color: #fff;
border: 1px solid #efefff;
}
.blue {
color: #99a;
}
.cell {
width: 34px;
}
.helper {
width: 155px;
display: none;
position: absolute;
margin-top: 12px;
//margin-top: 16px;
margin-left: 12%;
padding: 8px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
border: 1px solid #fafaff;
background-color: #efefff;
-moz-border-radius: 8px;
-webkit-border-radius: 8px;
background-color: #f4f4ff;
text-align: right;
font-size: 11px;
}
......@@ -199,7 +172,8 @@ form label {
float: none;
font-size:10pt;
color: #335;
padding: 9px;
padding: 10px;
width: 500px;
-moz-border-radius: 15px;
-webkit-border-radius: 15px;
background-color: #fff;
......@@ -215,7 +189,7 @@ form label {
}
.False, .True {
margin-left: 25%;
margin-left: 22%;
background-color: #fbb;
width: 19px;
height: 19px;
......@@ -229,6 +203,13 @@ form label {
background-color: #bfb;
}
.left {
float: left;
}
.right {
float: right;
}
/*
.datepick {
......
......@@ -20,31 +20,32 @@
<body>
<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 %}
<a href="/user/logout/">logout</a>
<a href="/user/logout/">Logout</a>
{% else %}
<a href="/user/login/">Login</a>
{% endif %}
{% endif %}&nbsp;
{% block menu %}{% endblock %}
{% if error_message %} &nbsp;&nbsp;&nbsp;
<div id="notify"><!--img src="/static/images/info.png" alt="info" "-->&nbsp; <span class="tip">{{ error_message }} </span></div>
<span class="notify">
{% if error_message %}
<!--img src="/static/images/info.png" alt="info" "-->&nbsp; {{ error_message }}
{% endif %}
<span class="right"><form style="display:nline" name="langForm" action="/i18n/setlang/" method="post">
<input name="next" type="hidden" value="/" />
<!--option value="">Language </option!-->
<form style="display:inline" name="langForm" action="/i18n/setlang/" method="post">
<input name="next" type="hidden" value="" />
<select name="language" onChange="langForm.submit()" />
<option value="#" /></option>
{% for lang in LANGUAGES %}
<option value="{{ lang.0 }}" />{{ lang.0 }}</option>
{% endfor %}
</select>
</form></span>
</form>
</span>
</div>
</div>
......@@ -58,9 +59,9 @@
{% block content %}{% endblock %}
</div>
<div id="footer">
<div class="menu">
{% 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>
......
......@@ -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|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>
{% endblock %}
......@@ -19,15 +19,9 @@
<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|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 %}
<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>
......@@ -36,6 +30,7 @@
{% 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>
{% endfor %}
</tr>
{% endfor %}
......@@ -57,21 +52,19 @@
<table>
<tr><td class='names' title="Fill in your name">
<div class="blue">{% trans "Your name" %}</div>
{{ form.as_p }}
</td>
{% for forms in vforms %}
{{ vforms.management_form }}
{% 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.comment }}
<div class="hide">
{{ form.choice }}
{{ form.voter }}
{% for hidden in form.hidden_fields %}{{ hidden }}{% endfor %}
</div>
{{ field.errors }}
......@@ -81,21 +74,30 @@
{% endfor %}
<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>
</table>
</form>
</td></tr>
</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">
<!--
function toggle_visibility(id) {
......@@ -125,7 +127,7 @@
{% for vote in bulletin.vote_set.all %}
{% ifequal choice vote.choice %}
{% if vote.comment %}
<br /><code>{{ bulletin.voter }}</code>: {{ vote.comment }} &nbsp</span>
<br /><span><code>{{ bulletin.voter }}</code>: {{ vote.comment }} &nbsp</span>
{% endif %}
{% endifequal %}
{% 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