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 | <div class="page-header"> | 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 | <%= render partial: 'created_metrics', locals: {metric_configurations: @metric_configurations} %> | 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,7 +45,7 @@ | ||
45 | 45 | ||
46 | <h2> <%= t('ranges') %> </h2> | 46 | <h2> <%= t('ranges') %> </h2> |
47 | <% if kalibro_configuration_owner? @compound_metric_configuration.kalibro_configuration_id %> | 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 | @compound_metric_configuration.id), class: 'btn btn-info' %> | 49 | @compound_metric_configuration.id), class: 'btn btn-info' %> |
50 | <% end %> | 50 | <% end %> |
51 | 51 | ||
@@ -71,7 +71,7 @@ | @@ -71,7 +71,7 @@ | ||
71 | <p> | 71 | <p> |
72 | <%= link_to t('back'), kalibro_configuration_path(@compound_metric_configuration.kalibro_configuration_id), class: 'btn btn-default' %> | 72 | <%= link_to t('back'), kalibro_configuration_path(@compound_metric_configuration.kalibro_configuration_id), class: 'btn btn-default' %> |
73 | <% if kalibro_configuration_owner? @compound_metric_configuration.kalibro_configuration_id %> | 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 | @compound_metric_configuration.id), method: :delete, data: { confirm: t('want_destroy_metric_configuration') }, | 75 | @compound_metric_configuration.id), method: :delete, data: { confirm: t('want_destroy_metric_configuration') }, |
76 | class: 'btn btn-danger' %> | 76 | class: 'btn btn-danger' %> |
77 | <% end %> | 77 | <% end %> |
app/views/kalibro_configurations/_kalibro_configuration.html.erb
@@ -4,7 +4,7 @@ | @@ -4,7 +4,7 @@ | ||
4 | <td><%= link_to t('show'), kalibro_configuration_path(kalibro_configuration.id), class: 'btn btn-info' %></td> | 4 | <td><%= link_to t('show'), kalibro_configuration_path(kalibro_configuration.id), class: 'btn btn-info' %></td> |
5 | <td> | 5 | <td> |
6 | <% if kalibro_configuration_owner?(kalibro_configuration.id) %> | 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 | <% end %> | 8 | <% end %> |
9 | </td> | 9 | </td> |
10 | </tr> | 10 | </tr> |
11 | \ No newline at end of file | 11 | \ No newline at end of file |
app/views/kalibro_configurations/_metric_configurations.html.erb
@@ -10,7 +10,7 @@ | @@ -10,7 +10,7 @@ | ||
10 | <%= link_to_edit_form(metric_configuration, @kalibro_configuration.id) %> | 10 | <%= link_to_edit_form(metric_configuration, @kalibro_configuration.id) %> |
11 | </td> | 11 | </td> |
12 | <td> | 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 | method: :delete, data: { confirm: t('want_destroy_metric_configuration') }, | 14 | method: :delete, data: { confirm: t('want_destroy_metric_configuration') }, |
15 | class: 'btn btn-danger' %> | 15 | class: 'btn btn-danger' %> |
16 | </td> | 16 | </td> |
app/views/kalibro_configurations/edit.html.erb
app/views/kalibro_configurations/index.html.erb
@@ -4,12 +4,12 @@ | @@ -4,12 +4,12 @@ | ||
4 | 4 | ||
5 | <% if user_signed_in? %> | 5 | <% if user_signed_in? %> |
6 | <p> | 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 | </p> | 8 | </p> |
9 | <%else%> | 9 | <%else%> |
10 | <p class="alert alert-warning alert-dismissable"> | 10 | <p class="alert alert-warning alert-dismissable"> |
11 | <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button> | 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 | </p> | 13 | </p> |
14 | <% end %> | 14 | <% end %> |
15 | 15 |
app/views/kalibro_configurations/new.html.erb
app/views/kalibro_configurations/show.html.erb
@@ -11,7 +11,7 @@ | @@ -11,7 +11,7 @@ | ||
11 | <div id="metrics"> | 11 | <div id="metrics"> |
12 | <h2><%= t('metric').pluralize %></h2> | 12 | <h2><%= t('metric').pluralize %></h2> |
13 | <% if kalibro_configuration_owner? @kalibro_configuration.id %> | 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 | <% end %> | 15 | <% end %> |
16 | 16 | ||
17 | <table class="table table-hover"> | 17 | <table class="table table-hover"> |
@@ -38,6 +38,6 @@ | @@ -38,6 +38,6 @@ | ||
38 | <p> | 38 | <p> |
39 | <%= link_to t('back'), kalibro_configurations_path, class: 'btn btn-default' %> | 39 | <%= link_to t('back'), kalibro_configurations_path, class: 'btn btn-default' %> |
40 | <% if kalibro_configuration_owner? @kalibro_configuration.id %> | 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 | <% end %> | 42 | <% end %> |
43 | </p> | 43 | </p> |
app/views/kalibro_ranges/_no_readings.html.erb
@@ -2,7 +2,7 @@ | @@ -2,7 +2,7 @@ | ||
2 | <h4 class="alert-heading"><%= t('activemodel.errors.kalibro_range.no_readings') %></h4> | 2 | <h4 class="alert-heading"><%= t('activemodel.errors.kalibro_range.no_readings') %></h4> |
3 | <p> | 3 | <p> |
4 | <% if reading_groups_owner? @reading_group_id %> | 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 | <% else %> | 6 | <% else %> |
7 | <p><%= t('activemodel.errors.kalibro_range.reading_group_belongs_to_another') %></p> | 7 | <p><%= t('activemodel.errors.kalibro_range.reading_group_belongs_to_another') %></p> |
8 | <% end %> | 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 | <%= form_for(@kalibro_range, :url => kalibro_configuration_metric_configuration_kalibro_range_update_url( | 3 | <%= form_for(@kalibro_range, :url => kalibro_configuration_metric_configuration_kalibro_range_update_url( |
4 | @kalibro_configuration_id, @metric_configuration_id, @kalibro_range.id), method: :put) do |f| %> | 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 | <%= form_for(@kalibro_range, :url => kalibro_configuration_metric_configuration_kalibro_ranges_path( | 3 | <%= form_for(@kalibro_range, :url => kalibro_configuration_metric_configuration_kalibro_ranges_path( |
4 | @kalibro_configuration_id, @metric_configuration_id)) do |f| %> | 4 | @kalibro_configuration_id, @metric_configuration_id)) do |f| %> |
app/views/metric_configurations/show.html.erb
@@ -53,7 +53,7 @@ | @@ -53,7 +53,7 @@ | ||
53 | 53 | ||
54 | <h2><%= KalibroRange.model_name.human(count: 2) %></h2> | 54 | <h2><%= KalibroRange.model_name.human(count: 2) %></h2> |
55 | <% if kalibro_configuration_owner? @metric_configuration.kalibro_configuration_id %> | 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 | @metric_configuration.id), class: 'btn btn-info' %> | 57 | @metric_configuration.id), class: 'btn btn-info' %> |
58 | <% end %> | 58 | <% end %> |
59 | 59 | ||
@@ -77,7 +77,7 @@ | @@ -77,7 +77,7 @@ | ||
77 | <p> | 77 | <p> |
78 | <%= link_to t('back'), kalibro_configuration_path(@metric_configuration.kalibro_configuration_id), class: 'btn btn-default' %> | 78 | <%= link_to t('back'), kalibro_configuration_path(@metric_configuration.kalibro_configuration_id), class: 'btn btn-default' %> |
79 | <% if kalibro_configuration_owner? @metric_configuration.kalibro_configuration_id %> | 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 | @metric_configuration.id), method: :delete, data: { confirm: t('want_destroy_metric_configuration') }, | 81 | @metric_configuration.id), method: :delete, data: { confirm: t('want_destroy_metric_configuration') }, |
82 | class: 'btn btn-danger' %> | 82 | class: 'btn btn-danger' %> |
83 | <% end %> | 83 | <% end %> |
app/views/projects/edit.html.erb
app/views/projects/index.html.erb
@@ -4,12 +4,12 @@ | @@ -4,12 +4,12 @@ | ||
4 | 4 | ||
5 | <% if user_signed_in? %> | 5 | <% if user_signed_in? %> |
6 | <p> | 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 | </p> | 8 | </p> |
9 | <%else%> | 9 | <%else%> |
10 | <p class="alert alert-warning alert-dismissable"> | 10 | <p class="alert alert-warning alert-dismissable"> |
11 | <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button> | 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 | </p> | 13 | </p> |
14 | <% end %> | 14 | <% end %> |
15 | 15 |
app/views/projects/new.html.erb
app/views/projects/show.html.erb
@@ -18,7 +18,7 @@ | @@ -18,7 +18,7 @@ | ||
18 | 18 | ||
19 | <h2><%= Repository.model_name.human(count: 2) %></h2> | 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 | <table class="table table-hover"> | 23 | <table class="table table-hover"> |
24 | <thead> | 24 | <thead> |
@@ -59,6 +59,6 @@ | @@ -59,6 +59,6 @@ | ||
59 | 59 | ||
60 | <p> | 60 | <p> |
61 | <% if project_owner? @project.id %> | 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 | <% end %> | 63 | <% end %> |
64 | </p> | 64 | </p> |
app/views/reading_groups/_reading.html.erb
@@ -4,7 +4,7 @@ | @@ -4,7 +4,7 @@ | ||
4 | <td style="background-color: #<%= reading.color %>; width: 20%;"> </td> | 4 | <td style="background-color: #<%= reading.color %>; width: 20%;"> </td> |
5 | <% if reading_groups_owner? @reading_group.id %> | 5 | <% if reading_groups_owner? @reading_group.id %> |
6 | <td> | 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 | </td> | 8 | </td> |
9 | <td> | 9 | <td> |
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' %> | 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
1 | <div class="page-header"> | 1 | <div class="page-header"> |
2 | - <h1><%= t('edit', model: ReadingGroup.model_name.human) %></h1> | 2 | + <h1><%= t_action(:edit, ReadingGroup) %></h1> |
3 | </div> | 3 | </div> |
4 | 4 | ||
5 | <%= render 'form' %> | 5 | <%= render 'form' %> |
6 | \ No newline at end of file | 6 | \ No newline at end of file |
app/views/reading_groups/index.html.erb
@@ -4,12 +4,12 @@ | @@ -4,12 +4,12 @@ | ||
4 | 4 | ||
5 | <% if user_signed_in? %> | 5 | <% if user_signed_in? %> |
6 | <p> | 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 | </p> | 8 | </p> |
9 | <%else%> | 9 | <%else%> |
10 | <p class="alert alert-warning alert-dismissable"> | 10 | <p class="alert alert-warning alert-dismissable"> |
11 | <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button> | 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 | </p> | 13 | </p> |
14 | <% end %> | 14 | <% end %> |
15 | 15 |
app/views/reading_groups/new.html.erb
app/views/reading_groups/show.html.erb
@@ -11,7 +11,9 @@ | @@ -11,7 +11,9 @@ | ||
11 | 11 | ||
12 | <h2><%= Reading.model_name.human(count: 2) %></h2> | 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 | <table class="table table-hover"> | 18 | <table class="table table-hover"> |
17 | <thead> | 19 | <thead> |
app/views/readings/edit.html.erb
1 | <div class="page-header"> | 1 | <div class="page-header"> |
2 | - <h1><%= t('edit', model: Reading.model_name.human) %></h1> | 2 | + <h1><%= t_action(:edit, Reading) %></h1> |
3 | </div> | 3 | </div> |
4 | 4 | ||
5 | <%= form_for(@reading, :url => reading_group_reading_update_path(@reading.reading_group_id, @reading.id), method: :put) do |f| %> | 5 | <%= form_for(@reading, :url => reading_group_reading_update_path(@reading.reading_group_id, @reading.id), method: :put) do |f| %> |
app/views/readings/new.html.erb
1 | <div class="page-header"> | 1 | <div class="page-header"> |
2 | - <h1><%= "#{t('new.female')} #{Reading.model_name.human}" %></h1> | 2 | + <h1><%= t_action(:new, Reading) %></h1> |
3 | </div> | 3 | </div> |
4 | 4 | ||
5 | <%= form_for(@reading, :url => reading_group_readings_path(@reading_group_id)) do |f| %> | 5 | <%= form_for(@reading, :url => reading_group_readings_path(@reading_group_id)) do |f| %> |
app/views/repositories/edit.html.erb
1 | <div class="page-header"> | 1 | <div class="page-header"> |
2 | - <h1><%= "#{t('edit')} #{Repository.model_name.human}" %></h1> | 2 | + <h1><%= t_action(:edit, Repository) %></h1> |
3 | </div> | 3 | </div> |
4 | 4 | ||
5 | <%= form_for(@repository, :url => project_repository_update_url(@project_id, @repository.id), method: :put) do |f| %> | 5 | <%= form_for(@repository, :url => project_repository_update_url(@project_id, @repository.id), method: :put) do |f| %> |
app/views/repositories/new.html.erb
1 | <div class="page-header"> | 1 | <div class="page-header"> |
2 | - <h1><%= "#{t('new.male')} #{Repository.model_name.human}" %></h1> | 2 | + <h1><%= t_action(:new, Repository) %></h1> |
3 | </div> | 3 | </div> |
4 | 4 | ||
5 | <%= form_for(@repository, :url => project_repositories_url(@project_id)) do |f| %> | 5 | <%= form_for(@repository, :url => project_repositories_url(@project_id)) do |f| %> |
app/views/shared/_reading_groups_list.erb
@@ -15,7 +15,7 @@ | @@ -15,7 +15,7 @@ | ||
15 | <td><%= link_to t('show'), reading_group_path(reading_group.id), class: 'btn btn-info' %></td> | 15 | <td><%= link_to t('show'), reading_group_path(reading_group.id), class: 'btn btn-info' %></td> |
16 | <td> | 16 | <td> |
17 | <% if reading_groups_owner? reading_group.id %> | 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 | <% end %> | 19 | <% end %> |
20 | </td> | 20 | </td> |
21 | </tr> | 21 | </tr> |