diff --git a/app/controllers/content_controller.rb b/app/controllers/content_controller.rb index 3b1a28cc..564967cd 100644 --- a/app/controllers/content_controller.rb +++ b/app/controllers/content_controller.rb @@ -549,7 +549,10 @@ class ContentController < ApplicationController @content = @entity update_page_tags - render json: attribute_value.to_json, status: 200 + respond_to do |format| + format.html { redirect_back(fallback_location: root_path, notice: "#{@attribute_field.label} updated!") } + format.json { render json: attribute_value.to_json, status: 200 } + end end def universe_field_update diff --git a/app/views/content/form/_rich_text_input.html.erb b/app/views/content/form/_rich_text_input.html.erb index 4a8fb7de..b0ad31ad 100644 --- a/app/views/content/form/_rich_text_input.html.erb +++ b/app/views/content/form/_rich_text_input.html.erb @@ -29,7 +29,7 @@ <%= text_area_tag "field[value]", value, - class: "max-w-3xl shadow-sm block w-full focus:ring-notebook-blue focus:border-notebook-blue sm:text-sm border-0 border-l-4 border-r-4 border-gray-200 rounded-md" \ + class: "shadow-sm block w-full focus:ring-notebook-blue focus:border-notebook-blue sm:text-sm border-0 border-l-4 border-r-4 border-gray-200 rounded-md" \ + " js-can-mention-pages js-autosize-textarea" \ + "#{' autocomplete js-autocomplete-' + field[:id].to_s if should_autocomplete}" \ + "#{' autosave-closest-form-on-change' if should_autosave}", diff --git a/app/views/content/tailwind_components/_content_fields_display.html.erb b/app/views/content/tailwind_components/_content_fields_display.html.erb index c9d9d61c..08489b36 100644 --- a/app/views/content/tailwind_components/_content_fields_display.html.erb +++ b/app/views/content/tailwind_components/_content_fields_display.html.erb @@ -12,7 +12,7 @@ <%= category[:icon] %> <%= category[:label] %> - <% if category[:percent_complete].present? && category[:percent_complete] > 10 %> + <% if category[:percent_complete].present? && category[:percent_complete] >= 25 %>
@@ -34,7 +34,7 @@ <%= field[:label] %>
-
<%= @@ -52,10 +52,10 @@ end %>
-
- <%= form_for content.raw_model, url: FieldTypeService.form_path(field), remote: true do |f| %> + <%= form_for content.raw_model, url: FieldTypeService.form_path(field), remote: true, authenticity_token: true do |f| %> <%= hidden_field_tag "entity[entity_id]", content.id %> <%= hidden_field_tag "entity[entity_type]", content.class_name %> <%=