Skip to content

Commit

Permalink
Making Websites With October CMS - Part 32 - Groups and Permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivan Dorić committed Mar 11, 2017
1 parent ec8e55b commit fee7b4d
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 130 deletions.
146 changes: 31 additions & 115 deletions octobermovies.sublime-workspace
Original file line number Diff line number Diff line change
Expand Up @@ -336,37 +336,19 @@
"buffers":
[
{
"file": "plugins/watchlearn/contact/components/contactform/default.htm",
"file": "plugins/watchlearn/movies/controllers/movies/_list_toolbar.htm",
"settings":
{
"buffer_size": 804,
"buffer_size": 997,
"encoding": "UTF-8",
"line_ending": "Unix"
}
},
{
"file": "themes/olympos/assets/sass/_globals.scss",
"file": "plugins/watchlearn/movies/controllers/movies/update.htm",
"settings":
{
"buffer_size": 2196,
"encoding": "UTF-8",
"line_ending": "Unix"
}
},
{
"file": "themes/olympos/layouts/default.htm",
"settings":
{
"buffer_size": 1618,
"encoding": "UTF-8",
"line_ending": "Unix"
}
},
{
"file": "config/mail.php",
"settings":
{
"buffer_size": 4431,
"buffer_size": 2357,
"encoding": "UTF-8",
"line_ending": "Unix"
}
Expand Down Expand Up @@ -590,20 +572,22 @@
"expanded_folders":
[
"/Users/idoric/Development/public/octobermovies",
"/Users/idoric/Development/public/octobermovies/config",
"/Users/idoric/Development/public/octobermovies/plugins",
"/Users/idoric/Development/public/octobermovies/plugins/watchlearn",
"/Users/idoric/Development/public/octobermovies/plugins/watchlearn/contact",
"/Users/idoric/Development/public/octobermovies/plugins/watchlearn/contact/components",
"/Users/idoric/Development/public/octobermovies/plugins/watchlearn/contact/components/contactform",
"/Users/idoric/Development/public/octobermovies/plugins/watchlearn/movies/models",
"/Users/idoric/Development/public/octobermovies/themes",
"/Users/idoric/Development/public/octobermovies/plugins/watchlearn/movies",
"/Users/idoric/Development/public/octobermovies/plugins/watchlearn/movies/controllers",
"/Users/idoric/Development/public/octobermovies/plugins/watchlearn/movies/controllers/movies",
"/Users/idoric/Development/public/octobermovies/themes/olympos",
"/Users/idoric/Development/public/octobermovies/themes/olympos/assets",
"/Users/idoric/Development/public/octobermovies/themes/olympos/layouts"
],
"file_history":
[
"/Users/idoric/Development/public/octobermovies/plugins/watchlearn/contact/components/contactform/default.htm",
"/Users/idoric/Development/public/octobermovies/themes/olympos/assets/sass/_globals.scss",
"/Users/idoric/Development/public/octobermovies/config/mail.php",
"/Users/idoric/Development/public/octobermovies/themes/olympos/layouts/default.htm",
"/Users/idoric/Development/public/octobermovies/themes/olympos/pages/homepage.htm",
"/Users/idoric/Development/public/octobermovies/plugins/watchlearn/movies/routes.php",
"/Users/idoric/Development/public/octobermovies/plugins/watchlearn/movies/models/Actor.php",
Expand Down Expand Up @@ -727,11 +711,7 @@
"/Users/ivan/Development/public/activenation/wp-content/themes/olympos/sass/_modules.scss",
"/Users/ivan/Development/public/activenation/wp-content/themes/olympos/sass/modules/_news-box.scss",
"/Users/ivan/Development/public/activenation/wp-content/themes/olympos/page-book.php",
"/Users/ivan/Library/Caches/com.binarynights.ForkLift2/#0/index.html",
"/Users/ivan/Development/public/activenation/wp-content/themes/olympos/sass/modules/_alert-bar.scss",
"/Users/ivan/Development/public/activenation/wp-content/themes/olympos/parts/get_cookie.php",
"/Users/ivan/Development/public/activenation/wp-content/themes/olympos/archive-activities.php",
"/Users/ivan/Development/public/activenation/wp-content/themes/olympos/sass/_list-activities.scss"
"/Users/ivan/Library/Caches/com.binarynights.ForkLift2/#0/index.html"
],
"find":
{
Expand Down Expand Up @@ -944,24 +924,24 @@
"groups":
[
{
"selected": 2,
"selected": 1,
"sheets":
[
{
"buffer": 0,
"file": "plugins/watchlearn/contact/components/contactform/default.htm",
"file": "plugins/watchlearn/movies/controllers/movies/_list_toolbar.htm",
"semi_transient": false,
"settings":
{
"buffer_size": 804,
"buffer_size": 997,
"regions":
{
},
"selection":
[
[
58,
58
250,
197
]
],
"settings":
Expand All @@ -970,119 +950,55 @@
"remote_loading": false,
"synced": false,
"syntax": "Packages/Twig/Syntaxes/HTML (Twig).tmLanguage",
"tabs_extra_last_activated": 1488640709.86,
"tabs_extra_last_activated": 1489255131.67,
"tabs_extra_last_activated_sheet_index": 0,
"tabs_extra_spawned": true
},
"translation.x": 0.0,
"translation.y": 0.0,
"translation.y": 36.0,
"zoom_level": 1.0
},
"stack_index": 2,
"stack_index": 1,
"type": "text"
},
{
"buffer": 1,
"file": "themes/olympos/assets/sass/_globals.scss",
"file": "plugins/watchlearn/movies/controllers/movies/update.htm",
"semi_transient": false,
"settings":
{
"buffer_size": 2196,
"buffer_size": 2357,
"regions":
{
},
"selection":
[
[
2085,
2085
1510,
1510
]
],
"settings":
{
"auto_indent": true,
"incomplete_sync": null,
"remote_loading": false,
"synced": false,
"syntax": "Packages/Syntax Highlighting for Sass/Syntaxes/SCSS.tmLanguage",
"tabs_extra_last_activated": 1488640620.65,
"syntax": "Packages/Twig/Syntaxes/HTML (Twig).tmLanguage",
"tabs_extra_last_activated": 1489256754.49,
"tabs_extra_last_activated_sheet_index": 1,
"tabs_extra_spawned": true
},
"translation.x": 0.0,
"translation.y": 4757.0,
"zoom_level": 1.0
},
"stack_index": 3,
"type": "text"
},
{
"buffer": 2,
"file": "themes/olympos/layouts/default.htm",
"semi_transient": false,
"settings":
{
"buffer_size": 1618,
"regions":
{
},
"selection":
[
"tabs_extra_moving":
[
1296,
1296
]
],
"settings":
{
"incomplete_sync": null,
"remote_loading": false,
"synced": false,
"syntax": "Packages/Twig/Syntaxes/HTML (Twig).tmLanguage",
"tabs_extra_last_activated": 1488641967.22,
"tabs_extra_last_activated_sheet_index": 2,
2,
0
],
"tabs_extra_spawned": true
},
"translation.x": 0.0,
"translation.y": 1426.0,
"translation.y": 1217.0,
"zoom_level": 1.0
},
"stack_index": 0,
"type": "text"
},
{
"buffer": 3,
"file": "config/mail.php",
"semi_transient": false,
"settings":
{
"buffer_size": 4431,
"regions":
{
},
"selection":
[
[
550,
550
]
],
"settings":
{
"incomplete_sync": null,
"remote_loading": false,
"synced": false,
"syntax": "Packages/PHP/PHP.sublime-syntax",
"tabs_extra_last_activated": 1488640959.42,
"tabs_extra_last_activated_sheet_index": 3,
"tabs_extra_spawned": true
},
"translation.x": 0.0,
"translation.y": 259.0,
"zoom_level": 1.0
},
"stack_index": 1,
"type": "text"
}
]
}
Expand Down
33 changes: 18 additions & 15 deletions plugins/watchlearn/movies/controllers/movies/_list_toolbar.htm
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
<div data-control="toolbar">
<a href="<?= Backend::url('watchlearn/movies/movies/create') ?>" class="btn btn-primary oc-icon-plus"><?= e(trans('backend::lang.form.create')) ?></a>
<button
class="btn btn-default oc-icon-trash-o"
disabled="disabled"
onclick="$(this).data('request-data', {
checked: $('.control-list').listWidget('getChecked')
})"
data-request="onDelete"
data-request-confirm="<?= e(trans('backend::lang.list.delete_selected_confirm')) ?>"
data-trigger-action="enable"
data-trigger=".control-list input[type=checkbox]"
data-trigger-condition="checked"
data-request-success="$(this).prop('disabled', true)"
data-stripe-load-indicator>
<?= e(trans('backend::lang.list.delete_selected')) ?>
</button>

<?php if($this->user->hasAccess('delete_movies')): ?>
<button
class="btn btn-default oc-icon-trash-o"
disabled="disabled"
onclick="$(this).data('request-data', {
checked: $('.control-list').listWidget('getChecked')
})"
data-request="onDelete"
data-request-confirm="<?= e(trans('backend::lang.list.delete_selected_confirm')) ?>"
data-trigger-action="enable"
data-trigger=".control-list input[type=checkbox]"
data-trigger-condition="checked"
data-request-success="$(this).prop('disabled', true)"
data-stripe-load-indicator>
<?= e(trans('backend::lang.list.delete_selected')) ?>
</button>
<?php endif ?>
</div>
2 changes: 2 additions & 0 deletions plugins/watchlearn/movies/controllers/movies/update.htm
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,15 @@
class="btn btn-default">
<?= e(trans('backend::lang.form.save_and_close')) ?>
</button>
<?php if($this->user->hasAccess('delete_movies')): ?>
<button
type="button"
class="oc-icon-trash-o btn-icon danger pull-right"
data-request="onDelete"
data-load-indicator="<?= e(trans('backend::lang.form.deleting')) ?>"
data-request-confirm="<?= e(trans('backend::lang.form.confirm_delete')) ?>">
</button>
<?php endif ?>

<span class="btn-text">
<?= e(trans('backend::lang.form.or')) ?> <a href="<?= Backend::url('watchlearn/movies/movies') ?>"><?= e(trans('backend::lang.form.cancel')) ?></a>
Expand Down
14 changes: 14 additions & 0 deletions plugins/watchlearn/movies/plugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,26 @@ navigation:
label: Movies
url: watchlearn/movies/movies
icon: icon-video-camera
permissions:
- manage_movies
sideMenu:
side-menu-item:
label: Genres
url: watchlearn/movies/genres
icon: icon-tag
permissions:
- manage_genres
side-menu-item2:
label: Actors
url: watchlearn/movies/actors
icon: icon-user
permissions:
manage_movies:
tab: Movies
label: 'Manage movies'
manage_genres:
tab: Movies
label: 'Manage genres'
delete_movies:
tab: Movies
label: 'Delete movies'

0 comments on commit fee7b4d

Please sign in to comment.