Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Helios Server
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TO
Helios Server
Commits
046e14ec
Commit
046e14ec
authored
May 7, 2011
by
Ben Adida
Browse files
Options
Downloads
Patches
Plain Diff
added election badge
parent
e694a7cb
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
helios/templates/election_view.html
+14
-0
14 additions, 0 deletions
helios/templates/election_view.html
helios/views.py
+6
-1
6 additions, 1 deletion
helios/views.py
with
20 additions
and
1 deletion
helios/templates/election_view.html
+
14
−
0
View file @
046e14ec
...
...
@@ -72,6 +72,20 @@ this {{election.election_type}} is <u>not</u> featured on the front page.
</p>
{% if admin_p %}
{% if not election.private_p %}
<div
style=
"background: lightyellow; padding:5px; padding-left: 10px; margin-top: 15px; border: 1px solid #aaa; width: 720px;"
class=
"round"
>
<a
href=
"#"
onclick=
"$('#badgebody').slideToggle(250);"
>
Embed an Election Badge
</a>
<div
id=
"badgebody"
style=
"display:none;"
>
<br
/>
<form
action=
"#"
>
<textarea
cols=
"90"
rows=
"4"
wrap=
"soft"
>
<
iframe src="{{election_badge_url}}" frameborder="0" style="border: 1px solid black" height="75" width="200"
>
<
/iframe
>
</textarea><br
/>
<p
style=
"font-size:0.8em;"
>
adding this HTML to your site displays a thin banner with direct links to voting.
</p>
</form>
</div>
</div>
{% endif %}
<p>
{% if election.result %}
...
...
This diff is collapsed.
Click to expand it.
helios/views.py
+
6
−
1
View file @
046e14ec
...
...
@@ -52,6 +52,9 @@ from django.conf import settings
def
get_election_url
(
election
):
return
settings
.
URL_HOST
+
reverse
(
election_shortcut
,
args
=
[
election
.
short_name
])
def
get_election_badge_url
(
election
):
return
settings
.
URL_HOST
+
reverse
(
election_badge
,
args
=
[
election
.
uuid
])
def
get_election_govote_url
(
election
):
return
settings
.
URL_HOST
+
reverse
(
election_vote_shortcut
,
args
=
[
election
.
short_name
])
...
...
@@ -282,6 +285,7 @@ def one_election_view(request, election):
eligible_p
=
True
election_url
=
get_election_url
(
election
)
election_badge_url
=
get_election_badge_url
(
election
)
status_update_message
=
None
vote_url
=
"
%s/booth/vote.html?%s
"
%
(
settings
.
SECURE_URL_HOST
,
urllib
.
urlencode
({
'
election_url
'
:
reverse
(
one_election
,
args
=
[
election
.
uuid
])}))
...
...
@@ -328,7 +332,8 @@ def one_election_view(request, election):
return
render_template
(
request
,
'
election_view
'
,
{
'
election
'
:
election
,
'
trustees
'
:
trustees
,
'
admin_p
'
:
admin_p
,
'
user
'
:
user
,
'
voter
'
:
voter
,
'
votes
'
:
votes
,
'
notregistered
'
:
notregistered
,
'
eligible_p
'
:
eligible_p
,
'
can_feature_p
'
:
can_feature_p
,
'
election_url
'
:
election_url
,
'
vote_url
'
:
vote_url
,
'
can_feature_p
'
:
can_feature_p
,
'
election_url
'
:
election_url
,
'
vote_url
'
:
vote_url
,
'
election_badge_url
'
:
election_badge_url
,
'
test_cookie_url
'
:
test_cookie_url
,
'
socialbuttons_url
'
:
socialbuttons_url
})
def
test_cookie
(
request
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment