From 42d478fadbd4cce3a39b643aea11b21e149d0e1b Mon Sep 17 00:00:00 2001 From: Ivan Doric Date: Sat, 26 Nov 2016 19:32:08 +0100 Subject: [PATCH] Making websites with October CMS - Part 24 - Extending User Plugin - Frontend --- octobermovies.sublime-workspace | 64 ++++--------------------- plugins/watchlearn/profile/Plugin.php | 8 ++++ themes/olympos/pages/login.htm | 2 +- themes/olympos/partials/user-update.htm | 35 ++++++++++++++ 4 files changed, 54 insertions(+), 55 deletions(-) create mode 100644 themes/olympos/partials/user-update.htm diff --git a/octobermovies.sublime-workspace b/octobermovies.sublime-workspace index fea0922..c5d46ed 100644 --- a/octobermovies.sublime-workspace +++ b/octobermovies.sublime-workspace @@ -536,15 +536,6 @@ "encoding": "UTF-8", "line_ending": "Unix" } - }, - { - "file": "plugins/watchlearn/profile/Plugin.php", - "settings": - { - "buffer_size": 782, - "encoding": "UTF-8", - "line_ending": "Unix" - } } ], "build_system": "", @@ -819,17 +810,13 @@ "/Users/ivan/Development/public/octobermovies", "/Users/ivan/Development/public/octobermovies/plugins", "/Users/ivan/Development/public/octobermovies/plugins/rainlab", - "/Users/ivan/Development/public/octobermovies/plugins/rainlab/user", "/Users/ivan/Development/public/octobermovies/plugins/rainlab/user/models", - "/Users/ivan/Development/public/octobermovies/plugins/rainlab/user/models/user", "/Users/ivan/Development/public/octobermovies/plugins/watchlearn", - "/Users/ivan/Development/public/octobermovies/plugins/watchlearn/contact/components/contactform", + "/Users/ivan/Development/public/octobermovies/plugins/watchlearn/movies", + "/Users/ivan/Development/public/octobermovies/plugins/watchlearn/movies/models", "/Users/ivan/Development/public/octobermovies/plugins/watchlearn/profile", "/Users/ivan/Development/public/octobermovies/plugins/watchlearn/profile/updates", - "/Users/ivan/Development/public/octobermovies/themes", - "/Users/ivan/Development/public/octobermovies/themes/olympos/layouts", - "/Users/ivan/Development/public/octobermovies/themes/olympos/pages", - "/Users/ivan/Development/public/octobermovies/themes/olympos/partials" + "/Users/ivan/Development/public/octobermovies/themes" ], "file_history": [ @@ -1167,7 +1154,7 @@ "groups": [ { - "selected": 2, + "selected": 1, "sheets": [ { @@ -1198,7 +1185,7 @@ "translation.y": 0.0, "zoom_level": 1.0 }, - "stack_index": 2, + "stack_index": 1, "type": "text" }, { @@ -1230,37 +1217,6 @@ "translation.y": 292.0, "zoom_level": 1.0 }, - "stack_index": 1, - "type": "text" - }, - { - "buffer": 2, - "file": "plugins/watchlearn/profile/Plugin.php", - "semi_transient": false, - "settings": - { - "buffer_size": 782, - "regions": - { - }, - "selection": - [ - [ - 397, - 397 - ] - ], - "settings": - { - "incomplete_sync": null, - "remote_loading": false, - "synced": false, - "syntax": "Packages/PHP/PHP.sublime-syntax" - }, - "translation.x": 0.0, - "translation.y": 628.0, - "zoom_level": 1.0 - }, "stack_index": 0, "type": "text" } @@ -1837,9 +1793,13 @@ "select_project": { "height": 500.0, - "last_filter": "watc", + "last_filter": "gau", "selected_items": [ + [ + "gau", + "~/Development/public/gaussocto/gaussocto.sublime-project" + ], [ "watc", "~/Development/public/watchlearn/watchlearn.sublime-project" @@ -1984,10 +1944,6 @@ "quer", "~/Development/public/query/query.sublime-project" ], - [ - "gau", - "~/Development/public/gaussdev/gaussdev.sublime-project" - ], [ "query", "~/Development/public/query/query.sublime-project" diff --git a/plugins/watchlearn/profile/Plugin.php b/plugins/watchlearn/profile/Plugin.php index 829aebf..1138e32 100644 --- a/plugins/watchlearn/profile/Plugin.php +++ b/plugins/watchlearn/profile/Plugin.php @@ -2,6 +2,7 @@ use System\Classes\PluginBase; use Rainlab\User\Controllers\Users as UsersController; +use Rainlab\User\Models\User as UserModel; class Plugin extends PluginBase { @@ -15,6 +16,13 @@ public function registerSettings() public function boot(){ + UserModel::extend(function ($model){ + $model->addFillable([ + 'facebook', + 'bio' + ]); + }); + UsersController::extendFormFields(function($form, $model, $context){ $form->addTabFields([ 'facebook' => [ diff --git a/themes/olympos/pages/login.htm b/themes/olympos/pages/login.htm index c8b12cb..f5c3380 100644 --- a/themes/olympos/pages/login.htm +++ b/themes/olympos/pages/login.htm @@ -26,7 +26,7 @@

Register

{% partial account ~ '::activation_check' %} - {% partial account ~ '::update' %} + {% partial 'user-update' %} {% partial account ~ '::deactivate_link' %} diff --git a/themes/olympos/partials/user-update.htm b/themes/olympos/partials/user-update.htm new file mode 100644 index 0000000..0808e7b --- /dev/null +++ b/themes/olympos/partials/user-update.htm @@ -0,0 +1,35 @@ +{{ form_ajax('onUpdate', { model: user }) }} + +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ + + +{{ form_close() }} \ No newline at end of file