From 3a58bd3cd6859f635ca7fc215755575e6da07587 Mon Sep 17 00:00:00 2001 From: Mojca Lorber Date: Mon, 23 Mar 2020 20:02:57 +0100 Subject: [PATCH] Disable selecting range at update column --- .../shared_styles/elements/checkboxes.scss | 12 ++++++++---- .../manage_column_partials/_date.html.erb | 12 +++++------- .../manage_column_partials/_datetime.html.erb | 12 +++++------- .../manage_column_partials/_time.html.erb | 12 +++++------- 4 files changed, 23 insertions(+), 25 deletions(-) diff --git a/app/assets/stylesheets/shared_styles/elements/checkboxes.scss b/app/assets/stylesheets/shared_styles/elements/checkboxes.scss index 08266f2f1..12e31c49c 100644 --- a/app/assets/stylesheets/shared_styles/elements/checkboxes.scss +++ b/app/assets/stylesheets/shared_styles/elements/checkboxes.scss @@ -72,10 +72,14 @@ input[type="checkbox"].sci-checkbox { } } - &:disabled + .sci-checkbox-label { - &::before { - background: $color-alto; - border: $border-tertiary; + &:disabled { + cursor: default; + + + .sci-checkbox-label { + &::before { + background: $color-alto; + border: $border-tertiary; + } } } } diff --git a/app/views/repository_columns/manage_column_partials/_date.html.erb b/app/views/repository_columns/manage_column_partials/_date.html.erb index 7727b7431..3336768e3 100644 --- a/app/views/repository_columns/manage_column_partials/_date.html.erb +++ b/app/views/repository_columns/manage_column_partials/_date.html.erb @@ -1,12 +1,10 @@
-
- - <%= check_box_tag 'range', '', column&.repository_date_range_value?, { id: 'date-range', class: column.new_record? ? 'sci-checkbox' : 'sci-checkbox disabled' } %> - - - <%= t('libraries.manange_modal_column.datetime_type.range_label') %> -
+ + <%= check_box_tag 'range', '', column&.repository_date_range_value?, { id: 'date-range', class: 'sci-checkbox', disabled: !column.new_record? } %> + + + <%= t('libraries.manange_modal_column.datetime_type.range_label') %>
diff --git a/app/views/repository_columns/manage_column_partials/_datetime.html.erb b/app/views/repository_columns/manage_column_partials/_datetime.html.erb index bd0fd1c2f..cca5cb7b1 100644 --- a/app/views/repository_columns/manage_column_partials/_datetime.html.erb +++ b/app/views/repository_columns/manage_column_partials/_datetime.html.erb @@ -1,12 +1,10 @@
-
- - <%= check_box_tag 'range', '', column&.repository_date_time_range_value?, { id: 'datetime-range', class: column.new_record? ? 'sci-checkbox' : 'sci-checkbox disabled' } %> - - - <%= t('libraries.manange_modal_column.datetime_type.range_label') %> -
+ + <%= check_box_tag 'range', '', column&.repository_date_time_range_value?, { id: 'datetime-range', class: 'sci-checkbox', disabled: !column.new_record? } %> + + + <%= t('libraries.manange_modal_column.datetime_type.range_label') %>
diff --git a/app/views/repository_columns/manage_column_partials/_time.html.erb b/app/views/repository_columns/manage_column_partials/_time.html.erb index 26ae71a0e..edef194d0 100644 --- a/app/views/repository_columns/manage_column_partials/_time.html.erb +++ b/app/views/repository_columns/manage_column_partials/_time.html.erb @@ -1,12 +1,10 @@
-
- - <%= check_box_tag 'range', '', column&.repository_time_range_value?, { id: 'time-range', class: column.new_record? ? 'sci-checkbox' : 'sci-checkbox disabled' } %> - - - <%= t('libraries.manange_modal_column.datetime_type.range_label') %> -
+ + <%= check_box_tag 'range', '', column&.repository_time_range_value?, { id: 'time-range', class: 'sci-checkbox', disabled: !column.new_record? } %> + + + <%= t('libraries.manange_modal_column.datetime_type.range_label') %>