Commit d74efaa9c03b0cae4348629f47c8ebedf5218d94
1 parent
9a57cbee
Exists in
colab
and in
4 other branches
Update all usages of model actions in views to new method
Showing
26 changed files
with
36 additions
and
34 deletions
Show diff stats
app/views/compound_metric_configurations/edit.html.erb
1 | 1 | <div class="page-header"> |
2 | - <h1> <%= t('edit_model', model: compound_metric_human_name) %> </h1> | |
3 | -</div | |
2 | + <h1> <%= t('helpers.submit.edit', model: compound_metric_human_name) %> </h1> | |
3 | +</div> | |
4 | 4 | |
5 | 5 | <%= render partial: 'created_metrics', locals: {metric_configurations: @metric_configurations} %> |
6 | 6 | ... | ... |
app/views/compound_metric_configurations/show.html.erb
... | ... | @@ -45,7 +45,7 @@ |
45 | 45 | |
46 | 46 | <h2> <%= t('ranges') %> </h2> |
47 | 47 | <% if kalibro_configuration_owner? @compound_metric_configuration.kalibro_configuration_id %> |
48 | - <%= link_to t('add_range'), kalibro_configuration_metric_configuration_new_kalibro_range_path(@compound_metric_configuration.kalibro_configuration_id, | |
48 | + <%= link_to t_action(:add, KalibroRange), kalibro_configuration_metric_configuration_new_kalibro_range_path(@compound_metric_configuration.kalibro_configuration_id, | |
49 | 49 | @compound_metric_configuration.id), class: 'btn btn-info' %> |
50 | 50 | <% end %> |
51 | 51 | |
... | ... | @@ -71,7 +71,7 @@ |
71 | 71 | <p> |
72 | 72 | <%= link_to t('back'), kalibro_configuration_path(@compound_metric_configuration.kalibro_configuration_id), class: 'btn btn-default' %> |
73 | 73 | <% if kalibro_configuration_owner? @compound_metric_configuration.kalibro_configuration_id %> |
74 | - <%= link_to t('destroy_metric_configuration'), kalibro_configuration_metric_configuration_path(@compound_metric_configuration.kalibro_configuration_id, | |
74 | + <%= link_to t_action(:destroy, MetricConfiguration), kalibro_configuration_metric_configuration_path(@compound_metric_configuration.kalibro_configuration_id, | |
75 | 75 | @compound_metric_configuration.id), method: :delete, data: { confirm: t('want_destroy_metric_configuration') }, |
76 | 76 | class: 'btn btn-danger' %> |
77 | 77 | <% end %> | ... | ... |
app/views/kalibro_configurations/_kalibro_configuration.html.erb
... | ... | @@ -4,7 +4,7 @@ |
4 | 4 | <td><%= link_to t('show'), kalibro_configuration_path(kalibro_configuration.id), class: 'btn btn-info' %></td> |
5 | 5 | <td> |
6 | 6 | <% if kalibro_configuration_owner?(kalibro_configuration.id) %> |
7 | - <%= link_to t('edit', model: ''), edit_kalibro_configuration_path(kalibro_configuration.id), class: 'btn btn-info' %> | |
7 | + <%= link_to t('edit'), edit_kalibro_configuration_path(kalibro_configuration.id), class: 'btn btn-info' %> | |
8 | 8 | <% end %> |
9 | 9 | </td> |
10 | 10 | </tr> |
11 | 11 | \ No newline at end of file | ... | ... |
app/views/kalibro_configurations/_metric_configurations.html.erb
... | ... | @@ -10,7 +10,7 @@ |
10 | 10 | <%= link_to_edit_form(metric_configuration, @kalibro_configuration.id) %> |
11 | 11 | </td> |
12 | 12 | <td> |
13 | - <%= link_to t('destroy_metric_configuration'), kalibro_configuration_metric_configuration_path(@kalibro_configuration.id, metric_configuration.id), | |
13 | + <%= link_to t_action(:destroy, MetricConfiguration), kalibro_configuration_metric_configuration_path(@kalibro_configuration.id, metric_configuration.id), | |
14 | 14 | method: :delete, data: { confirm: t('want_destroy_metric_configuration') }, |
15 | 15 | class: 'btn btn-danger' %> |
16 | 16 | </td> | ... | ... |
app/views/kalibro_configurations/edit.html.erb
app/views/kalibro_configurations/index.html.erb
... | ... | @@ -4,12 +4,12 @@ |
4 | 4 | |
5 | 5 | <% if user_signed_in? %> |
6 | 6 | <p> |
7 | - <%= link_to "#{t('new.female')} #{KalibroConfiguration.model_name.human}", new_kalibro_configuration_path, class: 'btn btn-primary' %> | |
7 | + <%= link_to t_action(:new, KalibroConfiguration), new_kalibro_configuration_path, class: 'btn btn-primary' %> | |
8 | 8 | </p> |
9 | 9 | <%else%> |
10 | 10 | <p class="alert alert-warning alert-dismissable"> |
11 | 11 | <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button> |
12 | - <%= t('unauthenticated', action: "#{t('create', model: KalibroConfiguration.model_name.human(count: 2)).downcase}") %>. | |
12 | + <%= t('unauthenticated', action: t_action(:create, KalibroConfiguration, count: 2).downcase) %>. | |
13 | 13 | </p> |
14 | 14 | <% end %> |
15 | 15 | ... | ... |
app/views/kalibro_configurations/new.html.erb
app/views/kalibro_configurations/show.html.erb
... | ... | @@ -11,7 +11,7 @@ |
11 | 11 | <div id="metrics"> |
12 | 12 | <h2><%= t('metric').pluralize %></h2> |
13 | 13 | <% if kalibro_configuration_owner? @kalibro_configuration.id %> |
14 | - <%= link_to "#{t('add')} #{t('metric')}", kalibro_configuration_choose_metric_path(@kalibro_configuration.id), class: 'btn btn-info' %> | |
14 | + <%= link_to t_action(:add, MetricConfiguration), kalibro_configuration_choose_metric_path(@kalibro_configuration.id), class: 'btn btn-info' %> | |
15 | 15 | <% end %> |
16 | 16 | |
17 | 17 | <table class="table table-hover"> |
... | ... | @@ -38,6 +38,6 @@ |
38 | 38 | <p> |
39 | 39 | <%= link_to t('back'), kalibro_configurations_path, class: 'btn btn-default' %> |
40 | 40 | <% if kalibro_configuration_owner? @kalibro_configuration.id %> |
41 | - <%= link_to t('destroy_configuration'), kalibro_configuration_path(@kalibro_configuration.id), method: :delete, data: { confirm: 'Are you sure that you want to destroy this Configuration?' }, class: 'btn btn-danger' %> | |
41 | + <%= link_to t_action(:destroy, KalibroConfiguration), kalibro_configuration_path(@kalibro_configuration.id), method: :delete, data: { confirm: 'Are you sure that you want to destroy this Configuration?' }, class: 'btn btn-danger' %> | |
42 | 42 | <% end %> |
43 | 43 | </p> | ... | ... |
app/views/kalibro_ranges/_no_readings.html.erb
... | ... | @@ -2,7 +2,7 @@ |
2 | 2 | <h4 class="alert-heading"><%= t('activemodel.errors.kalibro_range.no_readings') %></h4> |
3 | 3 | <p> |
4 | 4 | <% if reading_groups_owner? @reading_group_id %> |
5 | - <br /><%= link_to t('create', model: Reading.model_name.human), new_reading_group_reading_path(@reading_group_id), class: 'btn btn-danger' %> | |
5 | + <br /><%= link_to t_action(:create, Reading), new_reading_group_reading_path(@reading_group_id), class: 'btn btn-danger' %> | |
6 | 6 | <% else %> |
7 | 7 | <p><%= t('activemodel.errors.kalibro_range.reading_group_belongs_to_another') %></p> |
8 | 8 | <% end %> | ... | ... |
app/views/kalibro_ranges/edit.html.erb
1 | -<h1><%= t('edit', model: KalibroRange.model_name.human) %></h1> | |
1 | +<h1><%= t_action(:edit, KalibroRange) %></h1> | |
2 | 2 | |
3 | 3 | <%= form_for(@kalibro_range, :url => kalibro_configuration_metric_configuration_kalibro_range_update_url( |
4 | 4 | @kalibro_configuration_id, @metric_configuration_id, @kalibro_range.id), method: :put) do |f| %> | ... | ... |
app/views/kalibro_ranges/new.html.erb
1 | -<h1><%= "#{t('new.male')} #{KalibroRange.model_name.human}" %></h1> | |
1 | +<h1><%= t_action(:new, KalibroRange) %></h1> | |
2 | 2 | |
3 | 3 | <%= form_for(@kalibro_range, :url => kalibro_configuration_metric_configuration_kalibro_ranges_path( |
4 | 4 | @kalibro_configuration_id, @metric_configuration_id)) do |f| %> | ... | ... |
app/views/metric_configurations/show.html.erb
... | ... | @@ -53,7 +53,7 @@ |
53 | 53 | |
54 | 54 | <h2><%= KalibroRange.model_name.human(count: 2) %></h2> |
55 | 55 | <% if kalibro_configuration_owner? @metric_configuration.kalibro_configuration_id %> |
56 | - <%= link_to t('add_range'), kalibro_configuration_metric_configuration_new_kalibro_range_path(@metric_configuration.kalibro_configuration_id, | |
56 | + <%= link_to t_action(:add, KalibroRange), kalibro_configuration_metric_configuration_new_kalibro_range_path(@metric_configuration.kalibro_configuration_id, | |
57 | 57 | @metric_configuration.id), class: 'btn btn-info' %> |
58 | 58 | <% end %> |
59 | 59 | |
... | ... | @@ -77,7 +77,7 @@ |
77 | 77 | <p> |
78 | 78 | <%= link_to t('back'), kalibro_configuration_path(@metric_configuration.kalibro_configuration_id), class: 'btn btn-default' %> |
79 | 79 | <% if kalibro_configuration_owner? @metric_configuration.kalibro_configuration_id %> |
80 | - <%= link_to t('destroy_metric_configuration'), kalibro_configuration_metric_configuration_path(@metric_configuration.kalibro_configuration_id, | |
80 | + <%= link_to t_action(:destroy, MetricConfiguration), kalibro_configuration_metric_configuration_path(@metric_configuration.kalibro_configuration_id, | |
81 | 81 | @metric_configuration.id), method: :delete, data: { confirm: t('want_destroy_metric_configuration') }, |
82 | 82 | class: 'btn btn-danger' %> |
83 | 83 | <% end %> | ... | ... |
app/views/projects/edit.html.erb
app/views/projects/index.html.erb
... | ... | @@ -4,12 +4,12 @@ |
4 | 4 | |
5 | 5 | <% if user_signed_in? %> |
6 | 6 | <p> |
7 | - <%= link_to t('create', model: Project.model_name.human), new_project_path, class: 'btn btn-primary' %> | |
7 | + <%= link_to t_action(:create, Project), new_project_path, class: 'btn btn-primary' %> | |
8 | 8 | </p> |
9 | 9 | <%else%> |
10 | 10 | <p class="alert alert-warning alert-dismissable"> |
11 | 11 | <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button> |
12 | - <%= "#{t('unauthenticated', action: t("create", model: Project.model_name.human(count: 2)).downcase)}" %> | |
12 | + <%= t('unauthenticated', action: t_action(:create, Project, count: 2).downcase) %> | |
13 | 13 | </p> |
14 | 14 | <% end %> |
15 | 15 | ... | ... |
app/views/projects/new.html.erb
app/views/projects/show.html.erb
... | ... | @@ -18,7 +18,7 @@ |
18 | 18 | |
19 | 19 | <h2><%= Repository.model_name.human(count: 2) %></h2> |
20 | 20 | |
21 | -<% if project_owner? @project.id %><%= link_to "#{t('new.male')} #{Repository.model_name.human}", new_project_repository_path(@project,), class: 'btn btn-primary' %><% end %> | |
21 | +<% if project_owner? @project.id %><%= link_to t_action(:new, Repository), new_project_repository_path(@project,), class: 'btn btn-primary' %><% end %> | |
22 | 22 | |
23 | 23 | <table class="table table-hover"> |
24 | 24 | <thead> |
... | ... | @@ -59,6 +59,6 @@ |
59 | 59 | |
60 | 60 | <p> |
61 | 61 | <% if project_owner? @project.id %> |
62 | - <%= link_to t('destroy_project'), project_path(@project.id), method: :delete, data: { confirm: t('want_destroy_project') }, class: 'btn btn-danger' %> | |
62 | + <%= link_to t_action(:destroy, Project), project_path(@project.id), method: :delete, data: { confirm: t('want_destroy_project') }, class: 'btn btn-danger' %> | |
63 | 63 | <% end %> |
64 | 64 | </p> | ... | ... |
app/views/reading_groups/_reading.html.erb
... | ... | @@ -4,7 +4,7 @@ |
4 | 4 | <td style="background-color: #<%= reading.color %>; width: 20%;"> </td> |
5 | 5 | <% if reading_groups_owner? @reading_group.id %> |
6 | 6 | <td> |
7 | - <%= link_to t('edit', model: ''), edit_reading_group_reading_path(@reading_group.id, reading.id), class: 'btn btn-info' %> | |
7 | + <%= link_to t('edit'), edit_reading_group_reading_path(@reading_group.id, reading.id), class: 'btn btn-info' %> | |
8 | 8 | </td> |
9 | 9 | <td> |
10 | 10 | <%= link_to t('destroy'), reading_group_reading_path(@reading_group.id, reading.id), method: :delete, data: { confirm: t('sure_destroy', model: Reading.model_name.human) }, class: 'btn btn-danger' %> | ... | ... |
app/views/reading_groups/edit.html.erb
app/views/reading_groups/index.html.erb
... | ... | @@ -4,12 +4,12 @@ |
4 | 4 | |
5 | 5 | <% if user_signed_in? %> |
6 | 6 | <p> |
7 | - <%= link_to "#{t('new.male')} #{ReadingGroup.model_name.human}", new_reading_group_path, class: 'btn btn-primary' %> | |
7 | + <%= link_to t_action(:new, ReadingGroup), new_reading_group_path, class: 'btn btn-primary' %> | |
8 | 8 | </p> |
9 | 9 | <%else%> |
10 | 10 | <p class="alert alert-warning alert-dismissable"> |
11 | 11 | <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button> |
12 | - <%= t('unauthenticated', action: t('create', model: ReadingGroup.model_name.human)) %> | |
12 | + <%= t('unauthenticated', action: t_action(:create, ReadingGroup)) %> | |
13 | 13 | </p> |
14 | 14 | <% end %> |
15 | 15 | ... | ... |
app/views/reading_groups/new.html.erb
app/views/reading_groups/show.html.erb
... | ... | @@ -11,7 +11,9 @@ |
11 | 11 | |
12 | 12 | <h2><%= Reading.model_name.human(count: 2) %></h2> |
13 | 13 | |
14 | -<% if reading_groups_owner? @reading_group.id %><%= link_to "#{t('new.female')} #{Reading.model_name.human}", new_reading_group_reading_path(@reading_group,), class: 'btn btn-primary' %><% end %> | |
14 | +<% if reading_groups_owner? @reading_group.id %> | |
15 | + <%= link_to t_action(:new, Reading), new_reading_group_reading_path(@reading_group,), class: 'btn btn-primary' %> | |
16 | +<% end %> | |
15 | 17 | |
16 | 18 | <table class="table table-hover"> |
17 | 19 | <thead> | ... | ... |
app/views/readings/edit.html.erb
app/views/readings/new.html.erb
app/views/repositories/edit.html.erb
app/views/repositories/new.html.erb
app/views/shared/_reading_groups_list.erb
... | ... | @@ -15,7 +15,7 @@ |
15 | 15 | <td><%= link_to t('show'), reading_group_path(reading_group.id), class: 'btn btn-info' %></td> |
16 | 16 | <td> |
17 | 17 | <% if reading_groups_owner? reading_group.id %> |
18 | - <%= link_to t('edit', model: ''), edit_reading_group_path(reading_group.id), class: 'btn btn-info' %> | |
18 | + <%= link_to t('edit'), edit_reading_group_path(reading_group.id), class: 'btn btn-info' %> | |
19 | 19 | <% end %> |
20 | 20 | </td> |
21 | 21 | </tr> | ... | ... |