|
1 | 1 | <%= form_with(model: tag, local: true) do |form| %> |
2 | 2 | <% if tag.errors.any? %> |
3 | | - <div style="background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%); border: 1px solid #f87171; color: #dc2626; padding: 1.5rem; border-radius: 0.75rem; margin-bottom: 2rem;"> |
4 | | - <div style="display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1rem;"> |
5 | | - <svg style="width: 1.25rem; height: 1.25rem; flex-shrink: 0;" fill="none" stroke="currentColor" viewBox="0 0 24 24"> |
| 3 | + <div class="alert-error"> |
| 4 | + <div class="flex items-center gap-3 mb-4"> |
| 5 | + <svg class="icon-size-md text-red-600 flex-shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24"> |
6 | 6 | <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path> |
7 | 7 | </svg> |
8 | | - <h3 style="font-size: 1.125rem; font-weight: 600; margin: 0;"> |
| 8 | + <h3 class="alert-error-title"> |
9 | 9 | <%= pluralize(tag.errors.count, "error") %> prohibited this tag from being saved: |
10 | 10 | </h3> |
11 | 11 | </div> |
12 | | - <ul style="margin: 0; padding-left: 1.5rem;"> |
| 12 | + <ul class="alert-error-list"> |
13 | 13 | <% tag.errors.each do |error| %> |
14 | | - <li style="margin-bottom: 0.5rem; font-weight: 500;"><%= error.full_message %></li> |
| 14 | + <li class="mb-2 font-medium"><%= error.full_message %></li> |
15 | 15 | <% end %> |
16 | 16 | </ul> |
17 | 17 | </div> |
18 | 18 | <% end %> |
19 | 19 |
|
20 | | - <div style="space-y: 1.5rem;"> |
| 20 | + <div class="space-y-6"> |
21 | 21 |
|
22 | 22 | <!-- Tag Name Field --> |
23 | | - <div style="margin-bottom: 1.5rem;"> |
24 | | - <%= form.label :name, style: "display: block; font-size: 0.875rem; font-weight: 600; color: #374151; margin-bottom: 0.5rem;" do %> |
25 | | - <div style="display: flex; align-items: center; gap: 0.5rem;"> |
26 | | - <svg style="width: 1rem; height: 1rem;" fill="none" stroke="currentColor" viewBox="0 0 24 24"> |
| 23 | + <div class="mb-6"> |
| 24 | + <%= form.label :name, class: "input-label" do %> |
| 25 | + <div class="label-with-icon"> |
| 26 | + <svg class="icon-size" fill="none" stroke="currentColor" viewBox="0 0 24 24"> |
27 | 27 | <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 7h.01M7 3h5c.512 0 1.024.195 1.414.586l7 7a2 2 0 010 2.828l-7 7a2 2 0 01-2.828 0l-7-7A1.994 1.994 0 013 12V7a4 4 0 014-4z"/> |
28 | 28 | </svg> |
29 | 29 | Tag Name |
30 | 30 | </div> |
31 | 31 | <% end %> |
32 | 32 | <%= form.text_field :name, |
33 | 33 | placeholder: "Enter tag name (e.g., healthcare, technology, education)", |
34 | | - style: "width: 100%; padding: 0.875rem 1rem; border: 2px solid #e5e7eb; border-radius: 0.5rem; font-size: 0.875rem; transition: all 0.2s; background: white;", |
35 | | - onfocus: "this.style.borderColor='#8b5cf6'; this.style.boxShadow='0 0 0 3px rgba(139, 92, 246, 0.1)';", |
36 | | - onblur: "this.style.borderColor='#e5e7eb'; this.style.boxShadow='none';" %> |
37 | | - <p style="margin: 0.5rem 0 0 0; font-size: 0.75rem; color: #6b7280;"> |
| 34 | + class: "form-input" %> |
| 35 | + <p class="text-muted"> |
38 | 36 | Provide a clear, descriptive name for this content classification tag. |
39 | 37 | </p> |
40 | 38 | </div> |
41 | 39 |
|
42 | 40 | <!-- Cognates Field --> |
43 | | - <div data-controller="select-tags" style="margin-bottom: 1.5rem;"> |
44 | | - <div style="display: flex; justify-content: space-between; align-items: end; margin-bottom: 0.5rem;"> |
45 | | - <%= form.label :cognates_list, style: "font-size: 0.875rem; font-weight: 600; color: #374151;" do %> |
46 | | - <div style="display: flex; align-items: center; gap: 0.5rem;"> |
47 | | - <svg style="width: 1rem; height: 1rem;" fill="none" stroke="currentColor" viewBox="0 0 24 24"> |
| 41 | + <div data-controller="select-tags" class="mb-6"> |
| 42 | + <div class="flex justify-between items-end mb-2"> |
| 43 | + <%= form.label :cognates_list, class: "input-label" do %> |
| 44 | + <div class="label-with-icon"> |
| 45 | + <svg class="icon-size" fill="none" stroke="currentColor" viewBox="0 0 24 24"> |
48 | 46 | <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1"/> |
49 | 47 | </svg> |
50 | 48 | Related Tags (Cognates) |
51 | 49 | </div> |
52 | 50 | <% end %> |
53 | | - <small style="font-size: 0.75rem; color: #6b7280; font-weight: 400; text-transform: uppercase; letter-spacing: 0.05em;"> |
| 51 | + <small class="text-xs text-gray-500 font-normal uppercase tracking-wider"> |
54 | 52 | Press enter to add a new tag |
55 | 53 | </small> |
56 | 54 | </div> |
|
66 | 64 | multiple: true, |
67 | 65 | data: { "allow-clear": "true", "select-tags-target": "tagList" } %> |
68 | 66 |
|
69 | | - <p style="margin: 0.5rem 0 0 0; font-size: 0.75rem; color: #6b7280;"> |
| 67 | + <p class="text-muted"> |
70 | 68 | Select related tags that share similar meanings or contexts. These help with content discovery and organization. |
71 | 69 | </p> |
72 | 70 | </div> |
73 | 71 |
|
74 | 72 | </div> |
75 | 73 |
|
76 | 74 | <!-- Form Actions --> |
77 | | - <div style="margin-top: 2rem; padding-top: 2rem; border-top: 1px solid #e5e7eb; display: flex; gap: 1rem; justify-content: flex-end; flex-wrap: wrap;"> |
78 | | - <%= link_to tags_path, style: "background: #6b7280; color: white; padding: 0.875rem 1.75rem; border-radius: 0.5rem; text-decoration: none; font-weight: 600; font-size: 0.875rem; display: inline-flex; align-items: center; gap: 0.5rem; transition: all 0.2s;" do %> |
79 | | - <svg style="width: 1rem; height: 1rem;" fill="none" stroke="currentColor" viewBox="0 0 24 24"> |
| 75 | + <div class="mt-8 pt-8 border-t border-gray-200 flex gap-4 justify-end flex-wrap"> |
| 76 | + <%= link_to tags_path, class: "bg-gray-500 text-white py-3.5 px-7 rounded-lg no-underline font-semibold text-sm inline-flex items-center gap-2 transition-all hover:bg-gray-600 hover:-translate-y-0.5" do %> |
| 77 | + <svg class="icon-size" fill="none" stroke="currentColor" viewBox="0 0 24 24"> |
80 | 78 | <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"></path> |
81 | 79 | </svg> |
82 | 80 | <span>Cancel</span> |
83 | 81 | <% end %> |
84 | 82 |
|
85 | 83 | <%= form.submit (tag.persisted? ? "Update Tag" : "Create Tag"), |
86 | | - style: "background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%); color: white; padding: 0.875rem 1.75rem; border-radius: 0.5rem; border: none; font-weight: 600; font-size: 0.875rem; display: inline-flex; align-items: center; gap: 0.5rem; cursor: pointer; transition: all 0.2s;" %> |
| 84 | + class: "bg-gradient-purple text-white py-3.5 px-7 rounded-lg border-0 font-semibold text-sm inline-flex items-center gap-2 cursor-pointer transition-all shadow-blue hover:-translate-y-0.5" %> |
87 | 85 | </div> |
88 | 86 | <% end %> |
89 | | - |
90 | | -<style> |
91 | | - /* Form input focus effects */ |
92 | | - form input[type="text"]:focus, form select:focus { |
93 | | - outline: none; |
94 | | - } |
95 | | - |
96 | | - /* Button hover effects */ |
97 | | - a[style*="background: #6b7280"]:hover { |
98 | | - background: #4b5563 !important; |
99 | | - transform: translateY(-1px); |
100 | | - } |
101 | | - |
102 | | - input[type="submit"]:hover { |
103 | | - box-shadow: 0 10px 15px -3px rgba(139, 92, 246, 0.4), 0 4px 6px -2px rgba(139, 92, 246, 0.05) !important; |
104 | | - transform: translateY(-1px); |
105 | | - } |
106 | | - |
107 | | - /* Multi-select styling */ |
108 | | - select[multiple] { |
109 | | - appearance: none; |
110 | | - background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e"); |
111 | | - background-position: right 0.5rem center; |
112 | | - background-repeat: no-repeat; |
113 | | - background-size: 1.5em 1.5em; |
114 | | - padding-right: 2.5rem; |
115 | | - } |
116 | | - |
117 | | - /* Responsive design */ |
118 | | - @media (max-width: 640px) { |
119 | | - div[style*="justify-content: flex-end"] { |
120 | | - flex-direction: column !important; |
121 | | - align-items: stretch !important; |
122 | | - } |
123 | | - |
124 | | - a, input[type="submit"] { |
125 | | - text-align: center !important; |
126 | | - justify-content: center !important; |
127 | | - } |
128 | | - |
129 | | - div[style*="display: flex; justify-content: space-between"] { |
130 | | - flex-direction: column !important; |
131 | | - align-items: flex-start !important; |
132 | | - gap: 0.5rem !important; |
133 | | - } |
134 | | - } |
135 | | -</style> |
0 commit comments