From 03a99660a7ed2b88cb516d31c2a9fe98cb8abba0 Mon Sep 17 00:00:00 2001 From: alexdbondoc17 Date: Sat, 5 Feb 2022 12:31:33 +0000 Subject: [PATCH] Improve Main UI --- ...tation_marks_modal_form_component.html.erb | 23 ++-- .../doctrine_modal_form_component.html.erb | 4 +- ...document_doctrine_index_component.html.erb | 18 ++- .../document_doctrine_show_component.html.erb | 120 ++++++++++++++---- .../document_index_table_body_component.rb | 31 ----- ...cument_index_table_body_component.html.erb | 58 --------- .../sidenav_component.html.erb | 104 +++++++++------ .../subject_accordion_component.html.erb | 59 ++++++--- .../subject_index_form_component.rb | 21 ++- .../subject_index_form_component.html.erb | 31 +++-- .../subjects_sidenav_sub_menu_component.rb | 2 +- .../doctrine/annotations_controller.rb | 17 ++- app/controllers/documents_controller.rb | 3 +- app/controllers/subject_indexes_controller.rb | 2 +- .../controllers/application_controller.js | 4 + .../controllers/document_controller.js | 35 ++++- .../controllers/select2_controller.js | 4 +- .../controllers/selectize_controller.js | 20 +++ app/javascript/src/application.scss | 4 +- app/reflexes/document_reflex.rb | 9 +- .../_document_search_results_table.html.erb | 28 ++++ app/views/documents/index.html.erb | 57 +++++++-- app/views/layouts/application.html.erb | 2 +- app/views/subject_indexes/edit.html.erb | 2 +- app/views/subject_indexes/index.html.erb | 22 +++- app/views/subject_indexes/new.html.erb | 2 +- app/views/subject_indexes/show.html.erb | 36 ++++++ package.json | 3 + yarn.lock | 102 ++++++++++++++- 29 files changed, 572 insertions(+), 251 deletions(-) delete mode 100644 app/components/document_index_table_body_component.rb delete mode 100644 app/components/document_index_table_body_component/document_index_table_body_component.html.erb create mode 100644 app/javascript/controllers/selectize_controller.js create mode 100644 app/views/document/doctrines/_document_search_results_table.html.erb diff --git a/app/components/annotation_marks_modal_form_component/annotation_marks_modal_form_component.html.erb b/app/components/annotation_marks_modal_form_component/annotation_marks_modal_form_component.html.erb index 5bb36f3..094bd72 100644 --- a/app/components/annotation_marks_modal_form_component/annotation_marks_modal_form_component.html.erb +++ b/app/components/annotation_marks_modal_form_component/annotation_marks_modal_form_component.html.erb @@ -8,17 +8,24 @@ @@ -48,14 +55,14 @@
- <%= label_tag :phil_rep %> + <%= label_tag :phil_rep %> <%= text_field_tag :phil_rep, annotation.phil_rep, class: "form-control" %>
- <%= label_tag :editor_notes %> + <%= label_tag :editor_notes %> <%= rich_text_area_tag :editor_notes, annotation.editor_notes, placeholder: "Editor Notes" %>
diff --git a/app/components/doctrine_modal_form_component/doctrine_modal_form_component.html.erb b/app/components/doctrine_modal_form_component/doctrine_modal_form_component.html.erb index f4aa8d6..6f31dce 100644 --- a/app/components/doctrine_modal_form_component/doctrine_modal_form_component.html.erb +++ b/app/components/doctrine_modal_form_component/doctrine_modal_form_component.html.erb @@ -9,9 +9,9 @@
- <%= form_tag(doctrine_form_url, method: :patch, local: true) do %> -
+
<%= label_tag :subjects %> - <%= select_tag "subjects_ids[]", options_from_collection_for_select(Cdao::Subject.all, :id, :lineage_name, subject_ids), class: "form-select subjects-select2", multiple: true, prompt: "Please select" %> + <%= select_tag "subjects_ids[]", options_from_collection_for_select(Cdao::Subject.all, :id, :lineage_name, subject_ids), class: "form-select default-selectize", multiple: true, prompt: "Please select", readonly: true %>
<%= label_tag :content %> - <%= rich_text_area_tag :content, content, placeholder: "Doctrine Content" %> + <%= rich_text_area_tag :content, content, placeholder: "Doctrine Content", readonly: true %>
- <% end %>
@@ -59,6 +57,79 @@ + +
@@ -66,26 +137,31 @@
Annotation Marks
<% doctrine.annotations.order(rank: :asc).each do |annotation| %> -
+
+
+

+ <%= "#{annotation.annomarks.map { |annomark| "(#{annomark.code})" }.join(" ")}" %> + <%= raw [annotation.document.title, annotation.document.reference_number, annotation.document.docdate.strftime("%B %d, %Y"), annotation.phil_rep].reject(&:blank?).join(', ').html_safe %> +

+
+ + +
+ + <% if annotation.editor_notes.present? %>
-
-

- <%= "#{annotation.annomarks.map { |annomark| "(#{annomark.code})" }.join(" ")}" %> - <%= raw [annotation.document.title, annotation.document.reference_number, annotation.document.docdate.strftime("%B %d, %Y"), annotation.phil_rep].reject(&:blank?).join(', ').html_safe %> -

+
+ Editors Note:
- -
- Edit - Delete + +
+ <%= raw annotation.editor_notes %>
- -
- - <% if annotation.editor_notes.present? %> - Editors Note: <%= annotation.editor_notes %> - <% end %> -
+
+ <% end %>
+ - + + +
<% end %> diff --git a/app/components/subject_accordion_component/subject_accordion_component.html.erb b/app/components/subject_accordion_component/subject_accordion_component.html.erb index 0242d25..045cfc6 100644 --- a/app/components/subject_accordion_component/subject_accordion_component.html.erb +++ b/app/components/subject_accordion_component/subject_accordion_component.html.erb @@ -1,35 +1,60 @@ -<% parent.children.each do |second_subject| %> -
+<% parent.children.each do |sub1| %> +
-