Basic feature implemented, very basic poc
This commit is contained in:
parent
216089a3e7
commit
48c0067076
118 changed files with 2113 additions and 20 deletions
|
|
@ -24,8 +24,8 @@ $font-family-sans-serif:
|
|||
// Emoji fonts
|
||||
"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji" !default;
|
||||
|
||||
$primary: #0074d9;
|
||||
$danger: #ff4136;
|
||||
|
||||
@import 'bootstrap/scss/bootstrap';
|
||||
@import 'bootstrap-icons/font/bootstrap-icons';
|
||||
@import "rails_bootstrap_forms.css";
|
||||
|
||||
@import "./layout.scss";
|
||||
14
app/assets/stylesheets/layout.scss
Normal file
14
app/assets/stylesheets/layout.scss
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
.action-row {
|
||||
@extend .d-flex;
|
||||
@extend .p-2;
|
||||
@extend .mt-3;
|
||||
|
||||
// background-color: map-get($theme-colors, "primary");
|
||||
background-color: var(--bs-tertiary-bg);
|
||||
background-color: var(--bs-secondary-bg);
|
||||
|
||||
* {
|
||||
@extend .me-2;
|
||||
@extend .my-auto;
|
||||
}
|
||||
}
|
||||
|
|
@ -6,9 +6,12 @@ class ApplicationController < ActionController::Base
|
|||
private
|
||||
|
||||
def initialize_navbar
|
||||
@nav_path = controller_name
|
||||
@navbar_items = [
|
||||
{ label: 'Dashboard', path: :root },
|
||||
{ label: 'Home', path: :home }
|
||||
{ label: 'Dashboard', icon: :speedometer2, path: :root },
|
||||
{ label: Report.model_name.human(count: 2), icon: :'journal-text', path: :reports },
|
||||
{ label: Checklist.model_name.human(count: 2), icon: :'list-check', path: :checklists },
|
||||
{ label: Check.model_name.human(count: 2), icon: :check, path: :checks }
|
||||
]
|
||||
@search_url = nil # root_url
|
||||
end
|
||||
|
|
|
|||
61
app/controllers/checklists_controller.rb
Normal file
61
app/controllers/checklists_controller.rb
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
class ChecklistsController < ApplicationController
|
||||
before_action :set_checklist, only: %i[show edit update destroy]
|
||||
|
||||
# GET /checklists
|
||||
def index
|
||||
@checklists = Checklist.all
|
||||
end
|
||||
|
||||
# GET /checklists/1
|
||||
def show
|
||||
end
|
||||
|
||||
# GET /checklists/new
|
||||
def new
|
||||
@checklist = Checklist.new
|
||||
end
|
||||
|
||||
# GET /checklists/1/edit
|
||||
def edit
|
||||
@checklist.checklist_entries.build
|
||||
end
|
||||
|
||||
# POST /checklists
|
||||
def create
|
||||
@checklist = Checklist.new(checklist_params)
|
||||
|
||||
if @checklist.save
|
||||
redirect_to @checklist, notice: 'Checklist was successfully created.'
|
||||
else
|
||||
render :new, status: :unprocessable_entity
|
||||
end
|
||||
end
|
||||
|
||||
# PATCH/PUT /checklists/1
|
||||
def update
|
||||
if @checklist.update(checklist_params)
|
||||
redirect_to @checklist, notice: 'Checklist was successfully updated.', status: :see_other
|
||||
else
|
||||
render :edit, status: :unprocessable_entity
|
||||
end
|
||||
end
|
||||
|
||||
# DELETE /checklists/1
|
||||
def destroy
|
||||
@checklist.destroy!
|
||||
redirect_to checklists_url, notice: 'Checklist was successfully destroyed.', status: :see_other
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
# Use callbacks to share common setup or constraints between actions.
|
||||
def set_checklist
|
||||
@checklist = Checklist.find(params[:id])
|
||||
end
|
||||
|
||||
# Only allow a list of trusted parameters through.
|
||||
def checklist_params
|
||||
params.require(:checklist).permit(:code, :name, :description,
|
||||
checklist_entries_attributes: %i[id check_id position _destroy])
|
||||
end
|
||||
end
|
||||
80
app/controllers/checks_controller.rb
Normal file
80
app/controllers/checks_controller.rb
Normal file
|
|
@ -0,0 +1,80 @@
|
|||
class ChecksController < ApplicationController
|
||||
before_action :set_check, only: %i[show edit update destroy]
|
||||
|
||||
# GET /checks or /checks.json
|
||||
def index
|
||||
@checks = Check.all
|
||||
end
|
||||
|
||||
# GET /checks/1 or /checks/1.json
|
||||
def show
|
||||
end
|
||||
|
||||
# GET /checks/new
|
||||
def new
|
||||
@check = Check.new
|
||||
end
|
||||
|
||||
# GET /checks/1/edit
|
||||
def edit
|
||||
end
|
||||
|
||||
# POST /checks or /checks.json
|
||||
def create
|
||||
@check = Check.new(check_params)
|
||||
|
||||
respond_to do |format|
|
||||
if @check.save
|
||||
format.html do
|
||||
redirect_to check_url(@check),
|
||||
notice: t('scaffold.model_created_successfully', model: @check.model_name.human)
|
||||
end
|
||||
format.json { render :show, status: :created, location: @check }
|
||||
else
|
||||
flash[:alert] = t('there_were_errors', count: @check.errors.size)
|
||||
format.html { render :new, status: :unprocessable_entity }
|
||||
format.json { render json: @check.errors, status: :unprocessable_entity }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# PATCH/PUT /checks/1 or /checks/1.json
|
||||
def update
|
||||
respond_to do |format|
|
||||
if @check.update(check_params)
|
||||
format.html do
|
||||
redirect_to check_url(@check),
|
||||
notice: t('scaffold.model_updated_successfully', model: @check.model_name.human)
|
||||
end
|
||||
format.json { render :show, status: :ok, location: @check }
|
||||
else
|
||||
format.html { render :edit, status: :unprocessable_entity }
|
||||
format.json { render json: @check.errors, status: :unprocessable_entity }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# DELETE /checks/1 or /checks/1.json
|
||||
def destroy
|
||||
@check.destroy!
|
||||
|
||||
respond_to do |format|
|
||||
format.html do
|
||||
redirect_to checks_url, notice: t('scaffold.model_destroyed_successfully', model: @check.model_name.human)
|
||||
end
|
||||
format.json { head :no_content }
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
# Use callbacks to share common setup or constraints between actions.
|
||||
def set_check
|
||||
@check = Check.find(params[:id])
|
||||
end
|
||||
|
||||
# Only allow a list of trusted parameters through.
|
||||
def check_params
|
||||
params.require(:check).permit(:position, :name, :success_criterion, :level)
|
||||
end
|
||||
end
|
||||
64
app/controllers/elements_controller.rb
Normal file
64
app/controllers/elements_controller.rb
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
class ElementsController < ApplicationController
|
||||
before_action :set_element, only: %i[show edit update destroy]
|
||||
|
||||
# GET /elements
|
||||
def index
|
||||
@elements = Element.all
|
||||
end
|
||||
|
||||
# GET /elements/1
|
||||
def show
|
||||
end
|
||||
|
||||
# GET /elements/new
|
||||
def new
|
||||
@element = Element.new
|
||||
end
|
||||
|
||||
# GET /elements/1/edit
|
||||
def edit
|
||||
end
|
||||
|
||||
# POST /elements
|
||||
def create
|
||||
checklist_id = element_params.delete(:checklist_id)
|
||||
checklist = Checklist.find(checklist_id)
|
||||
@element = Element.new(element_params.merge(title: checklist.name))
|
||||
|
||||
if @element.save
|
||||
checklist.checks.each do |check|
|
||||
@element.success_criteria.create!(title: check.name, description: check.success_criterion, level: check.level)
|
||||
end
|
||||
redirect_to [:work, @element.report], notice: 'Element was successfully created.'
|
||||
else
|
||||
render :new, status: :unprocessable_entity
|
||||
end
|
||||
end
|
||||
|
||||
# PATCH/PUT /elements/1
|
||||
def update
|
||||
if @element.update(element_params)
|
||||
redirect_to @element, notice: 'Element was successfully updated.', status: :see_other
|
||||
else
|
||||
render :edit, status: :unprocessable_entity
|
||||
end
|
||||
end
|
||||
|
||||
# DELETE /elements/1
|
||||
def destroy
|
||||
@element.destroy!
|
||||
redirect_to elements_url, notice: 'Element was successfully destroyed.', status: :see_other
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
# Use callbacks to share common setup or constraints between actions.
|
||||
def set_element
|
||||
@element = Element.find(params[:id])
|
||||
end
|
||||
|
||||
# Only allow a list of trusted parameters through.
|
||||
def element_params
|
||||
params.require(:element).permit(:report_id, :path, :title, :description, :checklist_id)
|
||||
end
|
||||
end
|
||||
63
app/controllers/reports_controller.rb
Normal file
63
app/controllers/reports_controller.rb
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
class ReportsController < ApplicationController
|
||||
before_action :set_report, only: %i[show edit update destroy work]
|
||||
|
||||
# GET /reports
|
||||
def index
|
||||
@reports = Report.all
|
||||
end
|
||||
|
||||
# GET /reports/1
|
||||
def show
|
||||
end
|
||||
|
||||
# GET /reports/new
|
||||
def new
|
||||
@report = Report.new
|
||||
end
|
||||
|
||||
# GET /reports/1/edit
|
||||
def edit
|
||||
end
|
||||
|
||||
# POST /reports
|
||||
def create
|
||||
@report = Report.new(report_params)
|
||||
|
||||
if @report.save
|
||||
redirect_to @report, notice: 'Report was successfully created.'
|
||||
else
|
||||
render :new, status: :unprocessable_entity
|
||||
end
|
||||
end
|
||||
|
||||
# PATCH/PUT /reports/1
|
||||
def update
|
||||
if @report.update(report_params)
|
||||
redirect_to @report, notice: 'Report was successfully updated.', status: :see_other
|
||||
else
|
||||
render :edit, status: :unprocessable_entity
|
||||
end
|
||||
end
|
||||
|
||||
# DELETE /reports/1
|
||||
def destroy
|
||||
@report.destroy!
|
||||
redirect_to reports_url, notice: 'Report was successfully destroyed.', status: :see_other
|
||||
end
|
||||
|
||||
def work
|
||||
@report
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
# Use callbacks to share common setup or constraints between actions.
|
||||
def set_report
|
||||
@report = Report.find(params[:id])
|
||||
end
|
||||
|
||||
# Only allow a list of trusted parameters through.
|
||||
def report_params
|
||||
params.require(:report).permit(:name, :comment)
|
||||
end
|
||||
end
|
||||
58
app/controllers/success_criteria_controller.rb
Normal file
58
app/controllers/success_criteria_controller.rb
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
class SuccessCriteriaController < ApplicationController
|
||||
before_action :set_success_criterion, only: %i[ show edit update destroy ]
|
||||
|
||||
# GET /success_criteria
|
||||
def index
|
||||
@success_criteria = SuccessCriterion.all
|
||||
end
|
||||
|
||||
# GET /success_criteria/1
|
||||
def show
|
||||
end
|
||||
|
||||
# GET /success_criteria/new
|
||||
def new
|
||||
@success_criterion = SuccessCriterion.new
|
||||
end
|
||||
|
||||
# GET /success_criteria/1/edit
|
||||
def edit
|
||||
end
|
||||
|
||||
# POST /success_criteria
|
||||
def create
|
||||
@success_criterion = SuccessCriterion.new(success_criterion_params)
|
||||
|
||||
if @success_criterion.save
|
||||
redirect_to @success_criterion, notice: "Success criterion was successfully created."
|
||||
else
|
||||
render :new, status: :unprocessable_entity
|
||||
end
|
||||
end
|
||||
|
||||
# PATCH/PUT /success_criteria/1
|
||||
def update
|
||||
if @success_criterion.update(success_criterion_params)
|
||||
redirect_to @success_criterion, notice: "Success criterion was successfully updated.", status: :see_other
|
||||
else
|
||||
render :edit, status: :unprocessable_entity
|
||||
end
|
||||
end
|
||||
|
||||
# DELETE /success_criteria/1
|
||||
def destroy
|
||||
@success_criterion.destroy!
|
||||
redirect_to success_criteria_url, notice: "Success criterion was successfully destroyed.", status: :see_other
|
||||
end
|
||||
|
||||
private
|
||||
# Use callbacks to share common setup or constraints between actions.
|
||||
def set_success_criterion
|
||||
@success_criterion = SuccessCriterion.find(params[:id])
|
||||
end
|
||||
|
||||
# Only allow a list of trusted parameters through.
|
||||
def success_criterion_params
|
||||
params.require(:success_criterion).permit(:element_id, :title, :description, :level, :result, :comment)
|
||||
end
|
||||
end
|
||||
2
app/helpers/checklists_helper.rb
Normal file
2
app/helpers/checklists_helper.rb
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
module ChecklistsHelper
|
||||
end
|
||||
2
app/helpers/checks_helper.rb
Normal file
2
app/helpers/checks_helper.rb
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
module ChecksHelper
|
||||
end
|
||||
2
app/helpers/elements_helper.rb
Normal file
2
app/helpers/elements_helper.rb
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
module ElementsHelper
|
||||
end
|
||||
2
app/helpers/reports_helper.rb
Normal file
2
app/helpers/reports_helper.rb
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
module ReportsHelper
|
||||
end
|
||||
2
app/helpers/success_criteria_helper.rb
Normal file
2
app/helpers/success_criteria_helper.rb
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
module SuccessCriteriaHelper
|
||||
end
|
||||
|
|
@ -9,3 +9,6 @@ application.register("hello", HelloController)
|
|||
|
||||
import SetThemeController from "./set_theme_controller"
|
||||
application.register("set-theme", SetThemeController)
|
||||
|
||||
import ThemeSwitcherController from "./theme_switcher_controller"
|
||||
application.register("theme-switcher", ThemeSwitcherController)
|
||||
|
|
|
|||
28
app/javascript/controllers/theme_switcher_controller.js
Normal file
28
app/javascript/controllers/theme_switcher_controller.js
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
import { Controller } from "@hotwired/stimulus"
|
||||
import Cookie from "../lib/cookies"
|
||||
|
||||
// Connects to data-controller="theme-switcher"
|
||||
export default class extends Controller {
|
||||
COOKIE_NAME = "modeTheme"
|
||||
|
||||
connect() {
|
||||
console.log("connect switcher")
|
||||
}
|
||||
|
||||
switch() {
|
||||
const cookieValue = Cookie.get(this.COOKIE_NAME);
|
||||
const newThemeValue = cookieValue == "dark" ? "light" : "dark";
|
||||
|
||||
Cookie.set("modeTheme", newThemeValue);
|
||||
window.document.getElementsByTagName("html")[0].setAttribute("data-bs-theme", newThemeValue);
|
||||
|
||||
const icon = this.element.getElementsByTagName("i")[0];
|
||||
if(newThemeValue == "dark") {
|
||||
icon.classList.remove("bi-sun-fill")
|
||||
icon.classList.add("bi-moon-stars-fill")
|
||||
} else {
|
||||
icon.classList.add("bi-sun-fill")
|
||||
icon.classList.remove("bi-moon-stars-fill")
|
||||
}
|
||||
}
|
||||
}
|
||||
5
app/models/check.rb
Normal file
5
app/models/check.rb
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
class Check < ApplicationRecord
|
||||
enum :level, %i[A AA AAA]
|
||||
validates :position, :name, :success_criterion, :level, presence: true
|
||||
validates :position, numericality: { less_than: 200 }
|
||||
end
|
||||
6
app/models/checklist.rb
Normal file
6
app/models/checklist.rb
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
class Checklist < ApplicationRecord
|
||||
has_many :checklist_entries, -> { order(position: :asc) }, dependent: :destroy, inverse_of: :checklist
|
||||
has_many :checks, through: :checklist_entries
|
||||
|
||||
accepts_nested_attributes_for :checklist_entries
|
||||
end
|
||||
4
app/models/checklist_entry.rb
Normal file
4
app/models/checklist_entry.rb
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
class ChecklistEntry < ApplicationRecord
|
||||
belongs_to :checklist
|
||||
belongs_to :check
|
||||
end
|
||||
6
app/models/element.rb
Normal file
6
app/models/element.rb
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
class Element < ApplicationRecord
|
||||
attr_accessor :checklist_id
|
||||
|
||||
belongs_to :report
|
||||
has_many :success_criteria, dependent: :destroy
|
||||
end
|
||||
3
app/models/report.rb
Normal file
3
app/models/report.rb
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
class Report < ApplicationRecord
|
||||
has_many :elements, dependent: :destroy
|
||||
end
|
||||
4
app/models/success_criterion.rb
Normal file
4
app/models/success_criterion.rb
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
class SuccessCriterion < ApplicationRecord
|
||||
enum :result, %i[passed failed not_applicable]
|
||||
belongs_to :element
|
||||
end
|
||||
28
app/views/checklists/_checklist.html.erb
Normal file
28
app/views/checklists/_checklist.html.erb
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
<div id="<%= dom_id checklist %>">
|
||||
<p>
|
||||
<strong>Code:</strong>
|
||||
<%= checklist.code %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<strong>Name:</strong>
|
||||
<%= checklist.name %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<strong>Description:</strong>
|
||||
<%= checklist.description %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<strong>Checks</strong>
|
||||
<ul>
|
||||
<% checklist.checklist_entries.each do |entry| %>
|
||||
<li>
|
||||
<%= entry.position %> <%= entry.check.name %>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
2
app/views/checklists/_checklist.json.jbuilder
Normal file
2
app/views/checklists/_checklist.json.jbuilder
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
json.extract! checklist, :id, :code, :name, :description, :created_at, :updated_at
|
||||
json.url checklist_url(checklist, format: :json)
|
||||
13
app/views/checklists/_form.html.erb
Normal file
13
app/views/checklists/_form.html.erb
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
<%= bootstrap_form_with(model: checklist) do |form| %>
|
||||
<%= form.text_field :code %>
|
||||
<%= form.text_field :name %>
|
||||
<%= form.text_area :description %>
|
||||
<h2>Checks</h2>
|
||||
<% checklist.checklist_entries.each do |entry| %>
|
||||
<%= form.fields_for(:checklist_entries, entry) do |eform| %>
|
||||
<%= eform.number_field :position %>
|
||||
<%= eform.collection_select :check_id, Check.all, :id, :name %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<%= form.submit %>
|
||||
<% end %>
|
||||
8
app/views/checklists/edit.html.erb
Normal file
8
app/views/checklists/edit.html.erb
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
<h1><%= t("scaffold.pagetitle_edit", model: Checklist.model_name.human) %></h1>
|
||||
|
||||
<%= render "form", checklist: @checklist %>
|
||||
|
||||
<div class="action-row">
|
||||
<%= link_to t("scaffold.link_show", model: Checklist.model_name.human), @checklist %>
|
||||
<%= link_to t("scaffold.link_index", model: Checklist.model_name.human(count: 2)), checklists_path %>
|
||||
</div>
|
||||
33
app/views/checklists/index.html.erb
Normal file
33
app/views/checklists/index.html.erb
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
<h1><%= t("scaffold.pagetitle_index", model: Checklist.model_name.human(count: 2)) %></h1>
|
||||
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><%= Checklist.human_attribute_name(:id) %></th>
|
||||
|
||||
<th><%= Checklist.human_attribute_name(:code) %></th>
|
||||
|
||||
<th><%= Checklist.human_attribute_name(:name) %></th>
|
||||
|
||||
<th><%= Checklist.human_attribute_name(:description) %></th>
|
||||
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @checklists.each do |checklist| %>
|
||||
<tr>
|
||||
<td><%= link_to(checklist.id, url_for(checklist)) %></td>
|
||||
|
||||
<td><%= link_to(checklist.code, url_for(checklist)) %></td>
|
||||
|
||||
<td><%= link_to(checklist.name, url_for(checklist)) %></td>
|
||||
|
||||
<td><%= link_to(checklist.description, url_for(checklist)) %></td>
|
||||
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div class="action-row">
|
||||
<%= link_to t("scaffold.link_new", model: Checklist.model_name.human), new_checklist_path %>
|
||||
</div>
|
||||
1
app/views/checklists/index.json.jbuilder
Normal file
1
app/views/checklists/index.json.jbuilder
Normal file
|
|
@ -0,0 +1 @@
|
|||
json.array! @checklists, partial: "checklists/checklist", as: :checklist
|
||||
7
app/views/checklists/new.html.erb
Normal file
7
app/views/checklists/new.html.erb
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
<h1><%= t("scaffold.pagetitle_new", model: Checklist.model_name.human) %></h1>
|
||||
|
||||
<%= render "form", checklist: @checklist %>
|
||||
|
||||
<div class="action-row">
|
||||
<%= link_to t("scaffold.link_index", model: Checklist.model_name.human(count: 2)), checklists_path %>
|
||||
</div>
|
||||
9
app/views/checklists/show.html.erb
Normal file
9
app/views/checklists/show.html.erb
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<h1><%= t("scaffold.pagetitle_show", model: @checklist.class.model_name.human) %></h1>
|
||||
|
||||
<%= render @checklist %>
|
||||
|
||||
<div class="action-row">
|
||||
<%= link_to t("scaffold.link_edit", model: @checklist.model_name.human), edit_checklist_path(@checklist) %>
|
||||
<%= link_to t("scaffold.link_index", model: @checklist.model_name.human(count: 2)), checklists_path %>
|
||||
<%= button_to t("scaffold.link_destroy", model: @checklist.model_name.human), @checklist, method: :delete, class: "btn btn-warning" %>
|
||||
</div>
|
||||
1
app/views/checklists/show.json.jbuilder
Normal file
1
app/views/checklists/show.json.jbuilder
Normal file
|
|
@ -0,0 +1 @@
|
|||
json.partial! "checklists/checklist", checklist: @checklist
|
||||
22
app/views/checks/_check.html.erb
Normal file
22
app/views/checks/_check.html.erb
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
<div id="<%= dom_id check %>">
|
||||
<p>
|
||||
<strong><%= Check.human_attribute_name(:position) %>:</strong>
|
||||
<%= check.position %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<strong><%= Check.human_attribute_name(:name) %>:</strong>
|
||||
<%= check.name %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<strong><%= Check.human_attribute_name(:success_criterion) %>:</strong>
|
||||
<%= check.success_criterion %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<strong><%= Check.human_attribute_name(:level) %>:</strong>
|
||||
<%= check.level %>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
2
app/views/checks/_check.json.jbuilder
Normal file
2
app/views/checks/_check.json.jbuilder
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
json.extract! check, :id, :position, :name, :success_criterion, :level, :created_at, :updated_at
|
||||
json.url check_url(check, format: :json)
|
||||
7
app/views/checks/_form.html.erb
Normal file
7
app/views/checks/_form.html.erb
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
<%= bootstrap_form_with(model: check, remote: true) do |form| %>
|
||||
<%= form.text_field :position %>
|
||||
<%= form.text_field :name %>
|
||||
<%= form.text_area :success_criterion %>
|
||||
<%= form.select :level, Check.levels.keys, add_blank: !form.object.level.present? %>
|
||||
<%= form.submit %>
|
||||
<% end %>
|
||||
10
app/views/checks/edit.html.erb
Normal file
10
app/views/checks/edit.html.erb
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
<h1><%= t("scaffold.pagetitle_edit", model: @check.class.model_name.human) %></h1>
|
||||
|
||||
<%= render "form", check: @check %>
|
||||
|
||||
<br>
|
||||
|
||||
<div class="action-row">
|
||||
<%= link_to t("scaffold.link_show", model: @check.class.model_name.human), @check %>
|
||||
<%= link_to t("scaffold.link_index", model: @check.class.model_name.human(count: 2)), checks_path %>
|
||||
</div>
|
||||
25
app/views/checks/index.html.erb
Normal file
25
app/views/checks/index.html.erb
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
<h1><%= t("scaffold.pagetitle_index", model: Check.model_name.human(count: 2)) %></h1>
|
||||
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><%= Check.human_attribute_name(:id) %></th>
|
||||
<th><%= Check.human_attribute_name(:level) %></th>
|
||||
<th><%= Check.human_attribute_name(:name) %></th>
|
||||
<th><%= Check.human_attribute_name(:success_criterion) %></th>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @checks.each do |check| %>
|
||||
<tr>
|
||||
<td><%= check.id %></td>
|
||||
<td><%= check.level %></td>
|
||||
<td><%= link_to(check.name, url_for(check)) %></td>
|
||||
<td><%= link_to(truncate(check.success_criterion), url_for(check)) %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div class="action-row">
|
||||
<%= link_to t("scaffold.link_new", model: Check.model_name.human), new_check_path %>
|
||||
</div>
|
||||
1
app/views/checks/index.json.jbuilder
Normal file
1
app/views/checks/index.json.jbuilder
Normal file
|
|
@ -0,0 +1 @@
|
|||
json.array! @checks, partial: "checks/check", as: :check
|
||||
7
app/views/checks/new.html.erb
Normal file
7
app/views/checks/new.html.erb
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
<h1><%= t("scaffold.pagetitle_new", model: @check.class.model_name.human) %></h1>
|
||||
|
||||
<%= render "form", check: @check %>
|
||||
|
||||
<div class="action-row">
|
||||
<%= link_to t("scaffold.link_index", model: Check.model_name.human(count: 2)), checks_path %>
|
||||
</div>
|
||||
9
app/views/checks/show.html.erb
Normal file
9
app/views/checks/show.html.erb
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<h1><%= t("scaffold.pagetitle_show", model: @check.class.model_name.human) %></h1>
|
||||
|
||||
<%= render @check %>
|
||||
|
||||
<div class="action-row">
|
||||
<%= link_to t("scaffold.link_edit", model: @check.model_name.human), edit_check_path(@check) %>
|
||||
<%= link_to t("scaffold.link_index", model: @check.model_name.human(count: 2)), checks_path %>
|
||||
<%= button_to t("scaffold.link_destroy", model: @check.model_name.human), @check, method: :delete, class: "btn btn-warning" %>
|
||||
</div>
|
||||
1
app/views/checks/show.json.jbuilder
Normal file
1
app/views/checks/show.json.jbuilder
Normal file
|
|
@ -0,0 +1 @@
|
|||
json.partial! "checks/check", check: @check
|
||||
12
app/views/elements/_element.html.erb
Normal file
12
app/views/elements/_element.html.erb
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
<div id="<%= dom_id element %>" class="mt-3">
|
||||
<h2><i class="bi bi-card-checklist me-2"></i>
|
||||
<%= element.title %></h2>
|
||||
<p>
|
||||
<strong>Path:</strong>
|
||||
<%= element.path %>
|
||||
</p>
|
||||
|
||||
<% element.success_criteria.each do |sc| %>
|
||||
<%= render sc %>
|
||||
<% end %>
|
||||
</div>
|
||||
2
app/views/elements/_element.json.jbuilder
Normal file
2
app/views/elements/_element.json.jbuilder
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
json.extract! element, :id, :report_id, :path, :title, :description, :created_at, :updated_at
|
||||
json.url element_url(element, format: :json)
|
||||
7
app/views/elements/_form.html.erb
Normal file
7
app/views/elements/_form.html.erb
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
<%= bootstrap_form_with(model: element) do |form| %>
|
||||
<%= form.text_field :report_id %>
|
||||
<%= form.text_field :path %>
|
||||
<%= form.text_field :title %>
|
||||
<%= form.text_area :description %>
|
||||
<%= form.submit %>
|
||||
<% end %>
|
||||
8
app/views/elements/edit.html.erb
Normal file
8
app/views/elements/edit.html.erb
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
<h1><%= t("scaffold.pagetitle_edit", model: Element.model_name.human) %></h1>
|
||||
|
||||
<%= render "form", element: @element %>
|
||||
|
||||
<div class="action-row">
|
||||
<%= link_to t("scaffold.link_show", model: Element.model_name.human), @element %>
|
||||
<%= link_to t("scaffold.link_index", model: Element.model_name.human(count: 2)), elements_path %>
|
||||
</div>
|
||||
37
app/views/elements/index.html.erb
Normal file
37
app/views/elements/index.html.erb
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
<h1><%= t("scaffold.pagetitle_index", model: Element.model_name.human(count: 2)) %></h1>
|
||||
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><%= Element.human_attribute_name(:id) %></th>
|
||||
|
||||
<th><%= Element.human_attribute_name(:report_id) %></th>
|
||||
|
||||
<th><%= Element.human_attribute_name(:path) %></th>
|
||||
|
||||
<th><%= Element.human_attribute_name(:title) %></th>
|
||||
|
||||
<th><%= Element.human_attribute_name(:description) %></th>
|
||||
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @elements.each do |element| %>
|
||||
<tr>
|
||||
<td><%= link_to(element.id, url_for(element)) %></td>
|
||||
|
||||
<td><%= link_to(element.report_id, url_for(element)) %></td>
|
||||
|
||||
<td><%= link_to(element.path, url_for(element)) %></td>
|
||||
|
||||
<td><%= link_to(element.title, url_for(element)) %></td>
|
||||
|
||||
<td><%= link_to(element.description, url_for(element)) %></td>
|
||||
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div class="action-row">
|
||||
<%= link_to t("scaffold.link_new", model: Element.model_name.human), new_element_path %>
|
||||
</div>
|
||||
1
app/views/elements/index.json.jbuilder
Normal file
1
app/views/elements/index.json.jbuilder
Normal file
|
|
@ -0,0 +1 @@
|
|||
json.array! @elements, partial: "elements/element", as: :element
|
||||
7
app/views/elements/new.html.erb
Normal file
7
app/views/elements/new.html.erb
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
<h1><%= t("scaffold.pagetitle_new", model: Element.model_name.human) %></h1>
|
||||
|
||||
<%= render "form", element: @element %>
|
||||
|
||||
<div class="action-row">
|
||||
<%= link_to t("scaffold.link_index", model: Element.model_name.human(count: 2)), elements_path %>
|
||||
</div>
|
||||
9
app/views/elements/show.html.erb
Normal file
9
app/views/elements/show.html.erb
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<h1><%= t("scaffold.pagetitle_show", model: @element.class.model_name.human) %></h1>
|
||||
|
||||
<%= render @element %>
|
||||
|
||||
<div class="action-row">
|
||||
<%= link_to t("scaffold.link_edit", model: @element.model_name.human), edit_element_path(@element) %>
|
||||
<%= link_to t("scaffold.link_index", model: @element.model_name.human(count: 2)), elements_path %>
|
||||
<%= button_to t("scaffold.link_destroy", model: @element.model_name.human), @element, method: :delete, class: "btn btn-warning" %>
|
||||
</div>
|
||||
1
app/views/elements/show.json.jbuilder
Normal file
1
app/views/elements/show.json.jbuilder
Normal file
|
|
@ -0,0 +1 @@
|
|||
json.partial! "elements/element", element: @element
|
||||
|
|
@ -1,3 +1,17 @@
|
|||
<h1>Welcome</h1>
|
||||
<p>Find me in app/views/home/show.html.erb</p>
|
||||
<button class="btn btn-primary">Test</button>
|
||||
<h1>Dashboard</h1>
|
||||
<h2>Data</h2>
|
||||
<p>
|
||||
<i class="bi bi-journal-text"></i>
|
||||
<%= Report.count %>
|
||||
<%= link_to Report.model_name.human(count: Report.count), :reports %>
|
||||
</p>
|
||||
<p>
|
||||
<i class="bi bi-list-check"></i>
|
||||
<%= Checklist.count %>
|
||||
<%= link_to Checklist.model_name.human(count: Checklist.count), :checklists %>
|
||||
</p>
|
||||
<p>
|
||||
<i class="bi bi-check"></i>
|
||||
<%= Check.count %>
|
||||
<%= link_to Check.model_name.human(count: Check.count), :checks %>
|
||||
</p>
|
||||
16
app/views/layouts/_flash.html.erb
Normal file
16
app/views/layouts/_flash.html.erb
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
<% if flash[:alert] || flash[:notice] %>
|
||||
<div class="container mt-3 mb-3">
|
||||
<% if flash[:alert] %>
|
||||
<div class="alert alert-danger" role="alert">
|
||||
<%= flash[:alert] %><% flash.delete(:alert) %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<% if flash[:notice] %>
|
||||
<div class="alert alert-info" role="alert">
|
||||
<%= flash[:notice] %>
|
||||
<% flash.delete(:notice) %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
|
@ -9,7 +9,12 @@
|
|||
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
|
||||
<% @navbar_items.each do |navbar_item| %>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link <%= current_page?(navbar_item[:path]) && "active" %>" <%= current_page?(navbar_item[:path]) && "aria-current=\"page\"" %> href="<%= url_for(navbar_item[:path]) %>"><%= navbar_item[:label] %></a>
|
||||
<a class="nav-link <%= @nav_path.to_s == navbar_item[:path].to_s && "active" %>" <%= @nav_path.to_s == navbar_item[:path].to_s && "aria-current=\"page\"" %> href="<%= url_for(navbar_item[:path]) %>">
|
||||
<% if navbar_item[:icon] %>
|
||||
<span aria-hidden="true" class="bi-<%= navbar_item[:icon] %>"></span>
|
||||
<% end %>
|
||||
<%= navbar_item[:label] %>
|
||||
</a>
|
||||
</li>
|
||||
<% end %>
|
||||
<%# <li class="nav-item">
|
||||
|
|
@ -39,6 +44,19 @@
|
|||
<button class="btn btn-outline-success" type="submit" name="<%= @search_name || "q" %>"><%= @search_placeholder || "Suchen" %></button>
|
||||
</form>
|
||||
<% end %>
|
||||
<ul class="navbar-nav flex-row flex-wrap ms-md-auto">
|
||||
<li class="nav-item">
|
||||
<button class="btn btn-link nav-link py-2 px-0 px-lg-2 d-flex align-items-center"
|
||||
data-controller="theme-switcher"
|
||||
data-action="theme-switcher#switch"
|
||||
id="bd-theme"
|
||||
type="button"
|
||||
data-bs-display="static"
|
||||
aria-label="Toggle theme (auto)">
|
||||
<i class="bi <%= cookies[:modeTheme] == "dark" ? "bi-moon-stars-fill" : "bi-sun-fill" %> my-1"></i>
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
|
@ -12,13 +12,11 @@
|
|||
</head>
|
||||
|
||||
<body class="">
|
||||
<%= render partial: "layouts/sidebar" %>
|
||||
<%= render partial: "layouts/navigation" %>
|
||||
|
||||
<main class="">
|
||||
<%= render partial: "layouts/sidebar" %>
|
||||
<div class="p-3">
|
||||
<%= yield %>
|
||||
</div>
|
||||
<%= render partial: "layouts/flash" %>
|
||||
<main class="p-3">
|
||||
<%= yield %>
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
5
app/views/reports/_form.html.erb
Normal file
5
app/views/reports/_form.html.erb
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
<%= bootstrap_form_with(model: report) do |form| %>
|
||||
<%= form.text_field :name %>
|
||||
<%= form.text_area :comment %>
|
||||
<%= form.submit %>
|
||||
<% end %>
|
||||
12
app/views/reports/_report.html.erb
Normal file
12
app/views/reports/_report.html.erb
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
<div id="<%= dom_id report %>">
|
||||
<p>
|
||||
<strong>Name:</strong>
|
||||
<%= report.name %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<strong>Comment:</strong>
|
||||
<%= report.comment %>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
2
app/views/reports/_report.json.jbuilder
Normal file
2
app/views/reports/_report.json.jbuilder
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
json.extract! report, :id, :name, :comment, :created_at, :updated_at
|
||||
json.url report_url(report, format: :json)
|
||||
8
app/views/reports/edit.html.erb
Normal file
8
app/views/reports/edit.html.erb
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
<h1><%= t("scaffold.pagetitle_edit", model: Report.model_name.human) %></h1>
|
||||
|
||||
<%= render "form", report: @report %>
|
||||
|
||||
<div class="action-row">
|
||||
<%= link_to t("scaffold.link_show", model: Report.model_name.human), @report %>
|
||||
<%= link_to t("scaffold.link_index", model: Report.model_name.human(count: 2)), reports_path %>
|
||||
</div>
|
||||
29
app/views/reports/index.html.erb
Normal file
29
app/views/reports/index.html.erb
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
<h1><%= t("scaffold.pagetitle_index", model: Report.model_name.human(count: 2)) %></h1>
|
||||
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><%= Report.human_attribute_name(:id) %></th>
|
||||
|
||||
<th><%= Report.human_attribute_name(:name) %></th>
|
||||
|
||||
<th><%= Report.human_attribute_name(:comment) %></th>
|
||||
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @reports.each do |report| %>
|
||||
<tr>
|
||||
<td><%= link_to(report.id, url_for([:work, report])) %></td>
|
||||
|
||||
<td><%= link_to(report.name, url_for([:work, report])) %></td>
|
||||
|
||||
<td><%= link_to(report.comment, url_for([:work, report])) %></td>
|
||||
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div class="action-row">
|
||||
<%= link_to t("scaffold.link_new", model: Report.model_name.human), new_report_path %>
|
||||
</div>
|
||||
1
app/views/reports/index.json.jbuilder
Normal file
1
app/views/reports/index.json.jbuilder
Normal file
|
|
@ -0,0 +1 @@
|
|||
json.array! @reports, partial: "reports/report", as: :report
|
||||
7
app/views/reports/new.html.erb
Normal file
7
app/views/reports/new.html.erb
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
<h1><%= t("scaffold.pagetitle_new", model: Report.model_name.human) %></h1>
|
||||
|
||||
<%= render "form", report: @report %>
|
||||
|
||||
<div class="action-row">
|
||||
<%= link_to t("scaffold.link_index", model: Report.model_name.human(count: 2)), reports_path %>
|
||||
</div>
|
||||
9
app/views/reports/show.html.erb
Normal file
9
app/views/reports/show.html.erb
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<h1><%= t("scaffold.pagetitle_show", model: @report.class.model_name.human) %></h1>
|
||||
|
||||
<%= render @report %>
|
||||
|
||||
<div class="action-row">
|
||||
<%= link_to t("scaffold.link_edit", model: @report.model_name.human), edit_report_path(@report) %>
|
||||
<%= link_to t("scaffold.link_index", model: @report.model_name.human(count: 2)), reports_path %>
|
||||
<%= button_to t("scaffold.link_destroy", model: @report.model_name.human), @report, method: :delete, class: "btn btn-warning" %>
|
||||
</div>
|
||||
1
app/views/reports/show.json.jbuilder
Normal file
1
app/views/reports/show.json.jbuilder
Normal file
|
|
@ -0,0 +1 @@
|
|||
json.partial! "reports/report", report: @report
|
||||
21
app/views/reports/work.html.erb
Normal file
21
app/views/reports/work.html.erb
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
<div class="container">
|
||||
<h1><i class="bi bi-journal-text me-2"></i><%= @report.name %></h1>
|
||||
|
||||
<% @report.elements.each do |element| %>
|
||||
<%= render element %>
|
||||
<% end %>
|
||||
<hr>
|
||||
<h2><i class="bi bi-plus"></i>Element hinzufügen</h2>
|
||||
<%= bootstrap_form_with(model: @report.elements.build, layout: :horizontal) do |form| %>
|
||||
<%= form.collection_select(:checklist_id, Checklist.all, :id, :name) %>
|
||||
<%= form.hidden_field :report_id %>
|
||||
<%= form.text_field :path %>
|
||||
<%= form.submit %>
|
||||
<% end %>
|
||||
|
||||
<div class="action-row">
|
||||
<%= link_to t("scaffold.link_edit", model: @report.model_name.human), edit_report_path(@report) %>
|
||||
<%= link_to t("scaffold.link_index", model: @report.model_name.human(count: 2)), reports_path %>
|
||||
<%= button_to t("scaffold.link_destroy", model: @report.model_name.human), @report, method: :delete, class: "btn btn-warning" %>
|
||||
</div>
|
||||
</div>
|
||||
9
app/views/success_criteria/_form.html.erb
Normal file
9
app/views/success_criteria/_form.html.erb
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<%= bootstrap_form_with(model: success_criterion) do |form| %>
|
||||
<%= form.text_field :element_id %>
|
||||
<%= form.text_field :title %>
|
||||
<%= form.text_area :description %>
|
||||
<%= form.number_field :level %>
|
||||
<%= form.number_field :result %>
|
||||
<%= form.text_area :comment %>
|
||||
<%= form.submit %>
|
||||
<% end %>
|
||||
15
app/views/success_criteria/_success_criterion.html.erb
Normal file
15
app/views/success_criteria/_success_criterion.html.erb
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
<div id="<%= dom_id success_criterion %>" class="card mt-3">
|
||||
<div class="card-header">
|
||||
<h3><i class="bi bi-check me-2"></i><%= success_criterion.title %></h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<p>
|
||||
<%= success_criterion.description %>
|
||||
</p>
|
||||
<%= bootstrap_form_with(model: success_criterion, layout: :horizontal) do |form| %>
|
||||
<%= form.select :result, SuccessCriterion.results, include_blank: true %>
|
||||
<%= form.text_area :comment %>
|
||||
<%= form.submit(class: "btn btn-secondary") %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
json.extract! success_criterion, :id, :element_id, :title, :description, :level, :result, :comment, :created_at, :updated_at
|
||||
json.url success_criterion_url(success_criterion, format: :json)
|
||||
8
app/views/success_criteria/edit.html.erb
Normal file
8
app/views/success_criteria/edit.html.erb
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
<h1><%= t("scaffold.pagetitle_edit", model: SuccessCriterion.model_name.human) %></h1>
|
||||
|
||||
<%= render "form", success_criterion: @success_criterion %>
|
||||
|
||||
<div class="action-row">
|
||||
<%= link_to t("scaffold.link_show", model: SuccessCriterion.model_name.human), @success_criterion %>
|
||||
<%= link_to t("scaffold.link_index", model: SuccessCriterion.model_name.human(count: 2)), success_criteria_path %>
|
||||
</div>
|
||||
45
app/views/success_criteria/index.html.erb
Normal file
45
app/views/success_criteria/index.html.erb
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
<h1><%= t("scaffold.pagetitle_index", model: SuccessCriterion.model_name.human(count: 2)) %></h1>
|
||||
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><%= SuccessCriterion.human_attribute_name(:id) %></th>
|
||||
|
||||
<th><%= SuccessCriterion.human_attribute_name(:element_id) %></th>
|
||||
|
||||
<th><%= SuccessCriterion.human_attribute_name(:title) %></th>
|
||||
|
||||
<th><%= SuccessCriterion.human_attribute_name(:description) %></th>
|
||||
|
||||
<th><%= SuccessCriterion.human_attribute_name(:level) %></th>
|
||||
|
||||
<th><%= SuccessCriterion.human_attribute_name(:result) %></th>
|
||||
|
||||
<th><%= SuccessCriterion.human_attribute_name(:comment) %></th>
|
||||
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @success_criteria.each do |success_criterion| %>
|
||||
<tr>
|
||||
<td><%= link_to(success_criterion.id, url_for(success_criterion)) %></td>
|
||||
|
||||
<td><%= link_to(success_criterion.element_id, url_for(success_criterion)) %></td>
|
||||
|
||||
<td><%= link_to(success_criterion.title, url_for(success_criterion)) %></td>
|
||||
|
||||
<td><%= link_to(success_criterion.description, url_for(success_criterion)) %></td>
|
||||
|
||||
<td><%= link_to(success_criterion.level, url_for(success_criterion)) %></td>
|
||||
|
||||
<td><%= link_to(success_criterion.result, url_for(success_criterion)) %></td>
|
||||
|
||||
<td><%= link_to(success_criterion.comment, url_for(success_criterion)) %></td>
|
||||
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div class="action-row">
|
||||
<%= link_to t("scaffold.link_new", model: SuccessCriterion.model_name.human), new_success_criterion_path %>
|
||||
</div>
|
||||
1
app/views/success_criteria/index.json.jbuilder
Normal file
1
app/views/success_criteria/index.json.jbuilder
Normal file
|
|
@ -0,0 +1 @@
|
|||
json.array! @success_criteria, partial: "success_criteria/success_criterion", as: :success_criterion
|
||||
7
app/views/success_criteria/new.html.erb
Normal file
7
app/views/success_criteria/new.html.erb
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
<h1><%= t("scaffold.pagetitle_new", model: SuccessCriterion.model_name.human) %></h1>
|
||||
|
||||
<%= render "form", success_criterion: @success_criterion %>
|
||||
|
||||
<div class="action-row">
|
||||
<%= link_to t("scaffold.link_index", model: SuccessCriterion.model_name.human(count: 2)), success_criteria_path %>
|
||||
</div>
|
||||
9
app/views/success_criteria/show.html.erb
Normal file
9
app/views/success_criteria/show.html.erb
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<h1><%= t("scaffold.pagetitle_show", model: @success_criterion.class.model_name.human) %></h1>
|
||||
|
||||
<%= render @success_criterion %>
|
||||
|
||||
<div class="action-row">
|
||||
<%= link_to t("scaffold.link_edit", model: @success_criterion.model_name.human), edit_success_criterion_path(@success_criterion) %>
|
||||
<%= link_to t("scaffold.link_index", model: @success_criterion.model_name.human(count: 2)), success_criteria_path %>
|
||||
<%= button_to t("scaffold.link_destroy", model: @success_criterion.model_name.human), @success_criterion, method: :delete, class: "btn btn-warning" %>
|
||||
</div>
|
||||
1
app/views/success_criteria/show.json.jbuilder
Normal file
1
app/views/success_criteria/show.json.jbuilder
Normal file
|
|
@ -0,0 +1 @@
|
|||
json.partial! "success_criteria/success_criterion", success_criterion: @success_criterion
|
||||
Loading…
Add table
Add a link
Reference in a new issue