-
-
Notifications
You must be signed in to change notification settings - Fork 729
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding new help-modal dialog, use for explaining tag rule UI
- Loading branch information
Showing
9 changed files
with
60 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
app/assets/javascripts/admin/utils/directives/help-modal.js.coffee
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
angular.module("admin.utils").directive 'helpModal', ($compile, $templateCache, $window, DialogDefaults) -> | ||
restrict: 'C' | ||
scope: | ||
template: '@' | ||
link: (scope, element, attr) -> | ||
# Compile modal template | ||
template = $compile($templateCache.get(scope.template))(scope) | ||
|
||
# Load Dialog Options | ||
template.dialog(DialogDefaults) | ||
|
||
# Link opening of dialog to click event on element | ||
element.bind 'click', (e) -> template.dialog('open') | ||
|
||
scope.close = -> | ||
template.dialog('close') | ||
return |
10 changes: 10 additions & 0 deletions
10
app/assets/javascripts/admin/utils/services/dialog_defaults.js.coffee
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
angular.module("admin.utils").factory "DialogDefaults", ($window) -> | ||
show: { effect: "fade", duration: 400 } | ||
hide: { effect: "fade", duration: 300 } | ||
autoOpen: false | ||
resizable: false | ||
width: $window.innerWidth * 0.4; | ||
modal: true | ||
open: (event, ui) -> | ||
$('.ui-widget-overlay').bind 'click', -> | ||
$(this).siblings('.ui-dialog').find('.ui-dialog-content').dialog('close') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
angular.module("admin.utils", ["ngSanitize"]) | ||
angular.module("admin.utils", ["templates", "ngSanitize"]) |
18 changes: 18 additions & 0 deletions
18
app/assets/javascripts/templates/admin/modals/tag_rule_help.html.haml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#tag-rule-help | ||
.margin-bottom-30.text-center | ||
.text-big Tag Rules | ||
|
||
.margin-bottom-30 | ||
.text-normal Overview | ||
%p Tag rules provide a way to describe which items are visible or otherwise to which customers. Items can be Shipping Methods, Payment Methods, Products and Order Cycles. | ||
|
||
.margin-bottom-30 | ||
.text-normal 'By Default...' Rules | ||
%p Default rules allow you to hide items so that they are not visible by default. This behaviour can then be overriden by non-default rules for customers with particular tags. | ||
|
||
.margin-bottom-30 | ||
.text-normal 'Customers Tagged...' Rules | ||
%p By creating rules related to a specific customer tag, you can override the default behaviour (whether it be to show or to hide items) for customers with the specified tag. | ||
|
||
.text-center | ||
%input.button.red.icon-plus{ type: 'button', value: 'Got it', ng: { click: 'close()' } } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
.ui-dialog { | ||
p { | ||
line-height: 2; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,6 +35,9 @@ tags-input { | |
tr { | ||
td { | ||
border: none; | ||
h5 { | ||
display: inline-block; | ||
} | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters