Please <%= link_to 'fill out more fields', @content.edit_path %> for this page
before requesting an image.
<% end %>
<% if @can_request_another && @relevant_fields.any? %>
<%= 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
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 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.
<% end %>
<%= render partial: 'notice_dismissal/messages/19' if show_notice?(id: 19) %>
<% 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_down
<% end %>
<% end %>
<% 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_down
<% end %>
<% end %>
<% end %>
<% end %>
<% unless current_user.on_premium_plan? %>
Image generation is a Premium-only feature, but free accounts can still generate up
to <%= pluralize BasilService::FREE_IMAGE_LIMIT, 'image' %> for free.
You have generated <%= pluralize @generated_images_count, 'image' %>
and have <%= pluralize [0, BasilService::FREE_IMAGE_LIMIT - @generated_images_count].max, 'free image' %> remaining:
<% if @generated_images_count >= BasilService::FREE_IMAGE_LIMIT %>
<%= link_to 'Click here to manage your billing plan', subscription_path, class: 'blue-text text-darken-4' %>
<% end %>
<% end %>
<% if !@can_request_another && @in_progress_commissions.any? %>
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 %>
<% @commissions.each do |commission| %>
<% if commission.complete? %>
<%= link_to commission.image do %>
<%= image_tag commission.image %>
<% end %>
<%= @content.name %>
<% if commission.style? %>
(<%= commission.style.humanize %>)
<% end %>
Completed <%= time_ago_in_words commission.completed_at %> ago
· Took <%= distance_of_time_in_words commission.completed_at - commission.created_at %>
Basil is still working on this commission... (style: <%= commission.style %>)
(Requested <%= time_ago_in_words(commission.created_at) %> ago · Refresh this page for updates)
<% end %>
<% end %>
<% if @commissions.count == 10 %>
End of the list?
Only your 10 most recent generations are displayed here, but you can still find all
of your generated images on the <%= link_to 'Basil Feedback', basil_rating_queue_path %> pages.
<% end %>
<% content_for :javascript do %>
$(document).ready(function() {
$('.js-save-commission').click(function(e) {
$(this).text('Saved!');
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(e) {
$(this).text('Deleting...');
$(this).closest('.card').hide();
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 %>