-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
341609 Add delivery block to Site #14
base: 341607-update-show-pages
Are you sure you want to change the base?
Changes from 2 commits
7ead99a
29f4d26
ac2dd6f
790b5b4
01fc1cf
e6795ee
5fc4541
2fe812d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -51,6 +51,24 @@ | |||||
<%= f.text_field :longitude, class: "form-control" %> | ||||||
</fieldset> | ||||||
</div> | ||||||
|
||||||
<fieldset class="col-12 mt-4"> | ||||||
<%= f.label :delivery_address, class: "form-label" %> | ||||||
<%= f.text_area :delivery_address, class: "form-control" %> | ||||||
</fieldset> | ||||||
|
||||||
<fieldset class="col-12 mt-4"> | ||||||
<%= f.label :delivery_times, class: "form-label" %> | ||||||
<%= f.text_area :delivery_times, class: "form-control" %> | ||||||
</fieldset> | ||||||
|
||||||
<fieldset class="col-12 mt-4"> | ||||||
<%= f.label :delivery_map, class: "form-label" %> | ||||||
<%= f.file_field :delivery_map, class: "form-control" %> | ||||||
<% if @site.delivery_map.attached? %> | ||||||
<%= image_tag @site.delivery_map.variant(resize_to_limit: [200, 200]), class: "ms-0 mt-2" %> | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Prefer |
||||||
<% end %> | ||||||
</fieldset> | ||||||
<% end %> | ||||||
|
||||||
<div class="col-12 py-4 mt-4 text-end sticky-bottom bg-body-tertiary border-top"> | ||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,9 +3,7 @@ | |
breadcrumb_steps = { Site.model_name.human.pluralize => sites_path, @site.name => "" } | ||
%> | ||
|
||
<%= render Page::HeadingShowComponent.new( | ||
resource: @site, title: t(".title", site_id: @site.id, site_name: @site.name), breadcrumb_steps: | ||
) %> | ||
<%= render Page::HeadingShowComponent.new(resource: @site, title: @site.name, breadcrumb_steps:) %> | ||
<div class="col-12 p-4 border-top"> | ||
<div class="d-flex flex-row flex-wrap"> | ||
<div class="col-12 col-lg-6 pe-lg-4"> | ||
|
@@ -42,6 +40,22 @@ | |
<dd class="mb-0 pb-2 ps-3"><%= @site.public_send(attribute_name) %></dd> | ||
<% end %> | ||
</dl> | ||
|
||
<dl class="show-page_dl d-grid row-gap-2 pt-3 border-top mb-0"> | ||
<% %i[delivery_address delivery_times].each do |attribute_name| %> | ||
<dt class="pb-2"><%= Site.human_attribute_name(attribute_name) %></dt> | ||
<dd class="mb-0 pb-2 ps-3"><%= @site.public_send(attribute_name) %></dd> | ||
<% end %> | ||
|
||
<dt class="pb-2"><%= Site.human_attribute_name(:delivery_map) %></dt> | ||
<dd class="mb-0 pb-2 ps-3"> | ||
<% if @site.delivery_map.attached? %> | ||
<%= link_to @site.delivery_map, rel: :noopener, target: :_blank do %> | ||
<%= image_tag @site.delivery_map, class: "w-100" %> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use a representation with resize. Here if use upload a pdf, it will do an image of first page at least. |
||
<% end %> | ||
<% end %> | ||
</dd> | ||
</dl> | ||
<% end %> | ||
</div> | ||
</div> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# frozen_string_literal: true | ||
|
||
class AddDeliveryRelatedAttributesToSite < ActiveRecord::Migration[7.2] | ||
def change | ||
change_table :sites, bulk: true do |t| | ||
t.text :delivery_address | ||
t.text :delivery_times | ||
end | ||
end | ||
end |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we could add some format and size validation?