diff options
Diffstat (limited to 'app/views/admin')
| -rw-r--r-- | app/views/admin/_drafts.html.erb | 2 | ||||
| -rw-r--r-- | app/views/admin/_menu.html.erb | 13 | ||||
| -rw-r--r-- | app/views/admin/_recent_changes.html.erb | 24 | ||||
| -rw-r--r-- | app/views/admin/conventions.html.erb | 11 | ||||
| -rw-r--r-- | app/views/admin/index.html.erb | 201 | ||||
| -rw-r--r-- | app/views/admin/search_results.html.erb | 11 |
6 files changed, 89 insertions, 173 deletions
diff --git a/app/views/admin/_drafts.html.erb b/app/views/admin/_drafts.html.erb index a35b0ab..4ef568f 100644 --- a/app/views/admin/_drafts.html.erb +++ b/app/views/admin/_drafts.html.erb | |||
| @@ -17,7 +17,7 @@ | |||
| 17 | <td class="actions"> | 17 | <td class="actions"> |
| 18 | <%= link_to 'Show', node_path(draft.node) %> | 18 | <%= link_to 'Show', node_path(draft.node) %> |
| 19 | <%= link_to "Revisions", revision_path(draft.node.id) %> | 19 | <%= link_to "Revisions", revision_path(draft.node.id) %> |
| 20 | <%= button_to "Publish", publish_node_path(draft.node), method: :put, form: { data: { confirm: "Do you really want to publish?" } } %> | 20 | <%= button_to "Publish", publish_node_path(draft.node), method: :put, form: { data: { confirm: "Do you really want to publish?" }, class: 'button_to state_changing' } %> |
| 21 | </td> | 21 | </td> |
| 22 | </tr> | 22 | </tr> |
| 23 | <% end %> | 23 | <% end %> |
diff --git a/app/views/admin/_menu.html.erb b/app/views/admin/_menu.html.erb index 6dba085..7270df4 100644 --- a/app/views/admin/_menu.html.erb +++ b/app/views/admin/_menu.html.erb | |||
| @@ -1,8 +1,5 @@ | |||
| 1 | <%= language_selector %> | 1 | <%= link_to icon("home", library: "tabler", "aria-hidden": true), admin_path, "aria-label": "Dashboard", title: "Dashboard" %> |
| 2 | <%= button_to 'Logout', logout_path, method: :delete %> | 2 | <a href="#" onclick="admin_search.display_toggle(); return false;" aria-label="Search" title="Search"><%= icon("search", library: "tabler", "aria-hidden": true) %></a> |
| 3 | <%= link_to 'Overview', admin_path %> | 3 | <%= button_to logout_path, method: :delete, aria: { label: "Log out" }, title: "Log out" do %> |
| 4 | <a href="#" onclick="admin_search.display_toggle(); return false;">search</a> | 4 | <%= icon("logout", library: "tabler", "aria-hidden": true) %> |
| 5 | <%= link_to 'Nodes', nodes_path, selected?('nodes') %> | 5 | <% end %> |
| 6 | <%= link_to 'Assets', assets_path, selected?('assets') %> | ||
| 7 | <%= link_to 'User', users_path, selected?('users') %> | ||
| 8 | <%= link_to 'Navigation', menu_items_path, selected?('menu_items') %> > | ||
diff --git a/app/views/admin/_recent_changes.html.erb b/app/views/admin/_recent_changes.html.erb deleted file mode 100644 index 88b5e93..0000000 --- a/app/views/admin/_recent_changes.html.erb +++ /dev/null | |||
| @@ -1,24 +0,0 @@ | |||
| 1 | <h2>Recent Changes</h2> | ||
| 2 | <div id="draft_list"> | ||
| 3 | <table> | ||
| 4 | <tr class="header"> | ||
| 5 | <th>Title</th> | ||
| 6 | <th>path</th> | ||
| 7 | <th>user</th> | ||
| 8 | <th>date</th> | ||
| 9 | <th></th> | ||
| 10 | </tr> | ||
| 11 | <% @recent_changes.each do |node| %> | ||
| 12 | <tr> | ||
| 13 | <td><%= truncated_title_for_node node %></td> | ||
| 14 | <td><%= node.unique_name %></td> | ||
| 15 | <td><%= node.draft.user.login rescue "" %></td> | ||
| 16 | <td><%= node.updated_at.to_fs(:db) %></td> | ||
| 17 | <td class="actions"> | ||
| 18 | <%= link_to 'Show', node_path(node) %> | ||
| 19 | <%= link_to "Revisions", revision_path(:id => node.id) %> | ||
| 20 | </td> | ||
| 21 | </tr> | ||
| 22 | <% end %> | ||
| 23 | </table> | ||
| 24 | </div> \ No newline at end of file | ||
diff --git a/app/views/admin/conventions.html.erb b/app/views/admin/conventions.html.erb new file mode 100644 index 0000000..72f6214 --- /dev/null +++ b/app/views/admin/conventions.html.erb | |||
| @@ -0,0 +1,11 @@ | |||
| 1 | <h1>Node creation conventions</h1> | ||
| 2 | |||
| 3 | <table id="conventions"> | ||
| 4 | <tr><th>Kind</th><th>What happens</th></tr> | ||
| 5 | <% @node_kinds.each do |kind, config| %> | ||
| 6 | <tr> | ||
| 7 | <td><%= kind %></td> | ||
| 8 | <td><%= resolve_kind_text(config[:label]) %> — <%= resolve_kind_text(config[:hint]) %></td> | ||
| 9 | </tr> | ||
| 10 | <% end %> | ||
| 11 | </table> | ||
diff --git a/app/views/admin/index.html.erb b/app/views/admin/index.html.erb index 2741db3..319530d 100644 --- a/app/views/admin/index.html.erb +++ b/app/views/admin/index.html.erb | |||
| @@ -1,147 +1,76 @@ | |||
| 1 | <div id="admin_wizard"> | 1 | <h1>cccms dashboard</h1> |
| 2 | <div class="admin_wizard_button"><%= link_to 'Create Update or Pressemitteilung', new_node_path, :only_path => false %></div> | 2 | <div id="dashboard_search"> |
| 3 | <div class="admin_wizard_button"><a href="#" id="admin_wizard_my_work" class="button">Continue my work</a></div> | 3 | <%= form_tag admin_search_path, method: :get do %> |
| 4 | <div class="admin_wizard_button"><a href="#" id="admin_wizard_create_page" class="button">Add a page in the page tree</a></div> | 4 | <%= text_field_tag :search_term, nil, id: "dashboard_search_term", placeholder: "Search nodes and tags…", autocomplete: "off" %> |
| 5 | <div class="admin_wizard_button"><%= link_to("Upload a new asset", new_asset_path, :only_path => false) %></div> | 5 | <% end %> |
| 6 | <div id="dashboard_search_results" class="search_results"></div> | ||
| 6 | </div> | 7 | </div> |
| 7 | 8 | ||
| 8 | <p id="overview_toggle"> | 9 | <div id="dashboard_signposts" class="button_row"> |
| 9 | <a href="#" id="recent_changes_toggle" class="button">recent changes</a> | 10 | <%= link_to new_node_path, class: "action_button" do %> |
| 10 | <a href="#" id="my_work_toggle" class="button">my work</a> | 11 | <%= icon("plus", library: "tabler", "aria-hidden": true) %> Create post |
| 11 | <a href="#" id="current_drafts_toggle" class="button">current drafts (<%= @drafts_count %>)</a> | 12 | <% end %> |
| 12 | <a href="#" id="admin_sitemap_toggle" class="button">site map</a> | 13 | <%= link_to chapters_nodes_path, class: "action_button" do %> |
| 13 | </p> | 14 | <%= icon("map-pin", library: "tabler", "aria-hidden": true) %> Find a chapter |
| 14 | 15 | <% end %> | |
| 15 | <div id="recent_changes_table"> | 16 | <%= link_to new_asset_path, class: "action_button" do %> |
| 16 | 17 | <%= icon("upload", library: "tabler", "aria-hidden": true) %> Upload asset | |
| 17 | <h1>Recent Changes</h1> | 18 | <% end %> |
| 18 | 19 | <%= link_to sitemap_nodes_path, class: "action_button" do %> | |
| 19 | <table class="node_table"> | 20 | <%= icon("list-tree", library: "tabler", "aria-hidden": true) %> Add a page in the page tree |
| 20 | <tr class="header"> | 21 | <% end %> |
| 21 | <th class="node_id">ID</th> | ||
| 22 | <th class="title">Title</th> | ||
| 23 | <th class="actions">Actions</th> | ||
| 24 | <th class="editor">Locked by</th> | ||
| 25 | <th class="revision">Rev.</th> | ||
| 26 | </tr> | ||
| 27 | <% @recent_changes.each do |node| %> | ||
| 28 | <tr class="<%= cycle("even", "odd") %>"> | ||
| 29 | <td class="node_id"><%= node.id %></td> | ||
| 30 | <td class="title"> | ||
| 31 | <h4><%= link_to title_for_node(node), node_path(node) %></h4> | ||
| 32 | <p><%= link_to_path(node.unique_name, node.unique_name) %></p> | ||
| 33 | </td> | ||
| 34 | <td class="actions"> | ||
| 35 | <%= link_to 'show', node_path(node) %> | ||
| 36 | <%= link_to 'Revisions', node_revisions_path(node) %> | ||
| 37 | </td> | ||
| 38 | <td> | ||
| 39 | <%= node.lock_owner.login if node.lock_owner %> | ||
| 40 | </td> | ||
| 41 | <td> | ||
| 42 | <%= link_to ( node.draft ? node.draft.revision : (node.head ? node.head.revision : "EMPTY" ) ), node_revisions_path(node) %> | ||
| 43 | </td> | ||
| 44 | </tr> | ||
| 45 | <% end %> | ||
| 46 | </table> | ||
| 47 | </div> | 22 | </div> |
| 48 | 23 | ||
| 49 | <div id="my_work_table"> | 24 | <div id="dashboard_widgets"> |
| 50 | 25 | <div class="dashboard_widget"> | |
| 51 | <h1>My Work</h1> | 26 | <h3>Drafts and autosaves</h3> |
| 27 | <ul> | ||
| 28 | <% @drafts.each do |node| %> | ||
| 29 | <li> | ||
| 30 | <div> | ||
| 31 | <%= link_to title_for_node(node), node_path(node) %> | ||
| 32 | <span class="field_hint"><%= link_to_path("#{node.unique_name} ↗", node.unique_name) %></span> | ||
| 33 | </div> | ||
| 34 | <span class="dashboard_widget_meta"> | ||
| 35 | <% if (editor = node_last_editor(node)) %><%= editor %>, <% end %><%= relative_time_phrase(node.updated_at) %> | ||
| 36 | </span> | ||
| 37 | </li> | ||
| 38 | <% end %> | ||
| 39 | </ul> | ||
| 40 | <%= link_to "See all drafts →", drafts_nodes_path %> | ||
| 41 | </div> | ||
| 52 | 42 | ||
| 53 | <table class="node_table"> | 43 | <div class="dashboard_widget"> |
| 54 | <tr class="header"> | 44 | <h3>Recent changes</h3> |
| 55 | <th class="node_id">ID</th> | 45 | <table id="node_action_list"> |
| 56 | <th class="title">Title</th> | 46 | <%= render partial: "node_actions/action_row", collection: @actions, as: :action %> |
| 57 | <th class="actions">Actions</th> | 47 | </table> |
| 58 | <th class="editor">Locked by</th> | 48 | <%= link_to "See all recent changes →", admin_log_path %> |
| 59 | <th class="revision">Rev.</th> | 49 | </div> |
| 60 | </tr> | ||
| 61 | <% @mynodes.each do |node| %> | ||
| 62 | <tr class="<%= cycle("even", "odd") %>"> | ||
| 63 | <td class="node_id"><%= node.id %></td> | ||
| 64 | <td class="title"> | ||
| 65 | <h4><%= link_to title_for_node(node), node_path(node) %></h4> | ||
| 66 | <p><%= link_to_path(node.unique_name, node.unique_name) %></p> | ||
| 67 | </td> | ||
| 68 | <td class="actions"> | ||
| 69 | <%= link_to 'show', node_path(node) %> | ||
| 70 | <%= link_to 'Revisions', node_revisions_path(node) %> | ||
| 71 | </td> | ||
| 72 | <td> | ||
| 73 | <%= node.lock_owner.login if node.lock_owner %> | ||
| 74 | </td> | ||
| 75 | <td> | ||
| 76 | <%= link_to ( node.draft ? node.draft.revision : (node.head ? node.head.revision : "EMPTY" ) ), node_revisions_path(node) %> | ||
| 77 | </td> | ||
| 78 | </tr> | ||
| 79 | <% end %> | ||
| 80 | </table> | ||
| 81 | </div> | ||
| 82 | 50 | ||
| 83 | <div id="current_drafts_table"> | ||
| 84 | |||
| 85 | <h1>Current Drafts (<%= @drafts_count %>)</h1> | ||
| 86 | |||
| 87 | <table class="node_table"> | ||
| 88 | <tr class="header"> | ||
| 89 | <th class="node_id">ID</th> | ||
| 90 | <th class="title">Title</th> | ||
| 91 | <th class="actions">Actions</th> | ||
| 92 | <th class="editor">Locked by</th> | ||
| 93 | <th class="revision">Rev.</th> | ||
| 94 | </tr> | ||
| 95 | <% @drafts.each do |node| %> | ||
| 96 | <tr class="<%= cycle("even", "odd") %>"> | ||
| 97 | <td class="node_id"><%= node.id %></td> | ||
| 98 | <td class="title"> | ||
| 99 | <h4><%= link_to title_for_node(node), node_path(node) %></h4> | ||
| 100 | <p><%= link_to_path(node.unique_name, node.unique_name) %></p> | ||
| 101 | </td> | ||
| 102 | <td class="actions"> | ||
| 103 | <%= link_to 'show', node_path(node) %> | ||
| 104 | <%= link_to 'Revisions', node_revisions_path(node) %> | ||
| 105 | </td> | ||
| 106 | <td> | ||
| 107 | <%= node.lock_owner.login if node.lock_owner %> | ||
| 108 | </td> | ||
| 109 | <td> | ||
| 110 | <%= link_to ( node.draft ? node.draft.revision : (node.head ? node.head.revision : "EMPTY" ) ), node_revisions_path(node) %> | ||
| 111 | </td> | ||
| 112 | </tr> | ||
| 113 | <% end %> | ||
| 114 | </table> | ||
| 115 | </div> | 51 | </div> |
| 116 | 52 | ||
| 117 | <div id="admin_sitemap_table"> | 53 | <div id="dashboard_housekeeping"> |
| 118 | 54 | <h3>Housekeeping</h3> | |
| 119 | <h1>Sitemap</h1> | 55 | <div class="button_row"> |
| 120 | 56 | <%= link_to nodes_path, class: "action_button" do %> | |
| 121 | <table class="node_table"> | 57 | <%= icon("list", library: "tabler", "aria-hidden": true) %> Nodes |
| 122 | <tr class="header"> | 58 | <% end %> |
| 123 | <th class="node_id">ID</th> | 59 | <%= link_to events_path, class: "action_button" do %> |
| 124 | <th class="title">Title</th> | 60 | <%= icon("calendar", library: "tabler", "aria-hidden": true) %> Events |
| 125 | <th class="actions">Actions</th> | 61 | <% end %> |
| 126 | <th class="editor">Locked by</th> | 62 | <%= link_to assets_path, class: "action_button" do %> |
| 127 | </tr> | 63 | <%= icon("folder", library: "tabler", "aria-hidden": true) %> Assets |
| 128 | <% @sitemap.each do |node| %> | 64 | <% end %> |
| 129 | <% if !node.nil? %> | 65 | <%= link_to users_path, class: "action_button" do %> |
| 130 | <tr class="<%= cycle("even", "odd") %>"> | 66 | <%= icon("users", library: "tabler", "aria-hidden": true) %> Users |
| 131 | <td class="node_id" style="padding-left: <%= @sitemap_depth[node.id] * 30 %>px;"><%= node.id %></td> | 67 | <% end %> |
| 132 | <td class="title" style="padding-left: <%= @sitemap_depth[node.id] * 30 %>px;"> | 68 | <%= link_to menu_items_path, class: "action_button" do %> |
| 133 | <h4><%= link_to title_for_node(node), node_path(node) %></h4> | 69 | <%= icon("menu-2", library: "tabler", "aria-hidden": true) %> Navigation |
| 134 | <p><%= link_to_path(node.unique_name, node.unique_name) %></p> | ||
| 135 | </td> | ||
| 136 | <td class="actions"> | ||
| 137 | <%= link_to 'create subpage', new_node_path(:parent_id => node.id) %> | ||
| 138 | <%= link_to 'Revisions', node_revisions_path(node) %> | ||
| 139 | </td> | ||
| 140 | <td> | ||
| 141 | <%= node.lock_owner.login if node.lock_owner %> | ||
| 142 | </td> | ||
| 143 | </tr> | ||
| 144 | <% end %> | 70 | <% end %> |
| 71 | <% trash_count = Node.trash.children.count %> | ||
| 72 | <%= link_to trashed_nodes_path, class: "action_button" do %> | ||
| 73 | <%= icon("trash", library: "tabler", "aria-hidden": true) %> Trash<%= " (#{trash_count})" if trash_count > 0 %> | ||
| 145 | <% end %> | 74 | <% end %> |
| 146 | </table> | 75 | </div> |
| 147 | </div> | 76 | </div> |
diff --git a/app/views/admin/search_results.html.erb b/app/views/admin/search_results.html.erb index f8aece0..a757197 100644 --- a/app/views/admin/search_results.html.erb +++ b/app/views/admin/search_results.html.erb | |||
| @@ -1,7 +1,10 @@ | |||
| 1 | <h1>Search Results</h1> | 1 | <h1>Search Results</h1> |
| 2 | 2 | ||
| 3 | <ul> | 3 | <ul class="search_results_list"> |
| 4 | <%- @results.each do |result| %> | 4 | <% @results.each do |result| %> |
| 5 | <li><%= link_to "#{result.title} (#{result.unique_name})", edit_node_path(result) %></li> | 5 | <li> |
| 6 | <% end %> | 6 | <%= link_to title_for_node(result), node_path(result) %> |
| 7 | <span class="field_hint"><%= link_to_path("#{result.unique_name} ↗", result.unique_name) %></span> | ||
| 8 | </li> | ||
| 9 | <% end %> | ||
| 7 | </ul> | 10 | </ul> |
