Files
fizzy/app/views/bubbles/_date.html.erb
T
Jeffrey Hardy d98f92f0e6 Style
2024-09-13 18:28:12 -04:00

20 lines
1.7 KiB
Plaintext

<% if bubble.due_on.present? %>
<%= form_with model: bubble, data: { controller: "form" } do |form| %>
<label class="bubble__bubble bubble__meta bubble__date">
<%= bubble.due_on.strftime("%b <br> %d").html_safe %>
<%= form.date_field :due_on, class: "input input--hidden", data: { action: "change->form#submit click->form#showPicker"} %>
<span class="for-screen-reader">Change the due date</span>
</label>
<% end %>
<% else %>
<div class="bubble__bubble bubble__meta bubble__date bubble__date--new">
<%= form_with model: bubble, data: { controller: "form" } do |form| %>
<label class="btn btn--plain" style="--btn-icon-size: 2.5em; margin-inline-end: -0.2em">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="var(--bubble-color)"><path d="M9.569,16.5H2.5A.5.5,0,0,1,2,16V7.5A.5.5,0,0,1,2.5,7H16a.5.5,0,0,1,.5.5V9.57a7.281,7.281,0,0,1,2,0V3a1,1,0,0,0-1-1H15a.25.25,0,0,1-.25-.25v-1a.75.75,0,1,0-1.5,0V4.5a.75.75,0,1,1-1.5,0v-2a.5.5,0,0,0-.5-.5H7a.25.25,0,0,1-.25-.25v-1a.75.75,0,0,0-1.5,0V4.5a.75.75,0,1,1-1.5,0v-2a.5.5,0,0,0-.5-.5H1A1,1,0,0,0,0,3V16.5a2,2,0,0,0,2,2H9.569a7.281,7.281,0,0,1,0-2Z"/><path fill="var(--color-positive)" d="M17.5,11A6.5,6.5,0,1,0,24,17.5,6.508,6.508,0,0,0,17.5,11Zm.75,9a.75.75,0,1,1-1.5,0V18.5a.25.25,0,0,0-.25-.25H15a.75.75,0,0,1,0-1.5h1.5a.25.25,0,0,0,.25-.25V15a.75.75,0,1,1,1.5,0v1.5a.25.25,0,0,0,.25.25H20a.75.75,0,0,1,0,1.5H18.5a.25.25,0,0,0-.25.25Z"/></svg>
<%= form.date_field :due_on, class: "input input--hidden", data: { action: "change->form#submit click->form#showPicker"} %>
<span class="for-screen-reader">Add a due date</span>
</label>
<% end %>
</div>
<% end %>