Skip to content

Commit 69d04dd

Browse files
committed
Fix on alignement on Topic form
1 parent 572389f commit 69d04dd

File tree

2 files changed

+31
-33
lines changed

2 files changed

+31
-33
lines changed

app/views/topics/_form.html.erb

Lines changed: 25 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -67,18 +67,18 @@
6767
<small class="flex-fill text-end fw-light text-muted text-uppercase">Press enter to add a new tag</small>
6868
</div>
6969
<p>Please note: For any tag you add or remove, its cognates are also added or removed.</p>
70-
<%= f.select :tag_list,
71-
options_from_collection_for_select(
72-
ActsAsTaggableOn::Tag.all&.order(name: :asc),
73-
:name,
74-
:name,
75-
topic.tag_list
76-
),
77-
{ prompt: "Select tags", include_blank: true },
78-
multiple: true,
79-
style: "width: 100%; min-height: 120px; padding: 0.75rem 1rem; border: 2px solid #e5e7eb; border-radius: 0.5rem; font-size: 0.875rem; transition: all 0.2s; background: #f9fafb;",
80-
data: { "allow-new": "true", "allow-clear": "true", "select-tags-target": "tagList" }
81-
%>
70+
<%= f.select :tag_list,
71+
options_from_collection_for_select(
72+
ActsAsTaggableOn::Tag.all&.order(name: :asc),
73+
:name,
74+
:name,
75+
topic.tag_list
76+
),
77+
{ prompt: "Select tags", include_blank: true },
78+
multiple: true,
79+
style: "width: 100%; min-height: 120px; padding: 0.75rem 1rem; border: 2px solid #e5e7eb; border-radius: 0.5rem; font-size: 0.875rem; transition: all 0.2s; background: #f9fafb;",
80+
data: { "allow-new": "true", "allow-clear": "true", "select-tags-target": "tagList" }
81+
%>
8282
</div>
8383
<p style="margin-top: 0.5rem; font-size: 0.75rem; color: #6b7280;">Add relevant tags to help users discover this content. You can select existing tags or create new ones.</p>
8484
</div>
@@ -99,30 +99,28 @@
9999
<%= f.hidden_field :documents, multiple: true, value: document.signed_id, data: { upload_target: "hiddenField" } %>
100100
<% end %>
101101

102-
<%= f.file_field :documents, multiple: true, class: "form-control mt-4", id: "documents", data: { upload_target: "filesInput", action: "change->upload#uploadFile" } %>
102+
<%= f.file_field :documents, multiple: true, class: "form-control mt-4", id: "documents", data: { upload_target: "filesInput", action: "change->upload#uploadFile" } %>
103103

104-
<div class="d-none" data-upload-target="spinner">
105-
<div class="spinner-border spinner-border-sm mt-4" role="status">
106-
<span class="visually-hidden">Uploading in progress...</span>
107-
</div>
108-
<span>Uploading in progress...</span>
104+
<div class="d-none" data-upload-target="spinner">
105+
<div class="spinner-border spinner-border-sm mt-4" role="status">
106+
<span class="visually-hidden">Uploading in progress...</span>
109107
</div>
108+
<span>Uploading in progress...</span>
109+
</div>
110110

111-
<div class="col-12 d-flex justify-content-end mt-4">
112-
<%= f.submit class: "btn btn-primary me-1 mb-1", data: { upload_target: "submitButton" } %>
113-
<%= link_to "Cancel Editing", topics_path, class: "btn btn-light-secondary me-1 mb-1" %>
114-
</div>
111+
<div class="col-12 d-flex justify-content-end mt-4">
112+
<%= f.submit class: "btn btn-primary me-1 mb-1", data: { upload_target: "submitButton" } %>
113+
<%= link_to "Cancel Editing", topics_path, class: "btn btn-light-secondary me-1 mb-1" %>
115114
</div>
116115
</div>
117116
</div>
118117

119118
<div style="display: flex; justify-content: space-between; align-items: center; padding-top: 2rem; border-top: 1px solid #f3f4f6; margin-top: 2rem;">
120119
<div style="display: flex; gap: 1rem;">
121-
<%= f.submit "Save Topic",
122-
style: "background: linear-gradient(135deg, #10b981 0%, #059669 100%); color: white; font-weight: 600; padding: 0.75rem 2rem; border-radius: 0.5rem; border: none; cursor: pointer; font-size: 0.875rem; box-shadow: 0 4px 6px -1px rgba(16, 185, 129, 0.3); transition: all 0.2s;" %>
123-
<%= link_to "Back to Topics", topics_path,
124-
class: "topic-form-cancel-btn",
125-
style: "background: #f3f4f6; color: #6b7280; font-weight: 600; padding: 0.75rem 2rem; border-radius: 0.5rem; text-decoration: none; font-size: 0.875rem; transition: all 0.2s; display: inline-block;" %>
120+
<%= f.submit "Save Topic", style: "background: linear-gradient(135deg, #10b981 0%, #059669 100%); color: white; font-weight: 600; padding: 0.75rem 2rem; border-radius: 0.5rem; border: none; cursor: pointer; font-size: 0.875rem; box-shadow: 0 4px 6px -1px rgba(16, 185, 129, 0.3); transition: all 0.2s;" %>
121+
<%= link_to "Back to Topics", topics_path,
122+
class: "topic-form-cancel-btn",
123+
style: "background: #f3f4f6; color: #6b7280; font-weight: 600; padding: 0.75rem 2rem; border-radius: 0.5rem; text-decoration: none; font-size: 0.875rem; transition: all 0.2s; display: inline-block;" %>
126124
</div>
127125

128126
<% if topic.persisted? %>

app/views/topics/edit.html.erb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<div style="min-height: 100vh; background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%); padding: 2rem 0;">
44
<div style="max-width: 1200px; margin: 0 auto; padding: 0 1rem;">
5-
5+
66
<!-- Header Section -->
77
<div style="margin-bottom: 2rem;">
88
<div style="display: flex; align-items: center; gap: 1rem; margin-bottom: 1.5rem;">
@@ -18,7 +18,7 @@
1818
<%= @topic.title %>
1919
</div>
2020
</div>
21-
21+
2222
<!-- Breadcrumb -->
2323
<nav style="font-size: 0.875rem; color: #6b7280;">
2424
<ol style="display: flex; gap: 0.5rem; list-style: none; padding: 0; margin: 0;">
@@ -35,7 +35,7 @@
3535

3636
<!-- Main Form Card -->
3737
<div style="background: white; border-radius: 1rem; box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04); overflow: hidden;">
38-
38+
3939
<!-- Card Header -->
4040
<div style="background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%); padding: 2rem; color: white;">
4141
<div style="display: flex; align-items: center; gap: 1rem;">
@@ -52,7 +52,7 @@
5252
</div>
5353
</div>
5454
</div>
55-
55+
5656
<!-- Form Content -->
5757
<div style="padding: 2rem;">
5858
<%= render "form", topic: @topic, errors: @errors %>
@@ -68,7 +68,7 @@
6868
</svg>
6969
View Topic Details
7070
<% end %>
71-
71+
7272
<%= link_to topics_path, style: "background: #f3f4f6; color: #6b7280; font-weight: 600; padding: 0.75rem 1.5rem; border-radius: 0.5rem; text-decoration: none; font-size: 0.875rem; transition: all 0.2s; display: inline-flex; align-items: center; gap: 0.5rem;" do %>
7373
<svg style="width: 1rem; height: 1rem;" fill="none" stroke="currentColor" viewBox="0 0 24 24">
7474
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 10h16M4 14h16M4 18h16"/>
@@ -101,7 +101,7 @@
101101
<span style="font-weight: 500; color: #374151;">Tags:</span> <%= @topic.tags.count %> assigned
102102
</div>
103103
<div>
104-
<span style="font-weight: 500; color: #374151;">Status:</span>
104+
<span style="font-weight: 500; color: #374151;">Status:</span>
105105
<span style="<%= @topic.archived? ? 'color: #dc2626;' : 'color: #059669;' %>"><%= @topic.archived? ? 'Archived' : 'Active' %></span>
106106
</div>
107107
<div>

0 commit comments

Comments
 (0)