diff options
author | zotlabs <mike@macgirvin.com> | 2017-11-06 20:13:14 -0800 |
---|---|---|
committer | zotlabs <mike@macgirvin.com> | 2017-11-06 20:13:14 -0800 |
commit | 3f1a4b655900d64ad2c13f1906eb77eaf15d11b5 (patch) | |
tree | 4bd5ea0d025e1d7deca8080fb2eb84d97f250f4c /view | |
parent | 11a7a08b9d98073a3dcb012bea4ec32e8baf649d (diff) | |
download | volse-hubzilla-3f1a4b655900d64ad2c13f1906eb77eaf15d11b5.tar.gz volse-hubzilla-3f1a4b655900d64ad2c13f1906eb77eaf15d11b5.tar.bz2 volse-hubzilla-3f1a4b655900d64ad2c13f1906eb77eaf15d11b5.zip |
second half of issue #893 - move channel default permissions to its own module so we can apply different page/widget layouts than for connedit; the relevant functionality is abandoned on mod_connedit but still intact. Trying a slightly different look/behaviour for inherited settings and the associated checkboxes. This may need a bit more tweaking but overall looks a lot cleaner.
Diffstat (limited to 'view')
-rw-r--r-- | view/js/mod_defperms.js | 32 | ||||
-rw-r--r-- | view/pdl/mod_defperms.pdl | 6 | ||||
-rw-r--r-- | view/theme/redbasic/css/style.css | 16 | ||||
-rwxr-xr-x | view/tpl/defperms.tpl | 55 |
4 files changed, 109 insertions, 0 deletions
diff --git a/view/js/mod_defperms.js b/view/js/mod_defperms.js new file mode 100644 index 000000000..c89142579 --- /dev/null +++ b/view/js/mod_defperms.js @@ -0,0 +1,32 @@ +$(document).ready(function() { + + $('#id_permcat').change(function() { + $('.loading-role-rotator').show(); + var permName = $('#id_permcat').val(); + loadConnectionRole(permName); + }); + + +}); + + +function loadConnectionRole(name) { + + if(! name) + name = 'default'; + + $('.defperms-edit input').each(function() { + if(! $(this).is(':disabled')) + $(this).removeAttr('checked'); + }); + + $.get('permcat/' + name, function(data) { + $(data.perms).each(function() { + if(this.value) + $('#id_perms_' + this.name).attr('checked','checked'); + }); + $('.loading-role-rotator').hide(); + }); +} + + diff --git a/view/pdl/mod_defperms.pdl b/view/pdl/mod_defperms.pdl new file mode 100644 index 000000000..53a3ac9e5 --- /dev/null +++ b/view/pdl/mod_defperms.pdl @@ -0,0 +1,6 @@ +[region=aside] +[widget=settings_menu][/widget] +[/region] +[region=right_aside] +[widget=notifications][/widget] +[/region] diff --git a/view/theme/redbasic/css/style.css b/view/theme/redbasic/css/style.css index 9f9ece7c3..3228a8b02 100644 --- a/view/theme/redbasic/css/style.css +++ b/view/theme/redbasic/css/style.css @@ -977,6 +977,11 @@ a .drop-icons:hover { color: #FF0000; } +.perm-inherited { + color: #FF0000; +} + + #menulist { list-style-type: none; } @@ -1639,6 +1644,17 @@ dl.bb-dl > dd > li { background-color: #0275d8; } + +.form-group.checkbox > div > input:disabled + label .onoffswitch-switch { + background-color: red; + border-radius: 3px; + opacity: 0.3; + filter:alpha(opacity=30); + +} + + + .help-searchlist { list-style-type: none; } diff --git a/view/tpl/defperms.tpl b/view/tpl/defperms.tpl new file mode 100755 index 000000000..f4a711957 --- /dev/null +++ b/view/tpl/defperms.tpl @@ -0,0 +1,55 @@ +<div class="generic-content-wrapper"> + <div class="section-title-wrapper"> + <h2>{{$header}}</h2> + </div> + <div class="section-content-wrapper-np"> + <form id="abook-edit-form" action="defperms/{{$contact_id}}" method="post" > + + <input type="hidden" name="contact_id" value="{{$contact_id}}"> + <input type="hidden" name="section" value="{{$section}}"> + + <div class="panel-group" id="contact-edit-tools" role="tablist" aria-multiselectable="true"> + <div class="panel"> + <div id="perms-tool-collapse" class="panel-collapse collapse show" role="tabpanel" aria-labelledby="perms-tool"> + <div class="section-content-tools-wrapper"> + <div class="section-content-warning-wrapper"> + <p>{{$autolbl}}</p> + <p>{{$permnote_self}}</p> + </div> + {{if $permcat_enable}} + <div class="loading-role-rotator spinner-wrapper"></div> + <a href="settings/permcats" class="pull-right"><i class="fa fa-plus"></i> {{$permcat_new}}</a> + {{include file="field_select.tpl" field=$permcat}} + {{/if}} + + <div class="defperms-edit"> + {{foreach $perms as $prm}} + {{include file="field_checkbox.tpl" field=$prm}} + {{/foreach}} + </div> + + {{if $hidden_perms}} + {{foreach $hidden_perms as $prm}} + <input type="hidden" name="{{$prm.0}}" value="{{$prm.1}}" > + {{/foreach}} + {{/if}} + + + + <div> + <div class="section-content-info-wrapper"> + {{$autoapprove}} + </div> + {{include file="field_checkbox.tpl" field=$autoperms}} + </div> + + <div class="settings-submit-wrapper" > + <button type="submit" name="done" value="{{$submit}}" class="btn btn-primary">{{$submit}}</button> + </div> + </div> + </div> + </div> + </div> + </form> + </div> +</div> |