docbrown/app/views/listings/new.html.erb
yheuhtozr 824397b93f
views/listings etc i18n (#15040)
* views/listings etc i18n

* helper labels

* remove ja.yml

* Update edit.html.erb

* Apply suggestions from code review

Co-authored-by: Michael Kohl <citizen428@forem.com>

* Update delete_confirm.html.erb

* Update edit.html.erb

* Update fr.yml

* Update edit.html.erb

Co-authored-by: Michael Kohl <citizen428@forem.com>
2021-10-27 16:37:29 +01:00

44 lines
2.6 KiB
Text

<% title t("views.listings.new.meta.title") %>
<header class="crayons-layout crayons-layout--limited-l flex items-center justify-between p-2 l:p-4 l:pb-0">
<h1 class="crayons-title"><%= t("views.listings.new.heading") %></h1>
</header>
<main class="crayons-layout crayons-layout--2-cols crayons-layout--2-cols--inverted crayons-layout--limited-l">
<div class="crayons-layout__content">
<%= render "form", listing: @listing %>
</div>
<aside class="crayons-layout__sidebar-right px-3 m:px-0">
<div class="crayons-card crayons-card--secondary p-3 m:p-6 mb-2 m:mb-4">
<span class="color-base-60"><%= t("views.listings.new.personal") %></span>
<div class="flex m:flex-col items-center m:items-start justify-between">
<strong class="fs-2xl m:fs-3xl lh-tight color-base-90 m:mb-4 block" id="test-credits-size"><%= @credits.size %></strong>
<a target="_blank" rel="noopener noreferrer" class="crayons-btn crayons-btn--secondary m:w-100" href="/credits/purchase" data-no-instant><%= t("views.listings.new.buy") %></a>
</div>
</div>
<% if @organizations.present? %>
<div class="crayons-card crayons-card--secondary p-3 m:p-6 mb-4">
<span class="color-base-60"><%= t("views.listings.new.organization") %></label>
<% if @organizations.size > 1 %>
<select id="org-credits-select" class="org-credits-select crayons-select my-2">
<% @organizations.each do |org| %>
<option value="<%= org.id %>" data-credits="<%= org.credits.unspent.size %>"><%= org.name %></option>
<% end %>
</select>
<% end %>
<div class="flex m:flex-col items-center m:items-start justify-between">
<strong class="fs-2xl m:fs-3xl lh-tight color-base-90 m:mb-4 block" id="org-credits-number"><%= @organizations.first.credits.unspent.size %></strong>
<a id="org-credits-purchase-link" target="_blank" rel="noopener noreferrer" class="crayons-btn crayons-btn--secondary m:w-100" href="/credits/purchase?organization_id=<%= @organizations.first.id %>" data-no-instant><%= t("views.listings.new.buy") %></a>
</div>
<%= javascript_packs_with_chunks_tag "listingForm", "orgCreditsSelector", defer: true %>
</div>
<% end %>
<div class="fs-s color-base-60 mb-4">
<h3 class="fs-base fw-bold color-base-70 mb-2"><%= t("views.listings.new.disclaimer.subtitle") %></h3>
<p class="mb-2"><%= t("views.listings.new.disclaimer.description1", community: community_name) %></p>
<p><%= t("views.listings.new.disclaimer.description2") %></p>
</div>
</aside>
</main>