From e6c7d0f70da5f94eba72e418b34b699d6bdddda3 Mon Sep 17 00:00:00 2001 From: jpl Date: Wed, 19 Apr 2017 18:12:07 +0200 Subject: Refs #2982: updating integration for month_selector --- .../time_tables/components/Navigate.js | 98 ++++++++++++++-------- app/assets/stylesheets/modules/_timetables.sass | 21 +++++ 2 files changed, 82 insertions(+), 37 deletions(-) diff --git a/app/assets/javascripts/es6_browserified/time_tables/components/Navigate.js b/app/assets/javascripts/es6_browserified/time_tables/components/Navigate.js index df8c6e844..5db373f9c 100644 --- a/app/assets/javascripts/es6_browserified/time_tables/components/Navigate.js +++ b/app/assets/javascripts/es6_browserified/time_tables/components/Navigate.js @@ -16,44 +16,68 @@ let Navigate = ({ dispatch, metas, timetable, pagination, status, filters}) => {
-
{e.preventDefault()}}> - - - -
+ {_.map(pagination.periode_range, (month, i) => ( +
  • + +
  • + ))} + +
    +
    + + {/* prev/next */} +
    +
    + + +
    +
    +
    diff --git a/app/assets/stylesheets/modules/_timetables.sass b/app/assets/stylesheets/modules/_timetables.sass index e44a254c5..9122fedb2 100644 --- a/app/assets/stylesheets/modules/_timetables.sass +++ b/app/assets/stylesheets/modules/_timetables.sass @@ -13,6 +13,9 @@ padding-top: 123px transform: translateY(-1.4em) + .t2e-item-list > div + border-color: #fff + .t2e-item .th padding: 6px 0 0 0 @@ -94,3 +97,21 @@ left: 8px top: 6px z-index: 5 + + .form-group > .month_selector + > .btn.btn-default + background-color: rgba($grey, 0.15) + color: $darkgrey + border: none + border-radius: 0 + padding: 8px 15px 7px 15px + + > .caret + margin-left: 10px + color: $blue + + > .dropdown-menu + margin-top: 1px + border-radius: 0 0 4px 4px + max-height: 230px + overflow: auto -- cgit v1.2.3 From 26923fae9be9b73bf6922f61421f20273dea9481 Mon Sep 17 00:00:00 2001 From: jpl Date: Wed, 19 Apr 2017 18:23:56 +0200 Subject: Refs #2982: updating layout on tt#edit --- .../time_tables/components/Timetable.js | 26 +++--------------- app/assets/stylesheets/modules/_timetables.sass | 31 +++++++++++++++------- 2 files changed, 25 insertions(+), 32 deletions(-) diff --git a/app/assets/javascripts/es6_browserified/time_tables/components/Timetable.js b/app/assets/javascripts/es6_browserified/time_tables/components/Timetable.js index b27dddbf1..37b756507 100644 --- a/app/assets/javascripts/es6_browserified/time_tables/components/Timetable.js +++ b/app/assets/javascripts/es6_browserified/time_tables/components/Timetable.js @@ -19,26 +19,6 @@ class Timetable extends Component{ return currentDate } - componentDidUpdate(prevProps, prevState) { - if(this.props.status.isFetching == false){ - $('.table-2entries').each(function() { - var refH = [] - var refCol = [] - - $(this).find('.t2e-head').children('.td').each(function() { - var h = $(this).outerHeight(); - refH.push(h) - }); - - $(this).find('.t2e-item').children('.td-group').each(function() { - for(var nth = 0; nth < refH.length; nth++) { - $(this).find('.td:nth-child('+ (nth + 1) +')').css('height', refH[nth]); - } - }); - }); - } - } - render() { return (
    @@ -48,9 +28,9 @@ class Timetable extends Component{
    Synthèse
    -
    Journées d'application
    -
    Périodes
    -
    Exceptions
    +
    Journées d'application
    +
    Périodes
    +
    Exceptions
    diff --git a/app/assets/stylesheets/modules/_timetables.sass b/app/assets/stylesheets/modules/_timetables.sass index 9122fedb2..2d0a758d0 100644 --- a/app/assets/stylesheets/modules/_timetables.sass +++ b/app/assets/stylesheets/modules/_timetables.sass @@ -3,15 +3,27 @@ //---------------// #periods - .t2e-head > .th - height: 135px - text-align: left - border-color: $darkgrey - border-top-width: 2px + .t2e-head + > .th + height: 135px + text-align: left + border-color: $darkgrey + border-top-width: 2px + + > .strong + padding-top: 123px + transform: translateY(-1.4em) + + .t2e-head > .td, .t2e-item > .td-group > .td + height: 51px + + .t2e-head > .td + line-height: 38px - > .strong - padding-top: 123px - transform: translateY(-1.4em) + > span + display: inline-block + vertical-align: middle + line-height: 1.4 .t2e-item-list > div border-color: #fff @@ -95,7 +107,8 @@ white-space: nowrap position: absolute left: 8px - top: 6px + top: 50% + transform: translateY(-50%) z-index: 5 .form-group > .month_selector -- cgit v1.2.3 From 5fa880abef8d8bebbfb91f1db2ad9b99cdbcf341 Mon Sep 17 00:00:00 2001 From: Vlatka Pavisic Date: Thu, 20 Apr 2017 11:29:46 +0200 Subject: Refs #3146 : Add Imports button to workbenches#show --- app/views/workbenches/show.html.slim | 1 + 1 file changed, 1 insertion(+) diff --git a/app/views/workbenches/show.html.slim b/app/views/workbenches/show.html.slim index b46cf09a4..1025c1658 100644 --- a/app/views/workbenches/show.html.slim +++ b/app/views/workbenches/show.html.slim @@ -7,6 +7,7 @@ / Below is secundary actions & optional contents (filters, ...) .row.mb-sm .col-lg-12.text-right + = link_to Import.model_name.human.pluralize.capitalize, workbench_imports_path(@workbench), class: 'btn btn-primary' - if policy(Referential).create? = link_to t('referentials.actions.new'), new_referential_path(workbench_id: @workbench), class: 'btn btn-primary' -- cgit v1.2.3 From 23403a7344eeb2d0c4f052c984baa49b8c58154c Mon Sep 17 00:00:00 2001 From: Vlatka Pavisic Date: Thu, 20 Apr 2017 13:48:21 +0200 Subject: Refs #3033 : Attempt to display 403 page --- app/controllers/errors_controller.rb | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/app/controllers/errors_controller.rb b/app/controllers/errors_controller.rb index c68a60804..78e7285bc 100644 --- a/app/controllers/errors_controller.rb +++ b/app/controllers/errors_controller.rb @@ -1,9 +1,13 @@ class ErrorsController < ApplicationController def not_found - render :status => 404, :formats => [:html] + render status: 404, formats: [:html] end def server_error - render :status => 500, :formats => [:html] + render status: 500, formats: [:html] end -end \ No newline at end of file + + def not_allowed + render status: 403, formats: [:html] + end +end -- cgit v1.2.3 From c1eccef1259c7f7068f0b2f9dad15c79cdae49b1 Mon Sep 17 00:00:00 2001 From: Vlatka Pavisic Date: Thu, 20 Apr 2017 14:18:01 +0200 Subject: Refs #3033 : Attempt #2 to display 403 page --- app/controllers/errors_controller.rb | 7 ++++--- config/routes.rb | 10 ++++++---- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/app/controllers/errors_controller.rb b/app/controllers/errors_controller.rb index 78e7285bc..accf119a3 100644 --- a/app/controllers/errors_controller.rb +++ b/app/controllers/errors_controller.rb @@ -1,13 +1,14 @@ class ErrorsController < ApplicationController def not_found - render status: 404, formats: [:html] + render template: 'errors/not_found', status: 404, formats: [:html] end def server_error - render status: 500, formats: [:html] + render template: 'errors/server_error', status: 500, formats: [:html] end def not_allowed - render status: 403, formats: [:html] + render template: 'errors/not_found', status: 403, formats: [:html] end end + diff --git a/config/routes.rb b/config/routes.rb index a8c332fb8..538c069ed 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -213,9 +213,11 @@ ChouetteIhm::Application.routes.draw do get '/help/(*slug)' => 'help#show' - get '/404', to: 'errors#not_found' - get '/403', to: 'errors#not_allowed' - get '/422', to: 'errors#server_error' - get '/500', to: 'errors#server_error' + if Rails.env.production? + get '404', to: 'errors#not_found' + get '403', to: 'errors#not_allowed' + get '422', to: 'errors#server_error' + get '500', to: 'errors#server_error' + end end -- cgit v1.2.3 From e29e4c46bce58ca54a9eb10620038caebbf6f208 Mon Sep 17 00:00:00 2001 From: jpl Date: Thu, 20 Apr 2017 14:30:52 +0200 Subject: Refs #2892: adding periodManager actions css comp. --- .../time_tables/components/PeriodManager.js | 36 ++++++++- app/assets/stylesheets/components/_buttons.sass | 1 - app/assets/stylesheets/modules/_timetables.sass | 86 +++++++++++++++++----- 3 files changed, 104 insertions(+), 19 deletions(-) diff --git a/app/assets/javascripts/es6_browserified/time_tables/components/PeriodManager.js b/app/assets/javascripts/es6_browserified/time_tables/components/PeriodManager.js index 61098d9ea..35968fea3 100644 --- a/app/assets/javascripts/es6_browserified/time_tables/components/PeriodManager.js +++ b/app/assets/javascripts/es6_browserified/time_tables/components/PeriodManager.js @@ -14,7 +14,41 @@ class PeriodManager extends Component { className='period_manager' id={this.props.value.id} > - {(this.props.value.period_start.split('-')[2]) + ' > ' + actions.getHumanDate(this.props.value.period_end, 3)} +

    + {actions.getHumanDate(this.props.value.period_start, 3).substr(0, 7) + ' > ' + actions.getHumanDate(this.props.value.period_end, 3)} +

    + +
    +
    + +
    +
      +
    • + +
    • +
    • + +
    • +
    +
    ) } diff --git a/app/assets/stylesheets/components/_buttons.sass b/app/assets/stylesheets/components/_buttons.sass index 07758d56c..342e6503d 100644 --- a/app/assets/stylesheets/components/_buttons.sass +++ b/app/assets/stylesheets/components/_buttons.sass @@ -117,7 +117,6 @@ table, .table padding: 5px 15px > li.delete-action - > a, > button display: block position: relative diff --git a/app/assets/stylesheets/modules/_timetables.sass b/app/assets/stylesheets/modules/_timetables.sass index 2d0a758d0..ddb4e4116 100644 --- a/app/assets/stylesheets/modules/_timetables.sass +++ b/app/assets/stylesheets/modules/_timetables.sass @@ -15,10 +15,10 @@ transform: translateY(-1.4em) .t2e-head > .td, .t2e-item > .td-group > .td - height: 51px + height: 65px .t2e-head > .td - line-height: 38px + line-height: 50px > span display: inline-block @@ -74,7 +74,7 @@ background-color: transparent &.included - background-color: rgba($gold, 0.7) + background-color: rgba($gold, 0.5) > .td-group width: 34px @@ -91,26 +91,15 @@ > .td &.in_periods - background-color: rgba($gold, 0.7) - border-left-color: rgba($gold, 0.7) - border-right-color: rgba($gold, 0.7) + background-color: rgba($gold, 0.5) + border-left-color: rgba($gold, 0.5) + border-right-color: rgba($gold, 0.5) &.start_period border-left-color: rgba($grey, 0.5) &.end_period border-right-color: rgba($grey, 0.5) - .period_manager - display: block - height: auto - word-wrap: normal - white-space: nowrap - position: absolute - left: 8px - top: 50% - transform: translateY(-50%) - z-index: 5 - .form-group > .month_selector > .btn.btn-default background-color: rgba($grey, 0.15) @@ -128,3 +117,66 @@ border-radius: 0 0 4px 4px max-height: 230px overflow: auto + + .period_manager + display: block + height: auto + word-wrap: normal + white-space: nowrap + position: absolute + left: 8px + top: 50% + transform: translateY(-50%) + z-index: 5 + + > * + display: inline-block + vertical-align: middle + margin: 0 + + &.dropdown + margin-left: 5px + + .btn.dropdown-toggle + color: $blue + background-color: rgba(#fff, 0) + padding: 1px 5px + border-radius: 0 + transition: 0.2s + + &:hover, &:focus + background-color: rgba(#fff, 1) + transition: 0.2s + + .open > .btn.dropdown-toggle + background-color: rgba(#fff, 1) + border-color: $blue + box-shadow: none + transition: 0.2s + + .dropdown-menu + margin: 0 + border-radius: 0 + box-shadow: 0 0 3px rgba($darkgrey, 0.25) + + > li > a, > li > button + padding: 5px 15px + + > li.delete-action + > a, > button + display: block + position: relative + margin-top: 11px + + &:before + content: '' + display: block + position: absolute + left: 15px + right: 15px + top: -6px + height: 1px + background-color: $grey + + .fa:first-child + margin-right: 0.5em -- cgit v1.2.3 From 31a24a86f4830fd5c993e7f22a7b06b71258907d Mon Sep 17 00:00:00 2001 From: jpl Date: Thu, 20 Apr 2017 15:57:14 +0200 Subject: Refs #2892: update stuff --- .../javascripts/es6_browserified/time_tables/actions/index.js | 2 +- .../es6_browserified/time_tables/components/PeriodManager.js | 4 ++-- .../es6_browserified/time_tables/components/PeriodsInDay.js | 2 +- app/assets/stylesheets/modules/_timetables.sass | 6 +++++- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/app/assets/javascripts/es6_browserified/time_tables/actions/index.js b/app/assets/javascripts/es6_browserified/time_tables/actions/index.js index a023360a5..de359b99e 100644 --- a/app/assets/javascripts/es6_browserified/time_tables/actions/index.js +++ b/app/assets/javascripts/es6_browserified/time_tables/actions/index.js @@ -74,7 +74,7 @@ const actions = { let M = actions.monthName(strDate).toLowerCase() let Y = origin[0] - if(mLimit) { + if(mLimit && M.length > mLimit) { M = M.substr(0, mLimit) + '.' } diff --git a/app/assets/javascripts/es6_browserified/time_tables/components/PeriodManager.js b/app/assets/javascripts/es6_browserified/time_tables/components/PeriodManager.js index 35968fea3..01996b016 100644 --- a/app/assets/javascripts/es6_browserified/time_tables/components/PeriodManager.js +++ b/app/assets/javascripts/es6_browserified/time_tables/components/PeriodManager.js @@ -36,7 +36,7 @@ class PeriodManager extends Component {
  • @@ -44,7 +44,7 @@ class PeriodManager extends Component { type='button' > - Action + Supprimer
  • diff --git a/app/assets/javascripts/es6_browserified/time_tables/components/PeriodsInDay.js b/app/assets/javascripts/es6_browserified/time_tables/components/PeriodsInDay.js index adc500c86..901b2205e 100644 --- a/app/assets/javascripts/es6_browserified/time_tables/components/PeriodsInDay.js +++ b/app/assets/javascripts/es6_browserified/time_tables/components/PeriodsInDay.js @@ -41,7 +41,7 @@ class PeriodsInDay extends Component { let d = this.props.currentDate.getTime() if(d >= begin && d <= end) { - if(d == begin) { + if(d == begin || (this.props.currentDate.getUTCDate() == 1)) { return ( .caret margin-left: 10px color: $blue @@ -144,8 +147,9 @@ border-radius: 0 transition: 0.2s - &:hover, &:focus + &:hover, &:focus, &:active, &.active background-color: rgba(#fff, 1) + box-shadow: none transition: 0.2s .open > .btn.dropdown-toggle -- cgit v1.2.3 From a2d0add29c701db0222d1822193e7d67f9b34a12 Mon Sep 17 00:00:00 2001 From: Thomas Haddad Date: Thu, 20 Apr 2017 16:19:41 +0200 Subject: Refs #2892: Fix synthesis being affected by day types update Signed-off-by: Thomas Shawarma Haddad --- .../es6_browserified/time_tables/components/TimeTableDay.js | 5 +++-- .../javascripts/es6_browserified/time_tables/components/Timetable.js | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/es6_browserified/time_tables/components/TimeTableDay.js b/app/assets/javascripts/es6_browserified/time_tables/components/TimeTableDay.js index cc47c2052..eecdf174d 100644 --- a/app/assets/javascripts/es6_browserified/time_tables/components/TimeTableDay.js +++ b/app/assets/javascripts/es6_browserified/time_tables/components/TimeTableDay.js @@ -17,7 +17,7 @@ class TimeTableDay extends Component { {((this.props.value.day).charAt(0) == 'm') ? (this.props.value.day).substr(0, 2) : (this.props.value.day).charAt(0)} {this.props.value.mday} @@ -28,7 +28,8 @@ class TimeTableDay extends Component { TimeTableDay.propTypes = { value: PropTypes.object.isRequired, - index: PropTypes.number.isRequired + index: PropTypes.number.isRequired, + dayTypeActive: PropTypes.bool.isRequired } module.exports = TimeTableDay diff --git a/app/assets/javascripts/es6_browserified/time_tables/components/Timetable.js b/app/assets/javascripts/es6_browserified/time_tables/components/Timetable.js index 37b756507..738e1a3ed 100644 --- a/app/assets/javascripts/es6_browserified/time_tables/components/Timetable.js +++ b/app/assets/javascripts/es6_browserified/time_tables/components/Timetable.js @@ -46,6 +46,7 @@ class Timetable extends Component{ key={i} index={i} value={d} + dayTypeActive={this.props.metas.day_types[d.wday]} /> )}
    -- cgit v1.2.3 From 801c988c9eeee52b08fd78248df3aabb1ce84d9f Mon Sep 17 00:00:00 2001 From: jpl Date: Thu, 20 Apr 2017 16:29:20 +0200 Subject: Refs #2892: update stuff --- app/assets/stylesheets/modules/_timetables.sass | 1 + 1 file changed, 1 insertion(+) diff --git a/app/assets/stylesheets/modules/_timetables.sass b/app/assets/stylesheets/modules/_timetables.sass index 957487a46..cf0ccd98c 100644 --- a/app/assets/stylesheets/modules/_timetables.sass +++ b/app/assets/stylesheets/modules/_timetables.sass @@ -162,6 +162,7 @@ margin: 0 border-radius: 0 box-shadow: 0 0 3px rgba($darkgrey, 0.25) + min-width: 120px > li > a, > li > button padding: 5px 15px -- cgit v1.2.3 From 59e923453231927d9aa46fbd22576475a3f3c0ee Mon Sep 17 00:00:00 2001 From: jpl Date: Thu, 20 Apr 2017 16:45:59 +0200 Subject: Refs #2892: adding conditionnal position for period_manager dropdown on tt#edit --- app/assets/stylesheets/components/_dropdown.sass | 2 ++ app/assets/stylesheets/modules/_timetables.sass | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/app/assets/stylesheets/components/_dropdown.sass b/app/assets/stylesheets/components/_dropdown.sass index eb2cc8f74..99dc6292e 100644 --- a/app/assets/stylesheets/components/_dropdown.sass +++ b/app/assets/stylesheets/components/_dropdown.sass @@ -14,9 +14,11 @@ &:hover, &:focus color: #262626 background-color: whitesmoke + outline: none > .disabled > a, > .disabled > button cursor: not-allowed &, &:hover, &:focus color: rgba($darkgrey, 0.5) background-color: transparent + outline: none diff --git a/app/assets/stylesheets/modules/_timetables.sass b/app/assets/stylesheets/modules/_timetables.sass index cf0ccd98c..2b430fb6a 100644 --- a/app/assets/stylesheets/modules/_timetables.sass +++ b/app/assets/stylesheets/modules/_timetables.sass @@ -149,6 +149,8 @@ &:hover, &:focus, &:active, &.active background-color: rgba(#fff, 1) + border-color: $blue + outline: none box-shadow: none transition: 0.2s @@ -185,3 +187,9 @@ .fa:first-child margin-right: 0.5em + + .td-group.last_wday ~ .td-group.last_wday ~ .td-group.last_wday ~ .td-group.last_wday + > .td, ~ .td-group > .td + > .period_manager .dropdown-menu + left: auto + right: 0 -- cgit v1.2.3