Skip to content

Commit

Permalink
Merge 013e64e into abc7d73
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisma committed Apr 3, 2019
2 parents abc7d73 + 013e64e commit 6cbf040
Show file tree
Hide file tree
Showing 3 changed files with 94 additions and 98 deletions.
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" %>
9 changes: 5 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,18 @@

context 'with a filled in rejection information field' do
before do
page.fill_in 'request[rejection_information]', with: 'Info'
@rejection_info = 'a reason why the VM request was rejected'
page.fill_in 'request[rejection_information]', with: @rejection_info
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(@rejection_info)
end

it 'shows rejection information' do
expect(page).to have_text('Info')
it 'redirects to the requests path' do
expect(page).to have_current_path(requests_path)
end
end
end
Expand Down

0 comments on commit 6cbf040

Please sign in to comment.