Move user templates to a subfolder

This commit is contained in:
Frédéric Guillot
2014-12-04 21:04:33 -05:00
parent 66e0028b4a
commit 6739dba792
18 changed files with 62 additions and 53 deletions

View File

@@ -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>

View File

@@ -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.') ?>

View File

@@ -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 ?>

View File

@@ -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">

View File

@@ -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>

View File

@@ -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>

View File

@@ -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>
</form>

View File

@@ -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>

View File

@@ -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>

View File

@@ -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>

View File

@@ -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>