-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
77 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,60 @@ | ||
<%= form_with(model: link, local: true) do |form| %> | ||
<%= form_with(model: link, local: true, class: "max-w-md mx-auto p-4 bg-gray-800 rounded-lg shadow-md") do |form| %> | ||
<% if link.errors.any? %> | ||
<div id="error_explanation" class="bg-red-100 border-l-4 border-red-500 text-red-700 p-4 mb-4"> | ||
<h2 class="font-bold"><%= pluralize(link.errors.count, 'error') %> prohibited this link from being saved:</h2> | ||
<ul> | ||
<div id="error_explanation" class="bg-red-100 border-l-4 border-red-500 text-red-700 p-4 mb-4 rounded"> | ||
<h2 class="font-bold mb-2"><%= pluralize(link.errors.count, 'error') %> prohibited this link from being saved:</h2> | ||
<ul class="list-disc pl-5"> | ||
<% link.errors.full_messages.each do |message| %> | ||
<li><%= message %></li> | ||
<% end %> | ||
</ul> | ||
</div> | ||
<% end %> | ||
|
||
<div class="mb-4"> | ||
<%= form.label :title, class: 'block text-lime-200 mb-2' %> | ||
<%= form.text_field :title, class: 'block w-full px-3 py-2 text-black' %> | ||
<div class="mb-6"> | ||
<%= form.label :title, class: 'block text-lime-200 font-semibold mb-2' %> | ||
<%= form.text_field :title, class: 'block w-full px-4 py-2 border border-gray-700 rounded bg-gray-900 text-white focus:outline-none focus:border-lime-500' %> | ||
</div> | ||
|
||
<div class="mb-4"> | ||
<%= form.label :url, class: 'block text-lime-200 mb-2' %> | ||
<%= form.text_field :url, class: 'block w-full px-3 py-2 text-black' %> | ||
<div class="mb-6"> | ||
<%= form.label :url, class: 'block text-lime-200 font-semibold mb-2' %> | ||
<%= form.text_field :url, class: 'block w-full px-4 py-2 border border-gray-700 rounded bg-gray-900 text-white focus:outline-none focus:border-lime-500' %> | ||
</div> | ||
|
||
<div class="mb-4"> | ||
<%= form.label :description, class: 'block text-lime-200 mb-2' %> | ||
<%= form.text_area :description, class: 'block w-full px-3 py-2 text-black' %> | ||
<div class="mb-6"> | ||
<%= form.label :description, class: 'block text-lime-200 font-semibold mb-2' %> | ||
<%= form.text_area :description, rows: 3, class: 'block w-full px-4 py-2 border border-gray-700 rounded bg-gray-900 text-white focus:outline-none focus:border-lime-500' %> | ||
</div> | ||
|
||
<div class="mb-4"> | ||
<%= form.label :icon, class: 'block text-lime-200 mb-2' %> | ||
<%= form.text_field :icon, class: 'block w-full px-3 py-2 text-black' %> | ||
<div class="mb-6"> | ||
<%= form.label :icon, class: 'block text-lime-200 font-semibold mb-2' %> | ||
<%= form.text_field :icon, class: 'block w-full px-4 py-2 border border-gray-700 rounded bg-gray-900 text-white focus:outline-none focus:border-lime-500' %> | ||
<p class="text-gray-400 mt-2 text-sm"> | ||
Find icons at <a href="https://fontawesome.com/v6/icons" target="_blank" class="text-lime-300 underline">Font Awesome</a>. | ||
Use the class name (e.g., <code>fas fa-home</code>) in the icon field. | ||
</p> | ||
</div> | ||
|
||
<div class="mb-4"> | ||
<%= form.label :position, class: 'block text-lime-200 mb-2' %> | ||
<%= form.number_field :position, class: 'block w-full px-3 py-2 text-black' %> | ||
<div class="mb-6"> | ||
<%= form.label :position, class: 'block text-lime-200 font-semibold mb-2' %> | ||
<%= form.number_field :position, class: 'block w-full px-4 py-2 border border-gray-700 rounded bg-gray-900 text-white focus:outline-none focus:border-lime-500' %> | ||
</div> | ||
|
||
<div class="mb-4"> | ||
<%= form.label :visible, class: 'block text-lime-200 mb-2' %> | ||
<%= form.check_box :visible, class: 'text-black' %> | ||
<div class="mb-6 flex items-center"> | ||
<%= form.check_box :visible, class: 'mr-2' %> | ||
<%= form.label :visible, class: 'text-lime-200 font-semibold' %> | ||
</div> | ||
|
||
<div class="mb-4"> | ||
<%= form.label :pinned, class: 'block text-lime-200 mb-2' %> | ||
<%= form.check_box :pinned, class: 'text-black' %> | ||
<div class="mb-6 flex items-center"> | ||
<%= form.check_box :pinned, class: 'mr-2' %> | ||
<%= form.label :pinned, class: 'text-lime-200 font-semibold' %> | ||
</div> | ||
|
||
<div class="actions"> | ||
<%= form.submit 'Save', class: 'bg-lime-500 hover:bg-lime-700 text-white font-bold py-2 px-4 rounded' %> | ||
<div class="mb-6 flex items-center"> | ||
<%= form.check_box :hidden, class: 'mr-2' %> | ||
<%= form.label :hidden, class: 'text-lime-200 font-semibold' %> | ||
</div> | ||
|
||
<div class="actions text-center"> | ||
<%= form.submit 'Save', class: 'bg-lime-500 hover:bg-lime-700 text-white font-bold py-2 px-4 rounded transition duration-300 ease-in-out' %> | ||
</div> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
class AddHiddenToLinks < ActiveRecord::Migration[7.1] | ||
def change | ||
add_column :links, :hidden, :boolean, default: false | ||
end | ||
end |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.