diff options
| author | erdgeist <erdgeist@erdgeist.org> | 2026-06-27 22:52:50 +0200 |
|---|---|---|
| committer | erdgeist <erdgeist@erdgeist.org> | 2026-06-27 22:52:50 +0200 |
| commit | 9a19a0494ef51cdac9a78e24d517ca48ba44c453 (patch) | |
| tree | 8eaae12d8047a40e29d3ea7ff3116b5c869e04bd /app/views | |
| parent | 85a01e35274b8d4d4165a7b26bd7986e211246bb (diff) | |
| parent | 1853082fcd8c067390c246f9daa01a9b47387497 (diff) | |
Migration from Rails 2.3.5 to Rails 8.1 successful.
Merging dev branch.
Diffstat (limited to 'app/views')
50 files changed, 440 insertions, 279 deletions
diff --git a/app/views/admin/_drafts.html.erb b/app/views/admin/_drafts.html.erb index 58b946b..a35b0ab 100644 --- a/app/views/admin/_drafts.html.erb +++ b/app/views/admin/_drafts.html.erb | |||
| @@ -17,9 +17,9 @@ | |||
| 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 | <%= link_to "Publish", publish_node_path(draft.node), :method => :put, :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?" } } %> |
| 21 | </td> | 21 | </td> |
| 22 | </tr> | 22 | </tr> |
| 23 | <% end %> | 23 | <% end %> |
| 24 | </table> | 24 | </table> |
| 25 | </div> \ No newline at end of file | 25 | </div> |
diff --git a/app/views/admin/_menu.html.erb b/app/views/admin/_menu.html.erb index e8b39ce..6f217eb 100644 --- a/app/views/admin/_menu.html.erb +++ b/app/views/admin/_menu.html.erb | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | <%= language_selector %> | 1 | <%= language_selector %> |
| 2 | <%= link_to 'Logout', :controller => :sessions, :action => :destroy %> | 2 | <%= button_to 'Logout', logout_path, method: :delete %> |
| 3 | <%= link_to 'Overview', :controller => :admin, :action => 'index' %> | 3 | <%= link_to 'Overview', admin_path %> |
| 4 | <%= link_to 'Nodes', nodes_path, selected?('nodes') %> | 4 | <%= link_to 'Nodes', nodes_path, selected?('nodes') %> |
| 5 | <%= link_to 'Assets', assets_path, selected?('assets') %> | 5 | <%= link_to 'Assets', assets_path, selected?('assets') %> |
| 6 | <%= link_to 'User', users_path, selected?('users') %> | 6 | <%= link_to 'User', users_path, selected?('users') %> |
| 7 | <%= link_to 'Navigation', menu_items_path, selected?('menu_items') %> > \ No newline at end of file | 7 | <%= 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 index 300d088..88b5e93 100644 --- a/app/views/admin/_recent_changes.html.erb +++ b/app/views/admin/_recent_changes.html.erb | |||
| @@ -13,7 +13,7 @@ | |||
| 13 | <td><%= truncated_title_for_node node %></td> | 13 | <td><%= truncated_title_for_node node %></td> |
| 14 | <td><%= node.unique_name %></td> | 14 | <td><%= node.unique_name %></td> |
| 15 | <td><%= node.draft.user.login rescue "" %></td> | 15 | <td><%= node.draft.user.login rescue "" %></td> |
| 16 | <td><%= node.updated_at.to_s(:db) %></td> | 16 | <td><%= node.updated_at.to_fs(:db) %></td> |
| 17 | <td class="actions"> | 17 | <td class="actions"> |
| 18 | <%= link_to 'Show', node_path(node) %> | 18 | <%= link_to 'Show', node_path(node) %> |
| 19 | <%= link_to "Revisions", revision_path(:id => node.id) %> | 19 | <%= link_to "Revisions", revision_path(:id => node.id) %> |
diff --git a/app/views/admin/index.html.erb b/app/views/admin/index.html.erb index 526aa88..2741db3 100644 --- a/app/views/admin/index.html.erb +++ b/app/views/admin/index.html.erb | |||
| @@ -1,6 +1,15 @@ | |||
| 1 | <div id="admin_wizard"> | ||
| 2 | <div class="admin_wizard_button"><%= link_to 'Create Update or Pressemitteilung', new_node_path, :only_path => false %></div> | ||
| 3 | <div class="admin_wizard_button"><a href="#" id="admin_wizard_my_work" class="button">Continue my work</a></div> | ||
| 4 | <div class="admin_wizard_button"><a href="#" id="admin_wizard_create_page" class="button">Add a page in the page tree</a></div> | ||
| 5 | <div class="admin_wizard_button"><%= link_to("Upload a new asset", new_asset_path, :only_path => false) %></div> | ||
| 6 | </div> | ||
| 7 | |||
| 1 | <p id="overview_toggle"> | 8 | <p id="overview_toggle"> |
| 2 | <a href="#" id="recent_changes_toggle" class="button">recent changes</a> | 9 | <a href="#" id="recent_changes_toggle" class="button">recent changes</a> |
| 3 | <a href="#" id="current_drafts_toggle" class="button">current drafts</a> | 10 | <a href="#" id="my_work_toggle" class="button">my work</a> |
| 11 | <a href="#" id="current_drafts_toggle" class="button">current drafts (<%= @drafts_count %>)</a> | ||
| 12 | <a href="#" id="admin_sitemap_toggle" class="button">site map</a> | ||
| 4 | </p> | 13 | </p> |
| 5 | 14 | ||
| 6 | <div id="recent_changes_table"> | 15 | <div id="recent_changes_table"> |
| @@ -30,7 +39,41 @@ | |||
| 30 | <%= node.lock_owner.login if node.lock_owner %> | 39 | <%= node.lock_owner.login if node.lock_owner %> |
| 31 | </td> | 40 | </td> |
| 32 | <td> | 41 | <td> |
| 33 | <%= node.draft ? node.draft.revision : node.head.revision %> | 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> | ||
| 48 | |||
| 49 | <div id="my_work_table"> | ||
| 50 | |||
| 51 | <h1>My Work</h1> | ||
| 52 | |||
| 53 | <table class="node_table"> | ||
| 54 | <tr class="header"> | ||
| 55 | <th class="node_id">ID</th> | ||
| 56 | <th class="title">Title</th> | ||
| 57 | <th class="actions">Actions</th> | ||
| 58 | <th class="editor">Locked by</th> | ||
| 59 | <th class="revision">Rev.</th> | ||
| 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) %> | ||
| 34 | </td> | 77 | </td> |
| 35 | </tr> | 78 | </tr> |
| 36 | <% end %> | 79 | <% end %> |
| @@ -39,7 +82,7 @@ | |||
| 39 | 82 | ||
| 40 | <div id="current_drafts_table"> | 83 | <div id="current_drafts_table"> |
| 41 | 84 | ||
| 42 | <h1>Current Drafts</h1> | 85 | <h1>Current Drafts (<%= @drafts_count %>)</h1> |
| 43 | 86 | ||
| 44 | <table class="node_table"> | 87 | <table class="node_table"> |
| 45 | <tr class="header"> | 88 | <tr class="header"> |
| @@ -64,9 +107,41 @@ | |||
| 64 | <%= node.lock_owner.login if node.lock_owner %> | 107 | <%= node.lock_owner.login if node.lock_owner %> |
| 65 | </td> | 108 | </td> |
| 66 | <td> | 109 | <td> |
| 67 | <%= node.draft ? node.draft.revision : node.head.revision %> | 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> | ||
| 116 | |||
| 117 | <div id="admin_sitemap_table"> | ||
| 118 | |||
| 119 | <h1>Sitemap</h1> | ||
| 120 | |||
| 121 | <table class="node_table"> | ||
| 122 | <tr class="header"> | ||
| 123 | <th class="node_id">ID</th> | ||
| 124 | <th class="title">Title</th> | ||
| 125 | <th class="actions">Actions</th> | ||
| 126 | <th class="editor">Locked by</th> | ||
| 127 | </tr> | ||
| 128 | <% @sitemap.each do |node| %> | ||
| 129 | <% if !node.nil? %> | ||
| 130 | <tr class="<%= cycle("even", "odd") %>"> | ||
| 131 | <td class="node_id" style="padding-left: <%= @sitemap_depth[node.id] * 30 %>px;"><%= node.id %></td> | ||
| 132 | <td class="title" style="padding-left: <%= @sitemap_depth[node.id] * 30 %>px;"> | ||
| 133 | <h4><%= link_to title_for_node(node), node_path(node) %></h4> | ||
| 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 %> | ||
| 68 | </td> | 142 | </td> |
| 69 | </tr> | 143 | </tr> |
| 70 | <% end %> | 144 | <% end %> |
| 145 | <% end %> | ||
| 71 | </table> | 146 | </table> |
| 72 | </div> \ No newline at end of file | 147 | </div> |
diff --git a/app/views/admin/search_results.html.erb b/app/views/admin/search_results.html.erb new file mode 100644 index 0000000..671b665 --- /dev/null +++ b/app/views/admin/search_results.html.erb | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | <h1>Search Results</h1> | ||
| 2 | |||
| 3 | <ul> | ||
| 4 | <%- @results.each do |result| %> | ||
| 5 | <li><a href="<%= node_path(result) %>"><%= result.title %></a></li> | ||
| 6 | <% end %> | ||
| 7 | </ul> | ||
diff --git a/app/views/assets/edit.html.erb b/app/views/assets/edit.html.erb index d60db94..f198600 100644 --- a/app/views/assets/edit.html.erb +++ b/app/views/assets/edit.html.erb | |||
| @@ -1,12 +1,24 @@ | |||
| 1 | <h1>Editing asset</h1> | 1 | <h1>Editing asset</h1> |
| 2 | 2 | ||
| 3 | <% form_for(@asset) do |f| %> | 3 | <%= form_for(@asset, html: { multipart: true }) do |f| %> |
| 4 | <%= f.error_messages %> | 4 | <%= form_error_messages(f) %> |
| 5 | |||
| 6 | <% if @asset.upload.present? %> | ||
| 7 | <p> | ||
| 8 | <strong>Current file:</strong> | ||
| 9 | <%= @asset.upload.url %> | ||
| 10 | (<%= number_to_human_size(@asset.upload.size) %>) | ||
| 11 | </p> | ||
| 12 | <% end %> | ||
| 13 | |||
| 14 | <p> | ||
| 15 | <label>Replace file:</label><br> | ||
| 16 | <%= f.file_field :upload %> | ||
| 17 | </p> | ||
| 5 | 18 | ||
| 6 | <p> | 19 | <p> |
| 7 | <%= f.submit 'Update' %> | 20 | <%= f.submit 'Update' %> |
| 8 | </p> | 21 | </p> |
| 9 | <% end %> | 22 | <% end %> |
| 10 | 23 | ||
| 11 | <%= link_to 'Show', @asset %> | | 24 | <%= link_to 'Show', @asset %> | <%= link_to 'Back', assets_path %> |
| 12 | <%= link_to 'Back', assets_path %> \ No newline at end of file | ||
diff --git a/app/views/assets/index.html.erb b/app/views/assets/index.html.erb index fc7c029..51fc486 100644 --- a/app/views/assets/index.html.erb +++ b/app/views/assets/index.html.erb | |||
| @@ -10,12 +10,12 @@ | |||
| 10 | </tr> | 10 | </tr> |
| 11 | <% @assets.each do |asset| %> | 11 | <% @assets.each do |asset| %> |
| 12 | <tr> | 12 | <tr> |
| 13 | <td><%= image_tag asset.upload.url(:thumb) %></td> | 13 | <td><%= image_tag asset.upload.url(:thumb), style: "max-width: 100px; max-height: 100px;" %></td> |
| 14 | <td><%= link_to asset.name, asset.upload.url %></td> | 14 | <td><%= link_to asset.name, asset.upload.url %></td> |
| 15 | <td><%= asset.upload.content_type %></td> | 15 | <td><%= asset.upload.content_type %></td> |
| 16 | <td><%= link_to 'Show', asset %></td> | 16 | <td><%= link_to 'Show', asset %></td> |
| 17 | <td><%= link_to 'Edit', edit_asset_path(asset) %></td> | 17 | <td><%= link_to 'Edit', edit_asset_path(asset) %></td> |
| 18 | <td><%= link_to 'Destroy', asset, :confirm => 'Are you sure?', :method => :delete %></td> | 18 | <td><%= button_to 'Destroy', asset, method: :delete, form: { data: { confirm: 'Are you sure?' } } %></td> |
| 19 | </tr> | 19 | </tr> |
| 20 | <% end %> | 20 | <% end %> |
| 21 | </table> \ No newline at end of file | 21 | </table> |
diff --git a/app/views/assets/new.html.erb b/app/views/assets/new.html.erb index 366488f..6c1310a 100644 --- a/app/views/assets/new.html.erb +++ b/app/views/assets/new.html.erb | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | <h1>New asset</h1> | 1 | <h1>New asset</h1> |
| 2 | 2 | ||
| 3 | <% form_for(@asset, :html => { :multipart => true }) do |f| %> | 3 | <%= form_for(@asset, :html => { :multipart => true }) do |f| %> |
| 4 | <%= f.error_messages %> | 4 | <%= form_error_messages(f) %> |
| 5 | 5 | ||
| 6 | <p> | 6 | <p> |
| 7 | <%= f.label :name %><br /> | 7 | <%= f.label :name %><br /> |
| @@ -14,4 +14,4 @@ | |||
| 14 | </p> | 14 | </p> |
| 15 | <% end %> | 15 | <% end %> |
| 16 | 16 | ||
| 17 | <%= link_to 'Back', assets_path %> \ No newline at end of file | 17 | <%= link_to 'Back', assets_path %> |
diff --git a/app/views/assets/show.html.erb b/app/views/assets/show.html.erb index a64987c..694be5a 100644 --- a/app/views/assets/show.html.erb +++ b/app/views/assets/show.html.erb | |||
| @@ -6,7 +6,7 @@ | |||
| 6 | <table> | 6 | <table> |
| 7 | <tr> | 7 | <tr> |
| 8 | <td>Thumbnail</td> | 8 | <td>Thumbnail</td> |
| 9 | <td><%= image_tag @asset.upload.url(:medium) %></td> | 9 | <td><%= image_tag @asset.upload.url(:medium), style: "max-width: 300px; max-height: 300px;" %></td> |
| 10 | </tr> | 10 | </tr> |
| 11 | <tr> | 11 | <tr> |
| 12 | <td>Public Path</td> | 12 | <td>Public Path</td> |
| @@ -20,4 +20,4 @@ | |||
| 20 | <td>Size</td> | 20 | <td>Size</td> |
| 21 | <td><%= "#{@asset.upload.size/1024} KB" %></td> | 21 | <td><%= "#{@asset.upload.size/1024} KB" %></td> |
| 22 | </tr> | 22 | </tr> |
| 23 | </table> \ No newline at end of file | 23 | </table> |
diff --git a/app/views/content/_featured_articles.html.erb b/app/views/content/_featured_articles.html.erb index 75e2e1d..6717c51 100644 --- a/app/views/content/_featured_articles.html.erb +++ b/app/views/content/_featured_articles.html.erb | |||
| @@ -1,31 +1,56 @@ | |||
| 1 | <div id="featured_articles"> | 1 | <div id="featured_articles"> |
| 2 | <h2>Featured</h2> | 2 | <h2>Featured</h2> |
| 3 | |||
| 4 | <!-- %= link_to( | ||
| 5 | image_tag( '34c3-tuwat.1e4e25c.png' ), | ||
| 6 | "https://events.ccc.de/congress/2017/wiki/Main_Page", | ||
| 7 | :id => "34C3_icon", | ||
| 8 | :size => "155x90", | ||
| 9 | :title => "Chaos Communication Congress 2017" | ||
| 10 | )% --> | ||
| 11 | |||
| 3 | <%= link_to( | 12 | <%= link_to( |
| 4 | image_tag( 'chaosradio.png' ), | 13 | '<img src="/images/chaosradio.png" alt="Chaosradio">'.html_safe, |
| 5 | "http://chaosradio.ccc.de/", | 14 | "https://chaosradio.ccc.de/", |
| 6 | :id => "chaosradio_icon", | 15 | :id => "chaosradio_icon", |
| 7 | :title => "Chaosradio" | 16 | :title => "Chaosradio" |
| 8 | )%> | 17 | )%> |
| 9 | 18 | ||
| 10 | <%= link_to( | 19 | <%= link_to( |
| 11 | image_tag( 'ds.png' ), | 20 | '<img src="/images/media-ccc-de-banner.svg" width="155" height="45" alt="Media Dot CCC Dot de">'.html_safe, |
| 12 | "http://ds.ccc.de/", | 21 | "https://media.ccc.de", |
| 22 | :id => "media_ccc_de_icon", | ||
| 23 | :title => "Media Dot CCC Dot de" | ||
| 24 | )%> | ||
| 25 | |||
| 26 | <%= link_to( | ||
| 27 | '<img src="/images/ds.png" alt="Datenschleuder">'.html_safe, | ||
| 28 | "https://ds.ccc.de/", | ||
| 13 | :id => "ds_icon", | 29 | :id => "ds_icon", |
| 14 | :title => "Datenschleuder" | 30 | :title => "Datenschleuder" |
| 15 | )%> | 31 | )%> |
| 16 | 32 | ||
| 17 | <%= link_to( | 33 | <%= link_to( |
| 18 | image_tag( 'events.png' ), | 34 | '<img src="/images/events.png" alt="Events-Blog">'.html_safe, |
| 19 | "http://events.ccc.de/", | 35 | "https://events.ccc.de/", |
| 20 | :id => "events_icon", | 36 | :id => "events_icon", |
| 21 | :title => "Events Blog" | 37 | :title => "Events-Blog" |
| 22 | )%> | 38 | )%> |
| 23 | 39 | ||
| 24 | <%= link_to( | 40 | <%= link_to( |
| 25 | image_tag( 'twitter.png' ), | 41 | '<img src="/images/Fediverse.svg" width="64" height="64" alt="Fediverse">'.html_safe, |
| 26 | "https://twitter.com/chaosupdates", | 42 | "https://social.bau-ha.us/@ccc", |
| 27 | :id => "twitter_icon", | 43 | :rel => 'me', |
| 28 | :title => "Twitter" | 44 | :id => "fediverse_icon", |
| 45 | :title => "Fediverse" | ||
| 29 | )%> | 46 | )%> |
| 47 | |||
| 48 | <%= link_to( | ||
| 49 | '<img src="/images/Bluesky_Logo.svg" width="64" height="64" alt="bsky">'.html_safe, | ||
| 50 | "https://bsky.app/profile/ccc.de", | ||
| 51 | :id => "bluesky_icon", | ||
| 52 | :title => "bsky" | ||
| 53 | )%> | ||
| 54 | |||
| 30 | </div> | 55 | </div> |
| 31 | 56 | ||
diff --git a/app/views/content/_main_navigation.html.erb b/app/views/content/_main_navigation.html.erb index 67d4ecc..2fe8b77 100644 --- a/app/views/content/_main_navigation.html.erb +++ b/app/views/content/_main_navigation.html.erb | |||
| @@ -4,4 +4,4 @@ | |||
| 4 | <li><%= link_to_path item.title, item.path %></li> | 4 | <li><%= link_to_path item.title, item.path %></li> |
| 5 | <% end %> | 5 | <% end %> |
| 6 | </ul> | 6 | </ul> |
| 7 | </div> \ No newline at end of file | 7 | </div> |
diff --git a/app/views/content/_search.html.erb b/app/views/content/_search.html.erb index 9f61042..aa91424 100644 --- a/app/views/content/_search.html.erb +++ b/app/views/content/_search.html.erb | |||
| @@ -1,8 +1,3 @@ | |||
| 1 | <% form_tag search_path, :method => 'get' do %> | 1 | <%= form_tag search_path, :method => 'get' do %> |
| 2 | <table> | 2 | <div><%= text_field_tag :search_term, params[:search_term], :placeholder => 'suchen', :type => 'search' %></div> |
| 3 | <tr> | 3 | <% end %> |
| 4 | <td><%= text_field_tag :search_term, params[:search_term] %></td> | ||
| 5 | <td style="padding-top: 2px"><%= image_submit_tag("search_button.png") %></td> | ||
| 6 | </tr> | ||
| 7 | </table> | ||
| 8 | <% end %> \ No newline at end of file | ||
diff --git a/app/views/content/_tags.html.erb b/app/views/content/_tags.html.erb index d33bc10..f0e7210 100644 --- a/app/views/content/_tags.html.erb +++ b/app/views/content/_tags.html.erb | |||
| @@ -1,8 +1,10 @@ | |||
| 1 | <% unless @page.nil? || @page.tags.empty? %> | ||
| 1 | <div id="tags"> | 2 | <div id="tags"> |
| 2 | <h2>Tags</h2> | 3 | <h2>Tags</h2> |
| 3 | <ul class="teasertext"> | 4 | <ul class="teasertext"> |
| 4 | <% @page.tags.each do |tag| %> | 5 | <% @page.tags.each do |tag| %> |
| 5 | <li><%= link_to tag.name, tag_path(:id => tag.name) %></li> | 6 | <li><%= link_to tag.name, tag_path(tag.name) %></li> |
| 6 | <% end %> | 7 | <% end %> |
| 7 | </ul> | 8 | </ul> |
| 8 | </div> \ No newline at end of file | 9 | </div> |
| 10 | <% end %> | ||
diff --git a/app/views/custom/page_templates/public/no_date_and_author.html.erb b/app/views/custom/page_templates/public/no_date_and_author.html.erb index b019805..fa39e54 100644 --- a/app/views/custom/page_templates/public/no_date_and_author.html.erb +++ b/app/views/custom/page_templates/public/no_date_and_author.html.erb | |||
| @@ -1,8 +1,8 @@ | |||
| 1 | <div class="article"> | 1 | <div class="article" lang="<%= @page.effective_lang %>"> |
| 2 | <h2 class="headline"><%= @page.title %></h2> | 2 | <h2 class="headline"><%= @page.title %></h2> |
| 3 | <p><%= sanitize( @page.abstract ) %></p> | 3 | <p><%= sanitize( @page.abstract ) %></p> |
| 4 | <div id="headline_image"><%= headline_image %></div> | 4 | <div id="headline_image"><%= headline_image %></div> |
| 5 | <%= aggregate?(@page.body) %> | 5 | <%= aggregate?(@page.body) %> |
| 6 | </div> | 6 | </div> |
| 7 | 7 | ||
| 8 | <%= will_paginate(@content_collection) if @content_collection %> \ No newline at end of file | 8 | <%= will_paginate(@content_collection) if @content_collection %> |
diff --git a/app/views/custom/page_templates/public/no_date_and_author_with_map.html.erb b/app/views/custom/page_templates/public/no_date_and_author_with_map.html.erb new file mode 100644 index 0000000..6e86edf --- /dev/null +++ b/app/views/custom/page_templates/public/no_date_and_author_with_map.html.erb | |||
| @@ -0,0 +1,8 @@ | |||
| 1 | <div class="article"> | ||
| 2 | <h2 class="headline"><%= @page.title %></h2> | ||
| 3 | <p><%= sanitize( @page.abstract ) %></p> | ||
| 4 | <object data="/system/uploads/327/original/map.svg" type="image/svg+xml"/> | ||
| 5 | <%= aggregate?(@page.body) %> | ||
| 6 | </div> | ||
| 7 | |||
| 8 | <%= will_paginate(@content_collection) if @content_collection %> | ||
diff --git a/app/views/custom/page_templates/public/no_title_abstract_date_and_author.html.erb b/app/views/custom/page_templates/public/no_title_abstract_date_and_author.html.erb index 83cbff6..64e2a7c 100644 --- a/app/views/custom/page_templates/public/no_title_abstract_date_and_author.html.erb +++ b/app/views/custom/page_templates/public/no_title_abstract_date_and_author.html.erb | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | <div class="article"> | 1 | <div class="article" lang="<%= @page.effective_lang %>"> |
| 2 | <div id="headline_image"><%= headline_image %></div> | 2 | <div id="headline_image"><%= headline_image %></div> |
| 3 | <%= aggregate?(@page.body) %> | 3 | <%= aggregate?(@page.body) %> |
| 4 | </div> | 4 | </div> |
| 5 | 5 | ||
| 6 | <%= will_paginate(@content_collection) if @content_collection %> \ No newline at end of file | 6 | <%= will_paginate(@content_collection) if @content_collection %> |
diff --git a/app/views/custom/page_templates/public/standard_template.html.erb b/app/views/custom/page_templates/public/standard_template.html.erb index 8000af5..bbc8cd0 100644 --- a/app/views/custom/page_templates/public/standard_template.html.erb +++ b/app/views/custom/page_templates/public/standard_template.html.erb | |||
| @@ -1,8 +1,8 @@ | |||
| 1 | <div class="article"> | 1 | <div class="article" lang="<%= @page.effective_lang %>"> |
| 2 | <h2 class="headline"><%= @page.title %></h2> | 2 | <h2 class="headline"><%= @page.title %></h2> |
| 3 | <div class="abstract"><p><%= sanitize( @page.abstract )%></p></div> | 3 | <div class="abstract"><p><%= sanitize( @page.abstract )%></p></div> |
| 4 | <div id="headline_image"><%= headline_image %></div> | 4 | <div id="headline_image"><%= headline_image %></div> |
| 5 | <div class="body"><%= aggregate?(@page.body) %></div> | 5 | <div class="body"><%= aggregate?(@page.body) %></div> |
| 6 | </div> | 6 | </div> |
| 7 | 7 | ||
| 8 | <%= will_paginate(@content_collection) if @content_collection %> \ No newline at end of file | 8 | <%= will_paginate(@content_collection) if @content_collection %> |
diff --git a/app/views/custom/page_templates/public/title_only.html.erb b/app/views/custom/page_templates/public/title_only.html.erb index 09c7455..42fe9a6 100644 --- a/app/views/custom/page_templates/public/title_only.html.erb +++ b/app/views/custom/page_templates/public/title_only.html.erb | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | <div class="article"> | 1 | <div class="article" lang="<%= @page.effective_lang %>"> |
| 2 | <h2 class="headline"><%= @page.title %></h2> | 2 | <h2 class="headline"><%= @page.title %></h2> |
| 3 | <div id="headline_image"><%= headline_image %></div> | 3 | <div id="headline_image"><%= headline_image %></div> |
| 4 | <%= aggregate?(@page.body) %> | 4 | <%= aggregate?(@page.body) %> |
| 5 | </div> | 5 | </div> |
| 6 | 6 | ||
| 7 | <%= will_paginate(@content_collection) if @content_collection %> \ No newline at end of file | 7 | <%= will_paginate(@content_collection) if @content_collection %> |
diff --git a/app/views/custom/page_templates/public/update.html.erb b/app/views/custom/page_templates/public/update.html.erb index 5ea277a..d5995ac 100644 --- a/app/views/custom/page_templates/public/update.html.erb +++ b/app/views/custom/page_templates/public/update.html.erb | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | <div class="article"> | 1 | <div class="article" lang="<%= @page.effective_lang %>"> |
| 2 | <h2 class="headline"><%= @page.title %></h2> | 2 | <h2 class="headline"><%= @page.title %></h2> |
| 3 | <div class="author_and_date"><%= date_for_page @page %>, <%= @page.user.try(:login) %></div> | 3 | <div class="author_and_date"><%= date_for_page @page %>, <%= @page.user.try(:login) %></div> |
| 4 | <div class="abstract"><p><%= sanitize( @page.abstract )%></p></div> | 4 | <div class="abstract"><p><%= sanitize( @page.abstract )%></p></div> |
| @@ -6,4 +6,4 @@ | |||
| 6 | <div class="body"><%= aggregate?(@page.body) %></div> | 6 | <div class="body"><%= aggregate?(@page.body) %></div> |
| 7 | </div> | 7 | </div> |
| 8 | 8 | ||
| 9 | <%= will_paginate(@content_collection) if @content_collection %> \ No newline at end of file | 9 | <%= will_paginate(@content_collection) if @content_collection %> |
diff --git a/app/views/custom/partials/_article.html.erb b/app/views/custom/partials/_article.html.erb index 433c31c..b738ac7 100644 --- a/app/views/custom/partials/_article.html.erb +++ b/app/views/custom/partials/_article.html.erb | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | <div class="article_partial"> | 1 | <div class="article_partial" lang="<%= page.effective_lang %>"> |
| 2 | <h2 class="headline"><%= link_to_path page.title, page.node.unique_name %></h2> | 2 | <h2 class="headline"><%= link_to_path page.title, page.node.unique_name %></h2> |
| 3 | <div class="author_and_date"> | 3 | <div class="author_and_date"> |
| 4 | <%= date_for_page page %>, <%= author_for_page page %> | 4 | <%= date_for_page page %>, <%= author_for_page page %> |
| 5 | </div> | 5 | </div> |
| 6 | <p class="excerpt"><%= page.abstract %> <%= link_to_path t(:more), page.node.unique_name %></p> | 6 | <p class="excerpt"><%= page.abstract %> <%= link_to_path t(:more), page.node.unique_name %></p> |
| 7 | </div> \ No newline at end of file | 7 | </div> |
diff --git a/app/views/custom/partials/_no_date_and_author.html.erb b/app/views/custom/partials/_no_date_and_author.html.erb index 61d6aac..fed02ac 100644 --- a/app/views/custom/partials/_no_date_and_author.html.erb +++ b/app/views/custom/partials/_no_date_and_author.html.erb | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | <div class="article_partial"> | 1 | <div class="article_partial" lang="<%= page.effective_lang %>"> |
| 2 | <h2 class="headline"><%= link_to page.title, content_path(page.node.unique_path) %></h2> | 2 | <h2 class="headline"><%= link_to page.title, content_path(page.node.unique_path) %></h2> |
| 3 | <p class="excerpt"><%= page.abstract %></p> | 3 | <p class="excerpt"><%= page.abstract %></p> |
| 4 | </div> \ No newline at end of file | 4 | </div> |
diff --git a/app/views/events/edit.html.erb b/app/views/events/edit.html.erb index 17b6980..824cd66 100644 --- a/app/views/events/edit.html.erb +++ b/app/views/events/edit.html.erb | |||
| @@ -6,8 +6,8 @@ | |||
| 6 | 6 | ||
| 7 | <h1>Editing event</h1> | 7 | <h1>Editing event</h1> |
| 8 | 8 | ||
| 9 | <% form_for(@event) do |f| %> | 9 | <%= form_for(@event) do |f| %> |
| 10 | <%= f.error_messages %> | 10 | <%= form_error_messages(f) %> |
| 11 | 11 | ||
| 12 | <p> | 12 | <p> |
| 13 | <%= f.label :start_time %><br /> | 13 | <%= f.label :start_time %><br /> |
| @@ -47,4 +47,4 @@ | |||
| 47 | <p> | 47 | <p> |
| 48 | <%= f.submit 'Update' %> | 48 | <%= f.submit 'Update' %> |
| 49 | </p> | 49 | </p> |
| 50 | <% end %> \ No newline at end of file | 50 | <% end %> |
diff --git a/app/views/events/index.html.erb b/app/views/events/index.html.erb index c1b5b48..19b21ce 100644 --- a/app/views/events/index.html.erb +++ b/app/views/events/index.html.erb | |||
| @@ -26,11 +26,11 @@ | |||
| 26 | <td><%=h event.node_id %></td> | 26 | <td><%=h event.node_id %></td> |
| 27 | <td><%= link_to 'Show', event %></td> | 27 | <td><%= link_to 'Show', event %></td> |
| 28 | <td><%= link_to 'Edit', edit_event_path(event) %></td> | 28 | <td><%= link_to 'Edit', edit_event_path(event) %></td> |
| 29 | <td><%= link_to 'Destroy', event, :confirm => 'Are you sure?', :method => :delete %></td> | 29 | <td><%= button_to 'Destroy', event, method: :delete, form: { data: { confirm: 'Are you sure?' } } %></td> |
| 30 | </tr> | 30 | </tr> |
| 31 | <% end %> | 31 | <% end %> |
| 32 | </table> | 32 | </table> |
| 33 | 33 | ||
| 34 | <br /> | 34 | <br /> |
| 35 | 35 | ||
| 36 | <%= link_to 'New event', new_event_path %> \ No newline at end of file | 36 | <%= link_to 'New event', new_event_path %> |
diff --git a/app/views/events/new.html.erb b/app/views/events/new.html.erb index 8c9812e..cd892c5 100644 --- a/app/views/events/new.html.erb +++ b/app/views/events/new.html.erb | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | <h1>New event</h1> | 1 | <h1>New event</h1> |
| 2 | 2 | ||
| 3 | <% form_for(@event) do |f| %> | 3 | <%= form_for(@event) do |f| %> |
| 4 | <%= f.error_messages %> | 4 | <%= form_error_messages(f) %> |
| 5 | 5 | ||
| 6 | <p> | 6 | <p> |
| 7 | <%= f.label :start_time %><br /> | 7 | <%= f.label :start_time %><br /> |
| @@ -43,4 +43,4 @@ | |||
| 43 | </p> | 43 | </p> |
| 44 | <% end %> | 44 | <% end %> |
| 45 | 45 | ||
| 46 | <%= link_to 'Back', events_path %> \ No newline at end of file | 46 | <%= link_to 'Back', events_path %> |
diff --git a/app/views/layouts/admin.html.erb b/app/views/layouts/admin.html.erb index 97b81df..890aeaa 100644 --- a/app/views/layouts/admin.html.erb +++ b/app/views/layouts/admin.html.erb | |||
| @@ -4,16 +4,15 @@ | |||
| 4 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | 4 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> |
| 5 | <head> | 5 | <head> |
| 6 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> | 6 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> |
| 7 | <%= csrf_meta_tags %> | ||
| 7 | 8 | ||
| 8 | <title><%= "#{params[:controller]} | #{params[:action]}" %></title> | 9 | <title><%= "#{params[:controller]} | #{params[:action]}" %></title> |
| 9 | <%= javascript_include_tag 'jquery-1.3.2.min' %> | ||
| 10 | <%= javascript_include_tag 'jquery-ui-1.7.2.custom.min' %> | ||
| 11 | <%= javascript_include_tag 'jquery.hotkeys' %> | ||
| 12 | <%= javascript_include_tag 'tiny_mce/jquery.tinymce.js' %> | ||
| 13 | <%= javascript_tag "var AUTH_TOKEN = #{form_authenticity_token.inspect};" if protect_against_forgery? %> | 10 | <%= javascript_tag "var AUTH_TOKEN = #{form_authenticity_token.inspect};" if protect_against_forgery? %> |
| 14 | <%= stylesheet_link_tag 'admin' %> | 11 | <%= javascript_include_tag 'admin_bundle' %> |
| 15 | <%= javascript_include_tag 'admin_search.js' %> | 12 | <%= tinymce_assets %> |
| 16 | <%= javascript_include_tag 'admin_interface.js' %> | 13 | <link rel="stylesheet" href="/stylesheets/admin.css"> |
| 14 | <script src="/javascripts/admin_search.js"></script> | ||
| 15 | <script src="/javascripts/admin_interface.js"></script> | ||
| 17 | </head> | 16 | </head> |
| 18 | 17 | ||
| 19 | <body> | 18 | <body> |
| @@ -34,7 +33,7 @@ | |||
| 34 | <% end %> | 33 | <% end %> |
| 35 | </div> | 34 | </div> |
| 36 | <div id="content"> | 35 | <div id="content"> |
| 37 | <%= yield :layout %> | 36 | <%= yield %> |
| 38 | </div> | 37 | </div> |
| 39 | 38 | ||
| 40 | <div id="results"></div> | 39 | <div id="results"></div> |
diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 3c95d75..48e0a5b 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb | |||
| @@ -1,47 +1,74 @@ | |||
| 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | 1 | <!DOCTYPE HTML> |
| 2 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | ||
| 3 | 2 | ||
| 4 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | 3 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> |
| 5 | <head> | 4 | <head> |
| 6 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> | 5 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> |
| 6 | <meta name="viewport" content="width=device-width,initial-scale=1"/> | ||
| 7 | <meta name="description" content="Der Chaos Computer Club ist eine galaktische Gemeinschaft von Lebewesen für Informationsfreiheit und Technikfolgenabschätzung."/> | ||
| 8 | |||
| 9 | <meta property="og:image" content="https://www.ccc.de/images/chaosknoten.svg" /> | ||
| 10 | <meta property="og:description" content="Der Chaos Computer Club ist eine galaktische Gemeinschaft von Lebewesen für Informationsfreiheit und Technikfolgenabschätzung." /> | ||
| 7 | 11 | ||
| 8 | <title><%= page_title %></title> | 12 | <title><%= page_title %></title> |
| 9 | <%= stylesheet_link_tag "ccc" %> | 13 | <link rel="stylesheet" href="/stylesheets/ccc.css"> |
| 10 | <%= javascript_include_tag 'jquery-1.3.2.min' %> | 14 | <script src="/javascripts/jquery-1.3.2.min.js"></script> |
| 11 | <%= javascript_include_tag 'shadowbox/shadowbox' %> | 15 | <script src="/javascripts/shadowbox/shadowbox.js"></script> |
| 12 | <%= stylesheet_link_tag "shadowbox" %> | 16 | <link rel="stylesheet" href="/stylesheets/shadowbox.css"> |
| 13 | <%= javascript_include_tag 'public' %> | 17 | <script src="/javascripts/public.js"></script> |
| 18 | |||
| 19 | <%= auto_discovery_link_tag(:atom, '/rss/updates.xml', title: "ATOM") %> | ||
| 20 | <%= auto_discovery_link_tag(:rss, '/rss/updates.rdf', title: "RSS") %> | ||
| 21 | |||
| 22 | <script> | ||
| 23 | (function() { document.addEventListener("DOMContentLoaded", function() { | ||
| 24 | if (localStorage.getItem('override-prefers-color-scheme', false)) | ||
| 25 | document.getElementById("light-mode").checked = true; | ||
| 26 | }); })(); | ||
| 27 | </script> | ||
| 14 | 28 | ||
| 15 | <%= auto_discovery_link_tag(:atom, {:locale => :de, :controller => "rss", :action => "updates", :format => :xml}) %> | ||
| 16 | <%= auto_discovery_link_tag(:rss, {:locale => :de, :controller => "rss", :action => "updates", :format => :rdf}) %> | ||
| 17 | </head> | 29 | </head> |
| 18 | 30 | ||
| 19 | <body> | 31 | <body lang="<%= @page ? @page.effective_lang : 'de' %>"> |
| 20 | <div id="wrapper"> | 32 | <div id="wrapper"> |
| 21 | <div id="header"> | 33 | <div id="header"> |
| 22 | <%= link_to_path(image_tag("header.png"), "/home") %> | 34 | <img src="/images/header.png" alt=""> |
| 23 | </div> | 35 | </div> |
| 24 | <div id="search"> | 36 | <div id="toolbox"> |
| 25 | <%= render :partial => "content/search" %> | 37 | <div id="search"> |
| 38 | <%= render :partial => "content/search" %> | ||
| 39 | </div> | ||
| 40 | <div id="light-mode-div"> | ||
| 41 | <input id="light-mode" type="checkbox" aria-label="Switch between dark and light mode" /><label for="light-mode"><span class="hide-me">lights</span></label> | ||
| 42 | </div> | ||
| 43 | <div id="burger-div"> | ||
| 44 | <input type="checkbox" id="menu-toggle" class="menu-checkbox"> | ||
| 45 | <label for="menu-toggle" class="burger-menu"><span></span><span></span><span></span></label> | ||
| 46 | </div> | ||
| 26 | </div> | 47 | </div> |
| 27 | <div id="left_column"> | 48 | <div id="left_column"> |
| 28 | <%= main_menu %> | 49 | <%= main_menu %> |
| 29 | 50 | ||
| 30 | <%= language_selector %> | ||
| 31 | <% if current_user && @page.node %> | 51 | <% if current_user && @page.node %> |
| 32 | <%= link_to "Edit", node_path(:id => @page.node) %> | 52 | <div class="main_navigation"> |
| 53 | <h2>Admin</h2> | ||
| 54 | <ul> | ||
| 55 | <li><%= link_to raw('<span class="inactive admin_edit_link">⚙️ Overview</span>'), admin_path %></li> | ||
| 56 | <li><%= link_to raw('<span class="inactive admin_edit_link">✎ Edit</span>'), node_path(@page.node) %></li> | ||
| 57 | </ul> | ||
| 58 | </div> | ||
| 33 | <% end %> | 59 | <% end %> |
| 34 | 60 | ||
| 35 | <%= calendar %> | 61 | <%= calendar %> |
| 36 | </div> | 62 | </div> |
| 37 | <div id="center_column"> | 63 | <div id="center_column"> |
| 38 | <%= yield :layout %> | 64 | <%= yield :layout %> |
| 39 | |||
| 40 | <div id="footer"> | 65 | <div id="footer"> |
| 41 | <br /> | 66 | <br /> |
| 42 | <br /> | ||
| 43 | <p style="text-align: center"> | 67 | <p style="text-align: center"> |
| 44 | <%= link_to t(:sponsors), content_path("sponsors") %> | 68 | <%= link_to "Impressum", content_path("imprint") %> |
| 69 | <%= link_to "Datenschutz", content_path("datenschutz") %> | ||
| 70 | <%= language_selector %> | ||
| 71 | <!-- %= link_to t(:sponsors), content_path("sponsors") % --> | ||
| 45 | </p> | 72 | </p> |
| 46 | </div> | 73 | </div> |
| 47 | </div> | 74 | </div> |
| @@ -50,5 +77,6 @@ | |||
| 50 | <%= featured_articles %> | 77 | <%= featured_articles %> |
| 51 | </div> | 78 | </div> |
| 52 | </div> | 79 | </div> |
| 80 | |||
| 53 | </body> | 81 | </body> |
| 54 | </html> \ No newline at end of file | 82 | </html> |
diff --git a/app/views/layouts/pages.html.erb b/app/views/layouts/pages.html.erb index 327e0eb..70ceece 100644 --- a/app/views/layouts/pages.html.erb +++ b/app/views/layouts/pages.html.erb | |||
| @@ -4,6 +4,8 @@ | |||
| 4 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | 4 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> |
| 5 | <head> | 5 | <head> |
| 6 | <meta http-equiv="content-type" content="text/html;charset=UTF-8" /> | 6 | <meta http-equiv="content-type" content="text/html;charset=UTF-8" /> |
| 7 | <meta name="viewport" content="width=device-width,initial-scale=1" /> | ||
| 8 | <meta property="og:image" content="https://www.ccc.de/images/chaosknoten.svg" /> | ||
| 7 | <title>Pages: <%= controller.action_name %></title> | 9 | <title>Pages: <%= controller.action_name %></title> |
| 8 | <%= stylesheet_link_tag 'scaffold' %> | 10 | <%= stylesheet_link_tag 'scaffold' %> |
| 9 | </head> | 11 | </head> |
diff --git a/app/views/menu_items/edit.html.erb b/app/views/menu_items/edit.html.erb index 9ea0fcc..9891708 100644 --- a/app/views/menu_items/edit.html.erb +++ b/app/views/menu_items/edit.html.erb | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | <h1>Edit Menu Item</h1> | 1 | <h1>Edit Menu Item</h1> |
| 2 | 2 | ||
| 3 | <% form_for @menu_item do |f| %> | 3 | <%= form_for @menu_item do |f| %> |
| 4 | <table> | 4 | <table> |
| 5 | 5 | ||
| 6 | <tr> | 6 | <tr> |
| @@ -29,4 +29,4 @@ | |||
| 29 | <td class="right"><%= f.submit 'Update' %></td> | 29 | <td class="right"><%= f.submit 'Update' %></td> |
| 30 | </tr> | 30 | </tr> |
| 31 | </table> | 31 | </table> |
| 32 | <% end %> \ No newline at end of file | 32 | <% end %> |
diff --git a/app/views/menu_items/index.html.erb b/app/views/menu_items/index.html.erb index 123a07a..c52c150 100644 --- a/app/views/menu_items/index.html.erb +++ b/app/views/menu_items/index.html.erb | |||
| @@ -14,13 +14,10 @@ | |||
| 14 | <td class="menu_item_title"><%= menu_item.title %></td> | 14 | <td class="menu_item_title"><%= menu_item.title %></td> |
| 15 | <td><%= link_to "Edit", edit_menu_item_path(menu_item) %></td> | 15 | <td><%= link_to "Edit", edit_menu_item_path(menu_item) %></td> |
| 16 | <td> | 16 | <td> |
| 17 | <%= link_to( | 17 | <%= button_to "Delete", menu_item_path(menu_item), |
| 18 | "Delete", | 18 | method: :delete, |
| 19 | menu_item_path(menu_item), | 19 | form: { data: { confirm: "Are you sure?" } } %> |
| 20 | :method => :delete, | ||
| 21 | :confirm => "Are you sure?" | ||
| 22 | ) %> | ||
| 23 | </td> | 20 | </td> |
| 24 | </tr> | 21 | </tr> |
| 25 | <% end %> | 22 | <% end %> |
| 26 | </table> \ No newline at end of file | 23 | </table> |
diff --git a/app/views/menu_items/new.html.erb b/app/views/menu_items/new.html.erb index 64b9abb..68081d0 100644 --- a/app/views/menu_items/new.html.erb +++ b/app/views/menu_items/new.html.erb | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | <h1>Add Menu Item</h1> | 1 | <h1>Add Menu Item</h1> |
| 2 | 2 | ||
| 3 | <% form_for @menu_item do |f| %> | 3 | <%= form_for @menu_item do |f| %> |
| 4 | <table> | 4 | <table> |
| 5 | 5 | ||
| 6 | <tr> | 6 | <tr> |
| @@ -29,4 +29,4 @@ | |||
| 29 | <td class="right"><%= f.submit 'Create' %></td> | 29 | <td class="right"><%= f.submit 'Create' %></td> |
| 30 | </tr> | 30 | </tr> |
| 31 | </table> | 31 | </table> |
| 32 | <% end %> \ No newline at end of file | 32 | <% end %> |
diff --git a/app/views/nodes/edit.html.erb b/app/views/nodes/edit.html.erb index 8e27d0f..b45c700 100644 --- a/app/views/nodes/edit.html.erb +++ b/app/views/nodes/edit.html.erb | |||
| @@ -2,109 +2,89 @@ | |||
| 2 | <%= link_to 'metadata', '#', :id => 'button', :class => "unselected" %> | 2 | <%= link_to 'metadata', '#', :id => 'button', :class => "unselected" %> |
| 3 | <%= link_to 'Show', @node %> | 3 | <%= link_to 'Show', @node %> |
| 4 | <%= link_to 'Preview', preview_page_path(@draft) %> | 4 | <%= link_to 'Preview', preview_page_path(@draft) %> |
| 5 | <%= link_to 'Publish', publish_node_path, :method => :put, :confirm => "Publish this draft?" %> | 5 | <%= button_to 'Publish', publish_node_path(@node), method: :put, form: { data: { confirm: "Publish this draft?" } } %> |
| 6 | <%= link_to 'Revisions', node_revisions_path(@node) %> | 6 | <%= link_to 'Revisions', node_revisions_path(@node) %> |
| 7 | <% end %> | 7 | <% end %> |
| 8 | 8 | ||
| 9 | <div id="page_editor"> | 9 | <div id="page_editor"> |
| 10 | <% form_for(@node) do |f| %> | 10 | <%= form_for(@node) do |f| %> |
| 11 | <%= f.error_messages %> | 11 | <% if @node.errors.any? %> |
| 12 | <div class="error_messages"> | ||
| 13 | <ul><% @node.errors.full_messages.each do |msg| %><li><%= msg %></li><% end %></ul> | ||
| 14 | </div> | ||
| 15 | <% end %> | ||
| 12 | 16 | ||
| 13 | <div id="metadata"> | 17 | <div id="metadata"> |
| 14 | <table> | 18 | <div class="node_description">Event</div> |
| 15 | <tr> | 19 | <div class="node_content"><%= event_information %></div> |
| 16 | <td class="description">Event</td> | 20 | |
| 17 | <td><%= event_information %></td> | 21 | <div class="node_description">Slug</div> |
| 18 | </tr> | 22 | <div class="node_content"> |
| 19 | <tr> | 23 | <%= f.text_field( |
| 20 | <td class="description">Slug</td> | 24 | :staged_slug, :value => @node.staged_slug || @node.slug |
| 21 | <td> | 25 | ) |
| 22 | <%= | 26 | %> |
| 23 | f.text_field( | 27 | </div> |
| 24 | :staged_slug, :value => @node.staged_slug || @node.slug | 28 | |
| 25 | ) | 29 | <div class="node_description">parent</div> |
| 26 | %> | 30 | <div class="node_content"> |
| 27 | </td> | 31 | <%= text_field_tag :move_to_search_term, @node.parent.title rescue "" %> |
| 28 | </tr> | 32 | <div id="search_results"> |
| 29 | <tr> | ||
| 30 | <td class="description">parent</td> | ||
| 31 | <td> | ||
| 32 | <%= text_field_tag :move_to_search_term, @node.parent.title rescue "" %> | ||
| 33 | <div id="search_results"> | ||
| 34 | 33 | ||
| 35 | </div> | 34 | </div> |
| 36 | <%= f.hidden_field( | 35 | <%= f.hidden_field( |
| 37 | :staged_parent_id, | 36 | :staged_parent_id, |
| 38 | :value => @node.staged_parent_id || @node.parent_id | 37 | :value => @node.staged_parent_id || @node.parent_id |
| 39 | ) | 38 | ) |
| 40 | %> | 39 | %> |
| 41 | </td> | 40 | </div> |
| 42 | </tr> | ||
| 43 | 41 | ||
| 44 | <% fields_for @draft do |d| %> | 42 | <%= fields_for @draft do |d| %> |
| 45 | <tr> | 43 | <div class="node_description">Tags - comma seperated</div> |
| 46 | <td class="description">Tags - comma seperated</td> | 44 | <div class="node_content"><%= text_field_tag :tag_list, @draft.tag_list %></div> |
| 47 | <td><%= text_field_tag :tag_list, @draft.tag_list %></td> | 45 | |
| 48 | </tr> | 46 | <div class="node_description">Publish at</div> |
| 49 | <tr> | 47 | <div class="node_content"><%= d.datetime_select :published_at, :value => @draft.published_at %></div> |
| 50 | <td class="description">Publish at</td> | 48 | |
| 51 | <td><%= d.datetime_select :published_at, :value => @draft.published_at %></td> | 49 | <div class="node_description">Template</div> |
| 52 | </tr> | 50 | <div class="node_content"><%= d.select :template_name, custom_page_templates, {:prompt => 'Select Template'} %></div> |
| 53 | <tr> | 51 | |
| 54 | <td class="description">Template</td> | 52 | <div class="node_description">Author</div> |
| 55 | <td><%= d.select :template_name, custom_page_templates, {:prompt => 'Select Template'} %></td> | 53 | <div class="node_content"><%= d.select :user_id, user_list %></div> |
| 56 | </tr> | 54 | |
| 57 | <tr> | 55 | <div class="node_description">Images</div> |
| 58 | <td class="description">Author</td> | 56 | <div class="node_content"> |
| 59 | <td><%= d.select :user_id, user_list %></td> | 57 | <ul id="image_box" rel="<%= @draft.id %>"> |
| 60 | </tr> | 58 | <% @draft.assets.images.each do |image| %> |
| 61 | <tr> | 59 | <li rel="images_<%= image.id %>"> |
| 62 | <td class="description">Images</td> | 60 | <%= image_tag(image.upload.url(:thumb)) %> |
| 63 | <td> | 61 | </li> |
| 64 | <ul id="image_box" rel="<%= @draft.id %>"> | 62 | <% end %> |
| 65 | <% @draft.assets.images.each do |image| %> | 63 | </ul> |
| 66 | <li rel="images_<%= image.id %>"> | 64 | <div class="clear_left right"> |
| 67 | <%= image_tag(image.upload.url(:thumb)) %> | 65 | <a id="image_browser_toggle" class="unselected" href="#">image browser</a> |
| 68 | </li> | 66 | </div> |
| 69 | <% end %> | 67 | <div id="image_browser"> |
| 70 | </ul> | 68 | <ul> |
| 71 | <div class="clear_left right"> | 69 | <% Asset.images.each do |image| %> |
| 72 | <a id="image_browser_toggle" class="unselected" href="#">image browser</a> | 70 | <li rel="images_<%= image.id %>"><%= image_tag(image.upload.url(:thumb)) %></li> |
| 73 | </div> | 71 | <% end %> |
| 74 | <div id="image_browser"> | 72 | </ul> |
| 75 | <ul> | 73 | </div> |
| 76 | <% Asset.images.each do |image| %> | 74 | </div> |
| 77 | <li rel="images_<%= image.id %>"><%= image_tag(image.upload.url(:thumb)) %></li> | ||
| 78 | <% end %> | ||
| 79 | </ul> | ||
| 80 | </div> | ||
| 81 | </td> | ||
| 82 | </tr> | ||
| 83 | </table> | ||
| 84 | </div> | 75 | </div> |
| 85 | 76 | ||
| 86 | <table id="content"> | 77 | <div id="content"> |
| 87 | <tr> | 78 | <div class="node_description">Title</div> |
| 88 | <th class="description"></th> | 79 | <div class="node_content"><%= d.text_field :title %></div> |
| 89 | <th class="content"></th> | 80 | |
| 90 | </tr> | 81 | <div class="node_description">Abstract</div> |
| 91 | <tr> | 82 | <div class="node_content"><%= d.text_area :abstract %></div> |
| 92 | <td class="description">Title</td> | 83 | |
| 93 | <td><%= d.text_field :title %></td> | 84 | <div class="node_description">Body</div> |
| 94 | </tr> | 85 | <div class="node_content"><%= d.text_area :body, :class => 'with_editor' %></div> |
| 95 | <tr> | 86 | |
| 96 | <td class="description">Abstract</td> | 87 | <div><%= d.submit 'save' %></div> |
| 97 | <td><%= d.text_area :abstract %></td> | ||
| 98 | </tr> | ||
| 99 | <tr> | ||
| 100 | <td class="description">Body</td> | ||
| 101 | <td><%= d.text_area :body, :class => 'with_editor' %></td> | ||
| 102 | </tr> | ||
| 103 | <tr> | ||
| 104 | <td></td> | ||
| 105 | <td class="right"><%= d.submit 'save' %></td> | ||
| 106 | </tr> | ||
| 107 | </table> | ||
| 108 | <% end %> | 88 | <% end %> |
| 109 | <% end %> | 89 | <% end %> |
| 110 | </div> \ No newline at end of file | 90 | </div> |
diff --git a/app/views/nodes/index.html.erb b/app/views/nodes/index.html.erb index bf01645..e5a55d4 100644 --- a/app/views/nodes/index.html.erb +++ b/app/views/nodes/index.html.erb | |||
| @@ -27,7 +27,7 @@ | |||
| 27 | <%= node.lock_owner.login if node.lock_owner %> | 27 | <%= node.lock_owner.login if node.lock_owner %> |
| 28 | </td> | 28 | </td> |
| 29 | <td> | 29 | <td> |
| 30 | <%= node.draft ? node.draft.revision : node.head.revision %> | 30 | <%= node.draft ? node.draft.revision : (node.head ? node.head.revision : "EMPTY") %> |
| 31 | </td> | 31 | </td> |
| 32 | </tr> | 32 | </tr> |
| 33 | <% end %> | 33 | <% end %> |
diff --git a/app/views/nodes/new.html.erb b/app/views/nodes/new.html.erb index 850207b..028d727 100644 --- a/app/views/nodes/new.html.erb +++ b/app/views/nodes/new.html.erb | |||
| @@ -1,11 +1,14 @@ | |||
| 1 | <h1>Create new node</h1> | 1 | <h1>Create new node</h1> |
| 2 | 2 | ||
| 3 | <%= error_messages_for( :node ).gsub("Slug", "Title") %> | 3 | <% if @node.errors.any? %> |
| 4 | 4 | <div class="error_messages"> | |
| 5 | <ul><% @node.errors.full_messages.each do |msg| %><li><%= msg.to_s.gsub("Slug", "Title") %></li><% end %></ul> | ||
| 6 | </div> | ||
| 7 | <% end %> | ||
| 5 | 8 | ||
| 6 | <p>What kind of node do you want to create?</p> | 9 | <p>What kind of node do you want to create?</p> |
| 7 | 10 | ||
| 8 | <% form_tag nodes_path do %> | 11 | <%= form_tag nodes_path do %> |
| 9 | <table id="new_node"> | 12 | <table id="new_node"> |
| 10 | <tr> | 13 | <tr> |
| 11 | <td class="description">Type</td> | 14 | <td class="description">Type</td> |
| @@ -20,7 +23,11 @@ | |||
| 20 | </p> | 23 | </p> |
| 21 | <p> | 24 | <p> |
| 22 | <%= radio_button_tag :kind, "update" %> | 25 | <%= radio_button_tag :kind, "update" %> |
| 23 | Update / Press release ( is automatically created in /updates ) | 26 | Update ( is automatically created in /updates/<%= Time.now.year.to_s %>/ and gets tag "update" ) |
| 27 | </p> | ||
| 28 | <p> | ||
| 29 | <%= radio_button_tag :kind, "press_release" %> | ||
| 30 | Pressemitteilung ( is automatically created in /updates/<%= Time.now.year.to_s %>/ and gets tags "update, pressemitteilung" ) | ||
| 24 | </p> | 31 | </p> |
| 25 | </td> | 32 | </td> |
| 26 | </tr> | 33 | </tr> |
| @@ -31,8 +38,8 @@ | |||
| 31 | <tr id="parent_search_field"> | 38 | <tr id="parent_search_field"> |
| 32 | <td class="description">Parent</td> | 39 | <td class="description">Parent</td> |
| 33 | <td> | 40 | <td> |
| 34 | <%= text_field_tag :parent_search_term %> | 41 | <%= text_field_tag :parent_search_term, @parent_name %> |
| 35 | <%= hidden_field_tag :parent_id %> | 42 | <%= hidden_field_tag :parent_id, @parent_id %> |
| 36 | <div id="search_results"> | 43 | <div id="search_results"> |
| 37 | 44 | ||
| 38 | </div> | 45 | </div> |
| @@ -43,4 +50,4 @@ | |||
| 43 | <td class="right"><%= submit_tag "Create" %></td> | 50 | <td class="right"><%= submit_tag "Create" %></td> |
| 44 | </tr> | 51 | </tr> |
| 45 | </table> | 52 | </table> |
| 46 | <% end %> \ No newline at end of file | 53 | <% end %> |
diff --git a/app/views/nodes/update.js.erb b/app/views/nodes/update.js.erb index be26fab..35dfeee 100644 --- a/app/views/nodes/update.js.erb +++ b/app/views/nodes/update.js.erb | |||
| @@ -1,3 +1,5 @@ | |||
| 1 | $("#flash").html( | 1 | <% if flash[:notice] %> |
| 2 | "<span><%= escape_javascript(flash.delete(:notice)) %></span>" | 2 | $("#flash").html( |
| 3 | ); \ No newline at end of file | 3 | "<span><%= escape_javascript(flash.delete(:notice)) %></span>" |
| 4 | ); | ||
| 5 | <% end %> | ||
diff --git a/app/views/occurrences/edit.html.erb b/app/views/occurrences/edit.html.erb index 6a81188..aa4f6e0 100644 --- a/app/views/occurrences/edit.html.erb +++ b/app/views/occurrences/edit.html.erb | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | <h1>Editing occurrence</h1> | 1 | <h1>Editing occurrence</h1> |
| 2 | 2 | ||
| 3 | <% form_for(@occurrence) do |f| %> | 3 | <%= form_for(@occurrence) do |f| %> |
| 4 | <%= f.error_messages %> | 4 | <%= form_error_messages(f) %> |
| 5 | 5 | ||
| 6 | <p> | 6 | <p> |
| 7 | <%= f.label :summary %><br /> | 7 | <%= f.label :summary %><br /> |
| @@ -29,4 +29,4 @@ | |||
| 29 | <% end %> | 29 | <% end %> |
| 30 | 30 | ||
| 31 | <%= link_to 'Show', @occurrence %> | | 31 | <%= link_to 'Show', @occurrence %> | |
| 32 | <%= link_to 'Back', occurrences_path %> \ No newline at end of file | 32 | <%= link_to 'Back', occurrences_path %> |
diff --git a/app/views/occurrences/index.html.erb b/app/views/occurrences/index.html.erb index 06dbf07..0e99857 100644 --- a/app/views/occurrences/index.html.erb +++ b/app/views/occurrences/index.html.erb | |||
| @@ -18,11 +18,11 @@ | |||
| 18 | <td><%=h occurrence.event_id %></td> | 18 | <td><%=h occurrence.event_id %></td> |
| 19 | <td><%= link_to 'Show', occurrence %></td> | 19 | <td><%= link_to 'Show', occurrence %></td> |
| 20 | <td><%= link_to 'Edit', edit_occurrence_path(occurrence) %></td> | 20 | <td><%= link_to 'Edit', edit_occurrence_path(occurrence) %></td> |
| 21 | <td><%= link_to 'Destroy', occurrence, :confirm => 'Are you sure?', :method => :delete %></td> | 21 | <td><%= button_to 'Destroy', occurrence, method: :delete, form: { data: { confirm: 'Are you sure?' } } %></td> |
| 22 | </tr> | 22 | </tr> |
| 23 | <% end %> | 23 | <% end %> |
| 24 | </table> | 24 | </table> |
| 25 | 25 | ||
| 26 | <br /> | 26 | <br /> |
| 27 | 27 | ||
| 28 | <%= link_to 'New occurrence', new_occurrence_path %> \ No newline at end of file | 28 | <%= link_to 'New occurrence', new_occurrence_path %> |
diff --git a/app/views/occurrences/new.html.erb b/app/views/occurrences/new.html.erb index 0a77af1..c05ce40 100644 --- a/app/views/occurrences/new.html.erb +++ b/app/views/occurrences/new.html.erb | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | <h1>New occurrence</h1> | 1 | <h1>New occurrence</h1> |
| 2 | 2 | ||
| 3 | <% form_for(@occurrence) do |f| %> | 3 | <%= form_for(@occurrence) do |f| %> |
| 4 | <%= f.error_messages %> | 4 | <%= form_error_messages(f) %> |
| 5 | 5 | ||
| 6 | <p> | 6 | <p> |
| 7 | <%= f.label :summary %><br /> | 7 | <%= f.label :summary %><br /> |
| @@ -28,4 +28,4 @@ | |||
| 28 | </p> | 28 | </p> |
| 29 | <% end %> | 29 | <% end %> |
| 30 | 30 | ||
| 31 | <%= link_to 'Back', occurrences_path %> \ No newline at end of file | 31 | <%= link_to 'Back', occurrences_path %> |
diff --git a/app/views/pages/edit.html.erb b/app/views/pages/edit.html.erb index 749d7e3..8b1242c 100644 --- a/app/views/pages/edit.html.erb +++ b/app/views/pages/edit.html.erb | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | <h1>Editing page</h1> | 1 | <h1>Editing page</h1> |
| 2 | 2 | ||
| 3 | <% form_for(@page) do |f| %> | 3 | <%= form_for(@page) do |f| %> |
| 4 | <%= f.error_messages %> | 4 | <%= form_error_messages(f) %> |
| 5 | 5 | ||
| 6 | <p> | 6 | <p> |
| 7 | <%= f.label :title %><br /> | 7 | <%= f.label :title %><br /> |
diff --git a/app/views/pages/index.html.erb b/app/views/pages/index.html.erb index 16539da..91e5359 100644 --- a/app/views/pages/index.html.erb +++ b/app/views/pages/index.html.erb | |||
| @@ -10,9 +10,9 @@ | |||
| 10 | <tr> | 10 | <tr> |
| 11 | <td><%=h page.node_id %></td> | 11 | <td><%=h page.node_id %></td> |
| 12 | <td><%=h page.title %></td> | 12 | <td><%=h page.title %></td> |
| 13 | <td><%= link_to 'Show', link_to_path(page.node.unique_path) %></td> | 13 | <td><%= link_to 'Show', content_path(:page_path => page.node.unique_path) %></td> |
| 14 | <td><%= link_to 'Edit', edit_page_path(page) %></td> | 14 | <td><%= link_to 'Edit', edit_page_path(page) %></td> |
| 15 | <td><%= link_to 'Destroy', page, :confirm => 'Are you sure?', :method => :delete %></td> | 15 | <td><%= button_to 'Destroy', page, method: :delete, form: { data: { confirm: 'Are you sure?' } } %></td> |
| 16 | </tr> | 16 | </tr> |
| 17 | <% end %> | 17 | <% end %> |
| 18 | </table> | 18 | </table> |
diff --git a/app/views/pages/new.html.erb b/app/views/pages/new.html.erb index b27dc62..2758faf 100644 --- a/app/views/pages/new.html.erb +++ b/app/views/pages/new.html.erb | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | <h1>New page</h1> | 1 | <h1>New page</h1> |
| 2 | 2 | ||
| 3 | <% form_for(@page) do |f| %> | 3 | <%= form_for(@page) do |f| %> |
| 4 | <%= f.error_messages %> | 4 | <%= form_error_messages(f) %> |
| 5 | 5 | ||
| 6 | <p> | 6 | <p> |
| 7 | <%= f.label :node_id %><br /> | 7 | <%= f.label :node_id %><br /> |
diff --git a/app/views/revisions/diff.html.erb b/app/views/revisions/diff.html.erb index f7ad79c..b8d061d 100644 --- a/app/views/revisions/diff.html.erb +++ b/app/views/revisions/diff.html.erb | |||
| @@ -5,7 +5,7 @@ | |||
| 5 | 5 | ||
| 6 | <h1>Revisions#diff</h1> | 6 | <h1>Revisions#diff</h1> |
| 7 | 7 | ||
| 8 | <% form_tag diff_node_revisions_path do %> | 8 | <%= form_tag diff_node_revisions_path do %> |
| 9 | <%= select_tag :start_revision, options_for_select(@node.pages.map{|x| x.revision}, params[:start_revision].to_i) %> | 9 | <%= select_tag :start_revision, options_for_select(@node.pages.map{|x| x.revision}, params[:start_revision].to_i) %> |
| 10 | <%= select_tag :end_revision, options_for_select(@node.pages.map{|x| x.revision}, params[:end_revision].to_i) %> | 10 | <%= select_tag :end_revision, options_for_select(@node.pages.map{|x| x.revision}, params[:end_revision].to_i) %> |
| 11 | <%= submit_tag 'Diff' %> | 11 | <%= submit_tag 'Diff' %> |
| @@ -38,7 +38,7 @@ | |||
| 38 | </div> | 38 | </div> |
| 39 | </pre> | 39 | </pre> |
| 40 | 40 | ||
| 41 | <%= javascript_include_tag 'cacycle_diff' %> | 41 | <script src="/javascripts/cacycle_diff.js"></script> |
| 42 | <script type="text/javascript" charset="utf-8"> | 42 | <script type="text/javascript" charset="utf-8"> |
| 43 | window.onload = function() { | 43 | window.onload = function() { |
| 44 | title1 = document.getElementById('start_title').innerHTML; | 44 | title1 = document.getElementById('start_title').innerHTML; |
| @@ -62,4 +62,4 @@ | |||
| 62 | 62 | ||
| 63 | <h3>Body</h3> | 63 | <h3>Body</h3> |
| 64 | <p id="diffview_body"></p> | 64 | <p id="diffview_body"></p> |
| 65 | </div> \ No newline at end of file | 65 | </div> |
diff --git a/app/views/revisions/index.html.erb b/app/views/revisions/index.html.erb index dc9ad51..b875a4f 100644 --- a/app/views/revisions/index.html.erb +++ b/app/views/revisions/index.html.erb | |||
| @@ -4,7 +4,6 @@ | |||
| 4 | 4 | ||
| 5 | <h2>Revisions for Node: <%= @node.unique_name %></h2> | 5 | <h2>Revisions for Node: <%= @node.unique_name %></h2> |
| 6 | 6 | ||
| 7 | <% form_tag diff_node_revisions_path(@node) do %> | ||
| 8 | <table id="revisions"> | 7 | <table id="revisions"> |
| 9 | <tr class="header"> | 8 | <tr class="header"> |
| 10 | <th>First</th> | 9 | <th>First</th> |
| @@ -14,8 +13,9 @@ | |||
| 14 | <th>Editor</th> | 13 | <th>Editor</th> |
| 15 | <th>Date</th> | 14 | <th>Date</th> |
| 16 | <th></th> | 15 | <th></th> |
| 16 | <th></th> | ||
| 17 | </tr> | 17 | </tr> |
| 18 | <% @node.pages.reverse.each do |page| %> | 18 | <% (@pages || @node.pages.all).reverse.each do |page| %> |
| 19 | <tr> | 19 | <tr> |
| 20 | <td><%= radio_button_tag :start_revision, page.revision %></td> | 20 | <td><%= radio_button_tag :start_revision, page.revision %></td> |
| 21 | <td><%= radio_button_tag :end_revision, page.revision %></td> | 21 | <td><%= radio_button_tag :end_revision, page.revision %></td> |
| @@ -23,22 +23,36 @@ | |||
| 23 | <td class="title"><%= page.title %></td> | 23 | <td class="title"><%= page.title %></td> |
| 24 | <td class="user"><%= page.editor.try(:login) %></td> | 24 | <td class="user"><%= page.editor.try(:login) %></td> |
| 25 | <td class="date"><%= page.updated_at %></td> | 25 | <td class="date"><%= page.updated_at %></td> |
| 26 | <td><%= link_to 'show', node_revision_path(@node, page) %></td> | ||
| 26 | <td> | 27 | <td> |
| 27 | <%= link_to 'show', node_revision_path(@node, page) %> | 28 | <%= button_to 'restore', restore_node_revision_path(@node, page), |
| 28 | </td> | 29 | method: :put, |
| 29 | <td> | 30 | form: { data: { confirm: "Restore this revision?" } } %> |
| 30 | <%= link_to( | ||
| 31 | 'restore', | ||
| 32 | restore_node_revision_path(@node, page), | ||
| 33 | :method => :put, | ||
| 34 | :confirm => "Restore this revision?" | ||
| 35 | ) %> | ||
| 36 | </td> | 31 | </td> |
| 37 | </tr> | 32 | </tr> |
| 38 | <% end %> | 33 | <% end %> |
| 39 | <tr class="no_hover"> | 34 | <tr class="no_hover"> |
| 40 | <td colspan="8" class="right"><%= submit_tag 'Diff revisions' %></td> | 35 | <td colspan="8" class="right"> |
| 36 | <%= button_to 'Diff revisions', diff_node_revisions_path(@node), | ||
| 37 | method: :post, | ||
| 38 | form: { id: 'diff_form' } %> | ||
| 39 | </td> | ||
| 41 | </tr> | 40 | </tr> |
| 42 | </table> | 41 | </table> |
| 43 | 42 | ||
| 44 | <% end %> \ No newline at end of file | 43 | <script> |
| 44 | document.getElementById('diff_form').addEventListener('submit', function(e) { | ||
| 45 | var start = document.querySelector('input[name="start_revision"]:checked'); | ||
| 46 | var end = document.querySelector('input[name="end_revision"]:checked'); | ||
| 47 | if (start) { | ||
| 48 | var s = document.createElement('input'); | ||
| 49 | s.type = 'hidden'; s.name = 'start_revision'; s.value = start.value; | ||
| 50 | this.appendChild(s); | ||
| 51 | } | ||
| 52 | if (end) { | ||
| 53 | var en = document.createElement('input'); | ||
| 54 | en.type = 'hidden'; en.name = 'end_revision'; en.value = end.value; | ||
| 55 | this.appendChild(en); | ||
| 56 | } | ||
| 57 | }); | ||
| 58 | </script> | ||
diff --git a/app/views/rss/recent_changes.xml.builder b/app/views/rss/recent_changes.xml.builder index c3b3ec9..cce3b5d 100644 --- a/app/views/rss/recent_changes.xml.builder +++ b/app/views/rss/recent_changes.xml.builder | |||
| @@ -2,19 +2,19 @@ xml.instruct! | |||
| 2 | 2 | ||
| 3 | xml.feed(:xmlns => "http://www.w3.org/2005/Atom", "xml:base" => @host) do | 3 | xml.feed(:xmlns => "http://www.w3.org/2005/Atom", "xml:base" => @host) do |
| 4 | xml.title("CCC.de Recent Change") | 4 | xml.title("CCC.de Recent Change") |
| 5 | xml.link(:href => "http://www.ccc.de/") | 5 | xml.link(:href => "https://www.ccc.de/") |
| 6 | xml.link(:rel => "self", :href => "/rss/updates.xml") | 6 | xml.link(:rel => "self", :href => "/rss/updates.xml") |
| 7 | xml.updated(@items.first.updated_at.xmlschema) | 7 | xml.updated(@items.first.updated_at.xmlschema) |
| 8 | xml.author do | 8 | xml.author do |
| 9 | xml.name("Chaos Computer Club e.V.") | 9 | xml.name("Chaos Computer Club e.V.") |
| 10 | end | 10 | end |
| 11 | xml.id("http://www.ccc.de/") | 11 | xml.id("https://www.ccc.de/") |
| 12 | 12 | ||
| 13 | @items.each do |item| | 13 | @items.each do |item| |
| 14 | xml.entry do | 14 | xml.entry do |
| 15 | xml.title(item.title) | 15 | xml.title(item.title) |
| 16 | xml.link( | 16 | xml.link( |
| 17 | :href => "http://www.ccc.de/#{item.node.unique_path}", | 17 | :href => "https://www.ccc.de/#{item.node.unique_path}", |
| 18 | :rel => "alternate" | 18 | :rel => "alternate" |
| 19 | ) | 19 | ) |
| 20 | xml.id(content_url_helper(item.node.unique_path)) | 20 | xml.id(content_url_helper(item.node.unique_path)) |
| @@ -26,4 +26,4 @@ xml.feed(:xmlns => "http://www.w3.org/2005/Atom", "xml:base" => @host) do | |||
| 26 | 26 | ||
| 27 | end | 27 | end |
| 28 | 28 | ||
| 29 | end \ No newline at end of file | 29 | end |
diff --git a/app/views/rss/updates.rdf.builder b/app/views/rss/updates.rdf.builder index 00b6242..b02d34f 100644 --- a/app/views/rss/updates.rdf.builder +++ b/app/views/rss/updates.rdf.builder | |||
| @@ -2,26 +2,26 @@ xml.instruct! | |||
| 2 | xml.tag!("rdf:RDF", "xmlns:rdf" => "http://www.w3.org/1999/02/22-rdf-syntax-ns#", "xmlns:dc" => "http://purl.org/dc/elements/1.1/", "xmlns" => "http://purl.org/rss/1.0/") do | 2 | xml.tag!("rdf:RDF", "xmlns:rdf" => "http://www.w3.org/1999/02/22-rdf-syntax-ns#", "xmlns:dc" => "http://purl.org/dc/elements/1.1/", "xmlns" => "http://purl.org/rss/1.0/") do |
| 3 | xml.tag!( "rdf:Description", "rdf:about" => "http://www.w3.org/TR/rdf-syntax-grammar", "dc:title"=>"RDF/XML Syntax Specification (Revised)") | 3 | xml.tag!( "rdf:Description", "rdf:about" => "http://www.w3.org/TR/rdf-syntax-grammar", "dc:title"=>"RDF/XML Syntax Specification (Revised)") |
| 4 | 4 | ||
| 5 | xml.channel do | 5 | xml.channel( "rdf:about" => "https://www.ccc.de/de/rss/updates.xml" ) do |
| 6 | xml.title("Chaos Computer Club: Updates") | 6 | xml.title("Chaos Computer Club: Updates") |
| 7 | xml.link("http://www.ccc.de") | 7 | xml.link("https://www.ccc.de") |
| 8 | xml.description("Kabelsalat ist gesund.") | 8 | xml.description("Kabelsalat ist gesund.") |
| 9 | xml.tag!("dc:date", @items.first.published_at.xmlschema) | 9 | xml.tag!("dc:date", @items.first.published_at.xmlschema) |
| 10 | end | 10 | end |
| 11 | 11 | ||
| 12 | xml.image( "rdf:about" => "http://www.ccc.de/images/chaosknoten.gif") do | 12 | xml.image( "rdf:about" => "https://www.ccc.de/images/chaosknoten.gif") do |
| 13 | xml.title("Chaos Computer Club (Chaosknoten)") | 13 | xml.title("Chaos Computer Club (Chaosknoten)") |
| 14 | xml.link("http://www.ccc.de") | 14 | xml.link("https://www.ccc.de") |
| 15 | xml.url("http://www.ccc.de/images/chaosknoten.gif") | 15 | xml.url("https://www.ccc.de/images/chaosknoten.gif") |
| 16 | end | 16 | end |
| 17 | 17 | ||
| 18 | @items.each do |item| | 18 | @items.each do |item| |
| 19 | xml.item("rdf:about" => content_url(:page_path => item.node.unique_path)) do | 19 | xml.item("rdf:about" => content_url(:page_path => item.node.unique_path)) do |
| 20 | xml.title(item.title) | 20 | xml.title(CGI.escapeHTML(item.title.to_s)) |
| 21 | xml.link(content_url(:page_path => item.node.unique_path)) | 21 | xml.link(content_url(:page_path => item.node.unique_path)) |
| 22 | xml.description(item.abstract) | 22 | xml.description(CGI.escapeHTML(item.abstract.to_s)) |
| 23 | xml.tag!("dc:creator", item.user.login) | 23 | xml.tag!("dc:creator", (item.user ? item.user.login : "CCC")) |
| 24 | xml.tag!("dc:date", item.published_at.xmlschema) | 24 | xml.tag!("dc:date", item.published_at.xmlschema) |
| 25 | end | 25 | end |
| 26 | end | 26 | end |
| 27 | end \ No newline at end of file | 27 | end |
diff --git a/app/views/rss/updates.xml.builder b/app/views/rss/updates.xml.builder index c09c9c9..4b2e2f7 100644 --- a/app/views/rss/updates.xml.builder +++ b/app/views/rss/updates.xml.builder | |||
| @@ -2,17 +2,17 @@ xml.instruct! | |||
| 2 | 2 | ||
| 3 | xml.feed(:xmlns => "http://www.w3.org/2005/Atom", "xml:base" => @host) do | 3 | xml.feed(:xmlns => "http://www.w3.org/2005/Atom", "xml:base" => @host) do |
| 4 | xml.title("Chaos Computer Club Updates") | 4 | xml.title("Chaos Computer Club Updates") |
| 5 | xml.link(:href => "http://www.ccc.de/") | 5 | xml.link(:href => "https://www.ccc.de/") |
| 6 | xml.link(:rel => "self", :href => "#{@host}/rss/updates") | 6 | xml.link(:rel => "self", :href => "#{@host}/rss/updates.xml") |
| 7 | xml.updated(@items.first.published_at.xmlschema) | 7 | xml.updated(@items.first.published_at.xmlschema) |
| 8 | xml.author do | 8 | xml.author do |
| 9 | xml.name("Chaos Computer Club e.V.") | 9 | xml.name("Chaos Computer Club e.V.") |
| 10 | end | 10 | end |
| 11 | xml.id("#{@host}/rss/updates") | 11 | xml.id("https://www.ccc.de/rss/updates") |
| 12 | 12 | ||
| 13 | @items.each do |item| | 13 | @items.each do |item| |
| 14 | xml.entry do | 14 | xml.entry do |
| 15 | xml.title(item.title) | 15 | xml.title(CGI.escapeHTML(item.title.to_s)) |
| 16 | xml.link( | 16 | xml.link( |
| 17 | :href => content_url(:page_path => item.node.unique_path), | 17 | :href => content_url(:page_path => item.node.unique_path), |
| 18 | :rel => "alternate", | 18 | :rel => "alternate", |
| @@ -21,6 +21,7 @@ xml.feed(:xmlns => "http://www.w3.org/2005/Atom", "xml:base" => @host) do | |||
| 21 | xml.id(content_url(:page_path => item.node.feed_id)) | 21 | xml.id(content_url(:page_path => item.node.feed_id)) |
| 22 | xml.updated(item.updated_at.xmlschema) | 22 | xml.updated(item.updated_at.xmlschema) |
| 23 | xml.published(item.published_at.xmlschema) | 23 | xml.published(item.published_at.xmlschema) |
| 24 | xml.summary(CGI.escapeHTML(item.abstract.to_s)) | ||
| 24 | xml.content(:type => "xhtml") do | 25 | xml.content(:type => "xhtml") do |
| 25 | xml.div(item.body, :xmlns => "http://www.w3.org/1999/xhtml") | 26 | xml.div(item.body, :xmlns => "http://www.w3.org/1999/xhtml") |
| 26 | end | 27 | end |
| @@ -28,4 +29,4 @@ xml.feed(:xmlns => "http://www.w3.org/2005/Atom", "xml:base" => @host) do | |||
| 28 | 29 | ||
| 29 | end | 30 | end |
| 30 | 31 | ||
| 31 | end \ No newline at end of file | 32 | end |
diff --git a/app/views/search/_search_result.html.erb b/app/views/search/_search_result.html.erb index 14898a2..6cd01f8 100644 --- a/app/views/search/_search_result.html.erb +++ b/app/views/search/_search_result.html.erb | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | <% if node.head %> | 1 | <% if node and node.head %> |
| 2 | <div class="article_partial"> | 2 | <div class="article_partial" lang="<%= node.head.effective_lang %>"> |
| 3 | <h2 class="headline"><%= link_to node.head.title, content_path(node.unique_path) %></h2> | 3 | <h2 class="headline"><%= link_to node.head.title, content_path(node.unique_path) %></h2> |
| 4 | <p class="excerpt"><%= node.head.abstract %></p> | 4 | <p class="excerpt"><%= node.head.abstract %></p> |
| 5 | </div> | 5 | </div> |
| 6 | <% end %> \ No newline at end of file | 6 | <% end %> |
diff --git a/app/views/sessions/new.html.erb b/app/views/sessions/new.html.erb index fef0912..3c10303 100644 --- a/app/views/sessions/new.html.erb +++ b/app/views/sessions/new.html.erb | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | <div id="login_form"> | 1 | <div id="login_form"> |
| 2 | <% form_tag session_path do -%> | 2 | <%= form_tag session_path do -%> |
| 3 | <table> | 3 | <table> |
| 4 | <tr> | 4 | <tr> |
| 5 | <td></td> | 5 | <td></td> |
| @@ -21,4 +21,4 @@ | |||
| 21 | </tr> | 21 | </tr> |
| 22 | </table> | 22 | </table> |
| 23 | <% end -%> | 23 | <% end -%> |
| 24 | </div> \ No newline at end of file | 24 | </div> |
diff --git a/app/views/users/_user.html.erb b/app/views/users/_user.html.erb index 8117bcd..ddb7afd 100644 --- a/app/views/users/_user.html.erb +++ b/app/views/users/_user.html.erb | |||
| @@ -7,13 +7,10 @@ | |||
| 7 | <%= link_to "edit", edit_user_path(user) %> | 7 | <%= link_to "edit", edit_user_path(user) %> |
| 8 | </td> | 8 | </td> |
| 9 | <td> | 9 | <td> |
| 10 | <%= link_to( | 10 | <%= button_to "destroy", user_path(user), |
| 11 | "destroy", | 11 | method: :delete, |
| 12 | user_path(user), | 12 | form: { data: { confirm: "Do you really want to delete user #{user.login}?" } } %> |
| 13 | :method => :delete, | ||
| 14 | :confirm => "Do you really want to delete user #{user.login}?" | ||
| 15 | ) %> | ||
| 16 | </td> | 13 | </td> |
| 17 | <% end %> | 14 | <% end %> |
| 18 | </tr> | 15 | </tr> |
| 19 | <% end %> \ No newline at end of file | 16 | <% end %> |
diff --git a/app/views/users/edit.html.erb b/app/views/users/edit.html.erb index 226e821..df1005b 100644 --- a/app/views/users/edit.html.erb +++ b/app/views/users/edit.html.erb | |||
| @@ -1,8 +1,13 @@ | |||
| 1 | <h1>Edit existing user</h1> | 1 | <h1>Edit existing user</h1> |
| 2 | 2 | ||
| 3 | <%= error_messages_for :user %> | 3 | <% if @user.errors.any? %> |
| 4 | <div class="error_messages"> | ||
| 5 | <ul><% @user.errors.full_messages.each do |msg| %><li><%= msg.gsub("Slug", "Title") %></li><% end %></ul> | ||
| 6 | </div> | ||
| 7 | <% end %> | ||
| 4 | 8 | ||
| 5 | <% form_for @user do |f| %> | 9 | |
| 10 | <%= form_for @user do |f| %> | ||
| 6 | <table id="new_node"> | 11 | <table id="new_node"> |
| 7 | <tr> | 12 | <tr> |
| 8 | <td class="description">Login</td> | 13 | <td class="description">Login</td> |
| @@ -31,4 +36,4 @@ | |||
| 31 | <td class="right"><%= f.submit "Update" %></td> | 36 | <td class="right"><%= f.submit "Update" %></td> |
| 32 | </tr> | 37 | </tr> |
| 33 | </table> | 38 | </table> |
| 34 | <% end %> \ No newline at end of file | 39 | <% end %> |
diff --git a/app/views/users/new.html.erb b/app/views/users/new.html.erb index 6990c27..6beda4f 100644 --- a/app/views/users/new.html.erb +++ b/app/views/users/new.html.erb | |||
| @@ -1,8 +1,13 @@ | |||
| 1 | <h1>Create new user</h1> | 1 | <h1>Create new user</h1> |
| 2 | 2 | ||
| 3 | <%= error_messages_for :user %> | 3 | <% if @user.errors.any? %> |
| 4 | <div class="error_messages"> | ||
| 5 | <ul><% @user.errors.full_messages.each do |msg| %><li><%= msg.gsub("Slug", "Title") %></li><% end %></ul> | ||
| 6 | </div> | ||
| 7 | <% end %> | ||
| 4 | 8 | ||
| 5 | <% form_for @user do |f| %> | 9 | |
| 10 | <%= form_for @user do |f| %> | ||
| 6 | <table id="new_node"> | 11 | <table id="new_node"> |
| 7 | <tr> | 12 | <tr> |
| 8 | <td class="description">Login</td> | 13 | <td class="description">Login</td> |
| @@ -29,4 +34,4 @@ | |||
| 29 | <td class="right"><%= f.submit "Create" %></td> | 34 | <td class="right"><%= f.submit "Create" %></td> |
| 30 | </tr> | 35 | </tr> |
| 31 | </table> | 36 | </table> |
| 32 | <% end %> \ No newline at end of file | 37 | <% end %> |
