1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-07-24 23:59:47 +02:00

restructure CSS files

This commit is contained in:
Harvey Kandola 2017-11-28 11:32:14 +00:00
parent 68f5008a52
commit fd6b4c051b
14 changed files with 110 additions and 137 deletions

View file

@ -10,12 +10,10 @@
// https://documize.com
import { inject as service } from '@ember/service';
import Controller from '@ember/controller';
import NotifierMixin from '../../../mixins/notifier';
import DropdownMixin from '../../../mixins/dropdown';
import TooltipMixin from '../../../mixins/tooltip';
export default Controller.extend(NotifierMixin, DropdownMixin, {
export default Controller.extend(TooltipMixin, {
folderService: service('folder'),
folders: [],
dropdown: null,
@ -33,34 +31,9 @@ export default Controller.extend(NotifierMixin, DropdownMixin, {
}
}.property('folders'),
willDestroyElement() {
this._super(...arguments);
this.destroyDropdown();
},
actions: {
onShow(spaceId) {
this.set('deleteSpace.id', spaceId);
this.set('deleteSpace.name', '');
$(".delete-space-dialog").css("display", "block");
$('#delete-space-name').removeClass('error');
this.closeDropdown();
let dropOptions = Object.assign(this.get('dropDefaults'), {
target: $("#delete-space-button-" + spaceId)[0],
content: $(".delete-space-dialog")[0],
classes: 'drop-theme-basic',
position: "bottom right",
remove: false});
let drop = new Drop(dropOptions);
this.set('dropdown', drop);
},
onCancel() {
this.closeDropdown();
onShow(id) {
this.set('deleteSpace.id', id);
},
onDelete() {
@ -71,16 +44,16 @@ export default Controller.extend(NotifierMixin, DropdownMixin, {
let spaceName = space.get('name');
if (spaceNameTyped !== spaceName || spaceNameTyped === '' || spaceName === '') {
$('#delete-space-name').addClass('error').focus();
$('#delete-space-name').addClass('is-invalid').focus();
return;
}
this.closeDropdown();
$('#space-delete-modal').modal('hide');
$('#space-delete-modal').modal('dispose');
this.get('folderService').delete(spaceId).then(() => { /* jshint ignore:line */
this.set('deleteSpace.id', '');
this.set('deleteSpace.name', '');
this.showNotification("Deleted");
this.get('folderService').adminList().then((folders) => {
let nonPrivateFolders = folders.rejectBy('folderType', 2);

View file

@ -1,51 +1,47 @@
<div class="page-customize">
<div class="space-admin">
{{#if folders}}
<div class="form-header">
<div class="title">{{folders.length}} shared {{label}}</div>
<div class="tip">View and change shared space ownership</div>
</div>
<div class="input-control manage-space-list">
{{#each folders as |folder|}}
<div class="space pull-left width-80">
{{#if folders}}
<div class="row">
<div class="col">
<h1 class="admin-heading">{{folders.length}} shared {{label}}</h1>
</div>
</div>
<div class="view-customize">
<div class="space-list">
{{#each folders as |folder|}}
<div class="space row">
<div class="col-12 col-sm-8">
{{#link-to 'folder' folder.id folder.slug class="alt"}}{{folder.name}}{{/link-to}}
</div>
<div class="pull-right">
<div id="delete-space-button-{{folder.id}}" class="round-button-mono" title="Delete" {{action "onShow" folder.id}}>
<i class="material-icons">delete</i>
<div class="col-12 col-sm-4 text-right">
<div id="space-delete-button-{{folder.id}}" class="button-icon-danger align-middle" data-toggle="tooltip" data-placement="top" title="Delete space" {{action "onShow" folder.id}}>
<i class="material-icons" data-toggle="modal" data-target="#space-delete-modal" data-backdrop="static">delete</i>
</div>
</div>
<div class="clearfix" />
{{/each}}
</div>
<div class="dropdown-dialog delete-space-dialog">
<div class="content">
<p>Are you sure you want to delete this space and all associated documents?</p>
<div class="input-control">
<div class="tip">Please type the space name to confirm</div>
{{input type='text' id="delete-space-name" value=deleteSpace.name}}
</div>
</div>
<div class="actions">
<div class="flat-button" {{action 'onCancel'}}>
cancel
</div>
<div class="flat-button flat-red" {{action 'onDelete'}}>
delete
</div>
</div>
<div class="clearfix"></div>
</div>
{{else}}
<div class="form-header">
<div class="title">{{folders.length}} shared {{label}}</div>
<div class="tip">There are no spaces to maintain</div>
</div>
{{/if}}
{{/each}}
</div>
</div>
</div>
<div id="space-delete-modal" class="modal" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">Space Deletion</div>
<div class="modal-body">
<form onsubmit={{action 'onDelete'}}>
<p>Are you sure you want to delete this space and all documents?</p>
<div class="form-group">
<label for="delete-space-name">Please type space name to confirm</label>
{{input type='text' id="delete-space-name" class="form-control mousetrap" placeholder="Space name" value=deleteSpace.name}}
<small class="form-text text-muted">This will delete all documents and templates within this space!</small>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-outline-secondary" data-dismiss="modal">Cancel</button>
<button type="button" class="btn btn-danger" onclick={{action 'onDelete'}}>Delete</button>
</div>
</div>
</div>
</div>
{{else}}
<p>There are no spaces to maintain</p>
{{/if}}

View file

@ -1,25 +1,28 @@
{{#layout/zone-container}}
{{#layout/zone-sidebar}}
<div class="sidebar-common">
{{layout/sidebar-intro title='Settings' message='Documize application settings'}}
{{layout/nav-bar}}
<div class="container">
{{#toolbar/t-toolbar}}
{{#toolbar/t-links}}
{{#link-to "folders" class="link" tagName="li"}}SPACES{{/link-to}}
{{/toolbar/t-links}}
{{#toolbar/t-actions}}
{{/toolbar/t-actions}}
{{/toolbar/t-toolbar}}
<div class="row">
<div class="col my-5">
<ul class="tabnav-control">
{{#link-to 'customize.general' activeClass='selected' class="tab" tagName="li"}}General{{/link-to}}
{{#link-to 'customize.folders' activeClass='selected' class="tab" tagName="li"}}Spaces{{/link-to}}
{{#link-to 'customize.users' activeClass='selected' class="tab" tagName="li"}}Users{{/link-to}}
{{#if session.isGlobalAdmin}}
{{#link-to 'customize.global' activeClass='selected' class="tab" tagName="li"}}Global{{/link-to}}
{{#link-to 'customize.auth' activeClass='selected' class="tab" tagName="li"}}Authentication{{/link-to}}
{{/if}}
</ul>
</div>
<div class="sidebar-wrapper">
<div class="sidebar-menu">
<ul class="options">
{{#link-to 'customize.general' activeClass='selected' class="option" tagName="li"}}General{{/link-to}}
{{#link-to 'customize.folders' activeClass='selected' class="option" tagName="li"}}Spaces{{/link-to}}
{{#link-to 'customize.users' activeClass='selected' class="option" tagName="li"}}Users{{/link-to}}
{{#if session.isGlobalAdmin}}
{{#link-to 'customize.global' activeClass='selected' class="option" tagName="li"}}Global{{/link-to}}
{{#link-to 'customize.auth' activeClass='selected' class="option" tagName="li"}}Authentication{{/link-to}}
{{/if}}
</ul>
</div>
</div>
{{/layout/zone-sidebar}}
{{#layout/zone-content}}
<div class="page-customize">
{{outlet}}
</div>
{{/layout/zone-content}}
{{/layout/zone-container}}
</div>
<div class="mt-4 margin-bottom-100">
{{outlet}}
</div>
</div>