Skip to content

Commit

Permalink
Show with which groups a slider is coupled
Browse files Browse the repository at this point in the history
  • Loading branch information
noracato committed Aug 27, 2024
1 parent b860484 commit a4ebae8
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 4 deletions.
1 change: 1 addition & 0 deletions app/assets/javascripts/lib/models/input_element.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ class @InputElementList extends Backbone.Collection
user_value: def
disabled: dis
coupled: dis && values.coupling_disabled
coupling_groups: values.coupling_groups
}, { silent: true })

i.trigger('initial-set:user_value')
Expand Down
2 changes: 2 additions & 0 deletions app/assets/javascripts/lib/views/input_element_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,9 @@
end_year: App.settings.get('end_year'),
info_link: I18n.t('input_elements.common.info_link'),
coupling_icon: this.model.get('coupling_icon'),
coupling_groups: this.model.get('coupling_groups'),
info_coupling: I18n.t('input_elements.common.info_coupling'),
label_groups: I18n.t('input_elements.common.coupling_groups_label'),
})
);

Expand Down
8 changes: 8 additions & 0 deletions app/assets/stylesheets/_slider.sass
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,14 @@ $slider-box-height: 22px
margin: -0.75rem 0 0
svg
margin-bottom: -0.2rem
.coupling-groups
margin-bottom: 0.75rem
.group
background: #fff
padding: 0.2rem 0.5rem
border-radius: 2px
color: $landing-grey
margin-left: 0.25rem

&.info-box-visible
.show-info
Expand Down
4 changes: 0 additions & 4 deletions app/models/slide.rb
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,6 @@ def grouped_input_elements
interface_groups
end

def mixed_coupled?

end

def short_name_for_admin
"#{sidebar_item.try :key} : #{key}"
end
Expand Down
6 changes: 6 additions & 0 deletions app/views/input_elements/_input_element.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@
</span>
<span class="text"><%= info_coupling %></span>
</a>
<div class="coupling-groups">
<span><%= label_groups %></span>
<% _.each(coupling_groups, function (coupling_group) { %>
<span class="group"><%= coupling_group %></span>
<% }); %>
</div>
</div>
<% } %>
<%= info %>
Expand Down
1 change: 1 addition & 0 deletions config/locales/interface/input_elements/en_common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ en:
common:
info_link: Technical and financial properties
info_coupling: This slider is coupled with an external model, what does this mean?
coupling_groups_label: Part of the following couplings
1 change: 1 addition & 0 deletions config/locales/interface/input_elements/nl_common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ nl:
common:
info_link: Technische parameters en kosten
info_coupling: Deze schuif is gekoppeld aan een extern model, wat betekent dit?
coupling_groups_label: Maakt deel uit van de volgende koppelingen

0 comments on commit a4ebae8

Please sign in to comment.