summaryrefslogtreecommitdiff
path: root/app/Template
diff options
context:
space:
mode:
authorFrédéric Guillot <fred@kanboard.net>2014-12-04 21:04:33 -0500
committerFrédéric Guillot <fred@kanboard.net>2014-12-04 21:04:33 -0500
commit6739dba792f210a1836489a191527747d21e3da4 (patch)
treeb93e9df07f130c719d37b63700b960f1728e6707 /app/Template
parent66e0028b4aad5b3bd2604efb34fe89693383aa86 (diff)
Move user templates to a subfolder
Diffstat (limited to 'app/Template')
-rw-r--r--app/Template/user/edit.php (renamed from app/Template/user_edit.php)6
-rw-r--r--app/Template/user/external.php (renamed from app/Template/user_external.php)8
-rw-r--r--app/Template/user/index.php (renamed from app/Template/user_index.php)0
-rw-r--r--app/Template/user/last.php (renamed from app/Template/user_last.php)0
-rw-r--r--app/Template/user/layout.php (renamed from app/Template/user_layout.php)2
-rw-r--r--app/Template/user/login.php (renamed from app/Template/user_login.php)6
-rw-r--r--app/Template/user/new.php (renamed from app/Template/user_new.php)3
-rw-r--r--app/Template/user/notifications.php (renamed from app/Template/user_notifications.php)7
-rw-r--r--app/Template/user/password.php (renamed from app/Template/user_password.php)15
-rw-r--r--app/Template/user/remove.php13
-rw-r--r--app/Template/user/sessions.php (renamed from app/Template/user_sessions.php)2
-rw-r--r--app/Template/user/show.php (renamed from app/Template/user_show.php)0
-rw-r--r--app/Template/user/sidebar.php (renamed from app/Template/user_sidebar.php)2
-rw-r--r--app/Template/user_remove.php12
14 files changed, 42 insertions, 34 deletions
diff --git a/app/Template/user_edit.php b/app/Template/user/edit.php
index 14063d49..bc942567 100644
--- a/app/Template/user_edit.php
+++ b/app/Template/user/edit.php
@@ -1,7 +1,7 @@
<div class="page-header">
<h2><?= t('Edit user') ?></h2>
</div>
-<form method="post" action="?controller=user&amp;action=edit&amp;user_id=<?= $user['id'] ?>" autocomplete="off">
+<form method="post" action="<?= Helper\u('user', 'edit', array('user_id' => $user['id'])) ?>" autocomplete="off">
<?= Helper\form_csrf() ?>
@@ -25,6 +25,8 @@
<?php endif ?>
<div class="form-actions">
- <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/> <?= t('or') ?> <a href="?controller=user&amp;action=show&amp;user_id=<?= $user['id'] ?>"><?= t('cancel') ?></a>
+ <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/>
+ <?= t('or') ?>
+ <?= Helper\a(t('cancel'), 'user', 'show', array('user_id' => $user['id'])) ?>
</div>
</form> \ No newline at end of file
diff --git a/app/Template/user_external.php b/app/Template/user/external.php
index 676b2c73..31ffcb75 100644
--- a/app/Template/user_external.php
+++ b/app/Template/user/external.php
@@ -8,9 +8,9 @@
<p class="listing">
<?php if (Helper\is_current_user($user['id'])): ?>
<?php if (empty($user['google_id'])): ?>
- <a href="?controller=user&amp;action=google<?= Helper\param_csrf() ?>"><?= t('Link my Google Account') ?></a>
+ <?= Helper\a(t('Link my Google Account'), 'user', 'google', array(), true) ?>
<?php else: ?>
- <a href="?controller=user&amp;action=unlinkGoogle<?= Helper\param_csrf() ?>"><?= t('Unlink my Google Account') ?></a>
+ <?= Helper\a(t('Unlink my Google Account'), 'user', 'unlinkGoogle', array(), true) ?>
<?php endif ?>
<?php else: ?>
<?= empty($user['google_id']) ? t('No account linked.') : t('Account linked.') ?>
@@ -24,9 +24,9 @@
<p class="listing">
<?php if (Helper\is_current_user($user['id'])): ?>
<?php if (empty($user['github_id'])): ?>
- <a href="?controller=user&amp;action=gitHub<?= Helper\param_csrf() ?>"><?= t('Link my GitHub Account') ?></a>
+ <?= Helper\a(t('Link my GitHub Account'), 'user', 'github', array(), true) ?>
<?php else: ?>
- <a href="?controller=user&amp;action=unlinkGitHub<?= Helper\param_csrf() ?>"><?= t('Unlink my GitHub Account') ?></a>
+ <?= Helper\a(t('Unlink my GitHub Account'), 'user', 'unlinkGitHub', array(), true) ?>
<?php endif ?>
<?php else: ?>
<?= empty($user['github_id']) ? t('No account linked.') : t('Account linked.') ?>
diff --git a/app/Template/user_index.php b/app/Template/user/index.php
index 73612b0b..73612b0b 100644
--- a/app/Template/user_index.php
+++ b/app/Template/user/index.php
diff --git a/app/Template/user_last.php b/app/Template/user/last.php
index 0b55b0d5..0b55b0d5 100644
--- a/app/Template/user_last.php
+++ b/app/Template/user/last.php
diff --git a/app/Template/user_layout.php b/app/Template/user/layout.php
index 1fbc1ea0..0778b716 100644
--- a/app/Template/user_layout.php
+++ b/app/Template/user/layout.php
@@ -9,7 +9,7 @@
</div>
<section class="sidebar-container" id="user-section">
- <?= Helper\template('user_sidebar', array('user' => $user)) ?>
+ <?= Helper\template('user/sidebar', array('user' => $user)) ?>
<div class="sidebar-content">
<?= $user_content_for_layout ?>
diff --git a/app/Template/user_login.php b/app/Template/user/login.php
index a8e8fc15..fea44a01 100644
--- a/app/Template/user_login.php
+++ b/app/Template/user/login.php
@@ -4,7 +4,7 @@
<p class="alert alert-error"><?= Helper\escape($errors['login']) ?></p>
<?php endif ?>
- <form method="post" action="?controller=user&amp;action=check&amp;redirect_query=<?= urlencode($redirect_query) ?>">
+ <form method="post" action="<?= Helper\u('user', 'check', array('redirect_query' => urlencode($redirect_query))) ?>">
<?= Helper\form_csrf() ?>
@@ -17,11 +17,11 @@
<?= Helper\form_checkbox('remember_me', t('Remember Me'), 1) ?><br/>
<?php if (GOOGLE_AUTH): ?>
- <a href="?controller=user&amp;action=google"><?= t('Login with my Google Account') ?></a>
+ <?= Helper\a(t('Login with my Google Account'), 'user', 'google') ?>
<?php endif ?>
<?php if (GITHUB_AUTH): ?>
- <a href="?controller=user&amp;action=gitHub"><?= t('Login with my GitHub Account') ?></a>
+ <?= Helper\a(t('Login with my GitHub Account'), 'user', 'gitHub') ?>
<?php endif ?>
<div class="form-actions">
diff --git a/app/Template/user_new.php b/app/Template/user/new.php
index 1e483ade..af5824e0 100644
--- a/app/Template/user_new.php
+++ b/app/Template/user/new.php
@@ -31,7 +31,8 @@
<div class="form-actions">
<input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/>
- <?= t('or') ?> <?= Helper\a(t('cancel'), 'user', 'index') ?>
+ <?= t('or') ?>
+ <?= Helper\a(t('cancel'), 'user', 'index') ?>
</div>
</form>
</section>
diff --git a/app/Template/user_notifications.php b/app/Template/user/notifications.php
index 4a32a41d..33da61fb 100644
--- a/app/Template/user_notifications.php
+++ b/app/Template/user/notifications.php
@@ -2,7 +2,7 @@
<h2><?= t('Email notifications') ?></h2>
</div>
-<form method="post" action="?controller=user&amp;action=notifications&amp;user_id=<?= $user['id'] ?>" autocomplete="off">
+<form method="post" action="<?= Helper\u('user', 'notifications', array('user_id' => $user['id'])) ?>" autocomplete="off">
<?= Helper\form_csrf() ?>
@@ -13,13 +13,14 @@
<div class="form-checkbox-group">
<?php foreach ($projects as $project_id => $project_name): ?>
- <?= Helper\form_checkbox('projects['.$project_id.']', $project_name, '1', isset($notifications['project_'.$project_id])) ?>
+ <?= Helper\form_checkbox('projects['.$project_id.']', $project_name, '1', isset($notifications['project_'.$project_id])) ?><br/>
<?php endforeach ?>
</div>
<?php endif ?>
<div class="form-actions">
<input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/>
- <?= t('or') ?> <a href="?controller=user&amp;action=show&amp;user_id=<?= $user['id'] ?>"><?= t('cancel') ?></a>
+ <?= t('or') ?>
+ <?= Helper\a(t('cancel'), 'user', 'show', array('user_id' => $user['id'])) ?>
</div>
</form> \ No newline at end of file
diff --git a/app/Template/user_password.php b/app/Template/user/password.php
index 5da38595..76e0ab15 100644
--- a/app/Template/user_password.php
+++ b/app/Template/user/password.php
@@ -2,13 +2,15 @@
<h2><?= t('Password modification') ?></h2>
</div>
-<form method="post" action="?controller=user&amp;action=password&amp;user_id=<?= $user['id'] ?>" autocomplete="off">
+<form method="post" action="<?= Helper\u('user', 'password', array('user_id' => $user['id'])) ?>" autocomplete="off">
<?= Helper\form_hidden('id', $values) ?>
<?= Helper\form_csrf() ?>
- <?= Helper\form_label(t('Current password for the user "%s"', Helper\get_username()), 'current_password') ?>
- <?= Helper\form_password('current_password', $values, $errors) ?><br/>
+ <div class="alert alert-error">
+ <?= Helper\form_label(t('Current password for the user "%s"', Helper\get_username()), 'current_password') ?>
+ <?= Helper\form_password('current_password', $values, $errors) ?><br/>
+ </div>
<?= Helper\form_label(t('New password for the user "%s"', Helper\get_username($user)), 'password') ?>
<?= Helper\form_password('password', $values, $errors) ?><br/>
@@ -17,7 +19,8 @@
<?= Helper\form_password('confirmation', $values, $errors) ?><br/>
<div class="form-actions">
- <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/> <?= t('or') ?> <a href="?controller=user&amp;action=show&amp;user_id=<?= $user['id'] ?>"><?= t('cancel') ?></a>
+ <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/>
+ <?= t('or') ?>
+ <?= Helper\a(t('cancel'), 'user', 'show', array('user_id' => $user['id'])) ?>
</div>
-
-</form> \ No newline at end of file
+</form>
diff --git a/app/Template/user/remove.php b/app/Template/user/remove.php
new file mode 100644
index 00000000..5f58b631
--- /dev/null
+++ b/app/Template/user/remove.php
@@ -0,0 +1,13 @@
+<div class="page-header">
+ <h2><?= t('Remove user') ?></h2>
+</div>
+
+<div class="confirm">
+ <p class="alert alert-info"><?= t('Do you really want to remove this user: "%s"?', $user['name'] ?: $user['username']) ?></p>
+
+ <div class="form-actions">
+ <?= Helper\a(t('Yes'), 'user', 'remove', array('user_id' => $user['id'], 'confirmation' => 'yes'), true, 'btn btn-red') ?>
+ <?= t('or') ?>
+ <?= Helper\a(t('cancel'), 'user', 'show', array('user_id' => $user['id'])) ?>
+ </div>
+</div> \ No newline at end of file
diff --git a/app/Template/user_sessions.php b/app/Template/user/sessions.php
index b647d726..d05d5b6d 100644
--- a/app/Template/user_sessions.php
+++ b/app/Template/user/sessions.php
@@ -19,7 +19,7 @@
<td><?= dt('%B %e, %Y at %k:%M %p', $session['expiration']) ?></td>
<td><?= Helper\escape($session['ip']) ?></td>
<td><?= Helper\escape(Helper\summary($session['user_agent'])) ?></td>
- <td><a href="?controller=user&amp;action=removeSession&amp;user_id=<?= $user['id'] ?>&amp;id=<?= $session['id'].Helper\param_csrf() ?>"><?= t('Remove') ?></a></td>
+ <td><?= Helper\a(t('Remove'), 'user', 'removeSession', array('user_id' => $user['id'], 'id' => $session['id']), true) ?></td>
</tr>
<?php endforeach ?>
</table>
diff --git a/app/Template/user_show.php b/app/Template/user/show.php
index 1c843751..1c843751 100644
--- a/app/Template/user_show.php
+++ b/app/Template/user/show.php
diff --git a/app/Template/user_sidebar.php b/app/Template/user/sidebar.php
index 16532143..0a1a0764 100644
--- a/app/Template/user_sidebar.php
+++ b/app/Template/user/sidebar.php
@@ -30,7 +30,7 @@
</li>
<?php endif ?>
- <?php if (Helper\is_admin()): ?>
+ <?php if (Helper\is_admin() && ! Helper\is_current_user($user['id'])): ?>
<li>
<?= Helper\a(t('Remove'), 'user', 'remove', array('user_id' => $user['id'])) ?>
</li>
diff --git a/app/Template/user_remove.php b/app/Template/user_remove.php
deleted file mode 100644
index c20ccbba..00000000
--- a/app/Template/user_remove.php
+++ /dev/null
@@ -1,12 +0,0 @@
-<div class="page-header">
- <h2><?= t('Remove user') ?></h2>
-</div>
-
-<div class="confirm">
- <p class="alert alert-info"><?= t('Do you really want to remove this user: "%s"?', $user['name'] ?: $user['username']) ?></p>
-
- <div class="form-actions">
- <a href="?controller=user&amp;action=remove&amp;confirmation=yes&amp;user_id=<?= $user['id'].Helper\param_csrf() ?>" class="btn btn-red"><?= t('Yes') ?></a>
- <?= t('or') ?> <a href="?controller=user&amp;action=show&amp;user_id=<?= $user['id'] ?>"><?= t('cancel') ?></a>
- </div>
-</div> \ No newline at end of file