- <%= field.label %>
- <%= range_field_tag "basil_commission[field][#{field.id}][importance]", @guidance.fetch(field.id.to_s, 1), { min: 0, max: 1.3, step: 0.1, style: 'width: 50%', class: 'js-importance-slider hide' } %>
+
+ <%= field.label %>
+ <%= range_field_tag "basil_commission[field][#{field.id}][importance]", @guidance.fetch(field.id.to_s, 1), { min: 0, max: 1.3, step: 0.1, style: 'width: 100%', class: 'js-importance-slider hide' } %>
+
<%= value %>
@@ -57,68 +64,74 @@ function commission_basil(style) {
<%= link_to 'Customize per-field importance', "javascript:var sliders = document.getElementsByClassName('js-importance-slider'); for(var i = 0; i < sliders.length; i++) sliders.item(i).classList.remove('hide')" %>
<% end %>
-
+
How to customize per-field importance
- This allows you to tell Basil which fields are more or less important to you. For example, if Basil isn't
- getting a character's hair color right, you can increase the importance of the "Hair Color" field.
+ Customizing importance allows you to tell Basil which fields are more or less important to you. For example, if Basil is
+ focusing too hard on something specific you've said, you can turn down the importance of that field with
+ the slider.
- You can also tell Basil to ignore a field entirely by dragging the slider all the way to the left.
+ You can also tell Basil to ignore your answer to a field entirely by dragging the slider all the way to the left.
+
+ Your preferences for this page are saved whenever you request an image.
-
-
- This is still a work in progress and very much a beta that will change a lot before releasing publicly,
- but feel free to use it as much as you'd like to provide feedback!
-
-
- If you run into any issues, please let me know <%# in the %>
- <%# link_to 'Site Support forums', 'https://www.notebook.ai/forum/site-support' %>
- <%# or %> <%= link_to 'on Discord', 'https://discord.gg/7WCuGxY3AW' %>.
-
+
+ <%= link_to new_polymorphic_path(@content.page_type.downcase), class: "hoverable card-panel white-text #{@content.color}", style: 'display: block' do %>
+ add
+
+ Create another <%= @content.page_type.downcase %>
+
+ <% end %>
+ <% end %>
-
- <% if @can_request_another && @relevant_fields.any? %>
+
+ <% if @can_request_another && @relevant_fields.any? %>
+
Available styles
<% BasilService.enabled_styles_for(@content.page_type).each do |style| %>
- <%= link_to "javascript:commission_basil('#{style}')" do %>
-
- <%= style.humanize %>
- chevron_right
-
- <% end %>
- <% end %>
- <% end %>
-
- <% if @can_request_another && @relevant_fields.any? %>
- <% if BasilService.experimental_styles_for(@content.page_type).any? %>
-
Experimental styles
- <% BasilService.experimental_styles_for(@content.page_type).each do |style| %>
+
<%= link_to "javascript:commission_basil('#{style}')" do %>
<%= style.humanize %>
chevron_right
<% end %>
- <% end %>
+
<% end %>
- <% end %>
-
- <% if !@can_request_another %>
-
- Basil is working on your <%= pluralize @in_progress_commissions.count, 'requested commission' %>.
-
- As soon as he completes one, you'll be able to request another.
+
+ <% end %>
+
+ <% if @can_request_another && @relevant_fields.any? %>
+ <% if BasilService.experimental_styles_for(@content.page_type).any? %>
+
+
Experimental styles
+ <% BasilService.experimental_styles_for(@content.page_type).each do |style| %>
+
+ <%= link_to "javascript:commission_basil('#{style}')" do %>
+
+ <%= style.humanize %>
+ chevron_right
+
+ <% end %>
+
+ <% end %>
<% end %>
-
- <% end %>
+ <% end %>
+
+ <% if !@can_request_another %>
+
+ Basil is working on your <%= pluralize @in_progress_commissions.count, 'requested commission' %>.
+
+ As soon as he completes one, you'll be able to request another.
+
+ <% end %>
-
<% else %>
@@ -213,27 +224,35 @@ function commission_basil(style) {
<% content_for :javascript do %>
$(document).ready(function() {
- $('.js-save-commission').click(function() {
+ $('.js-save-commission').click(function(e) {
$(this).text('Saved!');
- var save_endpoint = $(this).data('endpoint');
+ var save_endpoint = $(this).data('endpoint') + '.json';
$.post(save_endpoint, function(data) {
console.log(data);
+
+ M.toast({ html: "This image has been added to <%= @content.name.gsub('"', '\"') %>'s page." });
});
+
+ e.preventDefault();
});
- $('.js-delete-commission').click(function() {
+ $('.js-delete-commission').click(function(e) {
$(this).text('Deleting...');
$(this).closest('.card').hide();
- var delete_endpoint = $(this).data('endpoint');
+ var delete_endpoint = $(this).data('endpoint') + '.json';
$.ajax({
url: delete_endpoint,
type: 'DELETE',
success: function(result) {
$(this).closest('.card').hide();
+
+ M.toast({ html: "Image successfully deleted." });
}
});
+
+ e.preventDefault();
});
});
<% end %>
\ No newline at end of file
diff --git a/app/views/content/display/sidebar/_references.html.erb b/app/views/content/display/sidebar/_references.html.erb
index 1090eb92..d97d7535 100644
--- a/app/views/content/display/sidebar/_references.html.erb
+++ b/app/views/content/display/sidebar/_references.html.erb
@@ -12,7 +12,7 @@
<%
show_in_this_universe_tab = !creating && !editing && raw_model.is_a?(Universe)
show_associations_tab = !creating && !editing
- show_gallery_tab = creating || editing || raw_model.image_uploads.any?
+ show_gallery_tab = creating || editing || raw_model.image_uploads.any? || @basil_images.any?
show_documents_tab = !creating && !editing && related_documents.any?
show_shares_tab = !creating && !editing && raw_model.content_page_shares.any?
show_collections_tab = !creating && !editing && raw_model.page_collection_submissions.accepted.any?
@@ -59,7 +59,9 @@
photo_library
Gallery
- <%= raw_model.image_uploads.count %>
+
+ <%= raw_model.image_uploads.count + @basil_images.count %>
+
<% end %>
diff --git a/app/views/content/show.html.erb b/app/views/content/show.html.erb
index 9db5e4cd..ab98cdc4 100644
--- a/app/views/content/show.html.erb
+++ b/app/views/content/show.html.erb
@@ -68,7 +68,7 @@
# the regular view if it's not a special case.
case serialized_category[:name]
when 'gallery'
- render partial: 'content/form/images/gallery', locals: { content: content } if @content.image_uploads.any?
+ render partial: 'content/form/images/gallery', locals: { content: content }
when 'contributors'
render partial: 'content/display/contributors', locals: { content: content } if @content.is_a?(Universe)