-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added defects page, fixed symbol for calendar in events and refactore…
…d checklist records page
- Loading branch information
Showing
19 changed files
with
382 additions
and
142 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
This file was deleted.
Oops, something went wrong.
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,107 @@ | ||
# frozen_string_literal: true | ||
|
||
module ChecklistsHelper | ||
def status_symbol(vehicle, event) | ||
unless vehicle.checklists.empty? | ||
if vehicle.checklists.where(event_id: event.id).exists? | ||
'fa-check' | ||
else | ||
"fa-thumbs-down" | ||
end | ||
else | ||
"fa-thumbs-down" | ||
end | ||
end | ||
|
||
def status_word(vehicle, event) | ||
unless vehicle.checklists.empty? | ||
if vehicle.checklists.where(event_id: event.id).exists? | ||
'Completed' | ||
else | ||
"Not Completed" | ||
end | ||
else | ||
"Not Created" | ||
end | ||
end | ||
|
||
def status_word_color(vehicle, event) | ||
unless vehicle.checklists.empty? | ||
if vehicle.checklists.where(event_id: event.id).exists? | ||
'text-success' | ||
else | ||
"text-warning" | ||
end | ||
else | ||
"text-danger" | ||
end | ||
end | ||
|
||
def status_date_word(vehicle, event) | ||
unless vehicle.checklists.empty? | ||
if vehicle.checklists.where(event_id: event.id).exists? | ||
vehicle.checklists.find_by(event_id: event.id).date.strftime('%D') | ||
else | ||
"Not Completed" | ||
end | ||
else | ||
"Not Created" | ||
end | ||
end | ||
|
||
def deadline_word(vehicle, event) | ||
unless vehicle.checklists.empty? | ||
if vehicle.checklists.where(event_id: event.id).exists? | ||
if vehicle.checklists.find_by(event_id: event.id).deadline | ||
'Deadlined' | ||
else | ||
'Not Deadlined' | ||
end | ||
else | ||
"Not Completed" | ||
end | ||
else | ||
"Not Created" | ||
end | ||
end | ||
|
||
def deadline_badge_color(vehicle, event) | ||
unless vehicle.checklists.empty? | ||
if vehicle.checklists.where(event_id: event.id).exists? | ||
if vehicle.checklists.find_by(event_id: event.id).deadline | ||
'badge-danger' | ||
else | ||
'badge-success' | ||
end | ||
else | ||
'badge-warnining' | ||
end | ||
end | ||
end | ||
|
||
def deadline_symbol(vehicle, event) | ||
unless vehicle.checklists.empty? | ||
if vehicle.checklists.where(event_id: event.id).exists? | ||
if vehicle.checklists.find_by(event_id: event.id).deadline | ||
'fa-exclamation-triangle' | ||
else | ||
'fa-check' | ||
end | ||
else | ||
'fa-thumbs-down' | ||
end | ||
end | ||
end | ||
|
||
def checklist_link(vehicle, event) | ||
unless vehicle.checklists.empty? | ||
if vehicle.checklists.where(event_id: event.id).exists? | ||
link_to "Show Checklist", checklist_path( vehicle.checklists.find_by(event_id: event.id).id), class: "btn btn-danger btn-sm" | ||
else | ||
"Not Completed" | ||
end | ||
else | ||
"Not Created" | ||
end | ||
end | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
<div class="jumbotron bg-secondary text-white"> | ||
<h3 class="display-5 text-center">Edit Checklist for <%= @checklist.vehicle.car_id%> for Event:   <%= link_to @checklist.event.id, event_path(@checklist.event.id), class: "badge badge-primary"%> </h3> | ||
<h3 class="display-5 text-center">Edit Checklist for <%= @checklist.vehicle.car_id%> for Event: <%= link_to @checklist.event.id, event_path(@checklist.event.id), class: "badge badge-danger ml-1"%> </h3> | ||
|
||
<%= render 'checklist_form', checklist: @checklist%> | ||
<%= render 'checklist_form', checklist: @checklist%> | ||
</div> |
Oops, something went wrong.