mirror of
https://github.com/documize/community.git
synced 2025-08-05 05:25:27 +02:00
Enable custom logo upload and rendering
This commit is contained in:
parent
a211ba051a
commit
036f36ba1d
36 changed files with 574 additions and 211 deletions
|
@ -1,8 +1,9 @@
|
|||
<div class="auth-center">
|
||||
<div class="auth-box">
|
||||
<div class="logo">
|
||||
<img src="/assets/img/logo-purple.png" title="Documize" alt="Documize" class="img-fluid">
|
||||
<div class="url">{{appMeta.appHost}}</div>
|
||||
<img src="{{appMeta.endpoint}}/public/logo?cb={{random-id}}"
|
||||
title="Documize" alt="Documize" class="img-fluid">
|
||||
<div class="url">{{appMeta.title}} ({{appMeta.appHost}})</div>
|
||||
</div>
|
||||
<div class="login-form">
|
||||
{{user/forgot-password forgot=(action "forgot")}}
|
||||
|
|
|
@ -2,8 +2,9 @@
|
|||
{{#if model.showLogin}}
|
||||
<div class="auth-box">
|
||||
<div class="logo">
|
||||
<img src="/assets/img/logo-purple.png" title="Documize" alt="Documize" class="img-fluid">
|
||||
<div class="url">{{appMeta.appHost}}</div>
|
||||
<img src="{{appMeta.endpoint}}/public/logo?cb={{random-id}}"
|
||||
title="Documize" alt="Documize" class="img-fluid">
|
||||
<div class="url">{{appMeta.title}} ({{appMeta.appHost}})</div>
|
||||
</div>
|
||||
<form {{action "login" on="submit"}}>
|
||||
<div class="form-group">
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
<div class="auth-center">
|
||||
<div class="auth-box">
|
||||
<div class="logo">
|
||||
<img src="/assets/img/logo-purple.png" title="Documize" alt="Documize" class="img-fluid">
|
||||
<div class="url">{{appMeta.appHost}}</div>
|
||||
<img src="{{appMeta.endpoint}}/public/logo?cb={{random-id}}"
|
||||
title="Documize" alt="Documize" class="img-fluid">
|
||||
<div class="url">{{appMeta.title}} ({{appMeta.appHost}})</div>
|
||||
</div>
|
||||
{{user/password-reset reset=(action "reset")}}
|
||||
</div>
|
||||
|
|
|
@ -16,9 +16,13 @@ export default Controller.extend({
|
|||
orgService: service('organization'),
|
||||
|
||||
actions: {
|
||||
save() {
|
||||
onUpdate() {
|
||||
return this.get('orgService').save(this.model.general).then(() => {
|
||||
});
|
||||
},
|
||||
|
||||
onDefaultLogo(orgId) {
|
||||
return this.get('orgService').useDefaultLogo(orgId);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
@ -3,4 +3,6 @@
|
|||
desc="Options to help you customize Documize"
|
||||
icon=constants.Icon.Settings}}
|
||||
|
||||
{{customize/general-settings model=model save=(action "save")}}
|
||||
{{customize/general-settings model=model
|
||||
onUpdate=(action "onUpdate")
|
||||
onDefaultLogo=(action "onDefaultLogo")}}
|
||||
|
|
|
@ -20,10 +20,10 @@
|
|||
{{#layout/master-content}}
|
||||
<div class="grid-container-6-4">
|
||||
<div class="grid-cell-1">
|
||||
{{layout/logo-heading
|
||||
title=model.folder.name
|
||||
desc=model.folder.desc
|
||||
meta=model.folder.icon}}
|
||||
{{layout/logo-heading
|
||||
title=model.folder.name
|
||||
desc=model.folder.desc
|
||||
meta=model.folder.icon}}
|
||||
</div>
|
||||
<div class="grid-cell-2 grid-cell-right">
|
||||
{{folder/space-toolbar
|
||||
|
|
|
@ -19,19 +19,20 @@ import Controller from '@ember/controller';
|
|||
export default Controller.extend(AuthMixin, Modals, {
|
||||
appMeta: service(),
|
||||
folderService: service('folder'),
|
||||
|
||||
spaceName: '',
|
||||
copyTemplate: true,
|
||||
copyPermission: true,
|
||||
copyDocument: false,
|
||||
hasClone: notEmpty('clonedSpace.id'),
|
||||
clonedSpace: null,
|
||||
|
||||
selectedView: 'all',
|
||||
selectedSpaces: null,
|
||||
publicSpaces: null,
|
||||
protectedSpaces: null,
|
||||
personalSpaces: null,
|
||||
spaceIcon: '',
|
||||
spaceLabel: '',
|
||||
spaceDesc: '',
|
||||
spaceName: '',
|
||||
|
||||
actions: {
|
||||
onShowModal() {
|
||||
|
@ -42,10 +43,22 @@ export default Controller.extend(AuthMixin, Modals, {
|
|||
this.set('clonedSpace', sp)
|
||||
},
|
||||
|
||||
|
||||
onSetIcon(icon) {
|
||||
this.set('spaceIcon', icon);
|
||||
},
|
||||
|
||||
onSetLabel(id) {
|
||||
this.set('spaceLabel', id);
|
||||
},
|
||||
|
||||
onAddSpace(e) {
|
||||
e.preventDefault();
|
||||
|
||||
let spaceName = this.get('spaceName');
|
||||
let spaceDesc = this.get('spaceDesc');
|
||||
let spaceIcon = this.get('spaceIcon');
|
||||
let spaceLabel = this.get('spaceLabel');
|
||||
let clonedId = this.get('clonedSpace.id');
|
||||
|
||||
if (is.empty(spaceName)) {
|
||||
|
@ -55,6 +68,9 @@ export default Controller.extend(AuthMixin, Modals, {
|
|||
|
||||
let payload = {
|
||||
name: spaceName,
|
||||
desc: spaceDesc,
|
||||
icon: spaceIcon,
|
||||
labelId: spaceLabel,
|
||||
cloneId: clonedId,
|
||||
copyTemplate: this.get('copyTemplate'),
|
||||
copyPermission: this.get('copyPermission'),
|
||||
|
@ -62,6 +78,9 @@ export default Controller.extend(AuthMixin, Modals, {
|
|||
}
|
||||
|
||||
this.set('spaceName', '');
|
||||
this.set('spaceDesc', '');
|
||||
this.set('spaceIcon', '');
|
||||
this.set('spaceLabel', '');
|
||||
this.set('clonedSpace', null);
|
||||
$("#new-space-name").removeClass("is-invalid");
|
||||
|
||||
|
|
|
@ -17,6 +17,7 @@ import AuthenticatedRouteMixin from 'ember-simple-auth/mixins/authenticated-rout
|
|||
export default Route.extend(AuthenticatedRouteMixin, {
|
||||
appMeta: service(),
|
||||
folderService: service('folder'),
|
||||
iconSvc: service('icon'),
|
||||
localStorage: service(),
|
||||
labelSvc: service('label'),
|
||||
|
||||
|
@ -66,6 +67,7 @@ export default Route.extend(AuthenticatedRouteMixin, {
|
|||
controller.set('publicSpaces', publicSpaces);
|
||||
controller.set('protectedSpaces', protectedSpaces);
|
||||
controller.set('personalSpaces', personalSpaces);
|
||||
controller.set('iconList', this.get('iconSvc').getSpaceIconList());
|
||||
},
|
||||
|
||||
activate() {
|
||||
|
|
|
@ -32,11 +32,13 @@
|
|||
{{#if labels}}
|
||||
<div class="list">
|
||||
{{#each labels as |label|}}
|
||||
<div class="item {{if (eq selectedView label.id) "selected"}}" {{action "onSelect" label.id}}>
|
||||
<i class={{concat "dicon " constants.Icon.Checkbox}}
|
||||
style={{label.bgfgColor}}/>
|
||||
<div class="name">{{label.name}} ({{label.count}})</div>
|
||||
</div>
|
||||
{{#if (gt label.count 0)}}
|
||||
<div class="item {{if (eq selectedView label.id) "selected"}}" {{action "onSelect" label.id}}>
|
||||
<i class={{concat "dicon " constants.Icon.Checkbox}}
|
||||
style={{label.bgfgColor}}/>
|
||||
<div class="name">{{label.name}} ({{label.count}})</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
{{/each}}
|
||||
</div>
|
||||
{{else}}
|
||||
|
@ -48,8 +50,10 @@
|
|||
{{#layout/master-content}}
|
||||
<div class="grid-container-8-2">
|
||||
<div class="grid-cell-1">
|
||||
{{layout/page-heading title=appMeta.title}}
|
||||
{{layout/page-desc desc=appMeta.message}}
|
||||
{{layout/logo-heading
|
||||
title=appMeta.title
|
||||
desc=appMeta.message
|
||||
logo=true}}
|
||||
</div>
|
||||
<div class="grid-cell-2 grid-cell-right">
|
||||
{{#if (or session.isEditor session.isAdmin)}}
|
||||
|
@ -68,16 +72,49 @@
|
|||
{{spaces/space-list spaces=selectedSpaces labels=labels}}
|
||||
|
||||
<div class="modal" tabindex="-1" role="dialog" id="add-space-modal">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-dialog modal-lg" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">Add Space</div>
|
||||
<div class="modal-header">New Space</div>
|
||||
<div class="modal-body">
|
||||
<form onsubmit={{action "onAddSpace"}}>
|
||||
<div class="form-group">
|
||||
<label for="new-space-name">Space Name</label>
|
||||
<label for="new-space-name">Name</label>
|
||||
{{input type="text" id="new-space-name" class="form-control mousetrap" placeholder="Space name" value=spaceName}}
|
||||
<small class="form-text text-muted">Characters and numbers only</small>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Description</label>
|
||||
{{focus-input id="space-desc" type="text" value=spaceDesc class="form-control" placeholder="Space description" autocomplete="off"}}
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Icon</label>
|
||||
<div class="ui-icon-picker">
|
||||
<ul class="list">
|
||||
{{#each iconList as |icon|}}
|
||||
<li class="item {{if (eq spaceIcon icon) "selected"}}" {{action "onSetIcon" icon}}>
|
||||
{{ui/ui-icon-meta icon=icon}}
|
||||
</li>
|
||||
{{/each}}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Label</label>
|
||||
<ul class="space-label-picker">
|
||||
<li class="label none {{if (eq spaceLabel "") "selected"}}" {{action "onSetLabel" ""}}>None</li>
|
||||
{{#each labels as |label|}}
|
||||
<li class="label {{if (eq spaceLabel label.id) "selected"}}"
|
||||
style={{label.bgColor}}
|
||||
{{action "onSetLabel" label.id}} title={{label.name}}>
|
||||
{{label.name}}
|
||||
</li>
|
||||
{{/each}}
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="clone-space-dropdown">Clone Space</label>
|
||||
{{ui/ui-select id="clone-space-dropdown" content=model prompt="select space" action=(action "onCloneSpaceSelect") optionValuePath="id" optionLabelPath="name" selection=clonedSpace}}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue