Repository: incubator-ignite Updated Branches: refs/heads/ignite-843 ce7c763a3 -> 1363b0b95
IGNITE-843: Reworked table add new item. Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/9716913b Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/9716913b Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/9716913b Branch: refs/heads/ignite-843 Commit: 9716913b3fc6307235c5f96e6762c58bf23e9520 Parents: ce7c763 Author: AKuznetsov <akuznet...@gridgain.com> Authored: Mon Aug 17 16:17:15 2015 +0700 Committer: AKuznetsov <akuznet...@gridgain.com> Committed: Mon Aug 17 16:17:15 2015 +0700 ---------------------------------------------------------------------- .../src/main/js/public/stylesheets/style.scss | 32 +++----- .../src/main/js/views/includes/controls.jade | 86 ++++++++++---------- 2 files changed, 51 insertions(+), 67 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9716913b/modules/control-center-web/src/main/js/public/stylesheets/style.scss ---------------------------------------------------------------------- diff --git a/modules/control-center-web/src/main/js/public/stylesheets/style.scss b/modules/control-center-web/src/main/js/public/stylesheets/style.scss index 848f211..b142597 100644 --- a/modules/control-center-web/src/main/js/public/stylesheets/style.scss +++ b/modules/control-center-web/src/main/js/public/stylesheets/style.scss @@ -18,6 +18,7 @@ $logo-path: "https://www.filepicker.io/api/file/QagunjDGRFul2JgNCAli"; $input-height: 28px; $ignite-red: #ec1c24; +$ignite-red-hover: #950d12; $ignite-block-callout-left: #248fb2; $ignite-block-callout-left-background: #f4f8fa; $ignite-block-callout-right: #50af51; @@ -176,7 +177,7 @@ hr { } .theme-line .btn-primary:hover { - background-color: #950d12; + background-color: $ignite-red-hover; } .theme-line .main-content .nav-horizontal a { @@ -390,7 +391,7 @@ hr { } .theme-line header a.btn:hover { - background-color: #950d12; + background-color: $ignite-red-hover; } .theme-line header .navbar-nav .tt-cursor { @@ -407,7 +408,7 @@ hr { } .theme-line .navbar-nav .active a:hover { - color: #950d12; + color: $ignite-red-hover; } .theme-line .main-links .links a:hover { @@ -419,7 +420,7 @@ hr { } .theme-line .main-content a:hover { - color: #950d12; + color: $ignite-red-hover; } .theme-line .sidebar-nav ul li a.active:before { @@ -431,7 +432,7 @@ hr { } .theme-line .sidebar-nav ul li a:hover, .theme-line .sidebar-nav ul li a.active:hover { - color: #950d12; + color: $ignite-red-hover; } .theme-line .main-content .nav-horizontal a.active { @@ -440,11 +441,11 @@ hr { } .theme-line .main-content .nav-horizontal a:hover { - color: #950d12; + color: $ignite-red-hover; } .theme-line .main-content .nav-horizontal a.active:hover { - border-color: #950d12; + border-color: $ignite-red-hover; } .theme-line header .navbar-nav a.active, .theme-line #versions-list li a:hover strong, .theme-line #versions-list li a.active .current, .theme-line #versions-list li a:active .current { @@ -491,7 +492,7 @@ h1, h2, h3, h4, h5, h6 { } div.submit-vote.submit-vote-parent.voted a.submit-vote-button:hover { - background-color: #950d12; + background-color: $ignite-red-hover; } a, .link .title { @@ -499,7 +500,7 @@ a, .link .title { } a:hover, .link:hover .title { - color: #950d12; + color: $ignite-red-hover; } .header h1.navbar-brand a { @@ -727,14 +728,6 @@ button .caret, .btn .caret { color: $ignite-red; font-weight: bold; } - - a:hover { - color: #950d12; - } - - a { - color: black; - } } .theme-line table.links-edit { @@ -893,11 +886,6 @@ button .caret, .btn .caret { .group-legend-tip { background: white; - padding-right: 5px; -} - -.group-legend-btn { - background: white; float: right; line-height: 20px; padding: 0 5px 0 5px; http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/9716913b/modules/control-center-web/src/main/js/views/includes/controls.jade ---------------------------------------------------------------------- diff --git a/modules/control-center-web/src/main/js/views/includes/controls.jade b/modules/control-center-web/src/main/js/views/includes/controls.jade index b2ab734..dd8b50b 100644 --- a/modules/control-center-web/src/main/js/views/includes/controls.jade +++ b/modules/control-center-web/src/main/js/views/includes/controls.jade @@ -43,8 +43,9 @@ mixin btn-save(show, click) mixin group-tip(lines) i.group-legend-tip.fa.fa-question-circle(ng-if=lines bs-tooltip='joinTip(#{lines})' type='button') -mixin group-btn-add(click, tip) - i.group-legend-btn.fa.fa-plus(ng-click=click bs-tooltip=tip) +mixin group-add(field) + div(ng-show='!tableNewItemActive(#{field})') + a(ng-click='tableNewItem(#{field})') Add mixin btn-add(click, tip) i.tipField.fa.fa-plus(ng-click=click bs-tooltip=tip) @@ -90,12 +91,9 @@ mixin table-pair(header, tblMdl, keyFld, valFld, keyPlaceholder, valPlaceholder, .group-legend label #{header}: +group-tip('field.tip') - +group-btn-add('tableNewItem(field)', 'field.addTip') - .group-content(ng-if='!((#{tblMdl} && #{tblMdl}.length > 0) || tableNewItemActive(field))') - a(ng-click='tableNewItem(field)') Add - .group-content(ng-show='(#{tblMdl} && #{tblMdl}.length > 0) || tableNewItemActive(field)') + .group-content table.col-sm-12.links-edit(id='{{::field.model}}' st-table=tblMdl) - tbody + tbody(ng-show='(#{tblMdl} && #{tblMdl}.length > 0)') tr(ng-repeat='item in #{tblMdl}') td.col-sm-12 div(ng-show='!tableEditing(field, $index)') @@ -103,10 +101,12 @@ mixin table-pair(header, tblMdl, keyFld, valFld, keyPlaceholder, valPlaceholder, +btn-remove('tableRemove(backupItem, field, $index)', 'field.removeTip') div(ng-if='tableEditing(field, $index)') +table-pair-edit('cur', keyPlaceholder, valPlaceholder, keyJavaBuildInTypes, valueJavaBuildInTypes, '{{::field.focusId}}', '$index') - tfoot(ng-show='tableNewItemActive(field)') + tfoot tr td.col-sm-12 - +table-pair-edit('new', keyPlaceholder, valPlaceholder, keyJavaBuildInTypes, valueJavaBuildInTypes, '{{::field.focusId}}', '-1') + +group-add('field') + div(ng-show='tableNewItemActive(field)') + +table-pair-edit('new', keyPlaceholder, valPlaceholder, keyJavaBuildInTypes, valueJavaBuildInTypes, '{{::field.focusId}}', '-1') mixin details-row - var lblDetailClasses = ['col-sm-4', 'details-label'] @@ -156,12 +156,9 @@ mixin details-row .group-legend label {{::detail.label}}: +group-tip('detail.tableTip') - +group-btn-add('tableNewItem(detail)', 'detail.addTip') - .group-content(ng-show='!((#{detailMdl} && #{detailMdl}.length > 0) || tableNewItemActive(detail))') - a(ng-click='tableNewItem(detail)') Add - .group-content(ng-show='(#{detailMdl} && #{detailMdl}.length > 0) || tableNewItemActive(detail)') + .group-content table.col-sm-12.links-edit-details(st-table='#{detailMdl}') - tbody + tbody(ng-show='(#{detailMdl} && #{detailMdl}.length > 0)') tr(ng-repeat='item in #{detailMdl} track by $index') td div(ng-show='!tableEditing(detail, $index)') @@ -175,13 +172,15 @@ mixin details-row .input-tip.form-group.has-feedback input.form-control(id='cur{{::detail.focusId}}' name='{{detail.model}}.edit' type='text' ng-model='detail.curValue' placeholder='{{::detail.placeholder}}' on-enter='tableSimpleSaveVisible(detail, index) && tableSimpleSave(tableSimpleValid, backupItem, detail, $index)' on-escape='tableReset()')&attributes(customValidators) +ico-exclamation('{{detail.model}}.edit', 'ipaddress', 'Invalid address, see help for format description.') - tfoot(ng-show='tableNewItemActive(detail)') + tfoot tr td.col-sm-12 - +btn-save('tableSimpleSaveVisible(detail, -1)', 'tableSimpleSave(tableSimpleValid, backupItem, detail, -1)') - .input-tip.form-group.has-feedback - input.form-control(id='new{{::detail.focusId}}' name='{{detail.model}}' type='text' ng-model='detail.newValue' ng-focus='tableNewItem(detail)' placeholder='{{::detail.placeholder}}' on-enter='tableSimpleSaveVisible(detail, -1) && tableSimpleSave(tableSimpleValid, backupItem, detail, -1)' on-escape='tableReset()')&attributes(customValidators) - +ico-exclamation('{{detail.model}}', 'ipaddress', 'Invalid address, see help for format description.') + +group-add('detail') + div(ng-show='tableNewItemActive(detail)') + +btn-save('tableSimpleSaveVisible(detail, -1)', 'tableSimpleSave(tableSimpleValid, backupItem, detail, -1)') + .input-tip.form-group.has-feedback + input.form-control(id='new{{::detail.focusId}}' name='{{detail.model}}' type='text' ng-model='detail.newValue' ng-focus='tableNewItem(detail)' placeholder='{{::detail.placeholder}}' on-enter='tableSimpleSaveVisible(detail, -1) && tableSimpleSave(tableSimpleValid, backupItem, detail, -1)' on-escape='tableReset()')&attributes(customValidators) + +ico-exclamation('{{detail.model}}', 'ipaddress', 'Invalid address, see help for format description.') mixin table-db-field-edit(prefix, focusId, index) -var databaseName = prefix + 'DatabaseName' @@ -326,12 +325,9 @@ mixin form-row-custom(lblClasses, fieldClasses, dataSource) .group-legend label {{::field.label}}: +group-tip('field.tableTip') - +group-btn-add('tableNewItem(field)', 'field.addTip') - .group-content(ng-show='!((#{fieldMdl} && #{fieldMdl}.length > 0) || tableNewItemActive(field))') - a(ng-click='tableNewItem(field)') Add - .group-content(ng-show='(#{fieldMdl} && #{fieldMdl}.length > 0) || tableNewItemActive(field)') + .group-content table.col-sm-12.links-edit(id='{{::field.model}}' st-table='#{fieldMdl}') - tbody + tbody(ng-show='(#{fieldMdl} && #{fieldMdl}.length > 0)') tr(ng-repeat='item in #{fieldMdl} track by $index') td.col-sm-12 div(ng-show='!tableEditing(field, $index)') @@ -344,12 +340,14 @@ mixin form-row-custom(lblClasses, fieldClasses, dataSource) +btn-save('tableSimpleSaveVisible(field, $index)', 'tableSimpleSave(tableSimpleValid, backupItem, field, $index)') .input-tip input.form-control(id='cur{{::field.focusId}}' type='text' ng-model='field.curValue' placeholder='{{::field.placeholder}}' on-enter='tableSimpleSaveVisible(field) && tableSimpleSave(tableSimpleValid, backupItem, field, $index)' on-escape='tableReset()') - tfoot(ng-show='tableNewItemActive(field)') + tfoot tr td.col-sm-12 - +btn-save('tableSimpleSaveVisible(field, -1)', 'tableSimpleSave(tableSimpleValid, backupItem, field, -1)') - .input-tip - input.form-control(id='new{{::field.focusId}}' type='text' ng-model='field.newValue' placeholder='{{::field.placeholder}}' on-enter='tableSimpleSaveVisible(field, -1) && tableSimpleSave(tableSimpleValid, backupItem, field, -1)' on-escape='tableReset()') + +group-add('field') + div(ng-show='tableNewItemActive(field)') + +btn-save('tableSimpleSaveVisible(field, -1)', 'tableSimpleSave(tableSimpleValid, backupItem, field, -1)') + .input-tip + input.form-control(id='new{{::field.focusId}}' type='text' ng-model='field.newValue' placeholder='{{::field.placeholder}}' on-enter='tableSimpleSaveVisible(field, -1) && tableSimpleSave(tableSimpleValid, backupItem, field, -1)' on-escape='tableReset()') .group-section(ng-switch-when='indexedTypes') +table-pair('Index key-value type pairs', fieldMdl, 'keyClass', 'valueClass', 'Key class full name', 'Value class full name', true, true) div(ng-switch-when='queryFieldsFirst' ng-hide=fieldHide) @@ -361,12 +359,9 @@ mixin form-row-custom(lblClasses, fieldClasses, dataSource) .group-legend label {{::field.label}}: +group-tip('field.tip') - +group-btn-add('tableNewItem(field)', 'field.addTip') - .group-content(ng-show='!((#{fieldMdl} && #{fieldMdl}.length > 0) || tableNewItemActive(field))') - a(ng-click='tableNewItem(field)') Add - .group-content(ng-show='(#{fieldMdl} && #{fieldMdl}.length > 0) || tableNewItemActive(field)') + .group-content table.col-sm-12.links-edit(st-table=fieldMdl) - tbody + tbody(ng-show='(#{fieldMdl} && #{fieldMdl}.length > 0)') tr(ng-repeat='item in #{fieldMdl}') td.col-sm-12 div(ng-show='!tableEditing(field, $index)') @@ -374,21 +369,20 @@ mixin form-row-custom(lblClasses, fieldClasses, dataSource) +btn-remove('tableRemove(backupItem, field, $index)', 'field.removeTip') div(ng-if='tableEditing(field, $index)') +table-db-field-edit('cur', '{{::field.focusId}}', '$index') - tfoot(ng-show='tableNewItemActive(field)') + tfoot tr - td.col-sm-12(ng-init='newDatabaseType="INTEGER"; newJavaType="Integer"') - +table-db-field-edit('new', '{{::field.focusId}}', '-1') + td.col-sm-12 + +group-add('field') + div(ng-show='tableNewItemActive(field)') + +table-db-field-edit('new', '{{::field.focusId}}', '-1') .group-section(ng-switch-when='table-query-groups' ng-hide=fieldHide) .col-sm-7.group .group-legend label {{::field.label}}: +group-tip('field.tip') - +group-btn-add('tableNewItem(field)', 'field.addTip') - .group-content(ng-show='!((#{fieldMdl} && #{fieldMdl}.length > 0) || tableNewItemActive(field))') - a(ng-click='tableNewItem(field)') Add - .group-content(ng-show='(#{fieldMdl} && #{fieldMdl}.length > 0) || tableNewItemActive(field)') + .group-content table.links-edit.col-sm-12(st-table=fieldMdl ng-init='newDirection = false') - tbody + tbody(ng-show='(#{fieldMdl} && #{fieldMdl}.length > 0)') tr(ng-repeat='group in #{fieldMdl}') td.col-sm-12 .col-sm-12(ng-show='!tableEditing(field, $index)') @@ -414,12 +408,14 @@ mixin form-row-custom(lblClasses, fieldClasses, dataSource) tr.col-sm-12(style='padding-left: 18px') td +table-group-item-edit('new', '-1') - tfoot(ng-show='tableNewItemActive(field)') + tfoot tr td.col-sm-12 - +btn-save('tableGroupSaveVisible(field, -1)', 'tableGroupSave(field, -1)') - .input-tip - input#newGroupName.form-control(type='text' ng-model='field.newGroupName' placeholder='Group name' on-enter='tableGroupSaveVisible(field, -1) && tableGroupSave(field, -1)' on-escape='tableReset()') + +group-add('field') + div(ng-show='tableNewItemActive(field)') + +btn-save('tableGroupSaveVisible(field, -1)', 'tableGroupSave(field, -1)') + .input-tip + input#newGroupName.form-control(type='text' ng-model='field.newGroupName' placeholder='Group name' on-enter='tableGroupSaveVisible(field, -1) && tableGroupSave(field, -1)' on-escape='tableReset()') mixin main-table(title, rows, focusId, click, rowTemplate) .padding-dflt(ng-show='#{rows} && #{rows}.length > 0')