diff options
| -rw-r--r-- | app/views/assets/index.html.erb | 56 | ||||
| -rw-r--r-- | app/views/events/index.html.erb | 24 | ||||
| -rw-r--r-- | config/locales/de.yml | 2 | ||||
| -rw-r--r-- | config/locales/en.yml | 2 | ||||
| -rw-r--r-- | public/stylesheets/admin.css | 77 |
5 files changed, 136 insertions, 25 deletions
diff --git a/app/views/assets/index.html.erb b/app/views/assets/index.html.erb index d2c5d6cc..84f096c2 100644 --- a/app/views/assets/index.html.erb +++ b/app/views/assets/index.html.erb | |||
| @@ -12,21 +12,55 @@ | |||
| 12 | <tr class="header"> | 12 | <tr class="header"> |
| 13 | <th><%= t("admin.columns.preview") %></th> | 13 | <th><%= t("admin.columns.preview") %></th> |
| 14 | <th><%= t("admin.columns.name") %></th> | 14 | <th><%= t("admin.columns.name") %></th> |
| 15 | <th><%= t("admin.columns.type") %></th> | ||
| 16 | <th></th> | ||
| 17 | <th></th> | ||
| 18 | <th></th> | 15 | <th></th> |
| 19 | </tr> | 16 | </tr> |
| 20 | <% @assets.each do |asset| %> | 17 | <% @assets.each do |asset| %> |
| 21 | <tr> | 18 | <tr> |
| 22 | <td><% if asset.has_variant?(:thumb) %><%= image_tag asset.upload.url(:thumb), style: "max-width: 100px; max-height: 100px;" %><% end %></td> | 19 | <td class="asset_thumb"> |
| 23 | <td><%= link_to asset.name, asset.upload.url %></td> | 20 | <% if asset.has_variant?(:thumb) %> |
| 24 | <td><%= asset.upload.content_type %></td> | 21 | <%= link_to image_tag(asset.upload.url(:thumb), :alt => ""), asset, |
| 25 | <td><%= link_to t("admin.common.show"), asset %></td> | 22 | :class => "asset_thumb_link" %> |
| 26 | <td><%= link_to t("admin.common.edit"), edit_asset_path(asset) %></td> | 23 | <% end %> |
| 27 | <td><%= button_to asset, method: :delete, form: { data: { confirm: t("admin.common.confirm_sure") }, class: 'button_to destructive' } do %> | 24 | </td> |
| 28 | <%= icon("trash", library: "tabler", "aria-hidden": true) %> <%= t("admin.common.destroy") %> | 25 | <td> |
| 29 | <% end %></td> | 26 | <div class="asset_name"> |
| 27 | <%= link_to asset.name.presence || asset.upload_file_name, asset %> | ||
| 28 | </div> | ||
| 29 | <div class="asset_meta asset_file"> | ||
| 30 | <%= icon("external-link", library: "tabler", "aria-hidden": true) %> | ||
| 31 | <%= link_to asset.upload_file_name, asset.upload.url, | ||
| 32 | :target => "_blank", :rel => "noopener" %> | ||
| 33 | </div> | ||
| 34 | <div class="asset_meta asset_type"> | ||
| 35 | <%= asset.upload.content_type %> · | ||
| 36 | <%= number_to_human_size(asset.upload.size) %> | ||
| 37 | </div> | ||
| 38 | </td> | ||
| 39 | <td class="actions"> | ||
| 40 | <div class="action_grid"> | ||
| 41 | <span class="action_item"> | ||
| 42 | <%= link_to asset, "aria-label" => t("admin.common.show"), | ||
| 43 | title: t("admin.common.show") do %> | ||
| 44 | <%= icon("eye", library: "tabler", "aria-hidden": true) %> | ||
| 45 | <% end %> | ||
| 46 | </span> | ||
| 47 | <span class="action_item"> | ||
| 48 | <%= link_to edit_asset_path(asset), "aria-label" => t("admin.common.edit"), | ||
| 49 | title: t("admin.common.edit") do %> | ||
| 50 | <%= icon("edit", library: "tabler", "aria-hidden": true) %> | ||
| 51 | <% end %> | ||
| 52 | </span> | ||
| 53 | <span class="action_item"> | ||
| 54 | <%= button_to asset, method: :delete, | ||
| 55 | form: { data: { confirm: t("admin.common.confirm_sure") }, | ||
| 56 | class: 'button_to destructive' }, | ||
| 57 | "aria-label" => t("admin.common.destroy"), | ||
| 58 | title: t("admin.common.destroy") do %> | ||
| 59 | <%= icon("trash", library: "tabler", "aria-hidden": true) %> | ||
| 60 | <% end %> | ||
| 61 | </span> | ||
| 62 | </div> | ||
| 63 | </td> | ||
| 30 | </tr> | 64 | </tr> |
| 31 | <% end %> | 65 | <% end %> |
| 32 | </table> | 66 | </table> |
diff --git a/app/views/events/index.html.erb b/app/views/events/index.html.erb index 51269282..2497a577 100644 --- a/app/views/events/index.html.erb +++ b/app/views/events/index.html.erb | |||
| @@ -17,7 +17,7 @@ | |||
| 17 | 17 | ||
| 18 | <% @events.each do |event| %> | 18 | <% @events.each do |event| %> |
| 19 | <tr> | 19 | <tr> |
| 20 | <td> | 20 | <td class="title"> |
| 21 | <div class="title_with_flags"> | 21 | <div class="title_with_flags"> |
| 22 | <span class="flag_stack"> | 22 | <span class="flag_stack"> |
| 23 | <%= flag("hours-24", Event.human_attribute_name(:allday)) if event.allday %> | 23 | <%= flag("hours-24", Event.human_attribute_name(:allday)) if event.allday %> |
| @@ -41,14 +41,22 @@ | |||
| 41 | </div> | 41 | </div> |
| 42 | </td> | 42 | </td> |
| 43 | <td class="event_when"> | 43 | <td class="event_when"> |
| 44 | <% if event.rrule.present? %> | 44 | <div class="when_body"> |
| 45 | <span class="rrule_raw" title="<%= event.rrule %>"><%= event_schedule_text(event) %></span> | 45 | <% if event.rrule.present? %> |
| 46 | <% if event.humanize_rrule.nil? && event.start_time %> | 46 | <% if event.humanize_rrule %> |
| 47 | <div class="event_meta"><%= admin_date(event.start_time) %></div> | 47 | <span title="<%= event.rrule %>"><%= event_schedule_text(event) %></span> |
| 48 | <% else %> | ||
| 49 | <span class="rrule_raw" title="<%= event.rrule %>"> | ||
| 50 | <%= t("events.schedule.unreadable") %> | ||
| 51 | </span> | ||
| 52 | <% if event.start_time %> | ||
| 53 | <div class="event_meta"><%= admin_date(event.start_time) %></div> | ||
| 54 | <% end %> | ||
| 55 | <% end %> | ||
| 56 | <% else %> | ||
| 57 | <%= event_date_range(event) %> | ||
| 48 | <% end %> | 58 | <% end %> |
| 49 | <% else %> | 59 | </div> |
| 50 | <%= event_date_range(event) %> | ||
| 51 | <% end %> | ||
| 52 | </td> | 60 | </td> |
| 53 | <td class="actions"> | 61 | <td class="actions"> |
| 54 | <div class="action_grid"> | 62 | <div class="action_grid"> |
diff --git a/config/locales/de.yml b/config/locales/de.yml index 1cd72106..fe40e507 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml | |||
| @@ -388,7 +388,6 @@ de: | |||
| 388 | editor: "Editor" | 388 | editor: "Editor" |
| 389 | date: "Datum" | 389 | date: "Datum" |
| 390 | author: "Autor" | 390 | author: "Autor" |
| 391 | type: "Typ" | ||
| 392 | index: | 391 | index: |
| 393 | title: "cccms Dashboard" | 392 | title: "cccms Dashboard" |
| 394 | search_placeholder: "Nodes und Tags durchsuchen…" | 393 | search_placeholder: "Nodes und Tags durchsuchen…" |
| @@ -601,6 +600,7 @@ de: | |||
| 601 | same_month: "%{from_day}.–%{to_day}. %{to_month}" | 600 | same_month: "%{from_day}.–%{to_day}. %{to_month}" |
| 602 | spanning: "%{from_full} – %{to_full}" | 601 | spanning: "%{from_full} – %{to_full}" |
| 603 | evening: "%{date}, %{from}–%{to} Uhr" | 602 | evening: "%{date}, %{from}–%{to} Uhr" |
| 603 | unreadable: "Termin-Regel nicht lesbar" | ||
| 604 | rrule_builder: | 604 | rrule_builder: |
| 605 | weekly: "Wöchentlich" | 605 | weekly: "Wöchentlich" |
| 606 | monthly: "Monatlich" | 606 | monthly: "Monatlich" |
diff --git a/config/locales/en.yml b/config/locales/en.yml index 9bd57c79..55c0abc5 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml | |||
| @@ -336,7 +336,6 @@ en: | |||
| 336 | author: "Author" | 336 | author: "Author" |
| 337 | editor: "Editor" | 337 | editor: "Editor" |
| 338 | date: "Date" | 338 | date: "Date" |
| 339 | type: "Type" | ||
| 340 | index: | 339 | index: |
| 341 | title: "cccms dashboard" | 340 | title: "cccms dashboard" |
| 342 | search_placeholder: "Search nodes and tags…" | 341 | search_placeholder: "Search nodes and tags…" |
| @@ -548,6 +547,7 @@ en: | |||
| 548 | same_month: "%{from_day}.–%{to_day}. %{to_month}" | 547 | same_month: "%{from_day}.–%{to_day}. %{to_month}" |
| 549 | spanning: "%{from_full} – %{to_full}" | 548 | spanning: "%{from_full} – %{to_full}" |
| 550 | evening: "%{date}, %{from}–%{to}" | 549 | evening: "%{date}, %{from}–%{to}" |
| 550 | unreadable: "Schedule not readable" | ||
| 551 | rrule_builder: | 551 | rrule_builder: |
| 552 | weekly: "Weekly" | 552 | weekly: "Weekly" |
| 553 | monthly: "Monthly" | 553 | monthly: "Monthly" |
diff --git a/public/stylesheets/admin.css b/public/stylesheets/admin.css index bd0c8412..acb87aba 100644 --- a/public/stylesheets/admin.css +++ b/public/stylesheets/admin.css | |||
| @@ -811,7 +811,8 @@ table.revisions_table tr:hover { | |||
| 811 | } | 811 | } |
| 812 | 812 | ||
| 813 | .user_table td.actions, | 813 | .user_table td.actions, |
| 814 | .node_table td.actions { | 814 | .node_table td.actions, |
| 815 | .assets_table td.actions { | ||
| 815 | width: 1px; | 816 | width: 1px; |
| 816 | white-space: nowrap; | 817 | white-space: nowrap; |
| 817 | padding-right: 0; | 818 | padding-right: 0; |
| @@ -822,24 +823,29 @@ table.revisions_table tr:hover { | |||
| 822 | padding-right: 0.75rem; | 823 | padding-right: 0.75rem; |
| 823 | } | 824 | } |
| 824 | 825 | ||
| 826 | .assets_table .asset_name, | ||
| 825 | .events_table .event_title { | 827 | .events_table .event_title { |
| 826 | font-weight: bold; | 828 | font-weight: bold; |
| 827 | } | 829 | } |
| 828 | 830 | ||
| 831 | .assets_table .asset_meta, | ||
| 829 | .events_table .event_meta { | 832 | .events_table .event_meta { |
| 830 | display: flex; | 833 | display: flex; |
| 831 | align-items: center; | 834 | align-items: center; |
| 832 | gap: 0.3rem; | 835 | gap: 0.3rem; |
| 833 | margin-top: 0.15rem; | 836 | margin-top: 0.35rem; |
| 834 | font-size: 0.875rem; | 837 | font-size: 0.875rem; |
| 838 | color: var(--text-muted); | ||
| 835 | } | 839 | } |
| 836 | 840 | ||
| 841 | .assets_table .asset_meta svg, | ||
| 837 | .events_table .event_meta svg { | 842 | .events_table .event_meta svg { |
| 838 | width: 0.875rem; | 843 | width: 0.875rem; |
| 839 | height: 0.875rem; | 844 | height: 0.875rem; |
| 840 | flex-shrink: 0; | 845 | flex-shrink: 0; |
| 841 | } | 846 | } |
| 842 | 847 | ||
| 848 | .assets_table .asset_meta a, | ||
| 843 | .events_table .event_meta a { | 849 | .events_table .event_meta a { |
| 844 | overflow-wrap: anywhere; | 850 | overflow-wrap: anywhere; |
| 845 | color: var(--text-muted); | 851 | color: var(--text-muted); |
| @@ -861,6 +867,69 @@ table.revisions_table tr:hover { | |||
| 861 | padding-right: 0; | 867 | padding-right: 0; |
| 862 | } | 868 | } |
| 863 | 869 | ||
| 870 | .assets_table .asset_thumb img { | ||
| 871 | display: block; | ||
| 872 | max-width: 120px; | ||
| 873 | max-height: 120px; | ||
| 874 | } | ||
| 875 | |||
| 876 | .assets_table td.asset_thumb { | ||
| 877 | padding-right: 0.75rem; | ||
| 878 | } | ||
| 879 | |||
| 880 | @media (max-width: 34rem) { | ||
| 881 | .events_table, | ||
| 882 | .events_table tbody, | ||
| 883 | .assets_table, | ||
| 884 | .assets_table tbody { | ||
| 885 | display: block; | ||
| 886 | } | ||
| 887 | |||
| 888 | .events_table tr.header, | ||
| 889 | .assets_table tr.header { | ||
| 890 | display: none; | ||
| 891 | } | ||
| 892 | |||
| 893 | .events_table td, | ||
| 894 | .assets_table td { | ||
| 895 | display: contents; | ||
| 896 | } | ||
| 897 | |||
| 898 | .assets_table tr { | ||
| 899 | display: grid; | ||
| 900 | grid-template-columns: auto 1fr; | ||
| 901 | grid-template-areas: | ||
| 902 | "thumb actions" | ||
| 903 | "thumb type" | ||
| 904 | "name name" | ||
| 905 | "file file"; | ||
| 906 | align-items: start; | ||
| 907 | column-gap: 0.75rem; | ||
| 908 | padding: 0.5rem 0; | ||
| 909 | } | ||
| 910 | |||
| 911 | .events_table tr { | ||
| 912 | display: grid; | ||
| 913 | grid-template-columns: 1fr auto; | ||
| 914 | grid-template-areas: | ||
| 915 | "title actions" | ||
| 916 | "when when"; | ||
| 917 | align-items: start; | ||
| 918 | column-gap: 0.75rem; | ||
| 919 | padding: 0.5rem 0; | ||
| 920 | } | ||
| 921 | |||
| 922 | .events_table .title_with_flags { grid-area: title; } | ||
| 923 | .assets_table .asset_thumb_link { grid-area: thumb; } | ||
| 924 | .assets_table .asset_type { grid-area: type; align-self: end; } | ||
| 925 | .events_table .when_body { grid-area: when; margin-top: 0.4rem; padding-left: 2rem; } | ||
| 926 | .assets_table .asset_name { grid-area: name; margin-top: 0.4rem; } | ||
| 927 | .assets_table .asset_file { grid-area: file; } | ||
| 928 | |||
| 929 | .events_table .action_grid, | ||
| 930 | .assets_table .action_grid { grid-area: actions; } | ||
| 931 | } | ||
| 932 | |||
| 864 | .action_grid { | 933 | .action_grid { |
| 865 | display: grid; | 934 | display: grid; |
| 866 | gap: 0.4rem; | 935 | gap: 0.4rem; |
| @@ -870,6 +939,7 @@ table.revisions_table tr:hover { | |||
| 870 | .user_table .action_grid { grid-template-columns: repeat(3, auto); } | 939 | .user_table .action_grid { grid-template-columns: repeat(3, auto); } |
| 871 | .node_table .action_grid { grid-template-columns: repeat(2, auto); } | 940 | .node_table .action_grid { grid-template-columns: repeat(2, auto); } |
| 872 | .events_table .action_grid { grid-template-columns: repeat(2, auto); } | 941 | .events_table .action_grid { grid-template-columns: repeat(2, auto); } |
| 942 | .assets_table .action_grid { grid-template-columns: repeat(3, auto); } | ||
| 873 | 943 | ||
| 874 | /* min-height keeps a row the same height whether or not the viewer may see | 944 | /* min-height keeps a row the same height whether or not the viewer may see |
| 875 | the lower controls. */ | 945 | the lower controls. */ |
| @@ -1566,9 +1636,8 @@ input#menu_item_title { | |||
| 1566 | margin-bottom: 1rem; | 1636 | margin-bottom: 1rem; |
| 1567 | } | 1637 | } |
| 1568 | 1638 | ||
| 1569 | /* Pushes the actions to the right of the heading. */ | ||
| 1570 | .page_actions h1 { | 1639 | .page_actions h1 { |
| 1571 | margin: 0 auto 0 0; | 1640 | margin: 0 0.75rem 0 0; |
| 1572 | } | 1641 | } |
| 1573 | 1642 | ||
| 1574 | .page_action_group { | 1643 | .page_action_group { |
