Gui improvements, ordering
This commit is contained in:
parent
6db0b64f4c
commit
42c077f6ab
28 changed files with 105 additions and 40 deletions
|
|
@ -1,7 +1,7 @@
|
||||||
.action-row {
|
.action-row {
|
||||||
@extend .d-flex;
|
@extend .d-flex;
|
||||||
@extend .p-2;
|
@extend .p-2;
|
||||||
@extend .mt-3;
|
@extend .mt-5;
|
||||||
|
|
||||||
// background-color: map-get($theme-colors, "primary");
|
// background-color: map-get($theme-colors, "primary");
|
||||||
background-color: var(--bs-tertiary-bg);
|
background-color: var(--bs-tertiary-bg);
|
||||||
|
|
|
||||||
|
|
@ -59,6 +59,6 @@ class PagesController < ApplicationController
|
||||||
|
|
||||||
# Only allow a list of trusted parameters through.
|
# Only allow a list of trusted parameters through.
|
||||||
def page_params
|
def page_params
|
||||||
params.require(:page).permit(:position, :path, :url, :report_id)
|
params.require(:page).permit(:position, :path, :url, :notes, :position)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -4,14 +4,21 @@ const LEAVE_ALERT = "Es gibt ungespeicherte Änderungen! Wirklich verlassen?"
|
||||||
|
|
||||||
// Connects to data-controller="unsaved-changes"
|
// Connects to data-controller="unsaved-changes"
|
||||||
export default class extends Controller {
|
export default class extends Controller {
|
||||||
|
static targets = ["cancel"]
|
||||||
|
|
||||||
initialState = null
|
initialState = null
|
||||||
|
|
||||||
connect() {
|
connect() {
|
||||||
this.initialState = this.formState()
|
this.initialState = this.formState()
|
||||||
|
console.log(this.cancelTargets)
|
||||||
|
|
||||||
window.addEventListener("beforeunload", (event) => this.leavingPage(event))
|
window.addEventListener("beforeunload", (event) => this.leavingPage(event))
|
||||||
document.addEventListener('turbo:before-visit', (e) => this.leavingPage(e))
|
document.addEventListener('turbo:before-visit', (e) => this.leavingPage(e))
|
||||||
this.element.addEventListener("submit", (_) => this.initialState = null)
|
this.element.addEventListener("submit", (_) => this.initialState = null)
|
||||||
|
this.cancelTargets.forEach(element => {
|
||||||
|
console.log(element)
|
||||||
|
element.addEventListener("onclick", (_) => this.initialState = null)
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
formState() {
|
formState() {
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,8 @@ class Element < ApplicationRecord
|
||||||
|
|
||||||
delegate :report, to: :page
|
delegate :report, to: :page
|
||||||
|
|
||||||
|
after_validation :set_position
|
||||||
|
|
||||||
# Calculate actual conformity level:
|
# Calculate actual conformity level:
|
||||||
# - if a success_criterion has result :failed -> the confirmity_level
|
# - if a success_criterion has result :failed -> the confirmity_level
|
||||||
# of that success_criterion is not reached.
|
# of that success_criterion is not reached.
|
||||||
|
|
@ -30,4 +32,9 @@ class Element < ApplicationRecord
|
||||||
def max_level
|
def max_level
|
||||||
@max_level ||= success_criteria.reject(&:not_applicable?).max(&:level)
|
@max_level ||= success_criteria.reject(&:not_applicable?).max(&:level)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def set_position
|
||||||
|
Rails.logger.debug("element: position #{position}")
|
||||||
|
self.position ||= (page.elements.pluck(:position).max || 0) + 1
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -3,4 +3,11 @@ class Page < ApplicationRecord
|
||||||
has_many :elements, dependent: :destroy
|
has_many :elements, dependent: :destroy
|
||||||
|
|
||||||
has_rich_text :comment
|
has_rich_text :comment
|
||||||
|
|
||||||
|
before_validation :set_position
|
||||||
|
|
||||||
|
private
|
||||||
|
def set_position
|
||||||
|
self.position ||= (report.pages.pluck(:position).max || 0) + 1
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,8 @@ class SuccessCriterion < ApplicationRecord
|
||||||
enum :result, %i[passed failed not_applicable]
|
enum :result, %i[passed failed not_applicable]
|
||||||
enum :level, %i[A AA AAA]
|
enum :level, %i[A AA AAA]
|
||||||
|
|
||||||
|
before_save :set_position
|
||||||
|
|
||||||
def level_value
|
def level_value
|
||||||
return nil unless level
|
return nil unless level
|
||||||
|
|
||||||
|
|
@ -23,4 +25,10 @@ class SuccessCriterion < ApplicationRecord
|
||||||
def header
|
def header
|
||||||
"HEADER"
|
"HEADER"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
def set_position
|
||||||
|
self.position ||= (element.success_criteria.pluck(:position).max || 0) + 1
|
||||||
|
Rails.logger.debug("set position: "+position.to_s)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -13,13 +13,13 @@
|
||||||
<%= link_to Check.model_name.human(count: Check.count), :checks %>
|
<%= link_to Check.model_name.human(count: Check.count), :checks %>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p class="mb-3">
|
||||||
<i class="bi bi-link"></i>
|
<i class="bi bi-link"></i>
|
||||||
<%= Link.count %>
|
<%= Link.count %>
|
||||||
<%= link_to Link.model_name.human(count: Link.count), :links %>
|
<%= link_to Link.model_name.human(count: Link.count), :links %>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<h2 class="mt-3">Backup</h2>
|
<h2>Backup</h2>
|
||||||
<ul class="ps-0" style="list-style-type: none">
|
<ul class="ps-0" style="list-style-type: none">
|
||||||
<li>
|
<li>
|
||||||
<%= link_to "XLSX Backup herunterladen", admin_backup_url(format: :xlsx), class: " ", data: { turbo_prefetch: false, frame: "_top", turbo: false } %>
|
<%= link_to "XLSX Backup herunterladen", admin_backup_url(format: :xlsx), class: " ", data: { turbo_prefetch: false, frame: "_top", turbo: false } %>
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col col-12 col-lg-8">
|
<div class="col col-12 col-lg-8">
|
||||||
<div class="mt-3">
|
<div>
|
||||||
<%= link_to tag.i(class: "bi bi-plus-lg"), new_checklist_entry_path(checklist_id: @checklist.id), class: "btn btn-primary float-end", data: { turbo_frame: "checklist_entries" } %>
|
<%= link_to tag.i(class: "bi bi-plus-lg"), new_checklist_entry_path(checklist_id: @checklist.id), class: "btn btn-primary float-end", data: { turbo_frame: "checklist_entries" } %>
|
||||||
<h2>Checks</h2>
|
<h2>Checks</h2>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,10 @@
|
||||||
<div id="<%= dom_id element %>" class="<%= "mt-5" unless element == element.page.elements.first %>">
|
<div id="<%= dom_id element %>" class="mb-5">
|
||||||
<%= turbo_frame_tag dom_id(element, :frame) do %>
|
<%= turbo_frame_tag dom_id(element, :frame) do %>
|
||||||
<div class="d-flex">
|
<div class="d-flex">
|
||||||
<h2 class="h4">
|
<h2 class="h4">
|
||||||
<i class="bi bi-boxes">
|
<i class="bi bi-boxes">
|
||||||
</i>
|
</i>
|
||||||
|
<%= element.page.position %>.<%= element.position %>
|
||||||
<%= element.title %>
|
<%= element.title %>
|
||||||
</h2>
|
</h2>
|
||||||
<%= link_to [:edit, element], class: "btn btn-link text-secondary" do %>
|
<%= link_to [:edit, element], class: "btn btn-link text-secondary" do %>
|
||||||
|
|
@ -18,7 +19,7 @@
|
||||||
|
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<div id="<%= dom_id(element, :success_criteria_list) %>">
|
<div id="<%= dom_id(element, :success_criteria_list) %>" class="mb-3">
|
||||||
<% element.success_criteria.each do |sc| %>
|
<% element.success_criteria.each do |sc| %>
|
||||||
<%= render sc %>
|
<%= render sc %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
@ -27,7 +28,7 @@
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="pt-3">
|
<div>
|
||||||
<%= turbo_frame_tag dom_id(element, "new_success_criterion_frame") do %>
|
<%= turbo_frame_tag dom_id(element, "new_success_criterion_frame") do %>
|
||||||
<%= render partial: "elements/new_success_criterion_button", locals: { element: element } %>
|
<%= render partial: "elements/new_success_criterion_button", locals: { element: element } %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
<%= bootstrap_form_with(model: element.persisted? ? element : [:page, element], data: element.persisted? || { turbo_frame: "_top" }) do |form| %>
|
<%= bootstrap_form_with(model: element.persisted? ? element : [:page, element]) do |form| %>
|
||||||
<%= form.hidden_field :page_id %>
|
<%= form.hidden_field :page_id %>
|
||||||
<%= form.text_field :title %>
|
<%= form.text_field :title %>
|
||||||
<%= form.rich_text_area :description %>
|
<%= form.rich_text_area :description %>
|
||||||
|
|
|
||||||
|
|
@ -1,6 +0,0 @@
|
||||||
<%= bootstrap_form_with(model: [:report, page], data: { turbo: false }) do |form| %>
|
|
||||||
<%= form.text_field :path %>
|
|
||||||
<%= form.text_field :url %>
|
|
||||||
<%# <%= form.rich_text_area :comment %>
|
|
||||||
<%= form.submit %>
|
|
||||||
<% end %>
|
|
||||||
5
app/views/pages/_form.html.slim
Normal file
5
app/views/pages/_form.html.slim
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
= bootstrap_form_with(model: [:report, page], data: { "turbo-frame": :nav }) do |form|
|
||||||
|
= form.text_field :path
|
||||||
|
= form.text_field :url
|
||||||
|
= form.submit
|
||||||
|
= link_to("Abbrechen", report_path(@page.report), class: "btn btn-outline-secondary")
|
||||||
3
app/views/pages/_notes.html.slim
Normal file
3
app/views/pages/_notes.html.slim
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
= bootstrap_form_with(model: page) do |form|
|
||||||
|
= form.text_area :notes, rows: [(page.notes&.count("\n") || 0) + 1, 10].max, placeholder: "Hier kannst du Notizen speichern. \n\nNotizen beziehen sich nur auf den aktuellen Pfad.", hide_label: true
|
||||||
|
= form.submit "Speichern"
|
||||||
|
|
@ -1,11 +1,14 @@
|
||||||
<div id="<%= dom_id page %>">
|
<div id="<%= dom_id page %>" class="mb-3">
|
||||||
|
<h2>
|
||||||
|
<i class="bi bi-file"></i>
|
||||||
|
<%= page.position %> <%= page.path %><small><%= page.url %></small></h2>
|
||||||
<div id="element_list">
|
<div id="element_list">
|
||||||
<% page.elements.each do |element| %>
|
<% page.elements.each do |element| %>
|
||||||
<%= render element %>
|
<%= render element %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="pt-3">
|
<div>
|
||||||
<%= turbo_frame_tag "new_element_frame" do %>
|
<%= turbo_frame_tag "new_element_frame" do %>
|
||||||
<%= render partial: "pages/new_element_button", locals: { page: page } %>
|
<%= render partial: "pages/new_element_button", locals: { page: page } %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@
|
||||||
<%= turbo_frame_tag "new_page_frame" do %>
|
<%= turbo_frame_tag "new_page_frame" do %>
|
||||||
<div class="border border-info p-3">
|
<div class="border border-info p-3">
|
||||||
<%= render "form", page: @page %>
|
<%= render "form", page: @page %>
|
||||||
<%= link_to "Abbrechen", report_path(@page.report) %>
|
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,9 +0,0 @@
|
||||||
<h1><%= t("scaffold.pagetitle_show", model: @page.class.model_name.human) %></h1>
|
|
||||||
|
|
||||||
<%= render @page %>
|
|
||||||
|
|
||||||
<div class="action-row">
|
|
||||||
<%= link_to t("scaffold.link_edit", model: @page.model_name.human), edit_page_path(@page) %>
|
|
||||||
<%= link_to t("scaffold.link_index", model: @page.model_name.human(count: 2)), report_pages_path(@page.report) %>
|
|
||||||
<%= button_to t("scaffold.link_destroy", model: @page.model_name.human), @page, method: :delete, class: "btn btn-outline-danger" %>
|
|
||||||
</div>
|
|
||||||
9
app/views/pages/show.html.slim
Normal file
9
app/views/pages/show.html.slim
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
h1
|
||||||
|
= t("scaffold.pagetitle_show", model: @page.class.model_name.human)
|
||||||
|
= render @page
|
||||||
|
= turbo_frame_tag(dom_id(@page, :notes)) do
|
||||||
|
= render partial: "pages/notes", locals: { page: @page }
|
||||||
|
.action-row
|
||||||
|
= link_to t("scaffold.link_edit", model: @page.model_name.human), edit_page_path(@page)
|
||||||
|
= link_to t("scaffold.link_index", model: @page.model_name.human(count: 2)), report_pages_path(@page.report)
|
||||||
|
= button_to t("scaffold.link_destroy", model: @page.model_name.human), @page, method: :delete, class: "btn btn-outline-danger"
|
||||||
|
|
@ -1 +1 @@
|
||||||
<%= link_to "#{tag.i(class: "bi bi-plus-lg")} Neuer Pfad".html_safe, new_report_page_path(report), class: "btn btn-primary" %>
|
<%= link_to "#{tag.i(class: "bi bi-plus-lg")} Neuer Pfad".html_safe, new_report_page_path(report), class: "btn btn-primary mb-3" %>
|
||||||
|
|
|
||||||
|
|
@ -1,22 +1,27 @@
|
||||||
h1
|
h1
|
||||||
i.bi.bi-journal-text.me-2
|
i.bi.bi-journal-text.me-2
|
||||||
= @report.name
|
= @report.name
|
||||||
p.small
|
p.small.mb-2
|
||||||
| Erstellt am
|
| Erstellt am
|
||||||
= l(@report.created_at, format: :short)
|
= l(@report.created_at, format: :short)
|
||||||
| , zuletzt bearbeitet am
|
| , zuletzt bearbeitet am
|
||||||
= l(@report.updated_at, format: :short)
|
= l(@report.updated_at, format: :short)
|
||||||
- if @report.comment
|
- if @report.comment
|
||||||
.mt-2.mb-4.lead
|
.smb-4.lead
|
||||||
= @report.comment
|
= @report.comment
|
||||||
= turbo_frame_tag "nav" do
|
= turbo_frame_tag "nav" do
|
||||||
.row
|
.row
|
||||||
.col-lg-3.col-md-6.col-sm-12
|
.col-lg-3.col-md-6.col-sm-12
|
||||||
nav.nav.nav-pills.flex-column.mb-3#page_list
|
nav.nav.nav-pills.flex-column.mb-3#page_list
|
||||||
- @report.pages.each do |page|
|
- @report.pages.each do |page|
|
||||||
= link_to(page.path, report_path(@report, page_id: page.id), class: "nav-link#{@current_page&.id == page.id ? " active" : nil }")
|
/= link_to(report_path(@report, page_id: page.id), class: "nav-link#{@current_page&.id == page.id ? " active" : nil }", data: { "turbo-action": :advance }) do
|
||||||
|
i.bi.bi-file
|
||||||
|
=< "#{page.position} #{page.path}"
|
||||||
|
= link_to(page.path, report_path(@report, page_id: page.id), class: "nav-link#{@current_page&.id == page.id ? " active" : nil }", data: { "turbo-action": :advance })
|
||||||
= turbo_frame_tag "new_page_frame" do
|
= turbo_frame_tag "new_page_frame" do
|
||||||
= render partial: "reports/new_page_button", locals: { report: @report }
|
= render partial: "reports/new_page_button", locals: { report: @report }
|
||||||
|
= turbo_frame_tag(dom_id(@current_page, :notes)) do
|
||||||
|
= render partial: "pages/notes", locals: { page: @current_page }
|
||||||
.col-lg-9.col-md-6.col-sm-12
|
.col-lg-9.col-md-6.col-sm-12
|
||||||
- if @current_page
|
- if @current_page
|
||||||
= render @current_page
|
= render @current_page
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,11 @@
|
||||||
<h1><i class="bi bi-journal-text me-2"></i><%= @report.name %></h1>
|
<h1><i class="bi bi-journal-text me-2"></i><%= @report.name %></h1>
|
||||||
<p class="small">
|
<p class="small mb-3">
|
||||||
Erstellt am <%= l(@report.created_at, format: :short) %>,
|
Erstellt am <%= l(@report.created_at, format: :short) %>,
|
||||||
zuletzt bearbeitet am <%= l(@report.updated_at, format: :short) %>
|
zuletzt bearbeitet am <%= l(@report.updated_at, format: :short) %>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<% if @report.comment %>
|
<% if @report.comment %>
|
||||||
<div class="mt-2 mb-4 lead">
|
<div class="mb-4 lead">
|
||||||
<%= @report.comment %>
|
<%= @report.comment %>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
|
|
||||||
<div id="<%= dom_id success_criterion %>" class="card mt-3">
|
<div id="<%= dom_id success_criterion %>" class="card mb-3">
|
||||||
<%== render partial: "success_criteria/header", locals: { success_criterion: success_criterion } %>
|
<%== render partial: "success_criteria/header", locals: { success_criterion: success_criterion } %>
|
||||||
|
|
||||||
<div class="collapse show" id="collapseSuccessCriterion_<%= success_criterion.id %>">
|
<div class="collapse show" id="collapseSuccessCriterion_<%= success_criterion.id %>">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<%= bootstrap_form_with(model: success_criterion.persisted? ? success_criterion : [:element, success_criterion], data: { controller: "unsaved-changes" }) do |form| %>
|
<%= bootstrap_form_with(model: success_criterion.persisted? ? success_criterion : [:element, success_criterion]) do |form| %>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<div class="btn-group" role="group" aria-label="Resultat">
|
<div class="btn-group" role="group" aria-label="Resultat">
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
<% edit_mode = action_name == "edit" %>
|
<% edit_mode = action_name == "edit" %>
|
||||||
<div class="card-header d-flex">
|
<div class="card-header d-flex">
|
||||||
<h3
|
<h3
|
||||||
class="h5 mt-2"
|
class="h5"
|
||||||
data-bs-toggle="collapse"
|
data-bs-toggle="collapse"
|
||||||
href="#collapseSuccessCriterion_<%= success_criterion.id %>"
|
href="#collapseSuccessCriterion_<%= success_criterion.id %>"
|
||||||
role="button"
|
role="button"
|
||||||
|
|
@ -9,6 +9,7 @@
|
||||||
aria-controls="collapseSuccessCriterion_<%= success_criterion.id %>"
|
aria-controls="collapseSuccessCriterion_<%= success_criterion.id %>"
|
||||||
style="cursor: pointer">
|
style="cursor: pointer">
|
||||||
<i class="bi <%= success_criterion_result_icon_classes(success_criterion) %>"></i>
|
<i class="bi <%= success_criterion_result_icon_classes(success_criterion) %>"></i>
|
||||||
|
<%= success_criterion.page.position %>.<%= success_criterion.element.position %>.<%= success_criterion.position %>
|
||||||
<%= success_criterion.title %>
|
<%= success_criterion.title %>
|
||||||
<span class="badge rounded-pill text-bg-secondary">
|
<span class="badge rounded-pill text-bg-secondary">
|
||||||
<%= success_criterion.level %>
|
<%= success_criterion.level %>
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
<%= turbo_frame_tag(dom_id(success_criterion, :frame)) do %>
|
<%= turbo_frame_tag(dom_id(success_criterion, :frame)) do %>
|
||||||
<% expanded = false unless defined?(expanded) %>
|
<% expanded = false unless defined?(expanded) %>
|
||||||
<div id="<%= dom_id success_criterion %>" class="card mt-3">
|
<div id="<%= dom_id success_criterion %>" class="card">
|
||||||
<%== render partial: "success_criteria/header", locals: {success_criterion: success_criterion } %>
|
<%== render partial: "success_criteria/header", locals: {success_criterion: success_criterion } %>
|
||||||
|
|
||||||
<div class="collapse<%= " show" if expanded %>" id="collapseSuccessCriterion_<%= success_criterion.id %>">
|
<div class="collapse<%= " show" if expanded %>" id="collapseSuccessCriterion_<%= success_criterion.id %>">
|
||||||
|
|
@ -31,7 +31,7 @@
|
||||||
<%= success_criterion.quick_fail %>
|
<%= success_criterion.quick_fail %>
|
||||||
<%= success_criterion.quick_fix %>
|
<%= success_criterion.quick_fix %>
|
||||||
<% if success_criterion.test_comment.present? %>
|
<% if success_criterion.test_comment.present? %>
|
||||||
<div class="comment mt-3"><%= success_criterion.test_comment %></div>
|
<div class="comment"><%= success_criterion.test_comment %></div>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -72,6 +72,8 @@ de-CH:
|
||||||
report:
|
report:
|
||||||
name: Bezeichnung
|
name: Bezeichnung
|
||||||
comment: Projektbeschreibung
|
comment: Projektbeschreibung
|
||||||
|
page:
|
||||||
|
notes: Notizen
|
||||||
models:
|
models:
|
||||||
account:
|
account:
|
||||||
one: Konto
|
one: Konto
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
class AddPositionToSuccessCriteria < ActiveRecord::Migration[7.2]
|
||||||
|
def change
|
||||||
|
add_column :success_criteria, :position, :integer, null: false
|
||||||
|
add_index :success_criteria, [:element_id, :position], unique: true
|
||||||
|
add_index :elements, [:page_id, :position], unique: true
|
||||||
|
add_index :pages, [:report_id, :position], unique: true
|
||||||
|
end
|
||||||
|
end
|
||||||
5
db/migrate/20241101013336_change_position_on_elements.rb
Normal file
5
db/migrate/20241101013336_change_position_on_elements.rb
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
class ChangePositionOnElements < ActiveRecord::Migration[7.2]
|
||||||
|
def change
|
||||||
|
change_column(:elements, :position, :integer, default: nil, null: false)
|
||||||
|
end
|
||||||
|
end
|
||||||
5
db/migrate/20241101015725_add_notes_to_pages.rb
Normal file
5
db/migrate/20241101015725_add_notes_to_pages.rb
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
class AddNotesToPages < ActiveRecord::Migration[7.2]
|
||||||
|
def change
|
||||||
|
add_column :pages, :notes, :text
|
||||||
|
end
|
||||||
|
end
|
||||||
9
db/schema.rb
generated
9
db/schema.rb
generated
|
|
@ -10,7 +10,7 @@
|
||||||
#
|
#
|
||||||
# It's strongly recommended that you check this file into your version control system.
|
# It's strongly recommended that you check this file into your version control system.
|
||||||
|
|
||||||
ActiveRecord::Schema[7.2].define(version: 2024_10_31_183755) do
|
ActiveRecord::Schema[7.2].define(version: 2024_11_01_015725) do
|
||||||
create_table "account_remember_keys", force: :cascade do |t|
|
create_table "account_remember_keys", force: :cascade do |t|
|
||||||
t.string "key", null: false
|
t.string "key", null: false
|
||||||
t.datetime "deadline", null: false
|
t.datetime "deadline", null: false
|
||||||
|
|
@ -124,7 +124,8 @@ ActiveRecord::Schema[7.2].define(version: 2024_10_31_183755) do
|
||||||
t.datetime "created_at", null: false
|
t.datetime "created_at", null: false
|
||||||
t.datetime "updated_at", null: false
|
t.datetime "updated_at", null: false
|
||||||
t.integer "page_id", null: false
|
t.integer "page_id", null: false
|
||||||
t.integer "position", default: 0, null: false
|
t.integer "position", null: false
|
||||||
|
t.index ["page_id", "position"], name: "index_elements_on_page_id_and_position", unique: true
|
||||||
t.index ["page_id"], name: "index_elements_on_page_id"
|
t.index ["page_id"], name: "index_elements_on_page_id"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -153,6 +154,8 @@ ActiveRecord::Schema[7.2].define(version: 2024_10_31_183755) do
|
||||||
t.integer "report_id", null: false
|
t.integer "report_id", null: false
|
||||||
t.datetime "created_at", null: false
|
t.datetime "created_at", null: false
|
||||||
t.datetime "updated_at", null: false
|
t.datetime "updated_at", null: false
|
||||||
|
t.text "notes"
|
||||||
|
t.index ["report_id", "position"], name: "index_pages_on_report_id_and_position", unique: true
|
||||||
t.index ["report_id"], name: "index_pages_on_report_id"
|
t.index ["report_id"], name: "index_pages_on_report_id"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -188,7 +191,9 @@ ActiveRecord::Schema[7.2].define(version: 2024_10_31_183755) do
|
||||||
t.datetime "updated_at", null: false
|
t.datetime "updated_at", null: false
|
||||||
t.integer "check_id"
|
t.integer "check_id"
|
||||||
t.integer "priority"
|
t.integer "priority"
|
||||||
|
t.integer "position", null: false
|
||||||
t.index ["check_id"], name: "index_success_criteria_on_check_id"
|
t.index ["check_id"], name: "index_success_criteria_on_check_id"
|
||||||
|
t.index ["element_id", "position"], name: "index_success_criteria_on_element_id_and_position", unique: true
|
||||||
t.index ["element_id"], name: "index_success_criteria_on_element_id"
|
t.index ["element_id"], name: "index_success_criteria_on_element_id"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue