Skip to content

Commit b893d7f

Browse files
committed
Use new Space#feature_enabled? method for checking if a feature is used
1 parent 264f3ce commit b893d7f

File tree

18 files changed

+62
-62
lines changed

18 files changed

+62
-62
lines changed

app/views/about/_about_nav.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
</ul>
2525

2626
<!-- REGISTERING YOUR LEARNING PATHS -->
27-
<% if TeSS::Config.feature['learning_paths'] %>
27+
<% if Space.current_space.feature_enabled?('learning_paths') %>
2828
<ul class="nav nav-stacked <%= show_active(show, 'learning_paths') %>">
2929
<li class="about-page-category">
3030
<%= link_to t('about.sidebar.learning_paths'), registering_learning_paths_path %>

app/views/about/_links.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<div class="quick-links">
22
<%= link_to 'What is ' + TeSS::Config.site['title_short'] + '?', about_path, class: ('selected-tab' if show == 'tess') %>
33
| <%= link_to 'How to Register', registering_resources_path, class: ('selected-tab' if show == 'registering') %>
4-
<% if TeSS::Config.feature['learning_paths'] %>
4+
<% if Space.current_space.feature_enabled?('learning_paths') %>
55
| <%= link_to 'Learning Paths', registering_learning_paths_path, class: ('selected-tab' if show == 'learning_paths') %>
66
<% end %>
77
| <%= link_to 'Developers Guide', developers_path, class: ('selected-tab' if show == 'developer') %>

app/views/about/developers.erb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,23 +72,23 @@
7272

7373
<p>
7474
<!-- Events -->
75-
<% if TeSS::Config.feature['events'] %>
75+
<% if Space.current_space.feature_enabled?('events') %>
7676
<code>
7777
<a href="<%= TeSS::Config.base_url %><%== t 'developer.api_example_1' %>">
7878
<%= TeSS::Config.base_url %><%== t 'developer.api_example_1' %></a>
7979
</code><br/>
8080
<% end %>
8181

8282
<!-- Materials -->
83-
<% if TeSS::Config.feature['materials'] %>
83+
<% if Space.current_space.feature_enabled?('materials') %>
8484
<code>
8585
<a href="<%= TeSS::Config.base_url %><%== t 'developer.api_example_3' %>">
8686
<%= TeSS::Config.base_url %><%== t 'developer.api_example_3' %> </a>
8787
</code><br/>
8888
<% end %>
8989

9090
<!-- Providers -->
91-
<% if TeSS::Config.feature['content_providers'] %>
91+
<% if Space.current_space.feature_enabled?('content_providers') %>
9292
<code>
9393
<a href="<%= TeSS::Config.base_url %><%== t 'developer.api_example_4' %>">
9494
<%= TeSS::Config.base_url %><%== t 'developer.api_example_4' %> </a>

app/views/about/tess.html.erb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
<% @feature_count = 0 %>
3939

4040
<!-- EVENTS-->
41-
<% if TeSS::Config.feature['events'] == true %>
41+
<% if Space.current_space.feature_enabled?('events') %>
4242
<div id="events" class="row <%= next_about_block(@feature_count += 1) %>">
4343
<h3 class="col-lg-12"><%= t('about.headings.events') %></h3>
4444
<div class="col-lg-2 col-lg-push-10 about-resource-icon">
@@ -59,7 +59,7 @@
5959
<% end %>
6060

6161
<!-- MATERIALS-->
62-
<% if TeSS::Config.feature['materials'] == true %>
62+
<% if Space.current_space.feature_enabled?('materials') %>
6363
<div id="materials" class="row <%= next_about_block(@feature_count += 1) %>">
6464
<h3 class="col-lg-12"><%= t('about.headings.materials') %></h3>
6565

@@ -83,7 +83,7 @@
8383
<% end %>
8484

8585
<!-- WORKFLOWS -->
86-
<% if TeSS::Config.feature['workflows'] == true %>
86+
<% if TeSS::Config.feature['workflows'] %>
8787
<div id="workflows" class="row <%= next_about_block(@feature_count += 1) %>">
8888
<h3 class="col-lg-12"><%= t('about.headings.workflows') %></h3>
8989
<div class="col-lg-2 col-lg-push-10 about-resource-icon">

app/views/collections/show.html.erb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@
1111
<%= render partial: 'collaborations/collaborators_button', locals: { resource: @collection } %>
1212
<% end %>
1313
<% if TeSS::Config.feature['collection_curation'] && current_user && policy(@collection).curate? %>
14-
<% if TeSS::Config.feature['events'] %>
14+
<% if Space.current_space.feature_enabled?('events') %>
1515
<%= link_to t('.curate_events', default: [:'helpers.links.events', 'events']),
1616
curate_events_collection_path(@collection), class: 'btn btn-default' %>
1717
<% end %>
18-
<% if TeSS::Config.feature['materials'] %>
18+
<% if Space.current_space.feature_enabled?('materials') %>
1919
<%= link_to t('.curate_materials', default: [:'helpers.links.materials', 'materials']),
2020
curate_materials_collection_path(@collection), class: 'btn btn-default' %>
2121
<% end %>
@@ -33,12 +33,12 @@
3333
<% not_finished_events_count = e.not_finished.count %>
3434
<% activator = tab_activator %>
3535
<ul class="nav nav-tabs">
36-
<% if TeSS::Config.feature['materials'] %>
36+
<% if Space.current_space.feature_enabled?('materials') %>
3737
<%= tab('Materials', icon_class_for_model('materials'), 'materials', activator: activator,
3838
disabled: { check: materials_count.zero?, message: 'No registered training materials' },
3939
count: materials_count) %>
4040
<% end %>
41-
<% if TeSS::Config.feature['events'] %>
41+
<% if Space.current_space.feature_enabled?('events') %>
4242
<%= tab('Events', icon_class_for_model('events'), 'events', activator: activator,
4343
disabled: { check: events_count.zero?, message: 'No associated events' },
4444
count: not_finished_events_count.zero? && events_count.positive? ? '0*' : not_finished_events_count) %>
@@ -47,7 +47,7 @@
4747
</div>
4848

4949
<div class="tab-content ml-3">
50-
<% if TeSS::Config.feature['materials'] %>
50+
<% if Space.current_space.feature_enabled?('materials') %>
5151
<%= render partial: 'common/associated_resources',
5252
locals: { model: Material,
5353
total_count: materials_count,
@@ -56,7 +56,7 @@
5656
view_all_link: materials_path(collections: @collection.title) } %>
5757
<% end %>
5858

59-
<% if TeSS::Config.feature['events'] %>
59+
<% if Space.current_space.feature_enabled?('events') %>
6060
<%= render partial: 'common/associated_events',
6161
locals: { total_count: events_count,
6262
resources: event_items,

app/views/content_providers/_form.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
<%= f.multi_input :keywords %>
3838

3939
<!-- Nodes: check feature enabled -->
40-
<% if TeSS::Config.feature['nodes'] %>
40+
<% if Space.current_space.feature_enabled?('nodes') %>
4141
<%= f.input :node_id, label: 'ELIXIR node', collection: Node.order(:name).all, label_method: :name %>
4242
<% end %>
4343

app/views/content_providers/partials/_content_provider_sidebar.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<%= content_provider.keywords.join(', ') %>
1111
</div>
1212
<% end %>
13-
<% unless content_provider.node.blank? || !TeSS::Config.feature['nodes'] %>
13+
<% unless content_provider.node.blank? || !Space.current_space.feature_enabled?('nodes') %>
1414
<h4 class="nav-heading">ELIXIR node</h4>
1515
<div class="nav-block">
1616
<p>

app/views/content_providers/show.html.erb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@
3232
<% sources = @content_provider.sources.order(enabled: :desc, finished_at: :desc) %>
3333
<% activator = tab_activator %>
3434
<ul class="nav nav-tabs">
35-
<% if TeSS::Config.feature['materials'] %>
35+
<% if Space.current_space.feature_enabled?('materials') %>
3636
<%= tab('Materials', icon_class_for_model('materials'), 'materials', activator: activator,
3737
disabled: { check: materials_count.zero?, message: 'No registered training materials' },
3838
count: materials_count) %>
3939
<% end %>
40-
<% if TeSS::Config.feature['events'] %>
40+
<% if Space.current_space.feature_enabled?('events') %>
4141
<%= tab('Events', icon_class_for_model('events'), 'events', activator: activator,
4242
disabled: { check: events_count.zero?, message: 'No associated events' },
4343
count: not_finished_events_count.zero? && events_count.positive? ? '0*' : not_finished_events_count) %>
@@ -49,7 +49,7 @@
4949
</ul>
5050

5151
<div class="tab-content">
52-
<% if TeSS::Config.feature['materials'] %>
52+
<% if Space.current_space.feature_enabled?('materials') %>
5353
<%= render partial: 'common/associated_resources',
5454
locals: { model: Material,
5555
total_count: materials_count,
@@ -59,7 +59,7 @@
5959
view_all_link: materials_path(content_provider: @content_provider.title) } %>
6060
<% end %>
6161

62-
<% if TeSS::Config.feature['events'] %>
62+
<% if Space.current_space.feature_enabled?('events') %>
6363
<%= render partial: 'common/associated_events',
6464
locals: { total_count: upcoming_events.count,
6565
past_count: past_events.count,

app/views/events/_form.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@
157157
<!-- Fields: that need to be check for enabled/disabled -->
158158

159159
<!-- Nodes: check feature enabled -->
160-
<% if TeSS::Config.feature['nodes'] %>
160+
<% if Space.current_space.feature_enabled?('nodes') %>
161161
<%= f.dropdown :node_ids, options: format_for_dropdown(Node.order(:name).all), label: 'Nodes',
162162
errors: @event.errors[:node_ids] %>
163163
<% end %>

app/views/learning_path_topics/show.html.erb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,12 @@
5353
<% not_finished_events_count = e.not_finished.count %>
5454
<% activator = tab_activator %>
5555
<ul class="nav nav-tabs">
56-
<% if TeSS::Config.feature['materials'] %>
56+
<% if Space.current_space.feature_enabled?('materials') %>
5757
<%= tab('Materials', icon_class_for_model('materials'), 'materials', activator: activator,
5858
disabled: { check: materials_count.zero?, message: 'No registered training materials' },
5959
count: materials_count) %>
6060
<% end %>
61-
<% if TeSS::Config.feature['events'] %>
61+
<% if Space.current_space.feature_enabled?('events') %>
6262
<%# tab('Events', icon_class_for_model('events'), 'events', activator: activator,
6363
disabled: { check: events_count.zero?, message: 'No associated events' },
6464
count: not_finished_events_count.zero? && events_count.positive? ? '0*' : not_finished_events_count) %>
@@ -67,7 +67,7 @@
6767
</div>
6868

6969
<div class="tab-content ml-3">
70-
<% if TeSS::Config.feature['materials'] %>
70+
<% if Space.current_space.feature_enabled?('materials') %>
7171
<%= render partial: 'common/associated_resources',
7272
locals: { model: Material,
7373
total_count: materials_count,
@@ -76,7 +76,7 @@
7676
view_all_link: materials_path(collections: @learning_path_topic.title) } %>
7777
<% end %>
7878

79-
<% if TeSS::Config.feature['events'] %>
79+
<% if Space.current_space.feature_enabled?('events') %>
8080
<%= render partial: 'common/associated_events',
8181
locals: { total_count: events_count,
8282
resources: event_items,

0 commit comments

Comments
 (0)