diff --git a/app/assets/javascripts/admin/index_utils/directives/save_bar.js.coffee b/app/assets/javascripts/admin/index_utils/directives/save_bar.js.coffee new file mode 100644 index 0000000000..a991592d42 --- /dev/null +++ b/app/assets/javascripts/admin/index_utils/directives/save_bar.js.coffee @@ -0,0 +1,7 @@ +angular.module("admin.indexUtils").directive "saveBar", -> + restrict: "E" + scope: + save: "&" + saving: "&" + dirty: "&" + templateUrl: "admin/save_bar.html" diff --git a/app/assets/javascripts/templates/admin/save_bar.html.haml b/app/assets/javascripts/templates/admin/save_bar.html.haml new file mode 100644 index 0000000000..c028427875 --- /dev/null +++ b/app/assets/javascripts/templates/admin/save_bar.html.haml @@ -0,0 +1,10 @@ +#save-bar.animate-show{ ng: { show: 'dirty()' } } + .twelve.columns.alpha + %h5{ ng: { show: "dirty() && !saving()" } } + You have made unsaved changes + %h5{ ng: { hide: "dirty() || saving()" } } + All changes saved + %h5{ ng: { show: "saving()" } } + Saving... + .four.columns.omega.text-right + %input.red{type: "button", value: "Save Changes", ng: { click: "save()" } } diff --git a/app/assets/stylesheets/admin/animations.css.sass b/app/assets/stylesheets/admin/animations.css.sass new file mode 100644 index 0000000000..88284c7487 --- /dev/null +++ b/app/assets/stylesheets/admin/animations.css.sass @@ -0,0 +1,35 @@ +@-webkit-keyframes slideInUp + 0% + -webkit-transform: translateY(20px) + transform: translateY(20px) + 100% + -webkit-transform: translateY(0) + transform: translateY(0) + +// @-webkit-keyframes slideOutDown +// 0% +// -webkit-transform: translateY(0) +// transform: translateY(0) +// 100% +// -webkit-transform: translateY(20px) +// transform: translateY(20px) + +.animate-show + -webkit-animation-name: slideInUp + animation-name: slideInUp + -webkit-animation-duration: 0.3s + animation-duration: 0.3s + -webkit-animation-fill-mode: both + animation-fill-mode: both + // line-height: 20px + // opacity: 1 + + // &.ng-hide + // -webkit-animation-name: slideOutDown + // animation-name: slideOutDown + // -webkit-animation-duration: 0.5s + // animation-duration: 0.5s + // -webkit-animation-fill-mode: both + // animation-fill-mode: both + // // line-height: 20px + // // opacity: 1 diff --git a/app/assets/stylesheets/admin/components/save_bar.sass b/app/assets/stylesheets/admin/components/save_bar.sass new file mode 100644 index 0000000000..c6b1236490 --- /dev/null +++ b/app/assets/stylesheets/admin/components/save_bar.sass @@ -0,0 +1,9 @@ +#save-bar + position: fixed + bottom: 0px + padding: 8px 10px + font-weight: bold + background-color: #fff + color: #5498da + h5 + color: #5498da