Skip to content

Commit 2264c45

Browse files
style: code cleanup
1 parent e7e1df8 commit 2264c45

File tree

141 files changed

+523
-537
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

141 files changed

+523
-537
lines changed

app/views/activities/index.html.erb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@
1616
<% rescue %>
1717
<% end %>
1818
<i>(<%= activity.created_at.getlocal.strftime("%d/%m/%Y %H:%M") %>)</i>
19-
<br/>
19+
<br>
2020
<ul>
2121
<% begin %>
2222
<% activity.parameters.to_h.each do |key, values| %>
2323
<li><%= key %> :
24-
<% if values && values.respond_to?(:each) %>
24+
<% if values && values.respond_to?(:each) %>
2525
<% values.each_with_index do |v, index| %>
26-
<%= v.present? ? v : v.inspect %> <%= ' => ' unless index == values.size-1 %>
26+
<%= v.presence || v.inspect %> <%= ' => ' unless index == values.size-1 %>
2727
<% end %>
2828
<% else %>
2929
<%= values %>

app/views/architectures/edit.html.erb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<%= render 'layouts/breadcrumb', breadcrumb_variables: {
2-
t("inventories") => modeles_url,
3-
'Architectures' => architectures_path,
4-
@architecture => '',
5-
} %>
2+
t("inventories") => modeles_url,
3+
'Architectures' => architectures_path,
4+
@architecture => ''
5+
} %>
66

77
<div class="container">
88
<div class="page-header">

app/views/architectures/index.html.erb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<%= render 'layouts/breadcrumb', breadcrumb_variables: {
2-
t("inventories") => modeles_url,
3-
Architecture.model_name.human.pluralize => ""
4-
}%>
2+
t("inventories") => modeles_url,
3+
Architecture.model_name.human.pluralize => ""
4+
} %>
55

66
<div class="container-fluid">
77

app/views/architectures/new.html.erb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<%= render 'layouts/breadcrumb', breadcrumb_variables: {
2-
t("inventories") => modeles_url,
3-
'Architectures' => architectures_path,
4-
"Nouvelle architecture" => '',
5-
} %>
2+
t("inventories") => modeles_url,
3+
'Architectures' => architectures_path,
4+
"Nouvelle architecture" => ''
5+
} %>
66

77
<div class="container">
88
<div class="page-header">

app/views/bays/_export_button.html.erb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,31 +5,31 @@
55
<ul class="dropdown-menu dropdown-menu-right">
66

77
<li class="dropdown-submenu pull-left">
8-
<%= link_to bay_path(bay, format: 'pdf', view: 'front', bg: ''), target: :_blank do %>
8+
<%= link_to bay_path(bay, format: 'pdf', view: 'front', bg: ''), target: :_blank, rel: :noopener do %>
99
<span class="glyphicon glyphicon-file" aria-hidden="true"></span>
1010
Export PDF
1111
<% end %>
1212
<ul class="dropdown-menu dropdown-menu-left">
1313
<li>
14-
<%= link_to bay_path(bay, format: 'pdf', view: 'front', bg: ''), target: :_blank do %>
14+
<%= link_to bay_path(bay, format: 'pdf', view: 'front', bg: ''), target: :_blank, rel: :noopener do %>
1515
<span class="glyphicon glyphicon-file" aria-hidden="true"></span>
1616
Face avant
1717
<% end %>
1818
</li>
1919
<li>
20-
<%= link_to bay_path(bay, format: 'pdf', view: 'back', bg: ''), target: :_blank do %>
20+
<%= link_to bay_path(bay, format: 'pdf', view: 'back', bg: ''), target: :_blank, rel: :noopener do %>
2121
<span class="glyphicon glyphicon-file" aria-hidden="true"></span>
2222
Face arrière
2323
<% end %>
2424
</li>
2525
<li>
26-
<%= link_to bay_path(bay, format: 'pdf', view: 'front', bg: 'cablage'), target: :_blank do %>
26+
<%= link_to bay_path(bay, format: 'pdf', view: 'front', bg: 'cablage'), target: :_blank, rel: :noopener do %>
2727
<span class="glyphicon glyphicon-file" aria-hidden="true"></span>
2828
Cablage - Face avant
2929
<% end %>
3030
</li>
3131
<li>
32-
<%= link_to bay_path(bay, format: 'pdf', view: 'back', bg: 'cablage'), target: :_blank do %>
32+
<%= link_to bay_path(bay, format: 'pdf', view: 'back', bg: 'cablage'), target: :_blank, rel: :noopener do %>
3333
<span class="glyphicon glyphicon-file" aria-hidden="true"></span>
3434
Cablage - Face arrière
3535
<% end %>
@@ -43,7 +43,7 @@
4343
<% end %>
4444
</li>
4545

46-
<li><%= link_to bay_path(bay, format: 'pdf', view: 'front', bg: '', debug: '1'), target: :_blank do %>
46+
<li><%= link_to bay_path(bay, format: 'pdf', view: 'front', bg: '', debug: '1'), target: :_blank, rel: :noopener do %>
4747
<span class="glyphicon glyphicon-print" aria-hidden="true"></span>
4848
Impression
4949
<% end %>

app/views/bays/_overview.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
grid-row:<%= "#{bay.lane.to_i}/#{bay.lane.to_i+1}" %>;
99
max-width: 195px;">
1010
<% bay.frames.sorted.each_with_index do |frame, index| %>
11-
<div class="overviewed_frame <%= 'no-margin' if index > 0 %> <%= 'highlighted' if @frames && @frames.include?(frame) %>">
11+
<div class="overviewed_frame <%= 'no-margin' if index.positive? %> <%= 'highlighted' if @frames&.include?(frame) %>">
1212
<%= link_to frame.name, room_path(frame.room, view: params[:view], islet: islet, 'bay-id': bay, 'frame-id': frame) %>
1313
</div>
1414
<% end %>

app/views/bays/edit.html.erb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<%= render 'layouts/breadcrumb', breadcrumb_variables: {
2-
t("inventories") => modeles_url,
3-
'Baies et doubles-baies' => bays_path,
4-
@bay.frames.map(&:name).join(' - ') => ''}
5-
%>
2+
t("inventories") => modeles_url,
3+
'Baies et doubles-baies' => bays_path,
4+
@bay.frames.map(&:name).join(' - ') => ''
5+
} %>
66

77
<div class="container">
88
<div class="page-header">

app/views/bays/index.html.erb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,7 @@
4343
</td>
4444

4545
<td>
46-
<%=
47-
bay.frames.map do |frame|
46+
bay.frames.map do |frame|
4847
link_to(frame.name, frame_path(frame))
4948
end.join(' / ').html_safe
5049
%>

app/views/bays/new.html.erb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<%= render 'layouts/breadcrumb', breadcrumb_variables: {
2-
t("inventories") => modeles_url,
3-
'Baies et doubles-baies' => bays_path,
4-
'Nouvelle baie' => ''}
5-
%>
2+
t("inventories") => modeles_url,
3+
'Baies et doubles-baies' => bays_path,
4+
'Nouvelle baie' => ''
5+
} %>
66

77
<div class="container">
88
<div class="page-header">

app/views/bays/show.html.erb

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<% provide :title, "Double baie #{@bay}" %>
2-
<%
3-
breadcrumb_variables = { t("visualization") => overview_rooms_path, @bay.room.name => room_path(@bay.room, view: params[:view]) }
2+
breadcrumb_variables = { t("visualization") => overview_rooms_path, @bay.room.name => room_path(@bay.room, view: params[:view]) }
43
if @bay.islet.name.present?
54
breadcrumb_variables["Ilot #{@bay.islet.name}"] = room_path(@bay.room, islet: @bay.islet.name, view: params[:view])
65
elsif params[:islet].present?
@@ -12,11 +11,11 @@
1211

1312
<div class="container-fluid" id="bay-container">
1413
<%= render partial: 'servers/room', locals: {
15-
room: @bay.room,
16-
islets: @servers_per_frames[@bay.islet.room_id],
17-
title: @bay.frames.size > 1 ? "Double baie #{@bay}" : @bay,
18-
view_side: params[:view],
19-
} %>
14+
room: @bay.room,
15+
islets: @servers_per_frames[@bay.islet.room_id],
16+
title: @bay.frames.size > 1 ? "Double baie #{@bay}" : @bay,
17+
view_side: params[:view]
18+
} %>
2019
</div>
2120

2221
<%= render 'servers/modal_add_element_in_frame' %>

app/views/bays/show.js.erb

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@ if (typeof delete_all_lines === "function") {
55
$('.couple .overviewed_frame').removeClass('selected')
66
$('.couple .overviewed_frame[data-bay-id=<%= @bay.id %>]').addClass('selected')
77

8-
$('#bay-container').html("<%= escape_javascript(render partial: 'servers/room', locals: {
9-
room: @bay.room,
10-
islets: @servers_per_frames[@bay.islet.room_id],
11-
title: @bay.frames.size > 1 ? "Double baie #{@bay}" : @bay,
12-
view_side: params[:view]}) %>")
8+
$('#bay-container').html("<%= escape_javascript(render(partial: 'servers/room', locals: {
9+
room: @bay.room,
10+
islets: @servers_per_frames[@bay.islet.room_id],
11+
title: @bay.frames.size > 1 ? "Double baie #{@bay}" : @bay,
12+
view_side: params[:view]
13+
})) %>")
1314

1415
var searchParams = new URLSearchParams(window.location.search)
1516
var view = '<%= params[:view] %>'

app/views/card_types/edit.html.erb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<%= render 'layouts/breadcrumb', breadcrumb_variables: {
2-
t("inventories") => modeles_url,
3-
CardType.model_name.human.pluralize => card_types_path,
4-
@card_type => '' }
5-
%>
2+
t("inventories") => modeles_url,
3+
CardType.model_name.human.pluralize => card_types_path,
4+
@card_type => ''
5+
} %>
66

77
<div class="container">
88
<div class="page-header">

app/views/card_types/index.html.erb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<%= render 'layouts/breadcrumb', breadcrumb_variables: {
2-
t("inventories") => modeles_url,
3-
CardType.model_name.human.pluralize => "" }
4-
%>
2+
t("inventories") => modeles_url,
3+
CardType.model_name.human.pluralize => ""
4+
} %>
55

66
<div class="container-fluid">
77

app/views/card_types/new.html.erb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<%= render 'layouts/breadcrumb', breadcrumb_variables: {
2-
t("inventories") => modeles_url,
3-
CardType.model_name.human.pluralize => card_types_path,
4-
t(".title") => '',
5-
} %>
2+
t("inventories") => modeles_url,
3+
CardType.model_name.human.pluralize => card_types_path,
4+
t(".title") => ''
5+
} %>
66

77
<div class="container">
88
<div class="page-header">

app/views/categories/edit.html.erb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<%= render 'layouts/breadcrumb', breadcrumb_variables: {
2-
t("inventories") => modeles_url,
3-
Category.model_name.human.pluralize => categories_path,
4-
@category => '',
5-
} %>
2+
t("inventories") => modeles_url,
3+
Category.model_name.human.pluralize => categories_path,
4+
@category => ''
5+
} %>
66

77
<div class="container">
88
<div class="page-header">

app/views/categories/index.html.erb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<%= render 'layouts/breadcrumb', breadcrumb_variables: {
2-
t("inventories") => modeles_url,
3-
t(".title") => ''}
4-
%>
2+
t("inventories") => modeles_url,
3+
t(".title") => ''
4+
} %>
55

66
<div class="container-fluid">
77

@@ -42,7 +42,7 @@
4242
<td>
4343
<%= link_to category.name, category_path(category) %>
4444
</td>
45-
<td><%= link_to "#{pluralize(category.modeles.count, 'modèle', 'modèles')}", modeles_path %> </td>
45+
<td><%= link_to pluralize(category.modeles.count, 'modèle', 'modèles').to_s, modeles_path %> </td>
4646
<td class="text-right">
4747
<%= link_to t("action.edit"), edit_category_path(category), class: 'btn btn-primary' %>
4848
<%= link_to t("action.delete"),

app/views/categories/new.html.erb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<%= render 'layouts/breadcrumb', breadcrumb_variables: {
2-
t("inventories") => modeles_url,
3-
Category.model_name.human.pluralize => categories_path,
4-
t(".title") => '',
5-
} %>
2+
t("inventories") => modeles_url,
3+
Category.model_name.human.pluralize => categories_path,
4+
t(".title") => ''
5+
} %>
66

77
<div class="container">
88
<div class="page-header">

app/views/changelog_entries/index.html.erb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<% provide(:title, ChangelogEntry.model_name.human.pluralize) %>
22
<%= render "layouts/breadcrumb", breadcrumb_variables: {
3-
ChangelogEntry.model_name.human.pluralize => ""
4-
} %>
3+
ChangelogEntry.model_name.human.pluralize => ""
4+
} %>
55

66
<div class="container-fluid">
77
<div class="page-header">
@@ -32,7 +32,7 @@
3232
</td>
3333
<td><%= link_to changelog_entry.author_display_name, changelog_entry.author %></td>
3434
<td><%= render changelog_entry.action_label_to_component %></td>
35-
<td><%=l changelog_entry.created_at %></td>
35+
<td><%= l changelog_entry.created_at %></td>
3636
<% end %>
3737
</tbody>
3838
</table>

app/views/changelog_entries/show.html.erb

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<% provide(:title, ChangelogEntry.model_name.human.pluralize) %>
22
<%= render "layouts/breadcrumb", breadcrumb_variables: {
3-
ChangelogEntry.model_name.human.pluralize => changelog_entries_path,
4-
"#{@changelog_entry.id} - #{@changelog_entry.action} - #{@changelog_entry.object}" => ""
5-
} %>
3+
ChangelogEntry.model_name.human.pluralize => changelog_entries_path,
4+
"#{@changelog_entry.id} - #{@changelog_entry.action} - #{@changelog_entry.object}" => ""
5+
} %>
66

77
<div class="container-fluid">
88
<div class="page-header">
9-
<h3><%=t ".informations" %></h3>
9+
<h3><%= t ".informations" %></h3>
1010
<dl class="dl-horizontal">
1111
<dt><%= ChangelogEntry.human_attribute_name(:object) %></dt>
1212
<dd>
@@ -27,21 +27,21 @@
2727
<dd><%= link_to @changelog_entry.author_display_name, @changelog_entry.author %></dd>
2828

2929
<dt><%= ChangelogEntry.human_attribute_name(:created_at) %></dt>
30-
<dd><%=l @changelog_entry.created_at %></dd>
30+
<dd><%= l @changelog_entry.created_at %></dd>
3131
</dl>
3232
</div>
3333

34-
<h3><%=t ".changes" %></h3>
34+
<h3><%= t ".changes" %></h3>
3535
<div class="row">
3636
<div class="col-md-6">
37-
<%=sanitize @changelog_entry.split_diff.left %>
37+
<%= sanitize @changelog_entry.split_diff.left %>
3838
</div>
3939
<div class="col-md-6">
40-
<%=sanitize @changelog_entry.split_diff.right %>
40+
<%= sanitize @changelog_entry.split_diff.right %>
4141
</div>
4242
</div>
4343

44-
<h3><%=t ".metadatas" %></h3>
44+
<h3><%= t ".metadatas" %></h3>
4545
<dl class="dl-horizontal">
4646
<% @changelog_entry.metadata.each do |key, value| %>
4747
<dt><%= key %></dt>

app/views/clusters/edit.html.erb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<%= render 'layouts/breadcrumb', breadcrumb_variables: {
2-
t("inventories") => modeles_url,
3-
'Clusters' => clusters_path,
4-
@cluster => ''
5-
} %>
2+
t("inventories") => modeles_url,
3+
'Clusters' => clusters_path,
4+
@cluster => ''
5+
} %>
66

77
<div class="container">
88
<div class="page-header">

app/views/clusters/index.html.erb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<%= render 'layouts/breadcrumb', breadcrumb_variables: {
2-
t("inventories") => modeles_url,
3-
Cluster.model_name.human.pluralize => "" }
4-
%>
2+
t("inventories") => modeles_url,
3+
Cluster.model_name.human.pluralize => ""
4+
} %>
55

66
<div class="container-fluid">
77

app/views/clusters/new.html.erb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<%= render 'layouts/breadcrumb', breadcrumb_variables: {
2-
t("inventories") => modeles_url,
3-
Cluster.model_name.human.pluralize => clusters_path,
4-
t(".title") => ''}
5-
%>
2+
t("inventories") => modeles_url,
3+
Cluster.model_name.human.pluralize => clusters_path,
4+
t(".title") => ''
5+
} %>
66

77
<div class="container">
88
<div class="page-header">

app/views/colors/edit.html.erb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<%= render 'layouts/breadcrumb', breadcrumb_variables: {
2-
t("inventories") => modeles_url,
3-
Color.model_name.human.pluralize => colors_path,
4-
@color.code => '',
5-
} %>
2+
t("inventories") => modeles_url,
3+
Color.model_name.human.pluralize => colors_path,
4+
@color.code => ''
5+
} %>
66

77
<div class="container">
88
<div class="page-header">

app/views/colors/index.html.erb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<%= render 'layouts/breadcrumb', breadcrumb_variables: {
2-
t("inventories") => modeles_url,
3-
Color.model_name.human.pluralize => ""}
4-
%>
2+
t("inventories") => modeles_url,
3+
Color.model_name.human.pluralize => ""
4+
} %>
55

66
<div class="container-fluid">
77

0 commit comments

Comments
 (0)