summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/controllers/menu_items_controller.rb2
-rw-r--r--app/controllers/users_controller.rb2
-rw-r--r--app/views/assets/index.html.erb6
-rw-r--r--app/views/assets/show.html.erb50
-rw-r--r--app/views/events/index.html.erb4
-rw-r--r--app/views/menu_items/edit.html.erb51
-rw-r--r--app/views/menu_items/index.html.erb9
-rw-r--r--app/views/nodes/index.html.erb5
-rw-r--r--app/views/occurrences/index.html.erb2
-rw-r--r--app/views/pages/index.html.erb2
-rw-r--r--app/views/users/edit.html.erb54
-rw-r--r--app/views/users/index.html.erb17
-rw-r--r--app/views/users/new.html.erb52
-rw-r--r--app/views/users/show.html.erb39
-rw-r--r--config/routes.rb9
-rw-r--r--public/stylesheets/admin.css32
16 files changed, 177 insertions, 159 deletions
diff --git a/app/controllers/menu_items_controller.rb b/app/controllers/menu_items_controller.rb
index 1b1eb59..314d1ea 100644
--- a/app/controllers/menu_items_controller.rb
+++ b/app/controllers/menu_items_controller.rb
@@ -14,7 +14,7 @@ class MenuItemsController < ApplicationController
14 end 14 end
15 15
16 def new 16 def new
17 @menu_item = MenuItem.new menu_item_params 17 @menu_item = MenuItem.new
18 end 18 end
19 19
20 def create 20 def create
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index f01691f..6572b7a 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -15,7 +15,7 @@ class UsersController < ApplicationController
15 end 15 end
16 16
17 def new 17 def new
18 @user = User.new 18 @user = User.new(admin: params[:admin].present?)
19 end 19 end
20 20
21 def create 21 def create
diff --git a/app/views/assets/index.html.erb b/app/views/assets/index.html.erb
index 4301fee..6591091 100644
--- a/app/views/assets/index.html.erb
+++ b/app/views/assets/index.html.erb
@@ -1,6 +1,6 @@
1<% content_for :subnavigation do %> 1<h1>Assets</h1>
2 <%= link_to 'New asset', new_asset_path %> 2
3<% end %> 3<%= link_to 'New asset', new_asset_path, class: 'action_button' %>
4 4
5<%= will_paginate @assets %> 5<%= will_paginate @assets %>
6 6
diff --git a/app/views/assets/show.html.erb b/app/views/assets/show.html.erb
index 694be5a..0286678 100644
--- a/app/views/assets/show.html.erb
+++ b/app/views/assets/show.html.erb
@@ -1,23 +1,29 @@
1<% content_for :subnavigation do %> 1<div id="page_editor">
2 <%= link_to 'Edit', edit_asset_path(@asset) %> 2 <h1><%= @asset.name %></h1>
3 <%= link_to 'Back', assets_path %>
4<% end %>
5 3
6<table> 4 <div id="content">
7 <tr> 5 <div class="node_description">Actions</div>
8 <td>Thumbnail</td> 6 <div class="node_content node_info_group">
9 <td><%= image_tag @asset.upload.url(:medium), style: "max-width: 300px; max-height: 300px;" %></td> 7 <div class="node_info_group_items">
10 </tr> 8 <div class="node_info_item">
11 <tr> 9 <%= link_to 'Edit', edit_asset_path(@asset), class: 'action_button' %>
12 <td>Public Path</td> 10 </div>
13 <td><%= @asset.upload.url.sub(/\?\d+$/, "") %></td> 11 <div class="node_info_item">
14 </tr> 12 <%= link_to 'Back', assets_path %>
15 <tr> 13 </div>
16 <td>Content Type</td> 14 </div>
17 <td><%= @asset.upload.content_type %></td> 15 </div>
18 </tr> 16
19 <tr> 17 <div class="node_description">Thumbnail</div>
20 <td>Size</td> 18 <div class="node_content"><%= image_tag @asset.upload.url(:medium), style: "max-width: 300px; max-height: 300px;" %></div>
21 <td><%= "#{@asset.upload.size/1024} KB" %></td> 19
22 </tr> 20 <div class="node_description">Public Path</div>
23</table> 21 <div class="node_content"><%= @asset.upload.url.sub(/\?\d+$/, "") %></div>
22
23 <div class="node_description">Content Type</div>
24 <div class="node_content"><%= @asset.upload.content_type %></div>
25
26 <div class="node_description">Size</div>
27 <div class="node_content"><%= "#{@asset.upload.size/1024} KB" %></div>
28 </div>
29</div>
diff --git a/app/views/events/index.html.erb b/app/views/events/index.html.erb
index c3e0e5a..b6a5b1f 100644
--- a/app/views/events/index.html.erb
+++ b/app/views/events/index.html.erb
@@ -1,4 +1,6 @@
1<h1>Listing events</h1> 1<h1>Events</h1>
2
3<%= link_to 'New event', new_event_path, class: 'action_button' %>
2 4
3<table class="events_table"> 5<table class="events_table">
4 <tr class="header"> 6 <tr class="header">
diff --git a/app/views/menu_items/edit.html.erb b/app/views/menu_items/edit.html.erb
index 9891708..dc5e8f9 100644
--- a/app/views/menu_items/edit.html.erb
+++ b/app/views/menu_items/edit.html.erb
@@ -1,32 +1,25 @@
1<h1>Edit Menu Item</h1> 1<h1>Edit Menu Item</h1>
2 2
3<%= form_for @menu_item do |f| %> 3<div id="page_editor">
4 <table> 4 <%= form_for @menu_item do |f| %>
5 5 <div id="content">
6 <tr> 6 <div class="node_description">Search</div>
7 <td class="description">Search</td> 7 <div class="node_content">
8 <td> 8 <%= text_field_tag :menu_search_term %>
9 <%= text_field_tag :menu_search_term %> 9 <div id="search_results"></div>
10 <div id="search_results"> 10 </div>
11 11
12 </div> 12 <div class="node_description">Node Id</div>
13 </td> 13 <div class="node_content"><%= f.text_field :node_id %></div>
14 </tr> 14
15 <tr> 15 <div class="node_description">Path</div>
16 <td class="description">Node Id</td> 16 <div class="node_content"><%= f.text_field :path %></div>
17 <td><%= f.text_field :node_id %></td> 17
18 </tr> 18 <div class="node_description">Title</div>
19 <tr> 19 <div class="node_content"><%= f.text_field :title %></div>
20 <td class="description">Path</td> 20
21 <td><%= f.text_field :path %></td> 21 <div class="node_description"></div>
22 </tr> 22 <div class="node_content"><%= f.submit 'Update' %></div>
23 <tr> 23 <% end %>
24 <td class="description">Title</td> 24 </div>
25 <td><%= f.text_field :title %></td> 25</div>
26 </tr>
27 <tr>
28 <td></td>
29 <td class="right"><%= f.submit 'Update' %></td>
30 </tr>
31 </table>
32<% end %>
diff --git a/app/views/menu_items/index.html.erb b/app/views/menu_items/index.html.erb
index c52c150..e84199b 100644
--- a/app/views/menu_items/index.html.erb
+++ b/app/views/menu_items/index.html.erb
@@ -1,10 +1,7 @@
1<% content_for :subnavigation do %>
2 <%= link_to "new", new_menu_item_path %>
3<% end %>
4
5
6<h1>Menu Items</h1> 1<h1>Menu Items</h1>
7 2
3<%= link_to 'New menu item', new_menu_item_path, class: 'action_button' %>
4
8<table id="menu_item_list"> 5<table id="menu_item_list">
9 <% @menu_items.each do |menu_item| %> 6 <% @menu_items.each do |menu_item| %>
10 <tr id="menu_items-<%= menu_item.id %>"> 7 <tr id="menu_items-<%= menu_item.id %>">
@@ -16,7 +13,7 @@
16 <td> 13 <td>
17 <%= button_to "Delete", menu_item_path(menu_item), 14 <%= button_to "Delete", menu_item_path(menu_item),
18 method: :delete, 15 method: :delete,
19 form: { data: { confirm: "Are you sure?" } } %> 16 form: { data: { confirm: "Are you sure?" }, class: 'button_to destructive' } %>
20 </td> 17 </td>
21 </tr> 18 </tr>
22 <% end %> 19 <% end %>
diff --git a/app/views/nodes/index.html.erb b/app/views/nodes/index.html.erb
index 2399105..903e80b 100644
--- a/app/views/nodes/index.html.erb
+++ b/app/views/nodes/index.html.erb
@@ -3,6 +3,11 @@
3<% end %> 3<% end %>
4<h1>Nodes</h1> 4<h1>Nodes</h1>
5 5
6<div>
7 <%= link_to 'New node', new_node_path, class: 'action_button' %>
8 <span class="field_hint">Creates a node with no parent or kind set — for a specific page, use the wizard's create flow or "add child" from an existing node instead.</span>
9</div>
10
6<%= will_paginate @nodes %> 11<%= will_paginate @nodes %>
7 <table class="node_table"> 12 <table class="node_table">
8 <tr class="header"> 13 <tr class="header">
diff --git a/app/views/occurrences/index.html.erb b/app/views/occurrences/index.html.erb
index 0e99857..82818d0 100644
--- a/app/views/occurrences/index.html.erb
+++ b/app/views/occurrences/index.html.erb
@@ -1,4 +1,4 @@
1<h1>Listing occurrences</h1> 1<h1>Occurrences</h1>
2 2
3<table> 3<table>
4 <tr> 4 <tr>
diff --git a/app/views/pages/index.html.erb b/app/views/pages/index.html.erb
index 91e5359..05c7311 100644
--- a/app/views/pages/index.html.erb
+++ b/app/views/pages/index.html.erb
@@ -1,4 +1,4 @@
1<h1>Listing pages</h1> 1<h1>Pages</h1>
2 2
3<table> 3<table>
4 <tr> 4 <tr>
diff --git a/app/views/users/edit.html.erb b/app/views/users/edit.html.erb
index df1005b..77b33c6 100644
--- a/app/views/users/edit.html.erb
+++ b/app/views/users/edit.html.erb
@@ -2,38 +2,32 @@
2 2
3<% if @user.errors.any? %> 3<% if @user.errors.any? %>
4 <div class="error_messages"> 4 <div class="error_messages">
5 <ul><% @user.errors.full_messages.each do |msg| %><li><%= msg.gsub("Slug", "Title") %></li><% end %></ul> 5 <ul><% @user.errors.full_messages.each do |msg| %><li><%= msg %></li><% end %></ul>
6 </div> 6 </div>
7<% end %> 7<% end %>
8 8
9<div id="page_editor">
10 <%= form_for @user do |f| %>
11 <div id="content">
12 <div class="node_description">Login</div>
13 <div class="node_content"><%= f.text_field :login %></div>
9 14
10<%= form_for @user do |f| %> 15 <div class="node_description">E-Mail</div>
11<table id="new_node"> 16 <div class="node_content"><%= f.text_field :email %></div>
12 <tr> 17
13 <td class="description">Login</td> 18 <div class="node_description">Password</div>
14 <td><%= f.text_field :login %></td> 19 <div class="node_content"><%= f.password_field :password %></div>
15 </tr> 20
16 <tr> 21 <div class="node_description">Confirm</div>
17 <td class="description">E-Mail</td> 22 <div class="node_content"><%= f.password_field :password_confirmation %></div>
18 <td><%= f.text_field :email %></td> 23
19 </tr> 24 <% if current_user.admin? %>
20 <tr> 25 <div class="node_description">Admin?</div>
21 <td class="description">Password</td> 26 <div class="node_content"><%= f.check_box :admin %></div>
22 <td><%= f.password_field :password %></td> 27 <% end %>
23 </tr> 28
24 <tr> 29 <div class="node_description"></div>
25 <td class="description">Confirm</td> 30 <div class="node_content"><%= f.submit "Update" %></div>
26 <td><%= f.password_field :password_confirmation %></td>
27 </tr>
28 <% if current_user.admin? %>
29 <tr>
30 <td class="description">Admin?</td>
31 <td><%= f.check_box :admin %></td>
32 </tr>
33 <% end %> 31 <% end %>
34 <tr> 32 </div>
35 <td class="description"></td> 33</div>
36 <td class="right"><%= f.submit "Update" %></td>
37 </tr>
38</table>
39<% end %>
diff --git a/app/views/users/index.html.erb b/app/views/users/index.html.erb
index 88868f5..46e958b 100644
--- a/app/views/users/index.html.erb
+++ b/app/views/users/index.html.erb
@@ -1,7 +1,6 @@
1<h1>Admins</h1>
2<%= link_to 'New admin user', new_user_path(admin: true), class: 'action_button' %>
1<table class="user_table"> 3<table class="user_table">
2 <tr>
3 <td><h1>Admins</h1></td>
4 </tr>
5 <tr class="header"> 4 <tr class="header">
6 <th>Login</th> 5 <th>Login</th>
7 <th></th> 6 <th></th>
@@ -9,9 +8,11 @@
9 <th></th> 8 <th></th>
10 </tr> 9 </tr>
11 <%= render :partial => "user", :locals => {:users => @users[:admin] ||= []} %> 10 <%= render :partial => "user", :locals => {:users => @users[:admin] ||= []} %>
12 <tr> 11</table>
13 <td><h1>Users</h1></td> 12
14 </tr> 13<h1>Users</h1>
14<%= link_to 'New user', new_user_path, class: 'action_button' %>
15<table class="user_table">
15 <tr class="header"> 16 <tr class="header">
16 <th>Login</th> 17 <th>Login</th>
17 <th></th> 18 <th></th>
@@ -20,7 +21,3 @@
20 </tr> 21 </tr>
21 <%= render :partial => "user", :locals => {:users => @users[:user] ||= []} %> 22 <%= render :partial => "user", :locals => {:users => @users[:user] ||= []} %>
22</table> 23</table>
23
24<% content_for :subnavigation do %>
25 <%= link_to "create", new_user_path %>
26<% end %>
diff --git a/app/views/users/new.html.erb b/app/views/users/new.html.erb
index 6beda4f..ce38fdf 100644
--- a/app/views/users/new.html.erb
+++ b/app/views/users/new.html.erb
@@ -2,36 +2,30 @@
2 2
3<% if @user.errors.any? %> 3<% if @user.errors.any? %>
4 <div class="error_messages"> 4 <div class="error_messages">
5 <ul><% @user.errors.full_messages.each do |msg| %><li><%= msg.gsub("Slug", "Title") %></li><% end %></ul> 5 <ul><% @user.errors.full_messages.each do |msg| %><li><%= msg %></li><% end %></ul>
6 </div> 6 </div>
7<% end %> 7<% end %>
8 8
9<div id="page_editor">
10 <%= form_for @user do |f| %>
11 <div id="content">
12 <div class="node_description">Login</div>
13 <div class="node_content"><%= f.text_field :login %></div>
9 14
10<%= form_for @user do |f| %> 15 <div class="node_description">E-Mail</div>
11<table id="new_node"> 16 <div class="node_content"><%= f.text_field :email %></div>
12 <tr> 17
13 <td class="description">Login</td> 18 <div class="node_description">Password</div>
14 <td><%= f.text_field :login %></td> 19 <div class="node_content"><%= f.password_field :password %></div>
15 </tr> 20
16 <tr> 21 <div class="node_description">Confirm</div>
17 <td class="description">E-Mail</td> 22 <div class="node_content"><%= f.password_field :password_confirmation %></div>
18 <td><%= f.text_field :email %></td> 23
19 </tr> 24 <div class="node_description">Admin?</div>
20 <tr> 25 <div class="node_content"><%= f.check_box :admin %></div>
21 <td class="description">Password</td> 26
22 <td><%= f.password_field :password %></td> 27 <div class="node_description"></div>
23 </tr> 28 <div class="node_content"><%= f.submit "Create" %></div>
24 <tr> 29 <% end %>
25 <td class="description">Confirm</td> 30 </div>
26 <td><%= f.password_field :password_confirmation %></td> 31</div>
27 </tr>
28 <tr>
29 <td class="description">Admin?</td>
30 <td><%= f.check_box :admin %></td>
31 </tr>
32 <tr>
33 <td class="description"></td>
34 <td class="right"><%= f.submit "Create" %></td>
35 </tr>
36</table>
37<% end %>
diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb
index 80483d3..e744efe 100644
--- a/app/views/users/show.html.erb
+++ b/app/views/users/show.html.erb
@@ -1,20 +1,23 @@
1<% content_for :subnavigation do %> 1<div id="page_editor">
2 <%= link_to 'Edit', edit_user_path(@user) %> 2 <h1><%= @user.login %></h1>
3<% end %>
4 3
5<h1>User: <%= @user.login %></h1> 4 <div id="content">
5 <div class="node_description">Actions</div>
6 <div class="node_content node_info_group">
7 <div class="node_info_group_items">
8 <div class="node_info_item">
9 <%= link_to 'Edit', edit_user_path(@user), class: 'action_button' %>
10 </div>
11 </div>
12 </div>
6 13
7<table id="new_node"> 14 <div class="node_description">Login</div>
8 <tr> 15 <div class="node_content"><%= @user.login %></div>
9 <td class="description">Login</td> 16
10 <td><%= @user.login %></td> 17 <div class="node_description">E-Mail</div>
11 </tr> 18 <div class="node_content"><%= @user.email %></div>
12 <tr> 19
13 <td class="description">E-Mail</td> 20 <div class="node_description">Admin?</div>
14 <td><%= @user.email %></td> 21 <div class="node_content"><%= @user.admin ? "yes" : "no" %></div>
15 </tr> 22 </div>
16 <tr> 23</div>
17 <td class="description">Admin?</td>
18 <td><%= @user.admin ? "yes" : "no" %></td>
19 </tr>
20</table> \ No newline at end of file
diff --git a/config/routes.rb b/config/routes.rb
index da46e5c..5d68828 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -20,15 +20,10 @@ Cccms::Application.routes.draw do
20 scope '(:locale)', locale: /de|en/ do 20 scope '(:locale)', locale: /de|en/ do
21 21
22 resources :tags 22 resources :tags
23 resources :occurrences
24 resources :events 23 resources :events
25 24
26 resources :pages do 25 get 'pages/:id/preview', to: 'pages#preview', as: :preview_page
27 member do 26 put 'pages/:id/sort_images', to: 'pages#sort_images', as: :sort_images_page
28 get :preview
29 put :sort_images
30 end
31 end
32 27
33 resources :nodes do 28 resources :nodes do
34 collection do 29 collection do
diff --git a/public/stylesheets/admin.css b/public/stylesheets/admin.css
index 66f13b8..f00a658 100644
--- a/public/stylesheets/admin.css
+++ b/public/stylesheets/admin.css
@@ -640,6 +640,13 @@ form.button_to button[type="submit"] {
640 color: #969696; 640 color: #969696;
641 padding-bottom: 4px; 641 padding-bottom: 4px;
642} 642}
643
644.action_button + .field_hint {
645 display: inline;
646 margin-left: 0.5rem;
647 margin-top: 0;
648}
649
643/* Identical declaration block to #search_results p span.result_path / 650/* Identical declaration block to #search_results p span.result_path /
644 #menu_search_results p span.result_path below -- three independent 651 #menu_search_results p span.result_path below -- three independent
645 copies of the same "small gray helper text" style. */ 652 copies of the same "small gray helper text" style. */
@@ -692,6 +699,7 @@ a.action_button {
692 font-weight: bold; 699 font-weight: bold;
693 text-decoration: none; 700 text-decoration: none;
694 color: #000000; 701 color: #000000;
702 margin-bottom: 1rem;
695} 703}
696 704
697#page_editor a.action_button:hover, 705#page_editor a.action_button:hover,
@@ -700,6 +708,11 @@ a.action_button:hover {
700 background-color: #000000; 708 background-color: #000000;
701} 709}
702 710
711#page_editor form input[type=text],
712#page_editor form input[type=password] {
713 padding: 5px;
714}
715
703@media(min-width:1016px) { 716@media(min-width:1016px) {
704 input#tag_list, 717 input#tag_list,
705 input#node_staged_slug, 718 input#node_staged_slug,
@@ -731,6 +744,11 @@ a.action_button:hover {
731 #page_editor #metadata, #page_editor #content, #admin_overview { 744 #page_editor #metadata, #page_editor #content, #admin_overview {
732 margin-left: -125px; 745 margin-left: -125px;
733 } 746 }
747
748 #page_editor form input[type=text],
749 #page_editor form input[type=password] {
750 width: 690px;
751 }
734} 752}
735 753
736@media(max-width:1015px) { 754@media(max-width:1015px) {
@@ -773,6 +791,12 @@ a.action_button:hover {
773 font-weight: bold; 791 font-weight: bold;
774 } 792 }
775 793
794 #page_editor form input[type=text],
795 #page_editor form input[type=password] {
796 box-sizing: border-box;
797 width: 100%;
798 }
799
776 input[type=text], textarea { 800 input[type=text], textarea {
777 font-size: 1.5rem; 801 font-size: 1.5rem;
778 } 802 }
@@ -920,6 +944,14 @@ div#draft_list table td.actions a {
920 cursor: grab; 944 cursor: grab;
921} 945}
922 946
947#menu_item_list td a {
948 text-decoration: underline;
949 text-decoration-style: wavy;
950 text-decoration-color: #b0b0b0;
951 text-decoration-thickness: 1px;
952 text-underline-offset: 2px;
953}
954
923.ui-state-highlight td { 955.ui-state-highlight td {
924 height: 20px; 956 height: 20px;
925} 957}