43 lines
1.5 KiB
Plaintext
43 lines
1.5 KiB
Plaintext
<%= render HeaderComponent.new(title: "Contributions") %>
|
|
|
|
<%= render MainWithTabnavComponent.new(tabnav_partial: "shared/tabnav_contributions") do %>
|
|
<% if @edit_content %>
|
|
<section>
|
|
<%= form_with model: [:admin, @content_title] do |form| %>
|
|
<p class="mb-2">
|
|
<%= form.label :content, @content_title.key.capitalize, class: 'font-bold' %>
|
|
</p>
|
|
<p class="flex gap-1">
|
|
<%= form.text_field :content %>
|
|
<%# <%= form.submit "Save", class: "btn-md btn-blue" %>
|
|
<%= button_tag type: 'submit', name: nil, title: "Save", class: 'btn-md btn-icon btn-outline' do %>
|
|
<%= render partial: "icons/save", locals: { custom_class: "text-blue-600 h-4 w-4 inline" } %>
|
|
<% end %>
|
|
</p>
|
|
<% end %>
|
|
</section>
|
|
<section>
|
|
<%= form_with model: [:admin, @content_body] do |form| %>
|
|
<p class="mb-2">
|
|
<%= form.label :content, @content_body.key.capitalize, class: 'font-bold' %>
|
|
</p>
|
|
<p>
|
|
<%= form.textarea :content, class: "w-full h-96" %>
|
|
</p>
|
|
<p class="text-right">
|
|
<%= link_to 'Cancel', request.path, class: 'btn-md btn-gray' %>
|
|
<%= form.submit "Save", class: "ml-2 btn-md btn-blue" %>
|
|
</p>
|
|
<% end %>
|
|
</section>
|
|
<% else %>
|
|
<section>
|
|
<% if @content_body.content.present? %>
|
|
<%= markdown_to_html @content_body.content %>
|
|
<% else %>
|
|
No content yet
|
|
<% end %>
|
|
</section>
|
|
<% end %>
|
|
<% end %>
|