aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorjpl2017-07-17 14:41:11 +0200
committerjpl2017-07-17 14:41:56 +0200
commit655bd61e19ecf68f5c4b90966d619bde0990aa25 (patch)
tree1872fa52939903ecf3b6fdd8d5b0db8f9206fcaa /app
parent778af76259115843d728a1a4983cabd510ad8c4b (diff)
downloadchouette-core-655bd61e19ecf68f5c4b90966d619bde0990aa25.tar.bz2
Refs #4108: adding workbenches#index
Diffstat (limited to 'app')
-rw-r--r--app/assets/stylesheets/_layout.sass10
-rw-r--r--app/assets/stylesheets/components/_panels.sass22
-rw-r--r--app/assets/stylesheets/old_application.sass.erb62
-rw-r--r--app/controllers/workbenches_controller.rb8
-rw-r--r--app/views/layouts/navigation/_main_nav_left.html.slim2
-rw-r--r--app/views/workbenches/index.html.slim69
6 files changed, 109 insertions, 64 deletions
diff --git a/app/assets/stylesheets/_layout.sass b/app/assets/stylesheets/_layout.sass
index c19d9b054..b6b91b2a5 100644
--- a/app/assets/stylesheets/_layout.sass
+++ b/app/assets/stylesheets/_layout.sass
@@ -28,3 +28,13 @@ body
// width: 75%
border-bottom: 1px solid rgba($blue, 0.5)
margin: 30px auto 45px auto
+
+.content_header
+ font-size: 2.2rem
+ font-weight: normal
+ margin: 40px 0
+ padding: 0px 15px 9px 15px
+ border-bottom: 1px solid #eee
+
+ &:first-child
+ margin-top: 0
diff --git a/app/assets/stylesheets/components/_panels.sass b/app/assets/stylesheets/components/_panels.sass
index ff384faf9..e9f615081 100644
--- a/app/assets/stylesheets/components/_panels.sass
+++ b/app/assets/stylesheets/components/_panels.sass
@@ -17,9 +17,31 @@
border-bottom: 2px solid $darkgrey
padding: 5px 15px
+ .badge
+ color: #fff
+ background-color: $grey
+
> h3, > h4
margin: 0
+ > .panel-title.with_actions
+ display: table
+ width: 100%
+
+ .badge
+ vertical-align: top
+
+ a
+ text-decoration: none
+ color: $blue
+
+ &:hover, &:focus
+ color: $darkblue
+
+ > div
+ display: table-cell
+ vertical-align: middle
+
.panel-footer
padding: 5px 15px
background-color: transparent
diff --git a/app/assets/stylesheets/old_application.sass.erb b/app/assets/stylesheets/old_application.sass.erb
deleted file mode 100644
index 3443a035d..000000000
--- a/app/assets/stylesheets/old_application.sass.erb
+++ /dev/null
@@ -1,62 +0,0 @@
-// First import journal variables
-$brand-primary: <%= ChouetteIhm::Application.config.company_theme %>
-$navbar-default-bg: $brand-primary
-$navbar-default-link-color: white
-$body-bg: #eee
-
-// Then bootstrap itself
-@import 'bootstrap-sass-official/_bootstrap-sprockets.scss'
-@import 'bootstrap-sass-official'
-
-// Whatever application styles you have go last
-// Modules and Variables
-@import 'modules/search'
-@import 'modules/index_item'
-@import 'modules/icons'
-@import 'modules/devise'
-@import 'modules/progress_bars'
-
-// Partials
-@import 'partials/base'
-@import 'partials/header'
-@import 'partials/footer'
-
-// Third-party
-@import 'tagmanager/tagmanager'
-@import 'font-awesome-sprockets'
-@import 'font-awesome'
-@import 'jquery-ui'
-@import 'formtastic'
-@import 'eonasdan-bootstrap-datetimepicker'
-@import 'footable'
-@import 'OpenLayers/ol'
-@import 'OpenLayers/custom'
-
-// Select2, themed w. Bootstrap
-@import 'select2'
-@import 'select2-bootstrap'
-
-@import 'vendor/openlayers_style'
-@import 'vendor/openlayers_ie6-style'
-@import 'vendor/openlayers_google'
-@import 'vendor/openlayers_framedCloud'
-@import 'vendor/formtastic_changes'
-@import 'vendor/pagination'
-@import 'vendor/map_layers'
-@import 'vendor/token-input'
-@import 'vendor/typeahead'
-@import 'vendor/bootstrap_changes'
-@import 'vendor/simple_form'
-// Select2
-@import 'vendor/select2'
-@import 'vendor/select2-bootstrap'
-
-// Main css
-@import 'main/*'
-
-// Components
-@import 'components/*'
-
-// Hack to make li simple
-li
- list-style: none
diff --git a/app/controllers/workbenches_controller.rb b/app/controllers/workbenches_controller.rb
index 22a71863a..171db6a07 100644
--- a/app/controllers/workbenches_controller.rb
+++ b/app/controllers/workbenches_controller.rb
@@ -2,7 +2,13 @@ class WorkbenchesController < BreadcrumbController
before_action :query_params, only: [:show]
defaults resource_class: Workbench
- respond_to :html, only: [:show]
+ respond_to :html, only: [:show, :index]
+
+ def index
+ # Only display Wb with selected name, according to #4108
+ @workbench = current_organisation.workbenches.find_by(name: "Gestion de l'offre")
+ @calendars = Calendar.where('organisation_id = ? OR shared = ?', current_organisation.id, true)
+ end
def show
scope = resource.all_referentials
diff --git a/app/views/layouts/navigation/_main_nav_left.html.slim b/app/views/layouts/navigation/_main_nav_left.html.slim
index 3cf6428af..9dfc828c0 100644
--- a/app/views/layouts/navigation/_main_nav_left.html.slim
+++ b/app/views/layouts/navigation/_main_nav_left.html.slim
@@ -16,7 +16,7 @@
#miOne.panel-collapse.collapse
.list-group
- = link_to root_path, class: "list-group-item #{(@localizationUrl == 'referentials#index') ? 'active' : ''}" do
+ = link_to root_path, class: "list-group-item #{(@localizationUrl == 'workbenches#index') ? 'active' : ''}" do
span Tableau de bord
= link_to '#', class: 'list-group-item' do
span Offre de mon organisation
diff --git a/app/views/workbenches/index.html.slim b/app/views/workbenches/index.html.slim
new file mode 100644
index 000000000..0ce1085d0
--- /dev/null
+++ b/app/views/workbenches/index.html.slim
@@ -0,0 +1,69 @@
+/ PageHeader
+= pageheader 'map-marker',
+ t('.title', organisation: current_organisation.name)
+
+/ PageContent
+.page_content
+ .container-fluid
+ .row
+ .col-lg-12
+ h2.content_header = t('.offers.title')
+
+ .row
+ .col-lg-6.col-md-6.col-sm-6.col-xs-12
+ .panel.panel-default
+ .panel-heading
+ h3.panel-title
+ = t('.offers.organisation')
+
+ .panel-body
+ em.small.text-muted = t('.offers.no_content')
+
+ .panel.panel-default
+ .panel-heading
+ h3.panel-title
+ = t('.offers.idf')
+
+ .panel-body
+ em.small.text-muted = t('.offers.no_content')
+
+ .col-lg-6.col-md-6.col-sm-6.col-xs-12
+ .panel.panel-default
+ .panel-heading
+ h3.panel-title.with_actions
+ div
+ = t('.offers.referentials')
+ span.badge.ml-xs = @workbench.referentials.count if @workbench.referentials.any?
+
+ - if @workbench.referentials.any?
+ div
+ = link_to '', workbench_path(@workbench), class: ' fa fa-chevron-right pull-right', title: t('.offers.see')
+
+ - if @workbench.referentials.any?
+ .list-group
+ - @workbench.referentials.each do |referential|
+ = link_to referential.name, referential_path(referential), class: 'list-group-item'
+
+ - else
+ .panel-body
+ em.small.text-muted = t('.offers.no_content')
+
+ .panel.panel-default
+ .panel-heading
+ h3.panel-title.with_actions
+ div
+ = t('.offers.calendars')
+ span.badge.ml-xs = @calendars.count if @calendars.any?
+
+ - if @calendars.any?
+ div
+ = link_to '', calendars_path, class: ' fa fa-chevron-right pull-right', title: t('.offers.see')
+
+ - if @calendars.any?
+ .list-group
+ - @calendars.each do |calendar|
+ = link_to calendar.name, calendar_path(calendar), class: 'list-group-item'
+
+ - else
+ .panel-body
+ em.small.text-muted = t('.offers.no_content')