Improve admin list toolbar

Change "Admins" group to "Owners" (more descriptive)
Fix bug in Firefox on Mediafinder form widget not respecting max-width 100%
Recompile assets
This commit is contained in:
Samuel Georges 2015-07-04 09:34:35 +10:00
parent a1e1b52d6e
commit 461e4f75de
8 changed files with 28 additions and 26 deletions

View File

@ -2663,7 +2663,8 @@ this.escape()
$(document).off('focusin.bs.modal')
this.$element.removeClass('in').attr('aria-hidden',true).off('click.dismiss.bs.modal')
$.support.transition&&this.$element.hasClass('fade')?this.$element.one($.support.transition.end,$.proxy(this.hideModal,this)).emulateTransitionEnd(300):this.hideModal()}
Modal.prototype.enforceFocus=function(){$(document).off('focusin.bs.modal').on('focusin.bs.modal',$.proxy(function(e){if(this.$element[0]!==e.target&&!this.$element.has(e.target).length){this.$element.focus()}},this))}
Modal.prototype.enforceFocus=function(){$(document).off('focusin.bs.modal').on('focusin.bs.modal',$.proxy(function(e){if($(e.target).hasClass('select2-search__field')){return}
if(this.$element[0]!==e.target&&!this.$element.has(e.target).length){this.$element.focus()}},this))}
Modal.prototype.escape=function(){if(this.isShown&&this.options.keyboard){this.$element.on('keyup.dismiss.bs.modal',$.proxy(function(e){e.which==27&&this.hide()},this))}else if(!this.isShown){this.$element.off('keyup.dismiss.bs.modal')}}
Modal.prototype.hideModal=function(){var that=this
this.$element.hide()

View File

@ -1,3 +1,8 @@
<div data-control="toolbar">
<a href="<?= Backend::url('backend/usergroups/create') ?>" class="btn btn-primary oc-icon-plus"><?= e(trans('backend::lang.user.group.new')) ?></a>
<a href="<?= Backend::url('backend/users') ?>" class="btn btn-default oc-icon-chevron-left">
<?= e(trans('backend::lang.user.return')) ?>
</a>
<a href="<?= Backend::url('backend/usergroups/create') ?>" class="btn btn-primary oc-icon-plus">
<?= e(trans('backend::lang.user.group.new')) ?>
</a>
</div>

View File

@ -1,6 +1,10 @@
<div data-control="toolbar">
<a href="<?= Backend::url('backend/users/create') ?>" class="btn btn-primary oc-icon-plus"><?= e(trans('backend::lang.user.new')) ?></a>
<a href="<?= Backend::url('backend/usergroups') ?>" class="btn btn-default oc-icon-group"><?= e(trans('backend::lang.user.group.list_title')) ?></a>
<a href="<?= Backend::url('backend/users/create') ?>" class="btn btn-primary oc-icon-plus">
<?= e(trans('backend::lang.user.new')) ?>
</a>
<a href="<?= Backend::url('backend/usergroups') ?>" class="btn btn-default oc-icon-group">
<?= e(trans('backend::lang.user.group.list_title')) ?>
</a>
<?php /* @todo
<div class="btn-group">
<button

View File

@ -26,10 +26,10 @@ class SeedSetupAdmin extends Seeder
public function run()
{
$group = UserGroup::create([
'name' => 'Admins',
'code' => 'admins',
'description' => 'Default group for administrators',
'is_new_user_default' => true
'name' => 'Owners',
'code' => 'owners',
'description' => 'Default group for website owners.',
'is_new_user_default' => false
]);
$user = User::create([

View File

@ -1818,17 +1818,8 @@ this.$box.css('top',toolbarHeight+'px')}}}}}(jQuery));(function($){'use strict';
var Figure=function(redactor){this.redactor=redactor
this.toolbar={}
this.init()}
Figure.prototype={control:{up:{classSuffix:'arrow-up'},down:{classSuffix:'arrow-down'},'|':{classSuffix:'divider'},remove:{classSuffix:'delete'}},controlGroup:['up','down','remove'],init:function(){this.observeCaptions()
this.observeToolbars()
this.observeKeyboard()},observeCaptions:function(){this.redactor.$editor.on('click.figure','figcaption:empty, cite:empty',$.proxy(function(event){$(event.target).prepend('<br />')
this.redactor.caret.setEnd(event.target)
event.stopPropagation()},this))
$(window).on('click',$.proxy(this.cleanCaptions,this))
this.redactor.$editor.on('blur.figure',$.proxy(this.cleanCaptions,this))
this.redactor.$editor.closest('form').one('submit',$.proxy(this.clearCaptions,this))
this.redactor.$editor.on('keydown.figure',$.proxy(function(event){var current=this.redactor.selection.getCurrent(),isEmpty=!current.length,isCaptionNode=!!$(current).closest('figcaption, cite').length,isDeleteKey=$.inArray(event.keyCode,[this.redactor.keyCode.BACKSPACE,this.redactor.keyCode.DELETE])>=0
if(isEmpty&&isDeleteKey&&isCaptionNode){event.preventDefault()}},this))},cleanCaptions:function(){this.redactor.$editor.find('figcaption, cite').filter(function(){return $(this).text()==''}).empty()},clearCaptions:function(){this.redactor.$editor.find('figcaption, cite').filter(function(){return $(this).text()==''}).remove()
if(this.redactor.opts.visual){this.redactor.code.sync()}},showToolbar:function(event){var $figure=$(event.currentTarget),type=$figure.data('type')||'default',$toolbar=this.getToolbar(type).data('figure',$figure).prependTo($figure).show()
Figure.prototype={control:{up:{classSuffix:'arrow-up'},down:{classSuffix:'arrow-down'},'|':{classSuffix:'divider'},remove:{classSuffix:'delete'}},controlGroup:['up','down','remove'],init:function(){this.observeToolbars()
this.observeKeyboard()},showToolbar:function(event){var $figure=$(event.currentTarget),type=$figure.data('type')||'default',$toolbar=this.getToolbar(type).data('figure',$figure).prependTo($figure).show()
if(this.redactor[type]&&this.redactor[type].onShow){this.redactor[type].onShow($figure,$toolbar)}},hideToolbar:function(event){$(event.currentTarget).find('.oc-figure-controls').appendTo(this.redactor.$box).hide()},observeToolbars:function(){this.redactor.$editor.on('mousedown.figure','.oc-figure-controls',$.proxy(function(event){event.preventDefault()
this.current=this.redactor.selection.getCurrent()},this))
this.redactor.$editor.on('click.figure','.oc-figure-controls span, .oc-figure-controls a',$.proxy(function(event){event.stopPropagation()
@ -1872,7 +1863,6 @@ break}
this.redactor.code.sync()},observeKeyboard:function(){var redactor=this.redactor
redactor.$editor.on('keydown.figure',function(event){var currentNode=redactor.selection.getBlock()
if(event.keyCode===8&&!redactor.caret.getOffset(currentNode)&&currentNode.previousSibling&&currentNode.previousSibling.nodeName==='FIGURE'){event.preventDefault()}})},destroy:function(){this.redactor.$editor.off('.figure')
$(window).off('click',$.proxy(this.cleanCaptions,this))
for(var type in this.toolbar){this.toolbar[type].find('span').off('.figure')}
this.redactor=null
this.toolbar=null}}
@ -2006,7 +1996,7 @@ return
if(this.$el.hasClass('stretch')){var height=$toolbar.outerHeight(true)
$editor.css('top',height+1)
$codeEditor.css('top',height)}}
RichEditor.prototype.sanityCheckContent=function(){var safeElements='p, h1, h2, h3, h4, h5, pre, figure';if(!this.$editor.children(':last-child').is(safeElements)){this.$editor.append('<p><br></p>')}
RichEditor.prototype.sanityCheckContent=function(){var safeElements='p, h1, h2, h3, h4, h5, pre, figure, ol, ul';if(!this.$editor.children(':last-child').is(safeElements)){this.$editor.append('<p><br></p>')}
if(!this.$editor.children(':first-child').is(safeElements)){this.$editor.prepend('<p><br></p>')}
this.$textarea.trigger('sanitize.oc.richeditor',[this.$editor])}
RichEditor.prototype.syncBefore=function(html){var container={html:html}

View File

@ -95,7 +95,7 @@ return [
'send_invite' => 'Send invitation by email',
'send_invite_comment' => 'Sends a welcome message containing login and password information.',
'delete_confirm' => 'Do you really want to delete this administrator?',
'return' => 'Return to the administrator list',
'return' => 'Return to admin list',
'allow' => 'Allow',
'inherit' => 'Inherit',
'deny' => 'Deny',
@ -108,9 +108,9 @@ return [
'code_comment' => 'Enter a unique code if you want to access it with the API.',
'menu_label' => 'Groups',
'list_title' => 'Manage Groups',
'new' => 'New Administrator Group',
'new' => 'New Group',
'delete_confirm' => 'Do you really want to delete this administrator group?',
'return' => 'Return to the group list',
'return' => 'Return to group list',
'users_count' => 'Users'
],
'preferences' => [

View File

@ -100,6 +100,7 @@
padding-bottom: 39px;
}
.field-mediafinder.style-image-single .find-object .icon-container {
display: block;
border: 1px solid #f6f8f9;
background: rgba(255, 255, 255, 0.5);
}
@ -125,7 +126,7 @@
display: none;
}
.field-mediafinder.style-image-single.is-populated .find-object {
display: inline-block;
display: block;
}
.field-mediafinder.style-file-single {
background-color: #ffffff;

View File

@ -12,6 +12,7 @@
padding-bottom: 39px;
.icon-container {
display: block;
border: 1px solid #f6f8f9;
background: rgba(255,255,255,.5);
@ -39,7 +40,7 @@
display: none;
}
.find-object {
display: inline-block;
display: block;
}
}