Skip to content

Commit

Permalink
Fix metadata fields
Browse files Browse the repository at this point in the history
  • Loading branch information
miharekar committed Sep 26, 2023
1 parent 1c5baa2 commit f5ae37a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 2 additions & 1 deletion app/views/shots/_details.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@
' %
- if shot.metadata.present?
.mt-2
- shot.metadata.each do |key, value|
- shot.user.metadata_fields.each do |key|
- value = shot.metadata[key]
- next if value.blank?
div
span.font-medium.text-stone-900.dark:text-stone-100 #{key}: 
Expand Down
3 changes: 1 addition & 2 deletions app/views/shots/_form.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,10 @@
' Calculate from TDS
- if current_user.premium?
- if current_user.metadata_fields.any?

- current_user.metadata_fields.each do |field|
.col-span-6.sm:col-span-3
= f.label "metadata[#{field}]", field, class: "standard-label"
= f.text_field "metadata[#{field}]", value: @shot.metadata[field], class: "standard-input"
= f.text_field "metadata[#{field}]", name: field_name(:shot, :metadata, field), value: @shot.metadata[field], class: "standard-input"
- else
p.text-stone-700.dark:text-stone-300.text-center
' You don't have any custom fields yet.
Expand Down

0 comments on commit f5ae37a

Please sign in to comment.