diff options
| author | jpl | 2017-02-06 19:26:48 +0100 |
|---|---|---|
| committer | jpl | 2017-02-06 19:26:48 +0100 |
| commit | 88108dd65028d73c13ddce43e25d0d204081fde3 (patch) | |
| tree | 0deef6629e6de7deafb35612e64cf3bdef14e68d | |
| parent | ba8b51d0a9d5bf0811dd76c0bb695b95f42fe437 (diff) | |
| download | chouette-core-88108dd65028d73c13ddce43e25d0d204081fde3.tar.bz2 | |
Refs #2535: starting with select_toolbox comp.
| -rw-r--r-- | app/assets/stylesheets/components/_tables.sass | 38 | ||||
| -rw-r--r-- | app/helpers/newapplication_helper.rb | 22 | ||||
| -rw-r--r-- | app/views/workbenches/show.html.slim | 2 |
3 files changed, 62 insertions, 0 deletions
diff --git a/app/assets/stylesheets/components/_tables.sass b/app/assets/stylesheets/components/_tables.sass index e97ee3d7a..caebc22e0 100644 --- a/app/assets/stylesheets/components/_tables.sass +++ b/app/assets/stylesheets/components/_tables.sass @@ -52,3 +52,41 @@ text-decoration: none font-weight: 700 color: inherit + +// select_toolbox +.select_toolbox + padding: 10px + background-color: #fff + box-shadow: 0 0 3px $darkgrey + position: fixed + z-index: 999 + right: 50px + bottom: 15px + + > ul + display: block + margin: 0 + padding: 0 + text-align: center + + > .st_action + display: inline-block + width: 35px + height: 35px + margin: 5px + + > a + display: block + height: 35px + text-align: center + line-height: 35px + border-radius: 50% + background-color: $blue + color: #fff + + &:hover + background-color: rgba($blue, 0.5) + + > .info-msg + font-style: italic + font-size: 0.85em diff --git a/app/helpers/newapplication_helper.rb b/app/helpers/newapplication_helper.rb index 70b16ce01..0311019cd 100644 --- a/app/helpers/newapplication_helper.rb +++ b/app/helpers/newapplication_helper.rb @@ -150,6 +150,28 @@ module NewapplicationHelper end end + # Actions on select toolbox + def select_toolbox collection, actions + tools = content_tag :ul do + actions.collect do |action| + + actitem = link_to '#', title: t("table.#{action}") do + if action == :edit + content_tag :span, '', class: 'fa fa-pencil' + elsif action == :delete + content_tag :span, '', class: 'fa fa-trash' + end + end + + content_tag :li, actitem, class: 'st_action' + end.join.html_safe + + end + content_tag :div, '', class: 'select_toolbox' do + tools.concat(content_tag(:span, "n élément(s) sélectionné(s)", class: 'info-msg')) + end + end + # Replacement message def replacement_msg text content_tag :div, '', class: 'alert alert-warning' do diff --git a/app/views/workbenches/show.html.slim b/app/views/workbenches/show.html.slim index 61175db98..a8cc585f3 100644 --- a/app/views/workbenches/show.html.slim +++ b/app/views/workbenches/show.html.slim @@ -46,6 +46,8 @@ :selectable, 'table' + = select_toolbox [:edit, :delete] + = new_pagination @wbench_refs, 'pull-right' - else |
