Skip to content

Commit c4c44ea

Browse files
committed
I think this should do it
1 parent 93fa7d9 commit c4c44ea

File tree

4 files changed

+32
-11
lines changed

4 files changed

+32
-11
lines changed

app/controllers/basil_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ def about
211211
end
212212

213213
def jam
214-
@recent_commissions = BasilCommission.order('id DESC').limit(18)
214+
@recent_commissions = BasilCommission.where(entity_id: nil).order('id DESC').limit(18)
215215
end
216216

217217
def queue_jam_job

app/views/basil/jam.html.erb

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -207,12 +207,12 @@
207207
<% if commission.complete? %>
208208
<%= image_tag commission.image, class: 'commission-image' %>
209209
<% else %>
210-
<%= image_tag image_path("placeholders/commission.png"), style: "width: 100%", class: 'commission-image' %>
210+
<%= image_tag image_path("placeholders/commission.png"), class: 'commission-image' %>
211211
<% end %>
212212
<% end %>
213213
<% if commission.final_settings %>
214214
<span class="card-title">
215-
<%= commission.final_settings&.fetch('jam_name', '') %>
215+
<%= commission.final_settings&.fetch('name', '') %>
216216
</span>
217217
<% end %>
218218
</div>
@@ -265,7 +265,10 @@
265265

266266
<div id="details-<%= commission.job_id %>" class="modal">
267267
<div class="modal-content">
268-
<h4><%= commission.final_settings&.fetch('jam_name', 'Nameless character') %></h4>
268+
<h4>
269+
<i class="material-icons <%= Character.text_color %>"><%= Character.icon %></i>
270+
<%= commission.final_settings&.fetch('name', 'Nameless character') %>
271+
</h4>
269272
<div class="row">
270273
<div class="col s12 m4 l3">
271274
<% if commission.complete? %>
@@ -283,9 +286,14 @@
283286
<% end %>
284287
</div>
285288
<div class="col s12 m8 l9">
286-
<p>
287-
<%= commission.final_settings&.fetch('jam_prompt', 'prompt text') %>
288-
</p>
289+
<ul style="margin: 0 8px">
290+
<li>
291+
<strong class="grey-text">Prompt:</strong>
292+
<blockquote>
293+
<%= commission.prompt %>
294+
</blockquote>
295+
</li>
296+
</ul>
289297
</div>
290298
</div>
291299
</div>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
class DropNotNullConstraintFromBasilCommissions < ActiveRecord::Migration[6.1]
2+
def up
3+
change_column_null :basil_commissions, :user_id, true
4+
change_column_null :basil_commissions, :entity_type, true
5+
change_column_null :basil_commissions, :entity_id, true
6+
end
7+
8+
def down
9+
change_column_null :basil_commissions, :user_id, false
10+
change_column_null :basil_commissions, :entity_type, false
11+
change_column_null :basil_commissions, :entity_id, false
12+
end
13+
end

db/schema.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#
1111
# It's strongly recommended that you check this file into your version control system.
1212

13-
ActiveRecord::Schema.define(version: 2023_04_14_183606) do
13+
ActiveRecord::Schema.define(version: 2023_05_12_222601) do
1414

1515
create_table "active_storage_attachments", force: :cascade do |t|
1616
t.string "name", null: false
@@ -187,9 +187,9 @@
187187
end
188188

189189
create_table "basil_commissions", force: :cascade do |t|
190-
t.integer "user_id", null: false
191-
t.string "entity_type", null: false
192-
t.integer "entity_id", null: false
190+
t.integer "user_id"
191+
t.string "entity_type"
192+
t.integer "entity_id"
193193
t.string "prompt"
194194
t.string "job_id"
195195
t.datetime "created_at", precision: 6, null: false

0 commit comments

Comments
 (0)