diff options
| author | erdgeist <erdgeist@erdgeist.org> | 2026-08-14 01:22:11 +0200 |
|---|---|---|
| committer | erdgeist <erdgeist@erdgeist.org> | 2026-08-14 01:22:11 +0200 |
| commit | 19b865108c26cf18c26697fee080844de94fb522 (patch) | |
| tree | 33af772574dacaa43d5ab0f79a2abc64a7bd9fa5 | |
| parent | 45d422f6582ac2ebf455a8c8168738db54a76582 (diff) | |
Scope admin form conventions with a class
.admin_layout replaces the #admin_layout. All css rules and
javascript queries were changed along and rules simplified
where the opportunity arose.
| -rw-r--r-- | app/views/assets/edit.html.erb | 2 | ||||
| -rw-r--r-- | app/views/assets/new.html.erb | 2 | ||||
| -rw-r--r-- | app/views/assets/show.html.erb | 2 | ||||
| -rw-r--r-- | app/views/elevations/new.html.erb | 2 | ||||
| -rw-r--r-- | app/views/events/edit.html.erb | 2 | ||||
| -rw-r--r-- | app/views/events/new.html.erb | 2 | ||||
| -rw-r--r-- | app/views/events/show.html.erb | 2 | ||||
| -rw-r--r-- | app/views/nodes/edit.html.erb | 2 | ||||
| -rw-r--r-- | app/views/nodes/show.html.erb | 2 | ||||
| -rw-r--r-- | app/views/otp_challenges/new.html.erb | 2 | ||||
| -rw-r--r-- | app/views/otp_enrollments/show.html.erb | 2 | ||||
| -rw-r--r-- | app/views/page_translations/edit.html.erb | 2 | ||||
| -rw-r--r-- | app/views/revisions/show.html.erb | 2 | ||||
| -rw-r--r-- | app/views/users/edit.html.erb | 2 | ||||
| -rw-r--r-- | app/views/users/new.html.erb | 2 | ||||
| -rw-r--r-- | app/views/users/show.html.erb | 2 | ||||
| -rw-r--r-- | public/javascripts/admin_interface.js | 8 | ||||
| -rw-r--r-- | public/stylesheets/admin.css | 53 |
18 files changed, 31 insertions, 62 deletions
diff --git a/app/views/assets/edit.html.erb b/app/views/assets/edit.html.erb index 1e4ae8f1..39490c03 100644 --- a/app/views/assets/edit.html.erb +++ b/app/views/assets/edit.html.erb | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | <div id="admin_layout"> | 1 | <div class="admin_layout"> |
| 2 | <h1><%= t(".title") %></h1> | 2 | <h1><%= t(".title") %></h1> |
| 3 | 3 | ||
| 4 | <%= form_for(@asset, html: { multipart: true }) do |f| %> | 4 | <%= form_for(@asset, html: { multipart: true }) do |f| %> |
diff --git a/app/views/assets/new.html.erb b/app/views/assets/new.html.erb index 1260644f..36f5ab88 100644 --- a/app/views/assets/new.html.erb +++ b/app/views/assets/new.html.erb | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | <div id="admin_layout"> | 1 | <div class="admin_layout"> |
| 2 | <h1><%= t(".title") %></h1> | 2 | <h1><%= t(".title") %></h1> |
| 3 | 3 | ||
| 4 | <%= form_for(@asset, :html => { :multipart => true }) do |f| %> | 4 | <%= form_for(@asset, :html => { :multipart => true }) do |f| %> |
diff --git a/app/views/assets/show.html.erb b/app/views/assets/show.html.erb index 5c111c7b..ee990bdb 100644 --- a/app/views/assets/show.html.erb +++ b/app/views/assets/show.html.erb | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | <div id="admin_layout"> | 1 | <div class="admin_layout"> |
| 2 | <h1><%= @asset.name %></h1> | 2 | <h1><%= @asset.name %></h1> |
| 3 | 3 | ||
| 4 | <div class="layout_row"> | 4 | <div class="layout_row"> |
diff --git a/app/views/elevations/new.html.erb b/app/views/elevations/new.html.erb index 084fb9e4..8dd64e78 100644 --- a/app/views/elevations/new.html.erb +++ b/app/views/elevations/new.html.erb | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | <h1><%= t(".title") %></h1> | 1 | <h1><%= t(".title") %></h1> |
| 2 | 2 | ||
| 3 | <div id="admin_layout"> | 3 | <div class="admin_layout"> |
| 4 | <% if current_user.otp_enrolled? %> | 4 | <% if current_user.otp_enrolled? %> |
| 5 | <p class="field_hint"> | 5 | <p class="field_hint"> |
| 6 | <%= t(".hint", :minutes => AuthenticatedSystem::ELEVATION_MAX_AGE.in_minutes.to_i) %> | 6 | <%= t(".hint", :minutes => AuthenticatedSystem::ELEVATION_MAX_AGE.in_minutes.to_i) %> |
diff --git a/app/views/events/edit.html.erb b/app/views/events/edit.html.erb index 7c855760..55e0d4ba 100644 --- a/app/views/events/edit.html.erb +++ b/app/views/events/edit.html.erb | |||
| @@ -12,7 +12,7 @@ | |||
| 12 | <%= hidden_field_tag :return_to, @return_to %> | 12 | <%= hidden_field_tag :return_to, @return_to %> |
| 13 | <%= form_error_messages(f) %> | 13 | <%= form_error_messages(f) %> |
| 14 | 14 | ||
| 15 | <div id="admin_layout"> | 15 | <div class="admin_layout"> |
| 16 | <div class="layout_row"> | 16 | <div class="layout_row"> |
| 17 | <div class="layout_row_label"><%= Event.human_attribute_name(:node) %> </div> | 17 | <div class="layout_row_label"><%= Event.human_attribute_name(:node) %> </div> |
| 18 | <div class="layout_row_content"> | 18 | <div class="layout_row_content"> |
diff --git a/app/views/events/new.html.erb b/app/views/events/new.html.erb index 5cc47b69..e5aea87b 100644 --- a/app/views/events/new.html.erb +++ b/app/views/events/new.html.erb | |||
| @@ -5,7 +5,7 @@ | |||
| 5 | <%= form_for(@event) do |f| %> | 5 | <%= form_for(@event) do |f| %> |
| 6 | <%= form_error_messages(f) %> | 6 | <%= form_error_messages(f) %> |
| 7 | 7 | ||
| 8 | <div id="admin_layout"> | 8 | <div class="admin_layout"> |
| 9 | <div class="layout_row"> | 9 | <div class="layout_row"> |
| 10 | <div class="layout_row_label"><%= Event.human_attribute_name(:node) %></div> | 10 | <div class="layout_row_label"><%= Event.human_attribute_name(:node) %></div> |
| 11 | <div class="layout_row_content"> | 11 | <div class="layout_row_content"> |
diff --git a/app/views/events/show.html.erb b/app/views/events/show.html.erb index 2f3d315d..0d91f850 100644 --- a/app/views/events/show.html.erb +++ b/app/views/events/show.html.erb | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | <div id="admin_layout" class="show_node"> | 1 | <div class="admin_layout show_node"> |
| 2 | <h1><%= @event.node ? t(".title_for_node", :path => @event.node.unique_name) : t(".title") %></h1> | 2 | <h1><%= @event.node ? t(".title_for_node", :path => @event.node.unique_name) : t(".title") %></h1> |
| 3 | 3 | ||
| 4 | <div class="layout_row"> | 4 | <div class="layout_row"> |
diff --git a/app/views/nodes/edit.html.erb b/app/views/nodes/edit.html.erb index d19fdd95..269e0e49 100644 --- a/app/views/nodes/edit.html.erb +++ b/app/views/nodes/edit.html.erb | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | <h1><%= title_for_node(@node) %></h1> | 1 | <h1><%= title_for_node(@node) %></h1> |
| 2 | 2 | ||
| 3 | <div id="admin_layout"> | 3 | <div class="admin_layout"> |
| 4 | <div class="node_action_bar"> | 4 | <div class="node_action_bar"> |
| 5 | <%= button_to t(".unlock_back"), unlock_node_path(@node), method: :put, | 5 | <%= button_to t(".unlock_back"), unlock_node_path(@node), method: :put, |
| 6 | form: { class: 'button_to state_changing' }, | 6 | form: { class: 'button_to state_changing' }, |
diff --git a/app/views/nodes/show.html.erb b/app/views/nodes/show.html.erb index af55d699..cf1d79c1 100644 --- a/app/views/nodes/show.html.erb +++ b/app/views/nodes/show.html.erb | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | <% locked_by_other = @node.locked? && @node.lock_owner != current_user %> | 1 | <% locked_by_other = @node.locked? && @node.lock_owner != current_user %> |
| 2 | <% may_change_live = current_user.may_change_live?(@node) %> | 2 | <% may_change_live = current_user.may_change_live?(@node) %> |
| 3 | <div id="admin_layout" class="show_node"> | 3 | <div class="admin_layout show_node"> |
| 4 | <h1><%= title_for_node(@node) %> <small>(<%= I18n.default_locale.to_s.upcase %>)</small></h1> | 4 | <h1><%= title_for_node(@node) %> <small>(<%= I18n.default_locale.to_s.upcase %>)</small></h1> |
| 5 | 5 | ||
| 6 | <div class="layout_row"> | 6 | <div class="layout_row"> |
diff --git a/app/views/otp_challenges/new.html.erb b/app/views/otp_challenges/new.html.erb index 798fc024..8247b262 100644 --- a/app/views/otp_challenges/new.html.erb +++ b/app/views/otp_challenges/new.html.erb | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | <h1><%= t(".title") %></h1> | 1 | <h1><%= t(".title") %></h1> |
| 2 | 2 | ||
| 3 | <div id="admin_layout"> | 3 | <div class="admin_layout"> |
| 4 | <div class="layout_row"> | 4 | <div class="layout_row"> |
| 5 | <div class="layout_row_label"> <%= t(".code") %> </div> | 5 | <div class="layout_row_label"> <%= t(".code") %> </div> |
| 6 | <div class="layout_row_content"> | 6 | <div class="layout_row_content"> |
diff --git a/app/views/otp_enrollments/show.html.erb b/app/views/otp_enrollments/show.html.erb index 03405d5f..16addb5b 100644 --- a/app/views/otp_enrollments/show.html.erb +++ b/app/views/otp_enrollments/show.html.erb | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | <h1><%= t(".title") %></h1> | 1 | <h1><%= t(".title") %></h1> |
| 2 | 2 | ||
| 3 | <div id="admin_layout"> | 3 | <div class="admin_layout"> |
| 4 | <div class="layout_row"> | 4 | <div class="layout_row"> |
| 5 | <div class="layout_row_label"><%= t(".scan") %></div> | 5 | <div class="layout_row_label"><%= t(".scan") %></div> |
| 6 | <div class="layout_row_content"> | 6 | <div class="layout_row_content"> |
diff --git a/app/views/page_translations/edit.html.erb b/app/views/page_translations/edit.html.erb index 3a4c8659..0172a501 100644 --- a/app/views/page_translations/edit.html.erb +++ b/app/views/page_translations/edit.html.erb | |||
| @@ -17,7 +17,7 @@ | |||
| 17 | <%= link_to t("nodes.edit.preview"), preview_page_path(@page, :locale => @locale), target: "_blank", rel: "noopener", class: "preview_link" %> | 17 | <%= link_to t("nodes.edit.preview"), preview_page_path(@page, :locale => @locale), target: "_blank", rel: "noopener", class: "preview_link" %> |
| 18 | </div> | 18 | </div> |
| 19 | 19 | ||
| 20 | <div id="admin_layout"> | 20 | <div class="admin_layout"> |
| 21 | <ul id="related_asset_list" style="display:none"> | 21 | <ul id="related_asset_list" style="display:none"> |
| 22 | <% @page.related_assets.includes(:asset).each do |related| %> | 22 | <% @page.related_assets.includes(:asset).each do |related| %> |
| 23 | <li data-large-url="<%= related.asset.upload.url(:large) %>" | 23 | <li data-large-url="<%= related.asset.upload.url(:large) %>" |
diff --git a/app/views/revisions/show.html.erb b/app/views/revisions/show.html.erb index a898b7e6..a2f276bc 100644 --- a/app/views/revisions/show.html.erb +++ b/app/views/revisions/show.html.erb | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | <% translation = @page.translations.find_by(:locale => @translation_locale) %> | 1 | <% translation = @page.translations.find_by(:locale => @translation_locale) %> |
| 2 | <div id="admin_layout" class="show_node"> | 2 | <div class="admin_layout show_node"> |
| 3 | <h1><%= t(".title", :rev => @page.revision) %>: <%= translation&.title %> <small>(<%= @translation_locale.to_s.upcase %>)</small></h1> | 3 | <h1><%= t(".title", :rev => @page.revision) %>: <%= translation&.title %> <small>(<%= @translation_locale.to_s.upcase %>)</small></h1> |
| 4 | 4 | ||
| 5 | <div class="layout_row"> | 5 | <div class="layout_row"> |
diff --git a/app/views/users/edit.html.erb b/app/views/users/edit.html.erb index 8a5900ce..2cf5a07c 100644 --- a/app/views/users/edit.html.erb +++ b/app/views/users/edit.html.erb | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | <div id="admin_layout"> | 1 | <div class="admin_layout"> |
| 2 | <h1><%= @user == current_user ? t(".my_account") : t(".edit_user", :login => @user.login) %></h1> | 2 | <h1><%= @user == current_user ? t(".my_account") : t(".edit_user", :login => @user.login) %></h1> |
| 3 | 3 | ||
| 4 | <% if @user.errors.any? %> | 4 | <% if @user.errors.any? %> |
diff --git a/app/views/users/new.html.erb b/app/views/users/new.html.erb index 13a238b5..a770b9a7 100644 --- a/app/views/users/new.html.erb +++ b/app/views/users/new.html.erb | |||
| @@ -6,7 +6,7 @@ | |||
| 6 | </div> | 6 | </div> |
| 7 | <% end %> | 7 | <% end %> |
| 8 | 8 | ||
| 9 | <div id="admin_layout"> | 9 | <div class="admin_layout"> |
| 10 | <%= form_for @user do |f| %> | 10 | <%= form_for @user do |f| %> |
| 11 | <div class="layout_row"> | 11 | <div class="layout_row"> |
| 12 | <div class="layout_row_label"><%= t("users.labels.login") %></div> | 12 | <div class="layout_row_label"><%= t("users.labels.login") %></div> |
diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index 9879e171..48c37ffb 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | <div id="admin_layout"> | 1 | <div class="admin_layout"> |
| 2 | <h1><%= @user.login %></h1> | 2 | <h1><%= @user.login %></h1> |
| 3 | 3 | ||
| 4 | <div class="layout_row"> | 4 | <div class="layout_row"> |
diff --git a/public/javascripts/admin_interface.js b/public/javascripts/admin_interface.js index 67bfb8fc..cbfa4dc6 100644 --- a/public/javascripts/admin_interface.js +++ b/public/javascripts/admin_interface.js | |||
| @@ -220,7 +220,7 @@ cccms = { | |||
| 220 | error: function(xhr) { | 220 | error: function(xhr) { |
| 221 | if (xhr.status === 423) { | 221 | if (xhr.status === 423) { |
| 222 | clearInterval(cccms.autosave_timer); | 222 | clearInterval(cccms.autosave_timer); |
| 223 | cccms.report_lock_lost($("#admin_layout > form").attr("data-show-url")); | 223 | cccms.report_lock_lost($(".admin_layout > form").attr("data-show-url")); |
| 224 | } | 224 | } |
| 225 | // any other failure: quietly retried on the next tick | 225 | // any other failure: quietly retried on the next tick |
| 226 | } | 226 | } |
| @@ -230,7 +230,7 @@ cccms = { | |||
| 230 | }; | 230 | }; |
| 231 | 231 | ||
| 232 | cccms.autosave_timer = setInterval(function() { | 232 | cccms.autosave_timer = setInterval(function() { |
| 233 | $("#admin_layout > form").submitWithAjax(); | 233 | $(".admin_layout > form").submitWithAjax(); |
| 234 | }, 7000); | 234 | }, 7000); |
| 235 | }, | 235 | }, |
| 236 | 236 | ||
| @@ -264,7 +264,7 @@ cccms = { | |||
| 264 | }); | 264 | }); |
| 265 | 265 | ||
| 266 | $force.on('click', function() { | 266 | $force.on('click', function() { |
| 267 | $("#admin_layout > form").submitWithAjax({ force: true }); | 267 | $(".admin_layout > form").submitWithAjax({ force: true }); |
| 268 | }); | 268 | }); |
| 269 | }, | 269 | }, |
| 270 | 270 | ||
| @@ -316,7 +316,7 @@ cccms = { | |||
| 316 | cccms.inline_images.ensure_overlay(); | 316 | cccms.inline_images.ensure_overlay(); |
| 317 | cccms.inline_images.editor = editor; | 317 | cccms.inline_images.editor = editor; |
| 318 | 318 | ||
| 319 | var showUrl = $("#admin_layout > form").attr("data-show-url") || ""; | 319 | var showUrl = $(".admin_layout > form").attr("data-show-url") || ""; |
| 320 | var match = showUrl.match(/(\d+)$/); | 320 | var match = showUrl.match(/(\d+)$/); |
| 321 | cccms.inline_images.node_id = match ? match[1] : ""; | 321 | cccms.inline_images.node_id = match ? match[1] : ""; |
| 322 | 322 | ||
diff --git a/public/stylesheets/admin.css b/public/stylesheets/admin.css index 1d504464..dbeb3dd1 100644 --- a/public/stylesheets/admin.css +++ b/public/stylesheets/admin.css | |||
| @@ -1454,17 +1454,10 @@ form.button_to svg { | |||
| 1454 | #metadata_details[open] > summary { display: none; } | 1454 | #metadata_details[open] > summary { display: none; } |
| 1455 | } | 1455 | } |
| 1456 | 1456 | ||
| 1457 | input[type=text]#tag_list, | 1457 | .admin_layout { |
| 1458 | input[type=text]#page_slug, | ||
| 1459 | input#move_to_search_term { | ||
| 1460 | padding: 5px; | ||
| 1461 | } | ||
| 1462 | |||
| 1463 | div#admin_layout { | ||
| 1464 | margin-top: 0; | 1458 | margin-top: 0; |
| 1465 | } | 1459 | } |
| 1466 | 1460 | ||
| 1467 | #admin_layout a.action_button, | ||
| 1468 | .action_button { | 1461 | .action_button { |
| 1469 | display: inline-flex; | 1462 | display: inline-flex; |
| 1470 | align-items: center; | 1463 | align-items: center; |
| @@ -1482,15 +1475,16 @@ div#admin_layout { | |||
| 1482 | font-size: inherit; | 1475 | font-size: inherit; |
| 1483 | } | 1476 | } |
| 1484 | 1477 | ||
| 1485 | #admin_layout a.action_button:hover, | ||
| 1486 | .action_button:hover { | 1478 | .action_button:hover { |
| 1487 | color: var(--surface); | 1479 | color: var(--surface); |
| 1488 | background-color: var(--text); | 1480 | background-color: var(--text); |
| 1489 | } | 1481 | } |
| 1490 | 1482 | ||
| 1491 | #admin_layout input[type=text], | 1483 | .admin_layout input[type=text], |
| 1492 | #admin_layout input[type=password], | 1484 | .admin_layout input[type=password], |
| 1493 | #admin_layout textarea { | 1485 | .admin_layout textarea { |
| 1486 | box-sizing: border-box; | ||
| 1487 | width: 100%; | ||
| 1494 | padding: 5px; | 1488 | padding: 5px; |
| 1495 | } | 1489 | } |
| 1496 | 1490 | ||
| @@ -1498,50 +1492,25 @@ input#tag_list { | |||
| 1498 | text-transform: lowercase; | 1492 | text-transform: lowercase; |
| 1499 | } | 1493 | } |
| 1500 | 1494 | ||
| 1501 | #admin_layout input[type=text], | 1495 | .admin_layout input[type=text]#page_title { |
| 1502 | #admin_layout input[type=password], | ||
| 1503 | #admin_layout textarea { | ||
| 1504 | box-sizing: border-box; | ||
| 1505 | width: 100%; | ||
| 1506 | } | ||
| 1507 | |||
| 1508 | input[type=text]#page_title { | ||
| 1509 | box-sizing: border-box; | ||
| 1510 | width: 100%; | ||
| 1511 | padding: 6px 5px 4px; | 1496 | padding: 6px 5px 4px; |
| 1512 | font-weight: bold; | 1497 | font-weight: bold; |
| 1513 | } | 1498 | } |
| 1514 | 1499 | ||
| 1515 | #admin_layout textarea#page_abstract { | 1500 | .admin_layout textarea#page_abstract { |
| 1516 | width: 100%; | ||
| 1517 | box-sizing: border-box; | ||
| 1518 | height: 8rem; | 1501 | height: 8rem; |
| 1519 | } | 1502 | } |
| 1520 | 1503 | ||
| 1521 | #admin_layout textarea#page_body { | 1504 | .admin_layout textarea#page_body { |
| 1522 | box-sizing: border-box; | ||
| 1523 | width: 100%; | ||
| 1524 | height: 60vh; | 1505 | height: 60vh; |
| 1525 | } | 1506 | } |
| 1526 | 1507 | ||
| 1527 | input#tag_list, | 1508 | .admin_layout .menu_field { |
| 1528 | input#page_slug, | ||
| 1529 | input#move_to_search_term { | ||
| 1530 | box-sizing: border-box; | ||
| 1531 | width: 100%; | ||
| 1532 | } | ||
| 1533 | |||
| 1534 | input#menu_search_term, | ||
| 1535 | input#menu_item_node_id, | ||
| 1536 | input#menu_item_path, | ||
| 1537 | input#menu_item_title { | ||
| 1538 | width: 100%; | ||
| 1539 | max-width: 44rem; | 1509 | max-width: 44rem; |
| 1540 | } | 1510 | } |
| 1541 | 1511 | ||
| 1542 | @media(min-width:1016px) { | 1512 | @media(min-width:1016px) { |
| 1543 | #admin_layout textarea#page_abstract { | 1513 | .admin_layout textarea#page_abstract { |
| 1544 | padding: 5px; | ||
| 1545 | height: 250px; | 1514 | height: 250px; |
| 1546 | } | 1515 | } |
| 1547 | } | 1516 | } |
