-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Thomas Scherz
committed
Jun 14, 2024
1 parent
ec87653
commit ea071a7
Showing
9 changed files
with
184 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<div class="container animated fadeIn" style="opacity: 0.8;"> | ||
<div class="card-detail bg-dark text-white p-4"> | ||
<hr class="bg-white"> | ||
|
||
<h1 class="text-center" style="color: white;">Edit Software Status</h1> | ||
|
||
<%= form_with(model: @software_record, url: update_decommissioned_software_record_path(@software_record), local: true, class: 'mt-4') do |form| %> | ||
<% if @software_record.errors.any? %> | ||
<div id="error_explanation" class="alert alert-danger"> | ||
<h2><%= pluralize(@software_record.errors.count, "error") %> prohibited this status from being saved:</h2> | ||
<ul> | ||
<% @software_record.errors.full_messages.each do |message| %> | ||
<li><%= message %></li> | ||
<% end %> | ||
</ul> | ||
</div> | ||
<% end %> | ||
|
||
<% if !@software_record.title.nil? && !@software_record.title.to_s.empty? %> | ||
<div class="form-group"> | ||
<%= form.label :title, class: 'form-label' %> | ||
<p class="form-control-plaintext text-white"><%= @software_record.title %></p> <!-- Display the title but don't allow editing --> | ||
</div> | ||
<% end %> | ||
|
||
<div class="form-group"> | ||
<%= form.label :status_id, class: 'form-label' %> | ||
<%= form.collection_select :status_id, Status.all, :id, :title, prompt: "Select Status" %> | ||
</div> | ||
|
||
<div class="actions mt-3"> | ||
<%= form.submit 'Update', class: 'btn btn-primary' %> | ||
<%= link_to 'Back', software_records_path, class: 'btn btn-secondary ml-2' %> | ||
</div> | ||
<% end %> | ||
</div> | ||
</div> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
<section class="jumbotron text-center"> | ||
<br/> | ||
<hr style = "background-color: black; width: 54%;"> | ||
<div class="container-fluid"> | ||
<h1 class="jumbotron-heading display-4" style="text-align: center; color: black; font-family: Courier New, Lucida, Console">Decommissioned | ||
List</h1> | ||
<em style="font-size: 14px; color: black">Collection of all the software application that have been decommissioned.</em><br/><br/> | ||
</div> | ||
<br/> | ||
<hr style = "background-color: black; width: 54%;"> | ||
</section> | ||
|
||
<% if @softwarerecords_count != 0 %> | ||
<div class="container animated fadeInLeft" style="margin-bottom: 10rem"> | ||
<div class="row"> | ||
<table class="table software-records-table" style="word-break: initial;"> | ||
<thead> | ||
<tr> | ||
<th class="text-left" style="padding-left: 20px"><%= sortable "title", "Title" %> | ||
<% if params[:direction] == "asc" || params[:direction] == nil %> | ||
<i class="fa fa-caret-up"></i> | ||
<% else %> | ||
<i class="fa fa-caret-down"></i> | ||
<% end %></th> | ||
|
||
<% if current_user.role.to_s == "viewer" %> | ||
<th class="text-left" style="padding-left: 20px">Actions</th> | ||
<% elsif current_user.role.to_s == "owner" %> | ||
<th colspan="2" class="text-left" style="padding-left: 20px">Actions</th> | ||
<% else %> | ||
<th colspan="3" class="text-left" style="padding-left: 20px">Actions</th> | ||
<% end %> | ||
</tr> | ||
</thead> | ||
|
||
<tbody> | ||
<% @software_records.each do |software_record| %> | ||
<tr> | ||
<td style="padding-left: 40px; white-space: nowrap;"><%= software_record.title %></td> | ||
<% if current_user.role.to_s == "viewer" %> | ||
<td><%= link_to 'View', software_record , { :class => "btn btn-success action-btn" }%></td> | ||
<% elsif current_user.role.to_s == "owner" %> | ||
<td><%= link_to 'Change Status', edit_decommissioned_software_record_path(software_record), class: "btn btn-primary action-btn", style: | ||
"white-space: nowrap;" %></td> | ||
<% else %> | ||
<td><%= link_to 'Change Status', edit_decommissioned_software_record_path(software_record), class: "btn btn-primary action-btn", style: | ||
"white-space: nowrap;" %></td> | ||
|
||
<% end %> | ||
</tr> | ||
<% end %> | ||
</tbody> | ||
</table> | ||
</div> | ||
</div> | ||
<% else %> | ||
<h3 class="text-center">No records found</h3> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# frozen_string_literal: true | ||
|
||
namespace 'app_port' do | ||
desc 'Creates Decommissioned Status' | ||
task create_decom: :environment do | ||
# NOTE: In order to see progress in the logs, you must have logging at :info or above | ||
WorksResave.work_resave | ||
Status.new(title: 'Decommissioned', status_type: 'Decommissioned') | ||
end | ||
end |