Skip to content

Commit

Permalink
Making websites with October CMS - Part 24 - Extending User Plugin - …
Browse files Browse the repository at this point in the history
…Frontend
  • Loading branch information
Ivan Doric committed Nov 26, 2016
1 parent 669474f commit 42d478f
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 55 deletions.
64 changes: 10 additions & 54 deletions octobermovies.sublime-workspace
Original file line number Diff line number Diff line change
Expand Up @@ -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": "",
Expand Down Expand Up @@ -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":
[
Expand Down Expand Up @@ -1167,7 +1154,7 @@
"groups":
[
{
"selected": 2,
"selected": 1,
"sheets":
[
{
Expand Down Expand Up @@ -1198,7 +1185,7 @@
"translation.y": 0.0,
"zoom_level": 1.0
},
"stack_index": 2,
"stack_index": 1,
"type": "text"
},
{
Expand Down Expand Up @@ -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"
}
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down
8 changes: 8 additions & 0 deletions plugins/watchlearn/profile/Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand All @@ -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' => [
Expand Down
2 changes: 1 addition & 1 deletion themes/olympos/pages/login.htm
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ <h3>Register</h3>

{% partial account ~ '::activation_check' %}

{% partial account ~ '::update' %}
{% partial 'user-update' %}

{% partial account ~ '::deactivate_link' %}

Expand Down
35 changes: 35 additions & 0 deletions themes/olympos/partials/user-update.htm
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{{ form_ajax('onUpdate', { model: user }) }}

<div class="form-group">
<label for="accountName">Full Name</label>
<input name="name" type="text" class="form-control" id="accountName" value="{{ form_value('name') }}">
</div>

<div class="form-group">
<label for="accountEmail">Email</label>
<input name="email" type="email" class="form-control" id="accountEmail" value="{{ form_value('email') }}">
</div>

<div class="form-group">
<label for="accountPassword">New Password</label>
<input name="password" type="password" class="form-control" id="accountPassword">
</div>

<div class="form-group">
<label for="accountPasswordConfirm">Confirm New Password</label>
<input name="password_confirmation" type="password" class="form-control" id="accountPasswordConfirm">
</div>

<div class="form-group">
<label>Facebook</label>
<input name="facebook" type="text" class="form-control" value="{{ form_value('facebook') }}">
</div>

<div class="form-group">
<label>Bio</label>
<textarea name="bio" type="text" class="form-control">{{ form_value('bio') }}</textarea>
</div>

<button type="submit" class="btn btn-default">Save</button>

{{ form_close() }}

0 comments on commit 42d478f

Please sign in to comment.