update tooltip

This commit is contained in:
Shaun Chyxion 2017-08-05 14:53:36 +08:00
parent ad354c76ac
commit d3d964cff6
16 changed files with 115 additions and 64 deletions

1
.gitignore vendored
View File

@ -20,6 +20,7 @@
!.editorconfig
!.ember-cli
!.jshintrc
!.eslintrc.js
!.travis.yml
!.watchmanconfig
!.gitignore

View File

@ -111,7 +111,10 @@ public class CustomerServiceSupport
viewModel.setAttr("years", years != null ? years : new String[0]);
viewModel.setAttr("ytdSales", ytdSales != null ?
ytdSales : Collections.emptyList());
List<ViewModel<CustomerIssue>> recentIssues = customerIssueService.listViewModels(
// recent 3 issues
List<ViewModel<CustomerIssue>> recentIssues =
customerIssueService.listViewModels(
new Search(CustomerYearToDateSale.CUSTOMER_ID, model.getId())
.eq(CustomerYearToDateSale.ENABLED, true)
.desc(CustomerYearToDateSale.DATE_CREATED)

13
web/.eslintrc.js Normal file
View File

@ -0,0 +1,13 @@
module.exports = {
root: true,
parserOptions: {
ecmaVersion: 2017,
sourceType: 'module'
},
extends: 'eslint:recommended',
env: {
browser: true
},
rules: {
}
};

View File

@ -1,5 +1,6 @@
import Ember from 'ember';
export default Ember.Component.extend({
classNames: ['widget-header']
classNames: ['widget-header'],
dropdownMenu: true
});

View File

@ -6,6 +6,7 @@ export default BaseComponent.extend({
tagName: 'a',
classNames: ['cursor-pointer'],
attributeBindings: ['title'],
'data-rel': 'tooltip',
title: 'Reload',
click() {
this.get('route').refresh();

View File

@ -3,16 +3,24 @@ import BaseComponent from './base-component';
export default BaseComponent.extend({
tagName: 'a',
attributeBindings: ['title', 'role', 'rel'],
attributeBindings: ['title', 'role', 'data-rel'],
role: 'button',
rel: 'tooltip',
'data-rel': 'tooltip',
enabledText: 'Enable',
disabledText: 'Disable',
enabledOp: 'enable',
disabledOp: 'disable',
enabled: Ember.computed.alias('model.enabled'),
title: Ember.computed('enabled', function() {
let me = this;
return this.get('enabled') ? me.get('disabledText') : me.get('enabledText');
}),
op: Ember.computed('enabled', function() {
let me = this;
return this.get('enabled') ?
me.get('disabledOp') || me.get('disabledText')
: me.get('enabledOp') || me.get('enabledText');
}),
iconSizeClass: 'bigger-120',
didReceiveAttrs() {
let me = this;
@ -27,6 +35,11 @@ export default BaseComponent.extend({
'iconOnly::btn-xs']);
}
},
didInsertElement() {
let me = this;
me._super(...arguments);
me.$().tooltip();
},
click() {
let me = this;
me.dialog.confirm('Are you sure to ' + me.get('title') + ' row?', () => {

View File

@ -18,7 +18,7 @@ const cols = ['showId',
'showIssue3',
];
const config = {
showAll: true,
showAll: false,
showAllChanged: Ember.observer('showAll', function() {
let me = this;
if (!me.get('lock')) {

View File

@ -13,7 +13,6 @@ export default Ember.Route.extend({
me.get('ajax').doPost('auth/login', model,
function(user) {
Ember.Logger.debug(`User ${user} Loggedin`);
Ember.$.sessionStorage.set('user', user);
me.set('ajax.user', user);
me.message.alert('Sign in successfully');
me.transitionTo('index');

View File

@ -1,13 +1,17 @@
<div class="widget-toolbar">
{{#if hasBlock}}
<div class="widget-menu">
<a href="#" data-action="settings" data-toggle="dropdown">
<i class="ace-icon fa fa-bars"></i>
</a>
<ul class="dropdown-menu dropdown-menu-right dropdown-light-blue dropdown-caret dropdown-closer">
{{#if dropdownMenu}}
<div class="widget-menu">
<a href="#" data-action="settings" data-toggle="dropdown" data-rel="tooltip" title="Dropdown">
<i class="ace-icon fa fa-bars"></i>
</a>
<ul class="dropdown-menu dropdown-menu-right dropdown-light-blue dropdown-caret dropdown-closer">
{{yield}}
</ul>
</div>
{{else}}
{{yield}}
</ul>
</div>
{{/if}}
{{/if}}
{{reload-btn}}
</div>

View File

@ -4,6 +4,14 @@
placeholder="Search ..."
value=searchText
insert-newline='search'
focus-out='search'
}}
<i class="ace-icon fa fa-search nav-search-icon"></i>
</span>
</span>
{{!--
<div class="inline" style="margin-top:0">
<a class="btn btn-xs btn-info" style="margin-bottom: 3px;">
<i class="ace-icon fa fa-search bigger-120"></i>
</a>
</div>
--}}

View File

@ -17,7 +17,7 @@
<th>
Name
</th>
<th class="hidden-480">
<th>
<i class="ace-icon fa fa-sticky-note-o bigger-110 hidden-480"></i>
Remark
</th>
@ -38,7 +38,7 @@
<td>
{{it.name}}
</td>
<td class="hidden-480">
<td>
{{editable-cell model=it field='note'}}
</td>
<td>
@ -72,7 +72,6 @@
<li>
{{status-toggle-button model=it iconOnly=true}}
</li>
<li>
{{#link-to 'customer-status.edit' it.id class='tooltip-info' data-rel='tooltip' title='Edit'}}
<span class="blue">
@ -80,17 +79,16 @@
</span>
{{/link-to}}
</li>
<li>
{{#if (not-eq model.data.firstObject.id it.id)}}
<button class="tooltip-info" title="Move Up" {{action (route-action 'moveUp' it)}}>
<a class="tooltip-info" title="Move Up" {{action (route-action 'moveUp' it)}}>
<i class="ace-icon fa fa-arrow-up bigger-120"></i>
</button>
</a>
{{/if}}
{{#if (not-eq model.data.lastObject.id it.id)}}
<button class="tooltip-info" title="Move Down" {{action (route-action 'moveDown' it)}}>
<a class="tooltip-info" title="Move Down" {{action (route-action 'moveDown' it)}}>
<i class="ace-icon fa fa-arrow-down bigger-120"></i>
</button>
</a>
{{/if}}
</li>
</ul>

View File

@ -1,26 +1,36 @@
{{#main-content}}
<div class="widget-box transparent">
{{#grid-header}}
{{#if ajax.user.admin}}
<li>
{{#link-to 'customer.import'}}
<i class="ace-icon fa fa-address-card-o bigger-110"></i>
Import Customers
{{#grid-header dropdownMenu=false}}
<div class="widget-menu">
{{#link-to 'customer.list.advanced-query' data-rel="tooltip" title='Advanced Query'}}
<i class="ace-icon fa fa-database"></i>
{{/link-to}}
</li>
<li>
{{#link-to 'customer-ytd-sale.import'}}
<i class="ace-icon fa fa-line-chart bigger-110"></i>
Import Sales Data
{{/link-to}}
</li>
{{/if}}
<li>
{{#link-to 'customer.list.advanced-query'}}
<i class="ace-icon fa fa-database bigger-110"></i>
Advanced Query
{{/link-to}}
</li>
<a href="#" data-action="settings" data-toggle="dropdown" data-rel="tooltip" title="Dropdown Menu">
<i class="ace-icon fa fa-bars"></i>
</a>
<ul class="dropdown-menu dropdown-menu-right dropdown-light-blue dropdown-caret dropdown-closer">
{{#if ajax.user.admin}}
<li>
{{#link-to 'customer.import'}}
<i class="ace-icon fa fa-address-card-o bigger-110"></i>
Import Customers
{{/link-to}}
</li>
<li>
{{#link-to 'customer-ytd-sale.import'}}
<i class="ace-icon fa fa-line-chart bigger-110"></i>
Import Sales Data
{{/link-to}}
</li>
{{/if}}
<li>
{{#link-to 'customer.list.advanced-query'}}
<i class="ace-icon fa fa-database bigger-110"></i>
Advanced Query
{{/link-to}}
</li>
</ul>
</div>
{{/grid-header}}
<div class="widget-body">
@ -36,7 +46,7 @@
<th>Name</th>
{{/if}}
{{#if tableOptions.showDateAdded}}
{{sortable-th name='dateAdded' text='Added'}}
{{sortable-th name='dateAdded' text='Added' class='hidden-480'}}
{{/if}}
{{#if tableOptions.showYears}}
<th>Years</th>
@ -60,7 +70,7 @@
{{sortable-th name='region' text='Region' class='hidden-480'}}
{{/if}}
{{#if tableOptions.showSalesperson}}
{{sortable-th name='salesperson' text='Salesperson'}}
{{sortable-th name='salesperson' text='Salesperson' class='hidden-480'}}
{{/if}}
{{#if tableOptions.showStatus}}
<th class="hidden-480">Status</th>
@ -97,7 +107,7 @@
</td>
{{/if}}
{{#if tableOptions.showDateAdded}}
<td>
<td class='hidden-480'>
{{date-cell value=it.dateAdded format='D/M/YYYY'}}
</td>
{{/if}}
@ -156,17 +166,17 @@
</td>
{{/if}}
{{#if tableOptions.showSalesperson}}
<td>
<td class="hidden-480">
{{it.salesperson}}
</td>
{{/if}}
{{#if tableOptions.showStatus}}
<td>
<td class="hidden-480">
{{it.statusText}}
</td>
{{/if}}
{{#if tableOptions.showIssue1}}
<td style="max-width: 32px;">
<td class="hidden-480" style="max-width: 32px;">
{{#if it.issue1}}
<div style="max-height: 48px; overflow: auto; cursor: pointer;">
{{it.issue1.issue}}
@ -184,7 +194,7 @@
</td>
{{/if}}
{{#if tableOptions.showIssue2}}
<td style="max-width: 32px">
<td class="hidden-480" style="max-width: 32px;">
{{#if it.issue2}}
<div style="max-height: 48px; overflow: auto; cursor: pointer;">
{{it.issue2.issue}}
@ -199,7 +209,7 @@
</td>
{{/if}}
{{#if tableOptions.showIssue3}}
<td style="max-width: 32px">
<td class="hidden-480" style="max-width: 32px;">
{{#if it.issue3}}
<div style="max-height: 48px; overflow: auto; cursor: pointer;">
{{it.issue3.issue}}

View File

@ -42,7 +42,7 @@
<th>
Name
</th>
<th>
<th class="hidden-480">
Name(EN)
</th>
</tr>
@ -52,7 +52,6 @@
{{log model.users}}
{{#each model.users as |u|}}
<tr>
{{log u}}
<td>
{{u.employeeId}}
</td>
@ -62,7 +61,7 @@
<td>
{{u.name}}
</td>
<td>
<td class="hidden-480">
{{u.enName}}
</td>
</tr>

View File

@ -15,11 +15,11 @@
<thead class="thin-border-bottom">
<tr>
{{sortable-th name='employeeId' text='Employee ID'}}
{{sortable-th name='account' text='Account'}}
{{sortable-th name='account' text='Account' class="hidden-480"}}
<th>
Name
</th>
{{sortable-th name='enName' text='Name(EN)'}}
{{sortable-th name='enName' text='Name(EN)' class="hidden-480"}}
<th>
Admin
</th>
@ -27,7 +27,7 @@
<i class="ace-icon fa fa-sticky-note-o bigger-110 hidden-480"></i>
Remark
</th>
<th>
<th class="hidden-480">
<i class="ace-icon fa fa-exchange bigger-110 hidden-480"></i>
Status
</th>
@ -44,13 +44,13 @@
<td>
{{it.employeeId}}
</td>
<td>
<td class="hidden-480">
{{it.account}}
</td>
<td>
{{it.name}}
</td>
<td>
<td class="hidden-480">
{{it.enName}}
</td>
<td>
@ -59,13 +59,13 @@
<td class="hidden-480">
{{editable-cell model=it field='note'}}
</td>
<td>
<td class="hidden-480">
{{status-cell model=it field='enabled' enabledText='ACTIVE' disabledText='BLOCKED'}}
</td>
<td>
<div class="hidden-sm hidden-xs btn-group">
{{status-toggle-button model=it enabledText='active' disabledText='block'}}
{{#link-to 'user.edit' it.id class='btn btn-xs btn-info' title='Edit User'}}
{{status-toggle-button model=it enabledOp='active' disabledOp='block' enabledText='Active User' disabledText='Block User'}}
{{#link-to 'user.edit' it.id class='btn btn-xs btn-info' data-rel='tooltip' title='Edit User'}}
<i class="ace-icon fa fa-pencil bigger-120"></i>
{{/link-to}}
</div>

View File

@ -62,7 +62,7 @@ module.exports = function(defaults) {
importVendor(app, 'bower_components/bootbox/bootbox.js');
importVendor(app, 'bower_components/validate/validate.js');
importVendor(app, 'bower_components/jquery-storage-api/jquery.storageapi.min.js');
// FueUX
importVendor(app, 'bower_components/fuelux/js/spinbox.js');
importVendor(app, 'bower_components/fuelux/js/tree.js');

View File

@ -1,2 +1,3 @@
# ember s --proxy http://127.0.0.1:8088/
ember s --proxy http://101.236.35.13/
rm -rf tmp dist
ember s --proxy http://127.0.0.1:8088/
# ember s --proxy http://101.236.35.13/