diff --git a/app/assets/javascripts/admin/dropdown/directives/links_dropdown.js.coffee b/app/assets/javascripts/admin/dropdown/directives/links_dropdown.js.coffee new file mode 100644 index 0000000000..a58688a542 --- /dev/null +++ b/app/assets/javascripts/admin/dropdown/directives/links_dropdown.js.coffee @@ -0,0 +1,5 @@ + angular.module("admin.dropdown").directive "linksDropdown", ($window)-> + restrict: "C" + scope: + links: "=" + templateUrl: "admin/links_dropdown.html" diff --git a/app/assets/javascripts/templates/admin/links_dropdown.html.haml b/app/assets/javascripts/templates/admin/links_dropdown.html.haml new file mode 100644 index 0000000000..1f44f2418c --- /dev/null +++ b/app/assets/javascripts/templates/admin/links_dropdown.html.haml @@ -0,0 +1,10 @@ +.ofn-drop-down + %span + %i.icon-check + Actions + %i{ 'ng-class' => "expanded && 'icon-caret-up' || !expanded && 'icon-caret-down'" } + %div.menu{ 'ng-show' => "expanded", style: 'width: 200px' } + %a.menu_item{ 'ng-repeat' => "link in links", href: '{{link.url}}', target: "{{link.target || '_self'}}", data: { method: "{{ link.method || 'get' }}", confirm: "{{link.confirm}}" }, style: 'display: inline-block; width: 100%' } + %span{ :style => 'text-align: center; display: inline-block; width: 20%'} + %i{ ng: { class: "link.icon" } } + %span{ style: "display: inline-block; width: auto"} {{ link.name }}