From 3965f6e94cce6a0f1433253630869a8b29ca494a Mon Sep 17 00:00:00 2001 From: Harvey Kandola Date: Thu, 10 Nov 2016 10:15:12 -0800 Subject: [PATCH] form styles fixed --- .../components/document/document-activity.js | 37 ++---- app/app/pods/document/wizard/controller.js | 8 +- app/app/styles/view/document/toolbar.scss | 9 +- .../styles/widget/widget-sidebar-menu.scss | 3 +- .../components/document/document-tab.hbs | 36 +++--- .../section/airtable/type-editor.hbs | 15 +-- .../components/section/base-editor.hbs | 2 +- .../components/section/gemini/type-editor.hbs | 74 +++++------- .../components/section/github/type-editor.hbs | 114 ++++++++---------- .../section/papertrail/type-editor.hbs | 78 +++++------- .../components/section/trello/type-editor.hbs | 72 +++++------ 11 files changed, 195 insertions(+), 253 deletions(-) diff --git a/app/app/components/document/document-activity.js b/app/app/components/document/document-activity.js index 04c1b9fb..2ecbf998 100644 --- a/app/app/components/document/document-activity.js +++ b/app/app/components/document/document-activity.js @@ -17,7 +17,7 @@ export default Ember.Component.extend({ didReceiveAttrs() { let editors = this.get('activity.editors'); let viewers = this.get('activity.viewers'); - let toc = this.get('pages'); + let pages = this.get('pages'); let sorted = []; if (is.null(editors)) { @@ -39,39 +39,28 @@ export default Ember.Component.extend({ Ember.set(item, "changed", item.action === "update-page"); Ember.set(item, "deleted", item.action === "remove-page"); - let page = _.findWhere(toc, { - id: item.pageId - }); - + let page = pages.findBy('id', item.pageId); let title = ""; - if (is.not.undefined(page)) { - title = page.get('title'); - - if (item.added) { - Ember.set(item, 'changeLabel', "added " + title); - } - - if (item.changed) { - Ember.set(item, 'changeLabel', "changed " + title); - } + if (item.deleted || is.undefined(page)) { + title = "removed section"; } else { - Ember.set(item, "deleted", true); - if (item.added) { - Ember.set(item, 'changeLabel', "added section (since removed)"); + title = "added " + page.get('title'); } if (item.changed) { - Ember.set(item, 'changeLabel', "changed section (since removed)"); - } - - if (item.deleted) { - Ember.set(item, 'changeLabel', "removed section"); + title = "changed " + page.get('title'); } } - sorted.pushObject({ date: item.created, item: item }); + Ember.set(item, 'changeLabel', title); + + let exists = sorted.findBy('item.pageId', item.pageId); + + if (is.undefined(exists)) { + sorted.pushObject({ date: item.created, item: item }); + } }); this.set('sortedItems', _.sortBy(sorted, 'date').reverse()); diff --git a/app/app/pods/document/wizard/controller.js b/app/app/pods/document/wizard/controller.js index b3e7a973..eb225ddc 100644 --- a/app/app/pods/document/wizard/controller.js +++ b/app/app/pods/document/wizard/controller.js @@ -10,16 +10,16 @@ export default Ember.Controller.extend(NotifierMixin, { }, onAddSection(section) { - this.audit.record("added-section"); this.audit.record("added-section-" + section.get('contentType')); let page = { documentId: this.get('model.document.id'), - title: `${section.get('title')} Section`, + title: `${section.get('title')}`, level: 1, sequence: 2048, body: "", - contentType: section.get('contentType') + contentType: section.get('contentType'), + pageType: section.get('pageType') }; let data = this.get('store').normalize('page', page); @@ -40,7 +40,7 @@ export default Ember.Controller.extend(NotifierMixin, { }; this.get('documentService').addPage(this.get('model.document.id'), model).then((newPage) => { - this.transitionToRoute('document.edit', + this.transitionToRoute('document.section', this.get('model.folder.id'), this.get('model.folder.slug'), this.get('model.document.id'), diff --git a/app/app/styles/view/document/toolbar.scss b/app/app/styles/view/document/toolbar.scss index 1376bdfa..439519f1 100644 --- a/app/app/styles/view/document/toolbar.scss +++ b/app/app/styles/view/document/toolbar.scss @@ -29,6 +29,11 @@ > a { color: $color-gray; + @include ease-in(); + + &:hover { + color: $color-link; + } } > .active { @@ -44,13 +49,14 @@ .add-tab { display: inline-block; vertical-align: text-top; + @include ease-in(); > i { font-size: 1.5rem; color: $color-gray; &:hover { - color: $color-green; + color: $color-link; } } } @@ -72,6 +78,7 @@ padding: 0; color: $color-gray; cursor: pointer; + @include ease-in(); &:hover { color: $color-link; diff --git a/app/app/styles/widget/widget-sidebar-menu.scss b/app/app/styles/widget/widget-sidebar-menu.scss index 2dabf6df..03fd9496 100644 --- a/app/app/styles/widget/widget-sidebar-menu.scss +++ b/app/app/styles/widget/widget-sidebar-menu.scss @@ -10,8 +10,9 @@ font-size: 1.3rem; list-style: none; cursor: pointer; - @extend .no-select; color: $color-off-black; + @extend .no-select; + @include ease-in(); &:hover { color: $color-link; diff --git a/app/app/templates/components/document/document-tab.hbs b/app/app/templates/components/document/document-tab.hbs index 060ec8bd..82553d27 100644 --- a/app/app/templates/components/document/document-tab.hbs +++ b/app/app/templates/components/document/document-tab.hbs @@ -1,25 +1,26 @@
- {{#if viewMode}} -
-
-
- edit -
-
-
- delete +
+
+

{{model.page.title}}

+
+
+
+ edit +
+
+
+ delete +
+
-
-
- {{#dropdown-dialog target="delete-section-button" position="bottom right" button="Delete" color="flat-red" onAction=(action 'onDelete')}} -

Are you sure you want to delete this section?

-

There is no undo!

- {{/dropdown-dialog}} +
+ {{#dropdown-dialog target="delete-section-button" position="bottom right" button="Delete" color="flat-red" onAction=(action 'onDelete')}} +

Are you sure you want to delete this section?

+

There is no undo!

+ {{/dropdown-dialog}} -
-

{{model.page.title}}

{{section/base-renderer page=model.page}}
{{/if}} @@ -27,5 +28,4 @@ {{#if editMode}} {{document/document-editor document=model.document folder=model.folder page=model.page meta=model.meta onCancel=(action 'onCancel') onAction=(action 'onAction')}} {{/if}} -
diff --git a/app/app/templates/components/section/airtable/type-editor.hbs b/app/app/templates/components/section/airtable/type-editor.hbs index 7f9c9bec..92756a57 100644 --- a/app/app/templates/components/section/airtable/type-editor.hbs +++ b/app/app/templates/components/section/airtable/type-editor.hbs @@ -1,15 +1,8 @@ {{#section/base-editor document=document folder=folder page=page isDirty=(action 'isDirty') onCancel=(action 'onCancel') onAction=(action 'onAction')}} -
-
-
-
Airtable
-
Paste the Airtable embed code snippet
-
-
- - {{textarea value=data rows="3" id="airtable-embed-code" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"}} -
-
+
+ +
Paste the Airtable embed code snippet
+ {{textarea value=data rows="3" id="airtable-embed-code" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"}}
{{/section/base-editor}} diff --git a/app/app/templates/components/section/base-editor.hbs b/app/app/templates/components/section/base-editor.hbs index b7176052..4bb101fc 100644 --- a/app/app/templates/components/section/base-editor.hbs +++ b/app/app/templates/components/section/base-editor.hbs @@ -4,7 +4,7 @@
{{tip}}
- {{input type='text' id="page-title" value=page.title class="mousetrap"}} + {{focus-input type='text' id="page-title" value=page.title class="mousetrap"}}
diff --git a/app/app/templates/components/section/gemini/type-editor.hbs b/app/app/templates/components/section/gemini/type-editor.hbs index 99c0068d..3dde7c69 100644 --- a/app/app/templates/components/section/gemini/type-editor.hbs +++ b/app/app/templates/components/section/gemini/type-editor.hbs @@ -1,53 +1,41 @@ {{#section/base-editor document=document folder=folder page=page busy=waiting tip="Gemini enterprise issue and ticketing software (https://www.countersoft.com)" isDirty=(action 'isDirty') onCancel=(action 'onCancel') onAction=(action 'onAction')}} -
-
-
-
-
Credentials
-
URL to the Gemini instance
-
-
- -
e.g. http://helpdesk.countersoft.com
- {{focus-input id="gemini-url" type="text" value=config.url readonly=isReadonly}} -
-
- -
Gemini username
- {{input id="gemini-username" type="text" value=config.username readonly=isReadonly}} -
-
- -
Gemini user API key (from user profile)
- {{input id="gemini-apikey" type="password" value=config.APIKey readonly=isReadonly}} -
-
Authenticate
-
+
+
+ +
e.g. http://helpdesk.countersoft.com
+ {{focus-input id="gemini-url" type="text" value=config.url readonly=isReadonly}}
+
+ +
Gemini username
+ {{input id="gemini-username" type="text" value=config.username readonly=isReadonly}} +
+
+ +
Gemini user API key (from user profile)
+ {{input id="gemini-apikey" type="password" value=config.APIKey readonly=isReadonly}} +
+
Authenticate
-
+
{{#if authenticated}} -
-
-
-
Workspace
-
Select Gemini workspace for source of items to be displayed
-
-
    - {{#each workspaces as |card|}} -
  • -
    {{card.Key}}
    - {{#if card.selected}} -
    - {{/if}} -
  • - {{/each}} -
-
- +
+ +
Select Gemini workspace for source of items to be displayed
+
    + {{#each workspaces as |card|}} +
  • +
    {{card.Key}}
    + {{#if card.selected}} +
    + {{/if}} +
  • + {{/each}} +
+
{{/if}}
diff --git a/app/app/templates/components/section/github/type-editor.hbs b/app/app/templates/components/section/github/type-editor.hbs index 05bd0fe3..a6a4276f 100644 --- a/app/app/templates/components/section/github/type-editor.hbs +++ b/app/app/templates/components/section/github/type-editor.hbs @@ -1,74 +1,62 @@ {{#section/base-editor document=document folder=folder page=page busy=busy tip="GitHub is how people build software. (https://github.com)" isDirty=(action 'isDirty') onCancel=(action 'onCancel') onAction=(action 'onAction')}} -
- - {{#if authenticated}} - -
-
- -
Select organization or user whose repository you want to show
- {{ui-select id="owners-dropdown" content=owners action=(action 'onOwnerChange') optionValuePath="id" optionLabelPath="name" selection=config.owner}} -
-
- -
default is 7 days ago
- {{input id="branch-since" value=config.branchSince type="text" }}
-
-
- -
Select the views you want to show
-
- {{input id="show-milestone" checked=config.showMilestones type="checkbox"}} - - {{input id="show-issues" checked=config.showIssues type="checkbox"}} - - {{input id="show-commits" checked=config.showCommits type="checkbox" }} - + {{#if authenticated}} +
+
+ +
Select organization or user whose repository you want to show
+ {{ui-select id="owners-dropdown" content=owners action=(action 'onOwnerChange') optionValuePath="id" optionLabelPath="name" selection=config.owner}} +
+
+ +
default is 7 days ago
+ {{input id="branch-since" value=config.branchSince type="text" }}
+
+
+ +
Select the views you want to show
+
+ {{input id="show-milestone" checked=config.showMilestones type="checkbox"}} + + {{input id="show-issues" checked=config.showIssues type="checkbox"}} + + {{input id="show-commits" checked=config.showCommits type="checkbox" }} + +
-
-
 
+
 
-
-
-
- -
Select the repository to show
-
- {{#each config.lists as |list|}} -
- {{#if list.included}} - check_box - {{else}} - check_box_outline_blank - {{/if}} - {{list.repo}} {{#if list.private}}(private){{/if}} -
- {{/each}} -
-
+
+
+
+ +
Select the repository to show
+
+ {{#each config.lists as |list|}} +
+ {{#if list.included}} + check_box + {{else}} + check_box_outline_blank + {{/if}} + {{list.repo}} {{#if list.private}}(private){{/if}} +
+ {{/each}}
-
-
- - {{else}} - -
-
-
-
-
Authentication
-
Click to authenticate with Github
+
-
Authenticate
- +
-
- - {{/if}} - + {{else}} +
+
+ +
Click to authenticate with Github
+
+
Authenticate
+
+ {{/if}}
- {{/section/base-editor}} diff --git a/app/app/templates/components/section/papertrail/type-editor.hbs b/app/app/templates/components/section/papertrail/type-editor.hbs index 4ca4ad77..fb4e61f6 100644 --- a/app/app/templates/components/section/papertrail/type-editor.hbs +++ b/app/app/templates/components/section/papertrail/type-editor.hbs @@ -1,58 +1,42 @@ {{#section/base-editor document=document folder=folder page=page busy=waiting tip="Papertrail cloud logging service (https://papertrailapp.com)" isDirty=(action 'isDirty') onCancel=(action 'onCancel') onAction=(action 'onAction')}}
-
-
-
-
Papertrail Authentication - {{#if authenticated}} - Complete - {{/if}} -
-
Provide your Papertrail API token
-
-
- -
API Token (from your profile)
- {{focus-input id="papertrail-apitoken" type="password" value=config.APIToken }} -
-
- {{#if authenticated}} - Re-Authenticate - {{else}} - Authenticate - {{/if}} -
-
-
+
+
+ +
API Token (from your profile)
+ {{focus-input id="papertrail-apitoken" type="password" value=config.APIToken }} +
+
+ {{#if authenticated}} + Re-Authenticate + {{else}} + Authenticate + {{/if}} +
+
{{#if authenticated}}
 
-
-
-
-
Log Filter
-
Determine which log entries you want to display
-
-
- -
e.g. bob OR ("some phrase" AND sally)
- {{input id="papertrail-query" type="text" class="mousetrap" value=config.query}} -
-
- -
How many log entries do you want?
- {{input id="papertrail-max" type="number" class="mousetrap" value=config.max}} -
-
- -
Optional Papertrail group
- {{ui-select id="group-dropdown" prompt="" content=options.groups action=(action 'onGroupsChange') optionValuePath="id" optionLabelPath="name" selection=config.group}} -
-
-
+
+
+ +
Determine which log entries you want to display e.g. bob OR ("some phrase" AND sally)
+ {{input id="papertrail-query" type="text" class="mousetrap" value=config.query}} +
+
+ +
How many log entries do you want?
+ {{input id="papertrail-max" type="number" class="mousetrap" value=config.max}} +
+
+ +
Optional Papertrail group
+ {{ui-select id="group-dropdown" prompt="" content=options.groups action=(action 'onGroupsChange') optionValuePath="id" optionLabelPath="name" selection=config.group}} +
+
{{/if}} diff --git a/app/app/templates/components/section/trello/type-editor.hbs b/app/app/templates/components/section/trello/type-editor.hbs index 6ea76281..9dce5877 100644 --- a/app/app/templates/components/section/trello/type-editor.hbs +++ b/app/app/templates/components/section/trello/type-editor.hbs @@ -49,50 +49,42 @@
 
-->
-
-
- -
Select board
- {{ui-select id="boards-dropdown" content=boards action=(action 'onBoardChange') optionValuePath="id" optionLabelPath="namePath" selection=config.board}} -
- {{#if config.board.id}} -
- -
Select lists to include
-
-
{{config.board.name}}
- {{#each config.lists as |list|}} -
- {{#if list.included}} - check_box - {{else}} - check_box_outline_blank - {{/if}} - {{list.name}} -
- {{/each}} -
-
-
- {{/if}} -
+
+ +
Select board
+ {{ui-select id="boards-dropdown" content=boards action=(action 'onBoardChange') optionValuePath="id" optionLabelPath="namePath" selection=config.board}}
- {{/if}} - - {{else}} - -
-
-
-
-
Authentication
-
Click to authenticate with Trello
+ {{#if config.board.id}} +
+ +
Select lists to include
+
+
{{config.board.name}}
+ {{#each config.lists as |list|}} +
+ {{#if list.included}} + check_box + {{else}} + check_box_outline_blank + {{/if}} + {{list.name}} +
+ {{/each}} +
+
-
Authenticate
- + {{/if}}
+ {{/if}} + {{else}} +
+
+ +
Click to authenticate with Trello
+
+
Authenticate
- {{/if}}
+ {{/section/base-editor}}