Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Sith
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
59
Issues
59
List
Boards
Labels
Service Desk
Milestones
Merge Requests
9
Merge Requests
9
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
AE
Sith
Commits
61e67898
Commit
61e67898
authored
Dec 25, 2016
by
Sli
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Coherent create/edit/delete templates for elections
parent
cd97901d
Pipeline
#642
passed with stage
in 3 minutes
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
50 deletions
+8
-50
election/templates/election/create_template.jinja
election/templates/election/create_template.jinja
+0
-15
election/templates/election/delete_template.jinja
election/templates/election/delete_template.jinja
+0
-12
election/templates/election/update_template.jinja
election/templates/election/update_template.jinja
+0
-15
election/views.py
election/views.py
+8
-8
No files found.
election/templates/election/create_template.jinja
deleted
100644 → 0
View file @
cd97901d
{%
extends
"core/base.jinja"
%}
{%
block
title
%}
{%
trans
%}
Create
{%
endtrans
%}
{%
endblock
%}
{%
block
content
%}
<h2>
{%
trans
%}
Create
{%
endtrans
%}
<section
class=
"election__add-candidature"
>
<form
action=
""
method=
"post"
>
{{
form.as_p
()
}}
<p><input
type=
"submit"
value=
"
{%
trans
%}
Save
{%
endtrans
%}
"
/></p>
{%
csrf_token
%}
</form>
</section>
{%
endblock
content
%}
\ No newline at end of file
election/templates/election/delete_template.jinja
deleted
100644 → 0
View file @
cd97901d
{%
extends
"core/base.jinja"
%}
{%
block
title
%}
{%
trans
%}
Delete
{%
endtrans
%}
{%
endblock
%}
{%
block
content
%}
<form
action=
""
method=
"post"
>
{%
csrf_token
%}
<p>
{%
trans
%}
Are you sure you want to delete
{%
endtrans
%}
"
{{
object
}}
"?
</p>
<input
type=
"submit"
value=
"Confirm"
/>
</form>
{%
endblock
content
%}
\ No newline at end of file
election/templates/election/update_template.jinja
deleted
100644 → 0
View file @
cd97901d
{%
extends
"core/base.jinja"
%}
{%
block
title
%}
{%
trans
%}
Edit
{%
endtrans
%}
{%
endblock
%}
{%
block
content
%}
<h2>
{%
trans
%}
Edit
{%
endtrans
%}
<section
class=
"election__add-candidature"
>
<form
action=
""
method=
"post"
>
{{
form.as_p
()
}}
<p><input
type=
"submit"
value=
"
{%
trans
%}
Save
{%
endtrans
%}
"
/></p>
{%
csrf_token
%}
</form>
</section>
{%
endblock
content
%}
\ No newline at end of file
election/views.py
View file @
61e67898
...
...
@@ -266,7 +266,7 @@ class CandidatureCreateView(CanCreateMixin, CreateView):
class
ElectionCreateView
(
CanCreateMixin
,
CreateView
):
model
=
Election
form_class
=
ElectionForm
template_name
=
'
election/create_templ
ate.jinja'
template_name
=
'
core/cre
ate.jinja'
def
dispatch
(
self
,
request
,
*
args
,
**
kwargs
):
if
not
request
.
user
.
is_subscribed
():
...
...
@@ -286,7 +286,7 @@ class ElectionCreateView(CanCreateMixin, CreateView):
class
RoleCreateView
(
CanCreateMixin
,
CreateView
):
model
=
Role
form_class
=
RoleForm
template_name
=
'
election/create_templ
ate.jinja'
template_name
=
'
core/cre
ate.jinja'
def
dispatch
(
self
,
request
,
*
arg
,
**
kwargs
):
self
.
election
=
get_object_or_404
(
Election
,
pk
=
kwargs
[
'election_id'
])
...
...
@@ -322,7 +322,7 @@ class RoleCreateView(CanCreateMixin, CreateView):
class
ElectionListCreateView
(
CanCreateMixin
,
CreateView
):
model
=
ElectionList
form_class
=
ElectionListForm
template_name
=
'
election/create_templ
ate.jinja'
template_name
=
'
core/cre
ate.jinja'
def
dispatch
(
self
,
request
,
*
arg
,
**
kwargs
):
self
.
election
=
get_object_or_404
(
Election
,
pk
=
kwargs
[
'election_id'
])
...
...
@@ -363,7 +363,7 @@ class ElectionListCreateView(CanCreateMixin, CreateView):
class
ElectionUpdateView
(
CanEditMixin
,
UpdateView
):
model
=
Election
form_class
=
ElectionForm
template_name
=
'
election/update_template
.jinja'
template_name
=
'
core/edit
.jinja'
pk_url_kwarg
=
'election_id'
def
get_success_url
(
self
,
**
kwargs
):
...
...
@@ -373,7 +373,7 @@ class ElectionUpdateView(CanEditMixin, UpdateView):
class
CandidatureUpdateView
(
CanEditMixin
,
UpdateView
):
model
=
Candidature
form_class
=
CandidateForm
template_name
=
'
election/update_template
.jinja'
template_name
=
'
core/edit
.jinja'
pk_url_kwarg
=
'candidature_id'
def
dispatch
(
self
,
request
,
*
arg
,
**
kwargs
):
...
...
@@ -409,7 +409,7 @@ class CandidatureUpdateView(CanEditMixin, UpdateView):
class
RoleUpdateView
(
CanEditMixin
,
UpdateView
):
model
=
Role
form_class
=
RoleForm
template_name
=
'
election/update_template
.jinja'
template_name
=
'
core/edit
.jinja'
pk_url_kwarg
=
'role_id'
def
dispatch
(
self
,
request
,
*
arg
,
**
kwargs
):
...
...
@@ -448,7 +448,7 @@ class RoleUpdateView(CanEditMixin, UpdateView):
class
CandidatureDeleteView
(
CanEditMixin
,
DeleteView
):
model
=
Candidature
template_name
=
'
election/delete_template
.jinja'
template_name
=
'
core/delete_confirm
.jinja'
pk_url_kwarg
=
'candidature_id'
def
dispatch
(
self
,
request
,
*
arg
,
**
kwargs
):
...
...
@@ -464,7 +464,7 @@ class CandidatureDeleteView(CanEditMixin, DeleteView):
class
RoleDeleteView
(
CanEditMixin
,
DeleteView
):
model
=
Role
template_name
=
'
election/delete_template
.jinja'
template_name
=
'
core/delete_confirm
.jinja'
pk_url_kwarg
=
'role_id'
def
dispatch
(
self
,
request
,
*
arg
,
**
kwargs
):
...
...
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