diff --git a/.gitconfig b/.gitconfig new file mode 100644 index 00000000..cb385d88 --- /dev/null +++ b/.gitconfig @@ -0,0 +1,5 @@ +[core] + whitespace = trailing-space,space-before-tab + autocrlf = input +[apply] + whitespace = fix \ No newline at end of file diff --git a/app/app/components/documize-setup.js b/app/app/components/documize-setup.js new file mode 100644 index 00000000..d81c1f97 --- /dev/null +++ b/app/app/components/documize-setup.js @@ -0,0 +1,71 @@ +// Copyright 2016 Documize Inc. . All rights reserved. +// +// This software (Documize Community Edition) is licensed under +// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html +// +// You can operate outside the AGPL restrictions by purchasing +// Documize Enterprise Edition and obtaining a commercial license +// by contacting . +// +// https://documize.com + +import Ember from 'ember'; + +const { + isEmpty, + computed, + set + +} = Ember; + +export default Ember.Component.extend({ + titleEmpty: computed.empty('model.title'), + firstnameEmpty: computed.empty('model.firstname'), + lastnameEmpty: computed.empty('model.lastname'), + emailEmpty: computed.empty('model.email'), + passwordEmpty: computed.empty('model.password'), + hasEmptyTitleError: computed.and('titleEmpty', 'titleError'), + hasEmptyFirstnameError: computed.and('firstnameEmpty', 'adminFirstnameError'), + hasEmptyLastnameError: computed.and('lastnameEmpty', 'adminLastnameError'), + hasEmptyEmailError: computed.and('emailEmpty', 'adminEmailError'), + hasEmptyPasswordError: computed.and('passwordEmpty', 'adminPasswordError'), + + actions: { + save() { + if (isEmpty(this.get('model.title'))) { + set(this, 'titleError', true); + return $("#siteTitle").focus(); + } + + if (isEmpty(this.get('model.firstname'))) { + set(this, 'adminFirstnameError', true); + return $("#adminFirstname").focus(); + } + + if (isEmpty(this.get('model.lastname'))) { + set(this, 'adminLastnameError', true); + return $("#adminLastname").focus(); + } + + if (isEmpty(this.get('model.email')) || !is.email(this.get('model.email'))) { + set(this, 'adminEmailError', true); + return $("#adminEmail").focus(); + } + + if (isEmpty(this.get('model.password'))) { + set(this, 'adminPasswordError', true); + return $("#adminPassword").focus(); + } + + this.model.allowAnonymousAccess = Ember.$("#allowAnonymousAccess").prop('checked'); + + this.get('save')().then(() => { + set(this, 'titleError', false); + set(this, 'adminFirstnameError', false); + set(this, 'adminLastnameError', false); + set(this, 'adminEmailError', false); + set(this, 'adminPasswordError', false); + }); + } + } +}); diff --git a/app/app/components/forgot-password.js b/app/app/components/forgot-password.js new file mode 100644 index 00000000..261a2748 --- /dev/null +++ b/app/app/components/forgot-password.js @@ -0,0 +1,41 @@ +// Copyright 2016 Documize Inc. . All rights reserved. +// +// This software (Documize Community Edition) is licensed under +// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html +// +// You can operate outside the AGPL restrictions by purchasing +// Documize Enterprise Edition and obtaining a commercial license +// by contacting . +// +// https://documize.com + +import Ember from 'ember'; + +const { + computed, + isEmpty +} = Ember; + +export default Ember.Component.extend({ + email: "", + sayThanks: false, + emailEmpty: computed.empty('email'), + hasEmptyEmailError: computed.and('emailEmpty', 'emailIsEmpty'), + + actions: { + forgot() { + let email = this.get('email'); + + if (isEmpty(email)) { + Ember.set(this, 'emailIsEmpty', true); + return $("#email").focus(); + } + + this.get('forgot')(email).then(() => { + Ember.set(this, 'sayThanks', true); + Ember.set(this, 'email', ''); + Ember.set(this, 'emailIsEmpty', false); + }); + } + } +}); diff --git a/app/app/components/general-settings.js b/app/app/components/general-settings.js new file mode 100644 index 00000000..41a2ebc5 --- /dev/null +++ b/app/app/components/general-settings.js @@ -0,0 +1,45 @@ +// Copyright 2016 Documize Inc. . All rights reserved. +// +// This software (Documize Community Edition) is licensed under +// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html +// +// You can operate outside the AGPL restrictions by purchasing +// Documize Enterprise Edition and obtaining a commercial license +// by contacting . +// +// https://documize.com + +import Ember from 'ember'; + +const { + isEmpty, + computed, + set +} = Ember; + +export default Ember.Component.extend({ + titleEmpty: computed.empty('model.title'), + messageEmpty: computed.empty('model.message'), + hasTitleInputError: computed.and('titleEmpty', 'titleError'), + hasMessageInputError: computed.and('messageEmpty', 'messageError'), + + actions: { + save() { + if (isEmpty(this.get('model.title'))) { + set(this, 'titleError', true); + return $("#siteTitle").focus(); + } + + if (isEmpty(this.get('model.message'))) { + set(this, 'messageError', true); + return $("#siteMessage").focus(); + } + + this.model.set('allowAnonymousAccess', Ember.$("#allowAnonymousAccess").prop('checked')); + this.get('save')().then(() => { + set(this, 'titleError', false); + set(this, 'messageError', false); + }); + } + } +}); diff --git a/app/app/components/password-reset.js b/app/app/components/password-reset.js new file mode 100644 index 00000000..49cca5c0 --- /dev/null +++ b/app/app/components/password-reset.js @@ -0,0 +1,59 @@ +// Copyright 2016 Documize Inc. . All rights reserved. +// +// This software (Documize Community Edition) is licensed under +// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html +// +// You can operate outside the AGPL restrictions by purchasing +// Documize Enterprise Edition and obtaining a commercial license +// by contacting . +// +// https://documize.com + +import Ember from 'ember'; + +const { + isEmpty, + isEqual, + computed, + set + +} = Ember; + +export default Ember.Component.extend({ + password: "", + passwordConfirm: "", + mustMatch: false, + passwordEmpty: computed.empty('password'), + confirmEmpty: computed.empty('passwordConfirm'), + hasPasswordError: computed.and('passwordEmpty', 'passwordIsEmpty'), + hasConfirmError: computed.and('confirmEmpty', 'passwordConfirmIsEmpty'), + + actions: { + reset() { + let password = this.get('password'); + let passwordConfirm = this.get('passwordConfirm'); + + if (isEmpty(password)) { + set(this, 'passwordIsEmpty', true); + return $("#newPassword").focus(); + } + + if (isEmpty(passwordConfirm)) { + set(this, 'passwordConfirmIsEmpty', true); + return $("#passwordConfirm").focus(); + } + + if (!isEqual(password, passwordConfirm)) { + set(this, 'hasPasswordError', true); + set(this, 'hasConfirmError', true); + set(this, 'mustMatch', true); + return; + } + + this.get('reset')(password).then(() => { + set(this, 'passwordIsEmpty', false); + set(this, 'passwordConfirmIsEmpty', false); + }); + } + } +}); diff --git a/app/app/components/user-profile.js b/app/app/components/user-profile.js new file mode 100644 index 00000000..4fd4ee31 --- /dev/null +++ b/app/app/components/user-profile.js @@ -0,0 +1,83 @@ +// Copyright 2016 Documize Inc. . All rights reserved. +// +// This software (Documize Community Edition) is licensed under +// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html +// +// You can operate outside the AGPL restrictions by purchasing +// Documize Enterprise Edition and obtaining a commercial license +// by contacting . +// +// https://documize.com + +import Ember from 'ember'; + +const { + computed, + isEmpty, + isEqual, + isPresent +} = Ember; + +export default Ember.Component.extend({ + password: { password: "", confirmation: "" }, + hasFirstnameError: computed.empty('model.firstname'), + hasLastnameError: computed.empty('model.lastname'), + hasEmailError: computed.empty('model.email'), + hasPasswordError: computed('passwordError', 'password.password', { + get() { + if (isPresent(this.get('passwordError'))) { + return `error`; + } + + if (isEmpty(this.get('password.password'))) { + return null; + } + } + }), + hasConfirmPasswordError: computed('confirmPasswordError', { + get() { + if (isPresent(this.get("confirmPasswordError"))) { + return `error`; + } + + return; + } + }), + + actions: { + save() { + let password = this.get('password.password'); + let confirmation = this.get('password.confirmation'); + + if (isEmpty(this.get('model.firstname'))) { + return $("#firstname").focus(); + } + if (isEmpty(this.get('model.lastname'))) { + return $("#lastname").focus(); + } + if (isEmpty(this.get('model.email'))) { + return $("#email").focus(); + } + + if (isPresent(password) && isEmpty(confirmation)) { + Ember.set(this, 'confirmPasswordError', 'error'); + return $("#confirmPassword").focus(); + } + if (isEmpty(password) && isPresent(confirmation)) { + Ember.set(this, 'passwordError', 'error'); + return $("#password").focus(); + } + if (!isEqual(password, confirmation)) { + Ember.set(this, 'passwordError', 'error'); + return $("#password").focus(); + } + + let passwords = this.get('password'); + + this.get('save')(passwords).finally(() => { + Ember.set(this, 'password.password', ''); + Ember.set(this, 'password.confirmation', ''); + }); + } + } +}); diff --git a/app/app/components/user-settings.js b/app/app/components/user-settings.js new file mode 100644 index 00000000..593d608f --- /dev/null +++ b/app/app/components/user-settings.js @@ -0,0 +1,56 @@ +// Copyright 2016 Documize Inc. . All rights reserved. +// +// This software (Documize Community Edition) is licensed under +// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html +// +// You can operate outside the AGPL restrictions by purchasing +// Documize Enterprise Edition and obtaining a commercial license +// by contacting . +// +// https://documize.com + +import Ember from 'ember'; + +const { + isEmpty, + computed, + set, + get +} = Ember; + +export default Ember.Component.extend({ + newUser: { firstname: "", lastname: "", email: "", active: true }, + firstnameEmpty: computed.empty('newUser.firstname'), + lastnameEmpty: computed.empty('newUser.lastname'), + emailEmpty: computed.empty('newUser.email'), + hasFirstnameEmptyError: computed.and('firstnameEmpty', 'firstnameError'), + hasLastnameEmptyError: computed.and('lastnameEmpty', 'lastnameError'), + hasEmailEmptyError: computed.and('emailEmpty', 'emailError'), + + actions: { + add() { + if (isEmpty(this.get('newUser.firstname'))) { + set(this, 'firstnameError', true); + return $("#newUserFirstname").focus(); + } + if (isEmpty(this.get('newUser.lastname'))) { + set(this, 'lastnameError', true); + return $("#newUserLastname").focus(); + } + if (isEmpty(this.get('newUser.email')) || is.not.email(this.get('newUser.email'))) { + set(this, 'emailError', true); + return $("#newUserEmail").focus(); + } + + let user = get(this, 'newUser'); + + get(this, 'add')(user).then(() => { + this.set('newUser', { firstname: "", lastname: "", email: "", active: true }); + set(this, 'firstnameError', false); + set(this, 'lastnameError', false); + set(this, 'emailError', false); + $("#newUserFirstname").focus(); + }); + } + } +}); diff --git a/app/app/pods/auth/forgot/controller.js b/app/app/pods/auth/forgot/controller.js index 96a57ca7..5fa8aa66 100644 --- a/app/app/pods/auth/forgot/controller.js +++ b/app/app/pods/auth/forgot/controller.js @@ -1,11 +1,11 @@ // Copyright 2016 Documize Inc. . All rights reserved. // -// This software (Documize Community Edition) is licensed under +// This software (Documize Community Edition) is licensed under // GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html // // You can operate outside the AGPL restrictions by purchasing // Documize Enterprise Edition and obtaining a commercial license -// by contacting . +// by contacting . // // https://documize.com @@ -13,23 +13,10 @@ import Ember from 'ember'; export default Ember.Controller.extend({ userService: Ember.inject.service('user'), - email: "", - sayThanks: false, actions: { - forgot: function () { - var self = this; - var email = this.get('email'); - - if (is.empty(email)) { - $("#email").addClass("error").focus(); - return; - } - - self.set('sayThanks', true); - this.set('email', ''); - - this.get('userService').forgotPassword(email); + forgot: function (email) { + return this.get('userService').forgotPassword(email); } } -}); \ No newline at end of file +}); diff --git a/app/app/pods/auth/forgot/template.hbs b/app/app/pods/auth/forgot/template.hbs index 90ddfdc1..886add5a 100644 --- a/app/app/pods/auth/forgot/template.hbs +++ b/app/app/pods/auth/forgot/template.hbs @@ -3,20 +3,6 @@ Documize diff --git a/app/app/pods/auth/reset/controller.js b/app/app/pods/auth/reset/controller.js index de4870a6..37fe2b87 100644 --- a/app/app/pods/auth/reset/controller.js +++ b/app/app/pods/auth/reset/controller.js @@ -1,11 +1,11 @@ // Copyright 2016 Documize Inc. . All rights reserved. // -// This software (Documize Community Edition) is licensed under +// This software (Documize Community Edition) is licensed under // GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html // // You can operate outside the AGPL restrictions by purchasing // Documize Enterprise Edition and obtaining a commercial license -// by contacting . +// by contacting . // // https://documize.com @@ -18,31 +18,10 @@ export default Ember.Controller.extend({ mustMatch: false, actions: { - reset() { - let self = this; - let password = this.get('password'); - let passwordConfirm = this.get('passwordConfirm'); - - if (is.empty(password)) { - $("#newPassword").addClass("error").focus(); - return; - } - - if (is.empty(passwordConfirm)) { - $("#passwordConfirm").addClass("error").focus(); - return; - } - - if (is.not.equal(password, passwordConfirm)) { - $("#newPassword").addClass("error").focus(); - $("#passwordConfirm").addClass("error"); - self.set('mustMatch', true); - return; - } - - this.get('userService').resetPassword(self.model, password).then(function (response) { /* jshint ignore:line */ - self.transitionToRoute('auth.login'); + reset(password) { + return this.get('userService').resetPassword(this.model, password).then(() => { /* jshint ignore:line */ + this.transitionToRoute('auth.login'); }); } } -}); \ No newline at end of file +}); diff --git a/app/app/pods/auth/reset/template.hbs b/app/app/pods/auth/reset/template.hbs index 2f26e5fb..78b551bb 100644 --- a/app/app/pods/auth/reset/template.hbs +++ b/app/app/pods/auth/reset/template.hbs @@ -2,23 +2,5 @@ - diff --git a/app/app/pods/customize/general/controller.js b/app/app/pods/customize/general/controller.js index 501c0d2b..604e8976 100644 --- a/app/app/pods/customize/general/controller.js +++ b/app/app/pods/customize/general/controller.js @@ -1,11 +1,11 @@ // Copyright 2016 Documize Inc. . All rights reserved. // -// This software (Documize Community Edition) is licensed under +// This software (Documize Community Edition) is licensed under // GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html // // You can operate outside the AGPL restrictions by purchasing // Documize Enterprise Edition and obtaining a commercial license -// by contacting . +// by contacting . // // https://documize.com @@ -17,19 +17,9 @@ export default Ember.Controller.extend(NotifierMixin, { actions: { save() { - if (is.empty(this.model.get('title'))) { - $("#siteTitle").addClass("error").focus(); - return; - } - - if (is.empty(this.model.get('message'))) { - $("#siteMessage").addClass("error").focus(); - return; - } - - this.model.set('allowAnonymousAccess', Ember.$("#allowAnonymousAccess").prop('checked')); - this.get('orgService').save(this.model); - this.showNotification('Saved'); + return this.get('orgService').save(this.model).then(() => { + this.showNotification('Saved'); + }); } } -}); \ No newline at end of file +}); diff --git a/app/app/pods/customize/general/template.hbs b/app/app/pods/customize/general/template.hbs index c161a5c8..adb167fa 100644 --- a/app/app/pods/customize/general/template.hbs +++ b/app/app/pods/customize/general/template.hbs @@ -1,29 +1,3 @@
-
-
-
General Settings
-
Tell people about this Documize instance
-
-
-
- -
Describe the title of this Documize instance
- {{focus-input id="siteTitle" type="text" value=model.title}} -
-
- -
Describe the purpose of this Documize instance
- {{textarea id="siteMessage" rows="3" value=model.message}} -
-
- -
Content within "Everyone" will be made available to anonymous users
-
- - -
-
-
save
-
-
+{{general-settings model=model save=(action 'save')}}
diff --git a/app/app/pods/customize/users/controller.js b/app/app/pods/customize/users/controller.js index 03680753..7dddaad0 100644 --- a/app/app/pods/customize/users/controller.js +++ b/app/app/pods/customize/users/controller.js @@ -1,11 +1,11 @@ // Copyright 2016 Documize Inc. . All rights reserved. // -// This software (Documize Community Edition) is licensed under +// This software (Documize Community Edition) is licensed under // GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html // // You can operate outside the AGPL restrictions by purchasing // Documize Enterprise Edition and obtaining a commercial license -// by contacting . +// by contacting . // // https://documize.com @@ -17,30 +17,13 @@ export default Ember.Controller.extend(NotifierMixin, { newUser: { firstname: "", lastname: "", email: "", active: true }, actions: { - add: function () { - if (is.empty(this.newUser.firstname)) { - $("#newUserFirstname").addClass("error").focus(); - return; - } - if (is.empty(this.newUser.lastname)) { - $("#newUserLastname").addClass("error").focus(); - return; - } - if (is.empty(this.newUser.email) || is.not.email(this.newUser.email)) { - $("#newUserEmail").addClass("error").focus(); - return; - } + add(user) { + Ember.set(this, 'newUser', user); - $("#newUserFirstname").removeClass("error"); - $("#newUserLastname").removeClass("error"); - $("#newUserEmail").removeClass("error"); - - this.get('userService') + return this.get('userService') .add(this.get('newUser')) .then((user) => { this.showNotification('Added'); - this.set('newUser', { firstname: "", lastname: "", email: "", active: true }); - $("#newUserFirstname").focus(); this.get('model').pushObject(user); }) .catch(function (error) { @@ -76,4 +59,4 @@ export default Ember.Controller.extend(NotifierMixin, { this.showNotification('Password changed'); } } -}); \ No newline at end of file +}); diff --git a/app/app/pods/customize/users/template.hbs b/app/app/pods/customize/users/template.hbs index e858f5a8..555cf597 100644 --- a/app/app/pods/customize/users/template.hbs +++ b/app/app/pods/customize/users/template.hbs @@ -1,23 +1,5 @@
-
-
-
Add User
-
New users receive an invitation email with a random password
-
-
- - {{focus-input id="newUserFirstname" type="text" value=newUser.firstname}} -
-
- - {{input id="newUserLastname" type="text" value=newUser.lastname}} -
-
- - {{input id="newUserEmail" type="text" value=newUser.email}} -
-
Add
-
+ {{user-settings add=(action 'add')}}
{{settings/user-list users=model onDelete=(action "onDelete") onSave=(action "onSave") onPassword=(action "onPassword")}} diff --git a/app/app/pods/profile/controller.js b/app/app/pods/profile/controller.js index 431dc2b8..fb4d2edd 100644 --- a/app/app/pods/profile/controller.js +++ b/app/app/pods/profile/controller.js @@ -1,62 +1,37 @@ // Copyright 2016 Documize Inc. . All rights reserved. // -// This software (Documize Community Edition) is licensed under +// This software (Documize Community Edition) is licensed under // GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html // // You can operate outside the AGPL restrictions by purchasing // Documize Enterprise Edition and obtaining a commercial license -// by contacting . +// by contacting . // // https://documize.com import Ember from 'ember'; +const { + isPresent +} = Ember; + export default Ember.Controller.extend({ userService: Ember.inject.service('user'), - password: { password: "", confirmation: "" }, session: Ember.inject.service(), actions: { - save: function () { - if (is.empty(this.model.get('firstname'))) { - $("#firstname").addClass("error").focus(); - return; - } - if (is.empty(this.model.get('lastname'))) { - $("#lastname").addClass("error").focus(); - return; - } - if (is.empty(this.model.get('email'))) { - $("#email").addClass("error").focus(); - return; - } - if (is.not.empty(this.password.password) && is.empty(this.password.confirmation)) { - $("#confirmPassword").addClass("error").focus(); - return; - } - if (is.empty(this.password.password) && is.not.empty(this.password.confirmation)) { - $("#password").addClass("error").focus(); - return; - } - if (is.not.equal(this.password.password, this.password.confirmation)) { - $("#password").addClass("error").focus(); - return; - } + save(passwords) { + let password = passwords.password; + let confirmation = passwords.confirmation; - let self = this; - - this.get('userService').save(this.model).then(function () { - if (is.not.empty(self.password.password) && is.not.empty(self.password.confirmation)) { - self.get('userService').updatePassword(self.model.get('id'), self.password.password).then(function () { - self.password.password = ""; - self.password.confirmation = ""; - }); + return this.get('userService').save(this.model).then(() => { + if (isPresent(password) && isPresent(confirmation)) { + this.get('userService').updatePassword(this.get('model.id'), password); } - self.model.generateInitials(); - self.get('session').set('user', self.model); + this.model.generateInitials(); + this.get('session').set('user', this.model); + this.transitionToRoute('folders'); }); - - this.transitionToRoute('folders'); } } -}); \ No newline at end of file +}); diff --git a/app/app/pods/profile/template.hbs b/app/app/pods/profile/template.hbs index 69cc6f6d..f01bedae 100644 --- a/app/app/pods/profile/template.hbs +++ b/app/app/pods/profile/template.hbs @@ -13,33 +13,7 @@ {{/layout/zone-sidebar}} {{#layout/zone-content}} -
-
-
- - {{focus-input id="firstname" type="text" value=model.firstname}} -
-
- - {{input id="lastname" type="text" value=model.lastname}} -
-
- - {{input id="email" type="text" value=model.email}} -
-
- -
Optional change your password
- {{input id="password" type="password" value=password.password}} -
-
- -
Confirm your new password
- {{input id="confirmPassword" type="password" value=password.confirmation}} -
-
save
-
-
+ {{user-profile model=model save=(action 'save')}} {{/layout/zone-content}} {{/layout/zone-container}} diff --git a/app/app/pods/setup/controller.js b/app/app/pods/setup/controller.js index 611277ab..6bfffb01 100644 --- a/app/app/pods/setup/controller.js +++ b/app/app/pods/setup/controller.js @@ -1,11 +1,11 @@ // Copyright 2016 Documize Inc. . All rights reserved. // -// This software (Documize Community Edition) is licensed under +// This software (Documize Community Edition) is licensed under // GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html // // You can operate outside the AGPL restrictions by purchasing // Documize Enterprise Edition and obtaining a commercial license -// by contacting . +// by contacting . // // https://documize.com @@ -19,39 +19,7 @@ export default Ember.Controller.extend(NotifierMixin, { actions: { save() { - if (is.empty(this.model.title)) { - $("#siteTitle").addClass("error").focus(); - return; - } - - if (is.empty(this.model.firstname)) { - $("#adminFirstname").addClass("error").focus(); - return; - } - - if (is.empty(this.model.lastname)) { - $("#adminLastname").addClass("error").focus(); - return; - } - - if (is.empty(this.model.email)) { - $("#adminEmail").addClass("error").focus(); - return; - } - - if (!is.email(this.model.email)) { - $("#adminEmail").addClass("error").focus(); - return; - } - - if (is.empty(this.model.password)) { - $("#adminPassword").addClass("error").focus(); - return; - } - - this.model.allowAnonymousAccess = Ember.$("#allowAnonymousAccess").prop('checked'); - - this.get('ajax').request("/setup", { + return this.get('ajax').request("/setup", { method: 'POST', data: this.model, dataType: "text", @@ -64,4 +32,4 @@ export default Ember.Controller.extend(NotifierMixin, { }); } } -}); \ No newline at end of file +}); diff --git a/app/app/pods/setup/template.hbs b/app/app/pods/setup/template.hbs index 25715da1..a49de2fa 100644 --- a/app/app/pods/setup/template.hbs +++ b/app/app/pods/setup/template.hbs @@ -9,46 +9,7 @@ Setup new database
+ {{documize-setup model=model save=(action 'save')}} -
-
-
-
-
Let's setup Documize
-
Database name is {{model.dbname}}
-
-
-
- -
What's your tribe called?
- {{focus-input id="siteTitle" type="text" value=model.title}} -
-
- -
What do people call you?
- {{input id="adminFirstname" type="text" value=model.firstname}} -
-
- -
How the government refers to you.
- {{input id="adminLastname" type="text" value=model.lastname}} -
-
- -
No spam. Ever!
- {{input id="adminEmail" type="email" value=model.email}} -
-
- -
Something you can remember without writing it down.
- {{input id="adminPassword" type="text" value=model.password}} -
-
Go Setup
-
-
-
-
- - diff --git a/app/app/services/user.js b/app/app/services/user.js index a8385ee1..28df54e9 100644 --- a/app/app/services/user.js +++ b/app/app/services/user.js @@ -126,4 +126,4 @@ export default Ember.Service.extend({ data: password }); } -}); \ No newline at end of file +}); diff --git a/app/app/templates/components/documize-setup.hbs b/app/app/templates/components/documize-setup.hbs new file mode 100644 index 00000000..ab0df0f7 --- /dev/null +++ b/app/app/templates/components/documize-setup.hbs @@ -0,0 +1,38 @@ +
+
+
+
+
Let's setup Documize
+
Database name is {{model.dbname}}
+
+
+
+ +
What's your tribe called?
+ {{focus-input id="siteTitle" type="text" value=model.title class=(if hasEmptyTitleError 'error')}} +
+
+ +
What do people call you?
+ {{input id="adminFirstname" type="text" value=model.firstname class=(if hasEmptyFirstnameError 'error')}} +
+
+ +
How the government refers to you.
+ {{input id="adminLastname" type="text" value=model.lastname class=(if hasEmptyLastnameError 'error')}} +
+
+ +
No spam. Ever!
+ {{input id="adminEmail" type="email" value=model.email class=(if hasEmptyEmailError 'error')}} +
+
+ +
Something you can remember without writing it down.
+ {{input id="adminPassword" type="text" value=model.password class=(if hasEmptyPasswordError 'error')}} +
+
Go Setup
+
+
+
+
diff --git a/app/app/templates/components/forgot-password.hbs b/app/app/templates/components/forgot-password.hbs new file mode 100644 index 00000000..88c0aedc --- /dev/null +++ b/app/app/templates/components/forgot-password.hbs @@ -0,0 +1,15 @@ +
+ {{#if sayThanks}} +
Thanks. Check your email for instructions.
+ {{else}} +
+ + {{focus-input type="email" value=email id="email" class=(if hasEmptyEmailError 'error')}} +
+
+
+ +
+ {{/if}} + {{#link-to 'auth.login'}}Sign In{{/link-to}} + diff --git a/app/app/templates/components/general-settings.hbs b/app/app/templates/components/general-settings.hbs new file mode 100644 index 00000000..6057bdc6 --- /dev/null +++ b/app/app/templates/components/general-settings.hbs @@ -0,0 +1,27 @@ +
+
+
General Settings
+
Tell people about this Documize instance
+
+
+
+ +
Describe the title of this Documize instance
+ {{focus-input id="siteTitle" type="text" value=model.title class=(if hasTitleInputError 'error')}} +
+
+ +
Describe the purpose of this Documize instance
+ {{textarea id="siteMessage" rows="3" value=model.message class=(if hasMessageInputError 'error')}} +
+
+ +
Content within "Everyone" will be made available to anonymous users
+
+ + +
+
+
save
+
+
diff --git a/app/app/templates/components/password-reset.hbs b/app/app/templates/components/password-reset.hbs new file mode 100644 index 00000000..8b65c352 --- /dev/null +++ b/app/app/templates/components/password-reset.hbs @@ -0,0 +1,19 @@ +