summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2014-10-16 16:43:37 +0200
committerGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2014-10-17 16:24:21 +0200
commit2796cc9ae559842a90fa15cba65c94a11b29195e (patch)
tree0dc742153cba0b4c45c15b255047b71188449f73
parentc5fe3bd6593d0a07c087d1e60ae2e4b8ab5f9fa9 (diff)
User list load a new page
Beginning of more options for administrator!
-rw-r--r--app/Controllers/userController.php4
-rw-r--r--app/views/stats/repartition.phtml2
-rw-r--r--app/views/user/manage.phtml41
-rw-r--r--p/scripts/main.js2
4 files changed, 26 insertions, 23 deletions
diff --git a/app/Controllers/userController.php b/app/Controllers/userController.php
index c516246c9..00b51cc3d 100644
--- a/app/Controllers/userController.php
+++ b/app/Controllers/userController.php
@@ -88,6 +88,10 @@ class FreshRSS_user_Controller extends Minz_ActionController {
*/
public function manageAction() {
Minz_View::prependTitle(_t('users.manage') . ' ยท ');
+
+ $this->view->current_user = Minz_Request::param(
+ 'u', Minz_Session::param('currentUser', '_')
+ );
}
public function createAction() {
diff --git a/app/views/stats/repartition.phtml b/app/views/stats/repartition.phtml
index 670714707..32268a546 100644
--- a/app/views/stats/repartition.phtml
+++ b/app/views/stats/repartition.phtml
@@ -5,7 +5,7 @@
<h1><?php echo _t('stats_repartition'); ?></h1>
- <select id="feed_select">
+ <select id="feed_select" class="select-change">
<option data-url="<?php echo _url('stats', 'repartition')?>"><?php echo _t('all_feeds')?></option>
<?php foreach ($this->categories as $category) {
$feeds = $category->feeds();
diff --git a/app/views/user/manage.phtml b/app/views/user/manage.phtml
index 03746cabb..fb569872b 100644
--- a/app/views/user/manage.phtml
+++ b/app/views/user/manage.phtml
@@ -3,27 +3,6 @@
<div class="post">
<a href="<?php echo _url('index', 'index'); ?>"><?php echo _t('back_to_rss_feeds'); ?></a>
- <form method="post" action="<?php echo _url('user', 'delete'); ?>">
- <legend><?php echo _t('users'); ?></legend>
-
- <div class="form-group">
- <label class="group-name" for="users_list"><?php echo _t('users_list'); ?></label>
- <div class="group-controls">
- <select id="users_list" name="username"><?php
- foreach (listUsers() as $user) {
- echo '<option>', $user, '</option>';
- }
- ?></select>
- </div>
- </div>
-
- <div class="form-group form-actions">
- <div class="group-controls">
- <button type="submit" class="btn btn-attention confirm"><?php echo _t('delete'); ?></button>
- </div>
- </div>
- </form>
-
<form method="post" action="<?php echo _url('user', 'create'); ?>">
<legend><?php echo _t('create_user'); ?></legend>
@@ -71,6 +50,26 @@
<button type="reset" class="btn"><?php echo _t('cancel'); ?></button>
</div>
</div>
+ </form>
+
+ <form method="post" action="<?php echo _url('user', 'delete'); ?>">
+ <legend><?php echo _t('users'); ?></legend>
+ <div class="form-group">
+ <label class="group-name" for="user-list"><?php echo _t('users_list'); ?></label>
+ <div class="group-controls">
+ <select id="user-list" class="select-change" name="username">
+ <?php foreach (listUsers() as $username) { ?>
+ <option data-url="<?php echo _url('user', 'manage', 'u', $username); ?>" <?php echo $this->current_user === $username ? 'selected="selected"' : ''; ?> value="<?php echo $username; ?>"><?php echo $username; ?></option>
+ <?php } ?>
+ </select>
+ </div>
+ </div>
+
+ <div class="form-group form-actions">
+ <div class="group-controls">
+ <button type="submit" class="btn btn-attention confirm"><?php echo _t('delete'); ?></button>
+ </div>
+ </div>
</form>
</div>
diff --git a/p/scripts/main.js b/p/scripts/main.js
index 77e1e3f77..1e13ff16a 100644
--- a/p/scripts/main.js
+++ b/p/scripts/main.js
@@ -1086,7 +1086,7 @@ function init_share_observers() {
}
function init_stats_observers() {
- $('#feed_select').on('change', function(e) {
+ $('.select-change').on('change', function(e) {
redirect($(this).find(':selected').data('url'));
});
}