From 8d4d5957bbe17151062c53a153e9092ff268b704 Mon Sep 17 00:00:00 2001 From: Matias Griese Date: Fri, 10 Oct 2014 15:25:07 +0300 Subject: [PATCH] Add logic to add new user account --- classes/controller.php | 6 +++++- themes/grav/templates/partials/blueprints-new.html.twig | 1 - themes/grav/templates/users.html.twig | 7 ++++++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/classes/controller.php b/classes/controller.php index 550eba01..d8cad3df 100644 --- a/classes/controller.php +++ b/classes/controller.php @@ -380,7 +380,11 @@ class AdminController */ public function taskContinue() { - // Only applies to pages. + if ($this->view == 'users') { + $this->setRedirect("{$this->view}/{$this->post['username']}"); + return true; + } + if ($this->view != 'pages') { return false; } diff --git a/themes/grav/templates/partials/blueprints-new.html.twig b/themes/grav/templates/partials/blueprints-new.html.twig index f05fd841..1659c72c 100644 --- a/themes/grav/templates/partials/blueprints-new.html.twig +++ b/themes/grav/templates/partials/blueprints-new.html.twig @@ -1,7 +1,6 @@ {% set form_id = form_id ? form_id : 'blueprints' %}
-

New Page

{% for field in blueprints.fields %} {% if field.type %} {% set value = data.value(field.name) %} diff --git a/themes/grav/templates/users.html.twig b/themes/grav/templates/users.html.twig index 7112e541..5f686818 100644 --- a/themes/grav/templates/users.html.twig +++ b/themes/grav/templates/users.html.twig @@ -7,7 +7,7 @@ {% block titlebar %} {% if not admin.route %}
- + Add Account

Users

{% else %} @@ -24,6 +24,11 @@ {% if not admin.route %} {% include 'partials/users-list.html.twig' %} + + +
+ {% include 'partials/blueprints-new.html.twig' with { blueprints: admin.blueprints('user/account_new') } %} +
{% else %} {% include 'partials/users-details.html.twig' %} {% endif %}