Add notes for rules. Fix #1089.

This commit is contained in:
FelisCatus 2017-09-20 11:11:54 -07:00
parent f1f5eb329d
commit a536ff5d98
22 changed files with 78 additions and 1 deletions

View File

@ -716,6 +716,9 @@ msgstr "Add condition"
msgid "options_cloneRule"
msgstr "Clone"
msgid "options_ruleNote"
msgstr "Note"
msgid "options_switchAttachedProfileInCondition"
msgstr "Rule list rules"

View File

@ -717,6 +717,9 @@ msgstr "Přidat podmínku"
msgid "options_cloneRule"
msgstr "Klonovat"
msgid "options_ruleNote"
msgstr "Note"
msgid "options_switchAttachedProfileInCondition"
msgstr "Pravidlo seznamu pravidel"

View File

@ -721,6 +721,9 @@ msgstr "Add condition"
msgid "options_cloneRule"
msgstr "Clone"
msgid "options_ruleNote"
msgstr "Note"
msgid "options_switchAttachedProfileInCondition"
msgstr "Rule list rules"

View File

@ -708,6 +708,9 @@ msgstr "Add condition"
msgid "options_cloneRule"
msgstr "Clone"
msgid "options_ruleNote"
msgstr "Note"
msgid "options_switchAttachedProfileInCondition"
msgstr "Rule list rules"

View File

@ -690,6 +690,9 @@ msgstr ""
msgid "options_cloneRule"
msgstr ""
msgid "options_ruleNote"
msgstr "Note"
msgid "options_switchAttachedProfileInCondition"
msgstr ""

View File

@ -721,6 +721,9 @@ msgstr "Add condition"
msgid "options_cloneRule"
msgstr "Clone"
msgid "options_ruleNote"
msgstr "Note"
msgid "options_switchAttachedProfileInCondition"
msgstr "Rule list rules"

View File

@ -723,6 +723,9 @@ msgstr "افزودن شرط"
msgid "options_cloneRule"
msgstr "کپی"
msgid "options_ruleNote"
msgstr "Note"
msgid "options_switchAttachedProfileInCondition"
msgstr "قوانین لیست قوانین"

View File

@ -718,6 +718,9 @@ msgstr "Add condition"
msgid "options_cloneRule"
msgstr "Clone"
msgid "options_ruleNote"
msgstr "Note"
msgid "options_switchAttachedProfileInCondition"
msgstr "Rule list rules"

View File

@ -606,6 +606,9 @@ msgstr ""
msgid "options_cloneRule"
msgstr ""
msgid "options_ruleNote"
msgstr "Note"
msgid "options_switchAttachedProfileInCondition"
msgstr ""

View File

@ -711,6 +711,9 @@ msgstr "Add condition"
msgid "options_cloneRule"
msgstr "Clone"
msgid "options_ruleNote"
msgstr "Note"
msgid "options_switchAttachedProfileInCondition"
msgstr "Rule list rules"

View File

@ -626,6 +626,9 @@ msgstr ""
msgid "options_cloneRule"
msgstr ""
msgid "options_ruleNote"
msgstr "Note"
msgid "options_switchAttachedProfileInCondition"
msgstr ""

View File

@ -596,6 +596,9 @@ msgstr ""
msgid "options_cloneRule"
msgstr ""
msgid "options_ruleNote"
msgstr "Note"
msgid "options_switchAttachedProfileInCondition"
msgstr ""

View File

@ -717,6 +717,9 @@ msgstr "Add condition"
msgid "options_cloneRule"
msgstr "Clone"
msgid "options_ruleNote"
msgstr "Note"
msgid "options_switchAttachedProfileInCondition"
msgstr "Rule list rules"

View File

@ -721,6 +721,9 @@ msgstr "Add condition"
msgid "options_cloneRule"
msgstr "Clone"
msgid "options_ruleNote"
msgstr "Note"
msgid "options_switchAttachedProfileInCondition"
msgstr "Rule list rules"

View File

@ -605,6 +605,9 @@ msgstr ""
msgid "options_cloneRule"
msgstr ""
msgid "options_ruleNote"
msgstr "Note"
msgid "options_switchAttachedProfileInCondition"
msgstr ""

View File

@ -607,6 +607,9 @@ msgstr ""
msgid "options_cloneRule"
msgstr ""
msgid "options_ruleNote"
msgstr "Note"
msgid "options_switchAttachedProfileInCondition"
msgstr ""

View File

@ -718,6 +718,9 @@ msgstr "Add condition"
msgid "options_cloneRule"
msgstr "Clone"
msgid "options_ruleNote"
msgstr "Note"
msgid "options_switchAttachedProfileInCondition"
msgstr "Rule list rules"

View File

@ -747,6 +747,9 @@ msgstr "Додати умову"
msgid "options_cloneRule"
msgstr "Дублювати"
msgid "options_ruleNote"
msgstr "Note"
#, fuzzy
msgid "options_switchAttachedProfileInCondition"
msgstr "Правила списку правил"

View File

@ -633,6 +633,9 @@ msgstr "添加条件"
msgid "options_cloneRule"
msgstr "克隆"
msgid "options_ruleNote"
msgstr "备注"
msgid "options_switchAttachedProfileInCondition"
msgstr "规则列表规则"

View File

@ -633,6 +633,9 @@ msgstr "添加條件"
msgid "options_cloneRule"
msgstr "克隆"
msgid "options_ruleNote"
msgstr "備註"
msgid "options_switchAttachedProfileInCondition"
msgstr "規則列表規則"

View File

@ -244,6 +244,16 @@ angular.module('omega').controller 'SwitchProfileCtrl', ($scope, $rootScope,
input[0]?.focus()
input[0]?.select()
$scope.showNotes = false
$scope.addNote = (index) ->
$scope.showNotes = true
unwatchRulesShowNote()
unwatchRulesShowNote = $scope.$watch 'profile.rules', ((rules) ->
if rules and rules.some((rule) -> !!rule.note)
$scope.showNotes = true
unwatchRulesShowNote()
), true
$scope.resetRules = ->
scope = $scope.$new('isolate')
scope.ruleProfile =

View File

@ -58,6 +58,7 @@ div(ng-controller='SwitchProfileCtrl')
th {{'options_conditionDetails' | tr}}
th {{'options_resultProfile' | tr}}
th {{'options_conditionActions' | tr}}
th(ng-if='showNotes') {{'options_ruleNote' | tr}}
tbody(ui-sortable='sortableOptions' ng-model='profile.rules')
tr.switch-rule-row(ng-repeat='rule in profile.rules')
td.sort-bar
@ -105,10 +106,14 @@ div(ng-controller='SwitchProfileCtrl')
= ' '
button.btn.btn-default.btn-sm(title="{{'options_cloneRule' | tr}}" ng-click='cloneRule($index)')
span.glyphicon.glyphicon-duplicate
button.btn.btn-default.btn-sm(title="{{'options_ruleNote' | tr}}" ng-if='!showNotes' ng-click='addNote($index)')
span.glyphicon.glyphicon-comment
td(ng-if='showNotes')
input.form-control(ng-model='rule.note')
tbody
tr
td(style='border-right: none;')
td(style='border-left: none;', colspan='4')
td(style='border-left: none;' colspan='4' ng-attr-colspan='{{showNotes ? 5 : 4}}')
button.btn.btn-default.btn-sm(ng-click='addRule()')
span.glyphicon.glyphicon-plus
= ' '
@ -133,6 +138,7 @@ div(ng-controller='SwitchProfileCtrl')
td
button.btn.btn-danger.btn-sm(title="{{'options_deleteAttached' | tr}}" ng-click='removeAttached()')
span.glyphicon.glyphicon-trash
td(ng-if='showNotes')
tbody
tr.switch-default-row
td
@ -143,6 +149,7 @@ div(ng-controller='SwitchProfileCtrl')
td
button.btn.btn-info.btn-sm(title="{{'options_resetRules_help' | tr}}" ng-click='resetRules()')
span.glyphicon.glyphicon-chevron-up
td(ng-if='showNotes')
section.settings-group(ng-if='!attached')
h3 {{'options_group_attachProfile' | tr}}
p.help-block {{'options_attachProfileHelp' | tr}}