|
1 | | -<%= form_with model: project do |f| %> |
2 | | - |
| 1 | +<%= form_with model: project, class: "space-y-6" do |f| %> |
3 | 2 | <% if project.errors.any? %> |
4 | | - <div class="errors"> |
5 | | - <h2><%= pluralize(project.errors.count, "error") %> prohibited this project from being saved:</h2> |
6 | | - <ul> |
7 | | - <% project.errors.full_messages.each do |message| %> |
8 | | - <li><%= message %></li> |
9 | | - <% end %> |
10 | | - </ul> |
| 3 | + <div class="bg-red-50 border-l-4 border-red-400 p-4 mb-6"> |
| 4 | + <div class="flex"> |
| 5 | + <div class="flex-shrink-0"> |
| 6 | + <svg class="h-5 w-5 text-red-400" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor"> |
| 7 | + <path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z" clip-rule="evenodd" /> |
| 8 | + </svg> |
| 9 | + </div> |
| 10 | + <div class="ml-3"> |
| 11 | + <h3 class="text-sm font-medium text-red-800"> |
| 12 | + <%= pluralize(project.errors.count, "error") %> prohibited this project from being saved: |
| 13 | + </h3> |
| 14 | + <div class="mt-2 text-sm text-red-700"> |
| 15 | + <ul class="list-disc pl-5 space-y-1"> |
| 16 | + <% project.errors.full_messages.each do |message| %> |
| 17 | + <li><%= message %></li> |
| 18 | + <% end %> |
| 19 | + </ul> |
| 20 | + </div> |
| 21 | + </div> |
| 22 | + </div> |
11 | 23 | </div> |
12 | 24 | <% end %> |
13 | 25 |
|
14 | 26 | <div> |
15 | | - <%= f.label :name %> |
16 | | - <%= f.text_field :name %> |
| 27 | + <%= f.label :name, class: "block text-sm font-medium text-gray-700" %> |
| 28 | + <div class="mt-1"> |
| 29 | + <%= f.text_field :name, class: "shadow-sm focus:ring-indigo-500 focus:border-indigo-500 block w-full sm:text-sm border-gray-300 rounded-md" %> |
| 30 | + </div> |
17 | 31 | </div> |
18 | 32 |
|
19 | | - <div class="actions"> |
20 | | - <%= f.submit %> |
| 33 | + <div> |
| 34 | + <%= f.label :active, class: "block text-sm font-medium text-gray-700" %> |
| 35 | + <div class="mt-1"> |
| 36 | + <%= f.check_box :active, class: "h-4 w-4 text-indigo-600 focus:ring-indigo-500 border-gray-300 rounded" %> |
| 37 | + <span class="ml-2 text-sm text-gray-600">Mark as active</span> |
| 38 | + </div> |
| 39 | + </div> |
| 40 | + |
| 41 | + <div class="pt-5"> |
| 42 | + <div class="flex justify-end"> |
| 43 | + <%= link_to "Cancel", projects_path, class: "bg-white py-2 px-4 border border-gray-300 rounded-md shadow-sm text-sm font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500" %> |
| 44 | + <%= f.submit class: "ml-3 inline-flex justify-center py-2 px-4 border border-transparent shadow-sm text-sm font-medium rounded-md text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500" %> |
| 45 | + </div> |
21 | 46 | </div> |
22 | 47 | <% end %> |
0 commit comments