diff --git a/omega-locales/ach/LC_MESSAGES/omega-web.po b/omega-locales/ach/LC_MESSAGES/omega-web.po index 40e6b91..1ae84bb 100644 --- a/omega-locales/ach/LC_MESSAGES/omega-web.po +++ b/omega-locales/ach/LC_MESSAGES/omega-web.po @@ -716,6 +716,9 @@ msgstr "Add condition" msgid "options_cloneRule" msgstr "Clone" +msgid "options_ruleNote" +msgstr "Note" + msgid "options_switchAttachedProfileInCondition" msgstr "Rule list rules" diff --git a/omega-locales/cs/LC_MESSAGES/omega-web.po b/omega-locales/cs/LC_MESSAGES/omega-web.po index 3db9f45..225eee3 100644 --- a/omega-locales/cs/LC_MESSAGES/omega-web.po +++ b/omega-locales/cs/LC_MESSAGES/omega-web.po @@ -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" diff --git a/omega-locales/de/LC_MESSAGES/omega-web.po b/omega-locales/de/LC_MESSAGES/omega-web.po index a2bde8a..fff3c8e 100644 --- a/omega-locales/de/LC_MESSAGES/omega-web.po +++ b/omega-locales/de/LC_MESSAGES/omega-web.po @@ -721,6 +721,9 @@ msgstr "Add condition" msgid "options_cloneRule" msgstr "Clone" +msgid "options_ruleNote" +msgstr "Note" + msgid "options_switchAttachedProfileInCondition" msgstr "Rule list rules" diff --git a/omega-locales/en_US/LC_MESSAGES/omega-web.po b/omega-locales/en_US/LC_MESSAGES/omega-web.po index 232993f..b82640b 100644 --- a/omega-locales/en_US/LC_MESSAGES/omega-web.po +++ b/omega-locales/en_US/LC_MESSAGES/omega-web.po @@ -708,6 +708,9 @@ msgstr "Add condition" msgid "options_cloneRule" msgstr "Clone" +msgid "options_ruleNote" +msgstr "Note" + msgid "options_switchAttachedProfileInCondition" msgstr "Rule list rules" diff --git a/omega-locales/es/LC_MESSAGES/omega-web.po b/omega-locales/es/LC_MESSAGES/omega-web.po index 1dbd1fe..babc66c 100644 --- a/omega-locales/es/LC_MESSAGES/omega-web.po +++ b/omega-locales/es/LC_MESSAGES/omega-web.po @@ -690,6 +690,9 @@ msgstr "" msgid "options_cloneRule" msgstr "" +msgid "options_ruleNote" +msgstr "Note" + msgid "options_switchAttachedProfileInCondition" msgstr "" diff --git a/omega-locales/es_AR/LC_MESSAGES/omega-web.po b/omega-locales/es_AR/LC_MESSAGES/omega-web.po index f9f50c8..c0124f9 100644 --- a/omega-locales/es_AR/LC_MESSAGES/omega-web.po +++ b/omega-locales/es_AR/LC_MESSAGES/omega-web.po @@ -721,6 +721,9 @@ msgstr "Add condition" msgid "options_cloneRule" msgstr "Clone" +msgid "options_ruleNote" +msgstr "Note" + msgid "options_switchAttachedProfileInCondition" msgstr "Rule list rules" diff --git a/omega-locales/fa/LC_MESSAGES/omega-web.po b/omega-locales/fa/LC_MESSAGES/omega-web.po index 15a21e9..ea8a326 100644 --- a/omega-locales/fa/LC_MESSAGES/omega-web.po +++ b/omega-locales/fa/LC_MESSAGES/omega-web.po @@ -723,6 +723,9 @@ msgstr "افزودن شرط" msgid "options_cloneRule" msgstr "کپی" +msgid "options_ruleNote" +msgstr "Note" + msgid "options_switchAttachedProfileInCondition" msgstr "قوانین لیست قوانین" diff --git a/omega-locales/fr/LC_MESSAGES/omega-web.po b/omega-locales/fr/LC_MESSAGES/omega-web.po index 405d010..e781152 100644 --- a/omega-locales/fr/LC_MESSAGES/omega-web.po +++ b/omega-locales/fr/LC_MESSAGES/omega-web.po @@ -718,6 +718,9 @@ msgstr "Add condition" msgid "options_cloneRule" msgstr "Clone" +msgid "options_ruleNote" +msgstr "Note" + msgid "options_switchAttachedProfileInCondition" msgstr "Rule list rules" diff --git a/omega-locales/is/LC_MESSAGES/omega-web.po b/omega-locales/is/LC_MESSAGES/omega-web.po index f7ef97c..e68dfa1 100644 --- a/omega-locales/is/LC_MESSAGES/omega-web.po +++ b/omega-locales/is/LC_MESSAGES/omega-web.po @@ -606,6 +606,9 @@ msgstr "" msgid "options_cloneRule" msgstr "" +msgid "options_ruleNote" +msgstr "Note" + msgid "options_switchAttachedProfileInCondition" msgstr "" diff --git a/omega-locales/ja/LC_MESSAGES/omega-web.po b/omega-locales/ja/LC_MESSAGES/omega-web.po index 69c30d8..5c2686b 100644 --- a/omega-locales/ja/LC_MESSAGES/omega-web.po +++ b/omega-locales/ja/LC_MESSAGES/omega-web.po @@ -711,6 +711,9 @@ msgstr "Add condition" msgid "options_cloneRule" msgstr "Clone" +msgid "options_ruleNote" +msgstr "Note" + msgid "options_switchAttachedProfileInCondition" msgstr "Rule list rules" diff --git a/omega-locales/nb_NO/LC_MESSAGES/omega-web.po b/omega-locales/nb_NO/LC_MESSAGES/omega-web.po index 9f76ba9..f847772 100644 --- a/omega-locales/nb_NO/LC_MESSAGES/omega-web.po +++ b/omega-locales/nb_NO/LC_MESSAGES/omega-web.po @@ -626,6 +626,9 @@ msgstr "" msgid "options_cloneRule" msgstr "" +msgid "options_ruleNote" +msgstr "Note" + msgid "options_switchAttachedProfileInCondition" msgstr "" diff --git a/omega-locales/nl/LC_MESSAGES/omega-web.po b/omega-locales/nl/LC_MESSAGES/omega-web.po index c3af900..f2efb95 100644 --- a/omega-locales/nl/LC_MESSAGES/omega-web.po +++ b/omega-locales/nl/LC_MESSAGES/omega-web.po @@ -596,6 +596,9 @@ msgstr "" msgid "options_cloneRule" msgstr "" +msgid "options_ruleNote" +msgstr "Note" + msgid "options_switchAttachedProfileInCondition" msgstr "" diff --git a/omega-locales/pt_BR/LC_MESSAGES/omega-web.po b/omega-locales/pt_BR/LC_MESSAGES/omega-web.po index 2f3b8de..f2956c2 100644 --- a/omega-locales/pt_BR/LC_MESSAGES/omega-web.po +++ b/omega-locales/pt_BR/LC_MESSAGES/omega-web.po @@ -717,6 +717,9 @@ msgstr "Add condition" msgid "options_cloneRule" msgstr "Clone" +msgid "options_ruleNote" +msgstr "Note" + msgid "options_switchAttachedProfileInCondition" msgstr "Rule list rules" diff --git a/omega-locales/ru/LC_MESSAGES/omega-web.po b/omega-locales/ru/LC_MESSAGES/omega-web.po index 08162b9..7ca2856 100644 --- a/omega-locales/ru/LC_MESSAGES/omega-web.po +++ b/omega-locales/ru/LC_MESSAGES/omega-web.po @@ -721,6 +721,9 @@ msgstr "Add condition" msgid "options_cloneRule" msgstr "Clone" +msgid "options_ruleNote" +msgstr "Note" + msgid "options_switchAttachedProfileInCondition" msgstr "Rule list rules" diff --git a/omega-locales/sk/LC_MESSAGES/omega-web.po b/omega-locales/sk/LC_MESSAGES/omega-web.po index 6bc5fc2..55848bd 100644 --- a/omega-locales/sk/LC_MESSAGES/omega-web.po +++ b/omega-locales/sk/LC_MESSAGES/omega-web.po @@ -605,6 +605,9 @@ msgstr "" msgid "options_cloneRule" msgstr "" +msgid "options_ruleNote" +msgstr "Note" + msgid "options_switchAttachedProfileInCondition" msgstr "" diff --git a/omega-locales/sl/LC_MESSAGES/omega-web.po b/omega-locales/sl/LC_MESSAGES/omega-web.po index 4f64ea4..ee61ac4 100644 --- a/omega-locales/sl/LC_MESSAGES/omega-web.po +++ b/omega-locales/sl/LC_MESSAGES/omega-web.po @@ -607,6 +607,9 @@ msgstr "" msgid "options_cloneRule" msgstr "" +msgid "options_ruleNote" +msgstr "Note" + msgid "options_switchAttachedProfileInCondition" msgstr "" diff --git a/omega-locales/tr/LC_MESSAGES/omega-web.po b/omega-locales/tr/LC_MESSAGES/omega-web.po index 7911f94..5fda874 100644 --- a/omega-locales/tr/LC_MESSAGES/omega-web.po +++ b/omega-locales/tr/LC_MESSAGES/omega-web.po @@ -718,6 +718,9 @@ msgstr "Add condition" msgid "options_cloneRule" msgstr "Clone" +msgid "options_ruleNote" +msgstr "Note" + msgid "options_switchAttachedProfileInCondition" msgstr "Rule list rules" diff --git a/omega-locales/uk/LC_MESSAGES/omega-web.po b/omega-locales/uk/LC_MESSAGES/omega-web.po index 89dc4db..8d7d8a5 100644 --- a/omega-locales/uk/LC_MESSAGES/omega-web.po +++ b/omega-locales/uk/LC_MESSAGES/omega-web.po @@ -747,6 +747,9 @@ msgstr "Додати умову" msgid "options_cloneRule" msgstr "Дублювати" +msgid "options_ruleNote" +msgstr "Note" + #, fuzzy msgid "options_switchAttachedProfileInCondition" msgstr "Правила списку правил" diff --git a/omega-locales/zh_CN/LC_MESSAGES/omega-web.po b/omega-locales/zh_CN/LC_MESSAGES/omega-web.po index 80492cc..e61823c 100644 --- a/omega-locales/zh_CN/LC_MESSAGES/omega-web.po +++ b/omega-locales/zh_CN/LC_MESSAGES/omega-web.po @@ -633,6 +633,9 @@ msgstr "添加条件" msgid "options_cloneRule" msgstr "克隆" +msgid "options_ruleNote" +msgstr "备注" + msgid "options_switchAttachedProfileInCondition" msgstr "规则列表规则" diff --git a/omega-locales/zh_TW/LC_MESSAGES/omega-web.po b/omega-locales/zh_TW/LC_MESSAGES/omega-web.po index 171f516..1a9a9b5 100644 --- a/omega-locales/zh_TW/LC_MESSAGES/omega-web.po +++ b/omega-locales/zh_TW/LC_MESSAGES/omega-web.po @@ -633,6 +633,9 @@ msgstr "添加條件" msgid "options_cloneRule" msgstr "克隆" +msgid "options_ruleNote" +msgstr "備註" + msgid "options_switchAttachedProfileInCondition" msgstr "規則列表規則" diff --git a/omega-web/src/omega/controllers/switch_profile.coffee b/omega-web/src/omega/controllers/switch_profile.coffee index 76e785a..a2c628d 100644 --- a/omega-web/src/omega/controllers/switch_profile.coffee +++ b/omega-web/src/omega/controllers/switch_profile.coffee @@ -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 = diff --git a/omega-web/src/partials/profile_switch.jade b/omega-web/src/partials/profile_switch.jade index 99f9a25..007b227 100644 --- a/omega-web/src/partials/profile_switch.jade +++ b/omega-web/src/partials/profile_switch.jade @@ -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}}