aboutsummaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2019-02-18 09:43:14 +0000
committerMatthew Somerville <matthew-github@dracos.co.uk>2019-02-22 11:47:33 +0000
commit7f41c1b26110e18c0068bcd9e209daebe26b6779 (patch)
tree0e6dd0b31fe073c1f30fb588e90237eae08da1e1 /templates
parentaee1158c6207a52fb459ad4b7dee745d15dcf08e (diff)
Refactor admin body/user functions to own files.
Diffstat (limited to 'templates')
-rw-r--r--templates/web/base/admin/bodies/_translations.html (renamed from templates/web/base/admin/_translations.html)0
-rw-r--r--templates/web/base/admin/bodies/body.html (renamed from templates/web/base/admin/body.html)12
-rw-r--r--templates/web/base/admin/bodies/category.html (renamed from templates/web/base/admin/category_edit.html)2
-rw-r--r--templates/web/base/admin/bodies/contact-form.html (renamed from templates/web/base/admin/contact-form.html)6
-rw-r--r--templates/web/base/admin/bodies/edit-league.html (renamed from templates/web/base/admin/edit-league.html)0
-rw-r--r--templates/web/base/admin/bodies/form.html (renamed from templates/web/base/admin/body-form.html)6
-rw-r--r--templates/web/base/admin/bodies/index.html (renamed from templates/web/base/admin/bodies.html)8
-rw-r--r--templates/web/base/admin/bodies/open311-form-fields.html (renamed from templates/web/base/admin/open311-form-fields.html)0
-rw-r--r--templates/web/base/admin/users/alerts.html (renamed from templates/web/base/admin/user-alerts.html)0
-rw-r--r--templates/web/base/admin/users/edit.html (renamed from templates/web/base/admin/user_edit.html)4
-rw-r--r--templates/web/base/admin/users/form.html (renamed from templates/web/base/admin/user-form.html)4
-rw-r--r--templates/web/base/admin/users/import.html (renamed from templates/web/base/admin/user_import.html)6
-rw-r--r--templates/web/base/admin/users/index.html (renamed from templates/web/base/admin/users.html)10
-rw-r--r--templates/web/zurich/admin/bodies/body.html (renamed from templates/web/zurich/admin/body.html)6
-rw-r--r--templates/web/zurich/admin/bodies/contact-form.html (renamed from templates/web/zurich/admin/contact-form.html)2
-rw-r--r--templates/web/zurich/admin/bodies/edit-league.html (renamed from templates/web/zurich/admin/edit-league.html)0
-rw-r--r--templates/web/zurich/admin/bodies/form.html (renamed from templates/web/zurich/admin/body-form.html)2
17 files changed, 34 insertions, 34 deletions
diff --git a/templates/web/base/admin/_translations.html b/templates/web/base/admin/bodies/_translations.html
index d8f7d52fb..d8f7d52fb 100644
--- a/templates/web/base/admin/_translations.html
+++ b/templates/web/base/admin/bodies/_translations.html
diff --git a/templates/web/base/admin/body.html b/templates/web/base/admin/bodies/body.html
index 37ab24496..afd2eff46 100644
--- a/templates/web/base/admin/body.html
+++ b/templates/web/base/admin/bodies/body.html
@@ -29,7 +29,7 @@
[% END %]
<br>
<a href="[% c.uri_for_email(body.url) %]" class="admin-offsite-link">[% loc('List all reported problems' ) %]</a> |
- <a href="[% c.uri_for( 'body', body_id, { text => 1 } ) %]">[% loc('Text only version') %]</a>
+ <a href="[% c.uri_for_action( 'admin/bodies/edit', [ body_id ], { text => 1 } ) %]">[% loc('Text only version') %]</a>
</p>
@@ -65,7 +65,7 @@
</p>
[% END %]
-<form method="post" action="[% c.uri_for('body', body_id ) %]" enctype="application/x-www-form-urlencoded" accept-charset="utf-8">
+<form method="post" action="[% c.uri_for_action('admin/bodies/edit', [ body_id ] ) %]" enctype="application/x-www-form-urlencoded" accept-charset="utf-8">
<table cellspacing="0" cellpadding="2" border="1" id="admin_contacts">
<tr>
@@ -79,7 +79,7 @@
</tr>
[% WHILE ( cat = contacts.next ) %]
<tr [% IF cat.state == 'deleted' %]class="is-deleted"[% END %]>
- <td class="contact-category"><a href="[% c.uri_for( 'body', body_id, cat.category ) %]">[% cat.category_display | html %]</a>
+ <td class="contact-category"><a href="[% c.uri_for_action( '/admin/bodies/edit', [ body_id ], cat.category ) %]">[% cat.category_display | html %]</a>
<br>[% cat.email | html %]</td>
<td>
[% cat.state %]
@@ -130,16 +130,16 @@
<div class="fms-admin-warning">
[% errors.values.join('<br>') %]
</div>
- [% INCLUDE 'admin/contact-form.html' translations=contact_translations %]
+ [% INCLUDE 'admin/bodies/contact-form.html' translations=contact_translations %]
[% ELSE %]
- [% INCLUDE 'admin/contact-form.html' translations={} %]
+ [% INCLUDE 'admin/bodies/contact-form.html' translations={} %]
[% END %]
</div>
[% IF NOT errors and c.user.is_superuser %]
<div class="admin-box">
<h2>[% loc('Edit body details') %]</h2>
- [% INCLUDE 'admin/body-form.html' %]
+ [% INCLUDE 'admin/bodies/form.html' %]
</div>
[% END %][%# Only show all the above if no errors with category form %]
diff --git a/templates/web/base/admin/category_edit.html b/templates/web/base/admin/bodies/category.html
index 7ae4e59b4..2f789ed81 100644
--- a/templates/web/base/admin/category_edit.html
+++ b/templates/web/base/admin/bodies/category.html
@@ -19,7 +19,7 @@
[% END %]
</p>
-[% INCLUDE 'admin/contact-form.html' %]
+[% INCLUDE 'admin/bodies/contact-form.html' %]
<h2>[% loc('History') %]</h2>
<table border="1">
diff --git a/templates/web/base/admin/contact-form.html b/templates/web/base/admin/bodies/contact-form.html
index 7e2830e9c..c55c5c036 100644
--- a/templates/web/base/admin/contact-form.html
+++ b/templates/web/base/admin/bodies/contact-form.html
@@ -1,4 +1,4 @@
-<form method="post" action="[% c.uri_for('body', body_id ) %]" enctype="application/x-www-form-urlencoded" accept-charset="utf-8" id="category_edit">
+<form method="post" action="[% c.uri_for_action('admin/bodies/edit', [ body_id ] ) %]" enctype="application/x-www-form-urlencoded" accept-charset="utf-8" id="category_edit">
[% IF contact.in_storage %]
<p>
@@ -20,7 +20,7 @@
</p>
[% END %]
- [% INCLUDE 'admin/_translations.html' %]
+ [% INCLUDE 'admin/bodies/_translations.html' %]
<div class="admin-hint">
<p>
@@ -117,7 +117,7 @@ as well.") %]
</select>
</p>
- [% INCLUDE 'admin/open311-form-fields.html', object = contact%]
+ [% INCLUDE 'admin/bodies/open311-form-fields.html', object = contact%]
[% END %]
[% IF c.cobrand.enable_category_groups %]
diff --git a/templates/web/base/admin/edit-league.html b/templates/web/base/admin/bodies/edit-league.html
index 4f31eeb2e..4f31eeb2e 100644
--- a/templates/web/base/admin/edit-league.html
+++ b/templates/web/base/admin/bodies/edit-league.html
diff --git a/templates/web/base/admin/body-form.html b/templates/web/base/admin/bodies/form.html
index 958ea5d78..0b162c274 100644
--- a/templates/web/base/admin/body-form.html
+++ b/templates/web/base/admin/bodies/form.html
@@ -1,4 +1,4 @@
- <form method="post" action="[% body ? c.uri_for('body', body.id) : c.uri_for('bodies') %]" enctype="application/x-www-form-urlencoded" accept-charset="utf-8">
+ <form method="post" action="[% body ? c.uri_for_action('admin/bodies/edit', [ body.id ]) : c.uri_for_action('admin/bodies/index') %]" enctype="application/x-www-form-urlencoded" accept-charset="utf-8">
<div class="fms-admin-info">
[% loc(
"Add a <strong>body</strong> for each administrative body, such as a council or department
@@ -25,7 +25,7 @@
<input type="text" class="form-control" name="name" id="name" value="[% body.name | html %]" size="50">
</p>
- [% INCLUDE 'admin/_translations.html' %]
+ [% INCLUDE 'admin/bodies/_translations.html' %]
<div class="admin-hint">
<p>
@@ -114,7 +114,7 @@
</select>
</p>
- [% INCLUDE 'admin/open311-form-fields.html', object = body, show_body_fields = 1 %]
+ [% INCLUDE 'admin/bodies/open311-form-fields.html', object = body, show_body_fields = 1 %]
<div class="admin-hint">
<p>
diff --git a/templates/web/base/admin/bodies.html b/templates/web/base/admin/bodies/index.html
index 33ae5b25a..84e1cda3c 100644
--- a/templates/web/base/admin/bodies.html
+++ b/templates/web/base/admin/bodies/index.html
@@ -39,12 +39,12 @@
[% IF c.cobrand.moniker == 'zurich' %]
[% FILTER repeat(4*body.indent_level) %]&nbsp;[% END %]
[% IF admin_type == 'super' %]
- <a href="[% c.uri_for( 'body', id ) %]">[% body.name | html %]</a>
+ <a href="[% c.uri_for_action( 'admin/bodies/edit', [ id ] ) %]">[% body.name | html %]</a>
[% ELSE %]
[% body.name | html %]
[% END %]
[% ELSE %] [%# not Zurich: all bodies should be links %]
- <a href="[% c.uri_for( 'body', id ) %]">[% body.name | html%]</a>
+ <a href="[% c.uri_for_action( 'admin/bodies/edit', [ id ] ) %]">[% body.name | html %]</a>
[%- IF body.parent %], [% body.parent.name | html %][% END -%]
[% END %]
</td>
@@ -76,10 +76,10 @@
[% IF (c.cobrand.moniker == 'zurich' AND admin_type == 'super') OR c.user.is_superuser %]
<div class="admin-box">
<h2>[% loc('Add body') %]</h2>
- [% INCLUDE 'admin/body-form.html', body='' %]
+ [% INCLUDE 'admin/bodies/form.html', body='' %]
</div>
[% END %]
-[% INCLUDE 'admin/edit-league.html' %]
+[% INCLUDE 'admin/bodies/edit-league.html' %]
[% INCLUDE 'admin/footer.html' %]
diff --git a/templates/web/base/admin/open311-form-fields.html b/templates/web/base/admin/bodies/open311-form-fields.html
index b716cf175..b716cf175 100644
--- a/templates/web/base/admin/open311-form-fields.html
+++ b/templates/web/base/admin/bodies/open311-form-fields.html
diff --git a/templates/web/base/admin/user-alerts.html b/templates/web/base/admin/users/alerts.html
index 6058e595b..6058e595b 100644
--- a/templates/web/base/admin/user-alerts.html
+++ b/templates/web/base/admin/users/alerts.html
diff --git a/templates/web/base/admin/user_edit.html b/templates/web/base/admin/users/edit.html
index cc456914d..8dd2b926f 100644
--- a/templates/web/base/admin/user_edit.html
+++ b/templates/web/base/admin/users/edit.html
@@ -8,8 +8,8 @@
[% status_message %]
-[% INCLUDE 'admin/user-form.html' %]
+[% INCLUDE 'admin/users/form.html' %]
-[% INCLUDE 'admin/user-alerts.html' %]
+[% INCLUDE 'admin/users/alerts.html' %]
[% INCLUDE 'admin/footer.html' %]
diff --git a/templates/web/base/admin/user-form.html b/templates/web/base/admin/users/form.html
index 735e15e87..7bc291419 100644
--- a/templates/web/base/admin/user-form.html
+++ b/templates/web/base/admin/users/form.html
@@ -1,4 +1,4 @@
-<form method="post" id="user_edit" action="[% c.uri_for( 'user_edit', user.id ) %]" enctype="application/x-www-form-urlencoded" accept-charset="utf-8">
+<form method="post" id="user_edit" action="[% c.uri_for_action( 'admin/users/edit', user.id ) %]" enctype="application/x-www-form-urlencoded" accept-charset="utf-8">
<input type="hidden" name="token" value="[% csrf_token %]" >
<input type="hidden" name="submit" value="1" >
@@ -191,7 +191,7 @@
</ul>
[% END %]
[% END %]
- [% TRY %][% INCLUDE 'admin/user-form-extra-fields.html' %][% CATCH file %][% END %]
+ [% TRY %][% INCLUDE 'admin/users/form-extra-fields.html' %][% CATCH file %][% END %]
</ul>
<p>
<input type="submit" class="btn" name="Submit changes" value="[% loc('Submit changes') %]" >
diff --git a/templates/web/base/admin/user_import.html b/templates/web/base/admin/users/import.html
index f866ed955..0c0b903d7 100644
--- a/templates/web/base/admin/user_import.html
+++ b/templates/web/base/admin/users/import.html
@@ -3,7 +3,7 @@
[% status_message %]
-<form method="post" id="user_edit" action="[% c.uri_for( 'user_import' ) %]" enctype="multipart/form-data" accept-charset="utf-8">
+<form method="post" id="user_edit" enctype="multipart/form-data" accept-charset="utf-8">
<input type="hidden" name="token" value="[% csrf_token %]" >
<input type="hidden" name="submit" value="1" >
@@ -27,7 +27,7 @@
[% FOREACH user IN new_users %]
<tr>
<td>
- <a href="[% c.uri_for_action( 'admin/user_edit', user.id ) %]">
+ <a href="[% c.uri_for_action( 'admin/users/edit', user.id ) %]">
[% user.name %]
</a>
</td>
@@ -50,7 +50,7 @@
[% FOREACH user IN existing_users %]
<tr>
<td>
- <a href="[% c.uri_for_action( 'admin/user_edit', user.id ) %]">
+ <a href="[% c.uri_for_action( 'admin/users/edit', user.id ) %]">
[% user.name %]
</a>
</td>
diff --git a/templates/web/base/admin/users.html b/templates/web/base/admin/users/index.html
index 6dfcf4204..e939f008b 100644
--- a/templates/web/base/admin/users.html
+++ b/templates/web/base/admin/users/index.html
@@ -4,7 +4,7 @@
<div class="fms-admin-info">
[% loc("User search finds matches in users' names and email addresses.") %]
</div>
-<form method="get" action="[% c.uri_for('users') %]" enctype="application/x-www-form-urlencoded" accept-charset="utf-8">
+<form method="get" action="[% c.uri_for_action('admin/users/index') %]" enctype="application/x-www-form-urlencoded" accept-charset="utf-8">
<p><label for="search">[% loc('Search:') %]</label>
<input class="form-control" type="text" name="search" size="30" id="search" value="[% searched | html %]">
</form>
@@ -24,14 +24,14 @@
[%- FOREACH user IN users %]
<tr>
<td>[% PROCESS value_or_nbsp value=user.name %]</td>
- <td><a href="[% c.uri_for( 'reports', search => user.email ) %]">[% PROCESS value_or_nbsp value=user.email %]</a></td>
+ <td><a href="[% c.uri_for_action( 'admin/reports', search => user.email ) %]">[% PROCESS value_or_nbsp value=user.email %]</a></td>
<td>[% PROCESS value_or_nbsp value=user.from_body.name %]
[% IF user.is_superuser %] * [% END %]
</td>
[% IF c.cobrand.moniker != 'zurich' %]
<td>[% user.flagged == 2 ? loc('User in abuse table') : user.flagged ? loc('Yes') : '&nbsp;' %]</td>
[% END %]
- <td>[% IF user.id %]<a href="[% c.uri_for( 'user_edit', user.id ) %]">[% loc('Edit') %]</a>[% END %]</td>
+ <td>[% IF user.id %]<a href="[% c.uri_for_action( 'admin/users/edit', user.id ) %]">[% loc('Edit') %]</a>[% END %]</td>
</tr>
[%- END -%]
</table>
@@ -46,9 +46,9 @@
[% IF NOT searched %]
<h2>[% loc('Add user') %]</h2>
-[% INCLUDE 'admin/user-form.html', user = '' %]
+[% INCLUDE 'admin/users/form.html', user = '' %]
[% ELSE %]
-<a href="[% c.uri_for( c.controller('Admin').action_for('user_add') ) %]">[% loc('Add user') %]</a>
+<a href="[% c.uri_for_action('admin/users/add') %]">[% loc('Add user') %]</a>
[% END %]
[% INCLUDE 'admin/footer.html' %]
diff --git a/templates/web/zurich/admin/body.html b/templates/web/zurich/admin/bodies/body.html
index 11be6eef7..aab038ff8 100644
--- a/templates/web/zurich/admin/body.html
+++ b/templates/web/zurich/admin/bodies/body.html
@@ -20,7 +20,7 @@
</tr>
[% WHILE ( cat = contacts.next ) %]
<tr[% IF cat.state == 'deleted' %] class="is-deleted"[% END %]>
- <td><a href="[% c.uri_for( 'body', body_id, cat.category ) %]">[% cat.category_display %]</a></td>
+ <td><a href="[% c.uri_for_action( 'admin/bodies/edit', [ body_id ], cat.category ) %]">[% cat.category_display %]</a></td>
<td>[% cat.email | html %]</td>
<td>[% cat.editor %]</td>
<td>[% cat.note | html %]</td>
@@ -39,13 +39,13 @@
</div>
[% END %]
- [% INCLUDE 'admin/contact-form.html' %]
+ [% INCLUDE 'admin/bodies/contact-form.html' %]
[% END %]
[% IF NOT errors %]
<h2>[% loc('Edit body details') %]</h2>
- [% INCLUDE 'admin/body-form.html' %]
+ [% INCLUDE 'admin/bodies/form.html' %]
[% END %]
[% INCLUDE 'admin/footer.html' %]
diff --git a/templates/web/zurich/admin/contact-form.html b/templates/web/zurich/admin/bodies/contact-form.html
index 3840d46a4..7b59124fb 100644
--- a/templates/web/zurich/admin/contact-form.html
+++ b/templates/web/zurich/admin/bodies/contact-form.html
@@ -1,4 +1,4 @@
-<form method="post" action="[% c.uri_for('body', body_id ) %]" enctype="application/x-www-form-urlencoded" accept-charset="utf-8" id="category_edit">
+<form method="post" action="[% c.uri_for_action('admin/bodies/edit', [ body_id ] ) %]" enctype="application/x-www-form-urlencoded" accept-charset="utf-8" id="category_edit">
[% IF contact.in_storage %]
<h1>[% contact.category_display | html %]</h1>
diff --git a/templates/web/zurich/admin/edit-league.html b/templates/web/zurich/admin/bodies/edit-league.html
index e69de29bb..e69de29bb 100644
--- a/templates/web/zurich/admin/edit-league.html
+++ b/templates/web/zurich/admin/bodies/edit-league.html
diff --git a/templates/web/zurich/admin/body-form.html b/templates/web/zurich/admin/bodies/form.html
index 44adcbc72..b625efc44 100644
--- a/templates/web/zurich/admin/body-form.html
+++ b/templates/web/zurich/admin/bodies/form.html
@@ -1,4 +1,4 @@
- <form method="post" action="[% body ? c.uri_for('body', body.id) : c.uri_for('bodies') %]" enctype="application/x-www-form-urlencoded" accept-charset="utf-8">
+ <form method="post" action="[% body ? c.uri_for_action('admin/bodies/edit', [ body.id ]) : c.uri_for_action('admin/bodies/index') %]" enctype="application/x-www-form-urlencoded" accept-charset="utf-8">
<p>
<label for="name">[% loc('Name') %]</label>