Skip to content

Commit

Permalink
default layout and poll updates, finished last week forgot to commit,…
Browse files Browse the repository at this point in the history
… bugs fixed
  • Loading branch information
nbenavi committed Sep 15, 2011
1 parent 29e4481 commit caf8704
Show file tree
Hide file tree
Showing 12 changed files with 854 additions and 160 deletions.
49 changes: 39 additions & 10 deletions deme_django/cms/templates/default_layout.html
Expand Up @@ -34,6 +34,15 @@
<link href="{% media_url "stylesheets/ui.jqgrid.css" %}" media="all" rel="Stylesheet" type="text/css" />

<script type="text/javascript" src="{% media_url "javascripts/fg.menu.js" %}"></script>
<script type="text/javascript">
$(document).ready(function () {
$('#showhidetarget').hide();

$('a#showhidetrigger').click(function () {
$('#showhidetarget').toggle(400);
});
});
</script>
<link href="{% media_url "stylesheets/fg.menu.css" %}" media="screen" rel="stylesheet" type="text/css" />
<!-- style exceptions for IE 6 -->
<!--[if IE 6]>
Expand Down Expand Up @@ -105,12 +114,21 @@
</script>

<script type="text/javascript">
function max()
{
self.moveTo(0,0);
self.resizeTo(screen.availWidth,screen.availHeight);

}
function resizeText(multiplier) {
if (document.body.style.fontSize == "") {
document.body.style.fontSize = "1.0em";
}
document.body.style.fontSize = parseFloat(document.body.style.fontSize) + (multiplier * 0.2) + "em";
}
<script type="text/javascript">
function unhide(divID) {
var item = document.getElementById(divID);
if (item) {
item.className=(item.className=='hidden')?'unhidden':'hidden';
}
}
</script>
</script>


Expand Down Expand Up @@ -312,10 +330,6 @@ <h3><a href="#">Permissions</a></h3>

</div>

<input type="button" value="Open Fullscreen" onclick="max()" />
<input type="button" value="Increase text size" onclick="resizeText(1)" />
<input type="button" value="Decrease text size" onclick="resizeText(-1)" />

<div class="footer">
<p>
<b>Desktop Browser</b>
Expand All @@ -328,6 +342,12 @@ <h3><a href="#">Permissions</a></h3>
<a href="{% url item_type_url viewer=viewer_name,action="list",format="rss" %}?{{ query_string }}">RSS</a>
{% endifequal %}
|
<a href="#" onclick="resizeText(1)">Increase text size</a>
|
<a href="#" onclick="resizeText(-1)">Decrease text size</a>
|
<a href="#"id="showhidetrigger" href="#">Fullscreen</a>
|
<a href="#" onclick="$('#google_translate_dialog').dialog({close: function(event, ui) {$('#google_translate_dialog').dialog('destroy')}}); return false;">Translate</a>
<div id="google_translate_dialog" title="Translate" style="display: none;">
<div id="google_translate_element">
Expand All @@ -344,10 +364,19 @@ <h3><a href="#">Permissions</a></h3>
</p>
<p>Copyright &copy;2008-{% now "Y" %} to Deme | <a href="http://github.com/mikemintz/deme/tree/master">Source Code</a> <span class="pipe">|</span> <a href="http://www.stanford.edu/~davies/">Authors</a> | <a href="{% url item_type_url viewer="item",action="admin" %}">Admin</a> | <a href="{% url item_type_url viewer="item",action="recentchanges" %}">Recent Changes</a></p>
</div>

<div id="showhidetarget">
<p>For Internet Explorer users:
Click on the Tools menu, located at the top of your browser window. When the drop-down menu appears, select the option labeled Full Screen.
</p>

<p>For Chrome users:Click on the Chrome "wrench" icon, located in the upper right hand corner of your browser window. When the drop-down menu appears, select the choice labeled Full Screen.</p>
<p>For Firefox user:Click on the View menu, located at the top of your browser window. When the drop-down menu appears, select the option labeled Full Screen.</p>
<p>For Safari users: Safari currently does not support the ability to go fullscreen.</p>
</div>
</div>
</div>


</body>

</html>
Expand Down
40 changes: 20 additions & 20 deletions deme_django/modules/poll/models.py
Expand Up @@ -197,7 +197,7 @@ class Meta:

#TODO: find out how to set max value in integer field
quorum_choices = zip( range(0,101), range(0,101) )
quorum = models.IntegerField(blank=True, choices=quorum_choices)
quorum = models.IntegerField(_('Quorum %'),blank=True, choices=quorum_choices)
poll = FixedForeignKey(Poll, related_name='polls_decision', null=True, blank=True, default=None)


Expand All @@ -210,8 +210,8 @@ class PluralityChooseNDecision(Decision):
dyadic_relations = {}

class Meta:
verbose_name = _('PluralityChooseNDecision')
verbose_name_plural = _('PluralityChooseNDecision')
verbose_name = _('Choose Plurality Decision')
verbose_name_plural = _('Choose Plurality Decisions')

#fields
n_choices = zip( range(0,101), range(0,101) )
Expand All @@ -226,14 +226,14 @@ class ThresholdChooseNDecision(Decision):
dyadic_relations = {}

class Meta:
verbose_name = _('ThresholdChooseNDecision')
verbose_name_plural = _('ThresholdChooseNDecision')
verbose_name = _('Choose Threshold Participants Decision')
verbose_name_plural = _('Choose Threshold Participants Decisions')

#fields
n_choices = zip( range(0,101), range(0,101) )
num_decision = models.IntegerField(blank=True, choices=n_choices)
p_choices = zip( range(0,101), range(0,101) )
p_decision = models.IntegerField(blank=True, choices=p_choices)
p_decision = models.IntegerField(_('Threshold %'),blank=True, choices=p_choices)

class ThresholdEChooseNDecision(Decision):
#Setup
Expand All @@ -244,14 +244,14 @@ class ThresholdEChooseNDecision(Decision):
dyadic_relations = {}

class Meta:
verbose_name = _('ThresholdEChooseNDecision')
verbose_name_plural = _('ThresholdEChooseNDecision')
verbose_name = _('Choose Threshold Eligibles Decision')
verbose_name_plural = _('Choose Threshold Eligibles Decisions')

#fields
n_choices = zip( range(0,101), range(0,101) )
num_decision = models.IntegerField(blank=True, choices=n_choices)
e_choices = zip( range(0,101), range(0,101) )
e_decision = models.IntegerField(blank=True, choices=e_choices)
e_decision = models.IntegerField(_('Threshold for eligibles %'),blank=True, choices=e_choices)

class UnanimousChooseNDecision(Decision):
#Setup
Expand All @@ -262,14 +262,14 @@ class UnanimousChooseNDecision(Decision):
dyadic_relations = {}

class Meta:
verbose_name = _('UnanimousChooseNDecision')
verbose_name_plural = _('UnanimousChooseNDecision')
verbose_name = _('Choose Unanimous Decision')
verbose_name_plural = _('Choose Unanimous Decisions')

#fields
n_choices = zip( range(0,101), range(0,101) )
num_decision = models.IntegerField(blank=True, choices=n_choices)
m_choices = zip( range(0,101), range(0,101) )
m_decision = models.IntegerField(blank=True, choices=m_choices)
m_decision = models.IntegerField(_('Unanimous minus'),blank=True, choices=m_choices)

class PluralityApproveNDecision(Decision):
#Setup
Expand All @@ -280,8 +280,8 @@ class PluralityApproveNDecision(Decision):
dyadic_relations = {}

class Meta:
verbose_name = _('PluralityApproveNDecision')
verbose_name_plural = _('PluralityApproveNDecision')
verbose_name = _(' Approve Plurality Decision')
verbose_name_plural = _('Approve Plurality Decisions')

#fields
n_choices = zip( range(0,101), range(0,101) )
Expand All @@ -296,14 +296,14 @@ class ThresholdApproveNDecision(Decision):
dyadic_relations = {}

class Meta:
verbose_name = _('ThresholdApproveNDecision')
verbose_name_plural = _('ThresholdApproveNDecision')
verbose_name = _('Approve Threshold Decision')
verbose_name_plural = _('Approve Threshold Decisions')

#fields
n_choices = zip( range(0,101), range(0,101) )
num_decision = models.IntegerField(blank=True, choices=n_choices)
p_choices = zip( range(0,101), range(0,101) )
p_decision = models.IntegerField(blank=True, choices=p_choices)
p_decision = models.IntegerField(_('Threshold Participants %'),blank=True, choices=p_choices)

class ThresholdEApproveNDecision(Decision):
#Setup
Expand All @@ -314,14 +314,14 @@ class ThresholdEApproveNDecision(Decision):
dyadic_relations = {}

class Meta:
verbose_name = _('ThresholdEApproveNDecision')
verbose_name_plural = _('ThresholdEApproveNDecision')
verbose_name = _('Approve Threshold Eligible Decision')
verbose_name_plural = _('Approve Threshold Eligible Decisions')

#fields
n_choices = zip( range(0,101), range(0,101) )
num_decision = models.IntegerField(blank=True, choices=n_choices)
e_choices = zip( range(0,101), range(0,101) )
e_decision = models.IntegerField(blank=True, choices=e_choices)
e_decision = models.IntegerField(_('Threshold eligible %'),blank=True, choices=e_choices)



4 changes: 2 additions & 2 deletions deme_django/modules/poll/templates/poll/approvenpoll.html
Expand Up @@ -162,10 +162,10 @@
<p><a href="{% url item_type_url viewer='pluralityapprovendecision',action='new'%}?populate_poll={{ item.pk }}&amp;redirect={{ full_path|urlencode }}">Plurality Aggregation</a></p>
{% endifagentcanglobal %}
{% ifagentcanglobal 'create ThresholdApproveNDecision' %}
<p><a href="{% url item_type_url viewer='thresholdapprovendecision',action='new'%}?populate_poll={{ item.pk }}&amp;redirect={{ full_path|urlencode }}">Threshold Aggregation</a></p>
<p><a href="{% url item_type_url viewer='thresholdapprovendecision',action='new'%}?populate_poll={{ item.pk }}&amp;redirect={{ full_path|urlencode }}">Threshold Participant Aggregation</a></p>
{% endifagentcanglobal %}
{% ifagentcanglobal 'create ThresholdEApproveNDecision' %}
<p><a href="{% url item_type_url viewer='thresholdeapprovendecision',action='new'%}?populate_poll={{ item.pk }}&amp;redirect={{ full_path|urlencode }}">ThresholdE Aggregation</a></p>
<p><a href="{% url item_type_url viewer='thresholdeapprovendecision',action='new'%}?populate_poll={{ item.pk }}&amp;redirect={{ full_path|urlencode }}">Threshold Eligible Aggregation</a></p>
{% endifagentcanglobal %}
</div>
</div>
Expand Down

0 comments on commit caf8704

Please sign in to comment.