Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix(Footer): Less HTML #518

Open
wants to merge 13 commits into
base: dev
Choose a base branch
from
24 changes: 8 additions & 16 deletions app/views/application/_footer.html.erb
Original file line number Diff line number Diff line change
@@ -1,17 +1,9 @@
<div id="footer" class="text-white bg-primary">
<div class="container-fluid">
<div class="row">
<div class="col-md-6 text-left footer-element__left">
<h4>
More Information
</h4>
<p>&copy;
<%= " " %>
<%= link_to "HPI Enterprise Platform and Integration Concepts", 'https://hpi.de/plattner/home.html' %>
<%= ' - ' %>
<%= link_to "Legal Notice", 'https://hpi.de/en/impressum.html' %>
</p>
</div>
</div>
<footer class="fixed-bottom text-white bg-primary">
<div class="p-2">
&copy;
<%= link_to "HPI Enterprise Platform and Integration Concepts", 'https://hpi.de/plattner/home.html' %>
-
<%= link_to "Legal Notice", 'https://hpi.de/en/impressum.html' %>
</div>
</div>
</footer>

159 changes: 81 additions & 78 deletions app/views/requests/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,91 +2,94 @@

<table class="table">
<tbody>
<tr>
<td><strong>VM Name</strong></td>
<td><%= @request.name %></td>
</tr>

<tr>
<td><strong>CPU cores</strong></td>
<td><%= @request.cpu_cores %></td>
</tr>

<tr>
<td><strong>RAM in GB</strong></td>
<td><%= @request.ram_gb %></td>
</tr>

<tr>
<td><strong>Storage in GB</strong></td>
<td><%= @request.storage_gb %></td>
</tr>

<tr>
<td><strong>Operating System</strong></td>
<td><%= @request.operating_system %></td>
</tr>

<tr>
<td><strong>Port</strong></td>
<td><%= @request.port %></td>
</tr>

<tr>
<td><strong>Application Name</strong></td>
<td><%= @request.application_name %></td>
</tr>

<tr>
<td><strong>Description</strong></td>
<td class="col-md-4"><%= @request.description %></td>
</tr>

<tr>
<td><strong>Comment</strong></td>
<td class="col-md-4"><%= @request.comment %></td>
</tr>

<tr>
<td><strong>Status</strong></td>
<td><%= @request.status %></td>
</tr>

<tr>
<td><strong>Responsible users</strong></td>
<td>
<% @request.responsible_users.each do |user| %>
<p><%= user.email %></p>
<% end %>
</td>
</tr>

<tr>
<td><strong>Users with sudo rights</strong></td>
<td>
<% @request.sudo_user_assignments.each do |assignment| %>
<p><%= assignment.user.email %></p>
<% end %>
</td>
</tr>

<tr>
<td><strong>Users</strong></td>
<td>
<% @request.non_sudo_user_assignments.each do |assignment| %>
<p><%= assignment.user.email %></p>
<% end %>
</td>
</tr>

<% if @request.rejected? %>
<tr>
<td><strong>VM Name</strong></td>
<td><%= @request.name %></td>
</tr>

<tr>
<td><strong>CPU cores</strong></td>
<td><%= @request.cpu_cores %></td>
</tr>

<tr>
<td><strong>RAM in GB:</strong></td>
<td><%= @request.ram_gb %></td>
</tr>

<tr>
<td><strong>Storage in GB:</strong></td>
<td><%= @request.storage_gb %></td>
</tr>

<tr>
<td><strong>Operating System</strong></td>
<td><%= @request.operating_system %></td>
</tr>

<tr>
<td><strong>Port</strong></td>
<td><%= @request.port %></td>
</tr>

<tr>
<td><strong>Application Name</strong></td>
<td><%= @request.application_name %></td>
</tr>

<tr>
<td><strong>Description</strong></td>
<td class="col-md-4"><%= @request.description %></td>
</tr>

<tr>
<td><strong>Comment</strong></td>
<td class="col-md-4"><%= @request.comment %></td>
</tr>

<tr>
<td><strong>Status</strong></td>
<td><%= @request.status %></td>
</tr>

<tr>
<td><strong>Responsible users</strong></td>
<td><strong>Rejection Information</strong></td>
<td>
<% @request.responsible_users.each do |user| %>
<p><%= user.email %></p>
<% end %>
</td>
</tr>

<tr>
<td><strong>Users with sudo rights</strong></td>
<td>
<% @request.sudo_user_assignments.each do |assignment| %>
<p><%= assignment.user.email %></p>
<% end %>
</td>
</tr>

<tr>
<td><strong>Users</strong></td>
<p><%= @request.rejection_information %><p>
<td>
<% @request.non_sudo_user_assignments.each do |assignment| %>
<p><%= assignment.user.email %></p>
<% end %>
</td>
</tr>
<% end %>

</tbody>
</table>

<% if @request.rejected? %>
<p>
<strong>Rejection Information:</strong>
<%= @request.rejection_information %>
</p>
<% end %>

<%= link_to 'Back', requests_path, class: "btn btn-secondary" %>
8 changes: 4 additions & 4 deletions spec/features/requests/accept_reject_request_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,17 @@

context 'with a filled in rejection information field' do
before do
page.fill_in 'request[rejection_information]', with: 'Info'
page.fill_in 'request[rejection_information]', with: 'A rejection information'
click_button('rejectButton')
end

it 'saves the rejection information' do
request.reload
expect(request.rejection_information).to eq('Info')
expect(request.rejection_information).to eq('A rejection information')
end

it 'shows rejection information' do
expect(page).to have_text('Info')
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should (re)add a test that the rejection information is actually displayed to the user

it 'redirects to the requests path' do
expect(page).to have_current_path(requests_path)
end
end
end
Expand Down