diff options
| author | Charlie Root <root@web.ccc.local> | 2025-01-28 22:47:15 +0100 |
|---|---|---|
| committer | Charlie Root <root@web.ccc.local> | 2025-01-28 22:47:15 +0100 |
| commit | c4296b59a7f9d667d295f9c37b71f7849b818fb3 (patch) | |
| tree | ccbace3a183c075991a0dfeb1dd9e6f25e901cf3 /app | |
| parent | dfbaadf0210b02a8bb54380c2c50302413dcf6d6 (diff) | |
Big overhaul patch and style changes
Diffstat (limited to 'app')
25 files changed, 161 insertions, 97 deletions
diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb index 1d1a1ca..cdfe564 100644 --- a/app/controllers/admin_controller.rb +++ b/app/controllers/admin_controller.rb | |||
| @@ -20,13 +20,17 @@ class AdminController < ApplicationController | |||
| 20 | end | 20 | end |
| 21 | 21 | ||
| 22 | def search | 22 | def search |
| 23 | @results = Node.search params[:search_term] | 23 | @results = Node.search params[:search_term], :per_page => 1000 |
| 24 | 24 | ||
| 25 | respond_to do |format| | 25 | respond_to do |format| |
| 26 | format.html | 26 | format.html do |
| 27 | render :template => 'admin/search_results.html' | ||
| 28 | end | ||
| 27 | format.js do | 29 | format.js do |
| 28 | render( :json => @results.map do |node| | 30 | render( :json => @results.map do |node| |
| 29 | {:id => node.id, :title => node.title, :edit_path => node_path(node)} | 31 | if node |
| 32 | {:id => node.id, :title => node.title, :edit_path => node_path(node)} | ||
| 33 | end | ||
| 30 | end | 34 | end |
| 31 | ) | 35 | ) |
| 32 | 36 | ||
| @@ -46,7 +50,6 @@ class AdminController < ApplicationController | |||
| 46 | render :partial => 'admin/menu_search_results' | 50 | render :partial => 'admin/menu_search_results' |
| 47 | end | 51 | end |
| 48 | 52 | ||
| 49 | |||
| 50 | format.js do | 53 | format.js do |
| 51 | render( :json => @results.map do |node| | 54 | render( :json => @results.map do |node| |
| 52 | {:node_id => node.id, :title => node.title, :unique_name => node.unique_name} | 55 | {:node_id => node.id, :title => node.title, :unique_name => node.unique_name} |
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index bce0c71..89cd330 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb | |||
| @@ -2,20 +2,20 @@ | |||
| 2 | # Likewise, all the methods added will be available for all controllers. | 2 | # Likewise, all the methods added will be available for all controllers. |
| 3 | 3 | ||
| 4 | class ApplicationController < ActionController::Base | 4 | class ApplicationController < ActionController::Base |
| 5 | 5 | ||
| 6 | include ExceptionNotifiable | 6 | include ExceptionNotifiable |
| 7 | include AuthenticatedSystem | 7 | include AuthenticatedSystem |
| 8 | 8 | ||
| 9 | helper :all # include all helpers, all the time | 9 | helper :all # include all helpers, all the time |
| 10 | protect_from_forgery # See ActionController::RequestForgeryProtection for details | 10 | protect_from_forgery # See ActionController::RequestForgeryProtection for details |
| 11 | 11 | ||
| 12 | # Scrub sensitive parameters from your log | 12 | # Scrub sensitive parameters from your log |
| 13 | filter_parameter_logging :password, :password_confirmation | 13 | filter_parameter_logging :password, :password_confirmation |
| 14 | 14 | ||
| 15 | before_filter :set_locale | 15 | before_filter :set_locale |
| 16 | 16 | ||
| 17 | protected | 17 | protected |
| 18 | 18 | ||
| 19 | def set_locale | 19 | def set_locale |
| 20 | if params[:locale] && I18n.available_locales.include?(params[:locale].to_sym) | 20 | if params[:locale] && I18n.available_locales.include?(params[:locale].to_sym) |
| 21 | I18n.locale = params[:locale].to_sym | 21 | I18n.locale = params[:locale].to_sym |
diff --git a/app/controllers/content_controller.rb b/app/controllers/content_controller.rb index 1b13456..c62b726 100644 --- a/app/controllers/content_controller.rb +++ b/app/controllers/content_controller.rb | |||
| @@ -1,30 +1,30 @@ | |||
| 1 | class ContentController < ApplicationController | 1 | class ContentController < ApplicationController |
| 2 | 2 | ||
| 3 | # Public | 3 | # Public |
| 4 | 4 | ||
| 5 | before_filter :find_page | 5 | before_filter :find_page |
| 6 | 6 | ||
| 7 | # This is the method that renders most of the the public content. It recieves | 7 | # This is the method that renders most of the the public content. It recieves |
| 8 | # a :locale and a :page_path parameter through the params hash. It looks up | 8 | # a :locale and a :page_path parameter through the params hash. It looks up |
| 9 | # the node with the corresponding unique_name attribute. The method doesn't | 9 | # the node with the corresponding unique_name attribute. The method doesn't |
| 10 | # return a node though, the node is really a proxy object for pages. It | 10 | # return a node though, the node is really a proxy object for pages. It |
| 11 | # returns the most recent page associated to this node instead. | 11 | # returns the most recent page associated to this node instead. |
| 12 | def render_page | 12 | def render_page |
| 13 | 13 | ||
| 14 | expires_in 20.minutes, :public => true | 14 | expires_in 20.minutes, :public => true |
| 15 | 15 | ||
| 16 | if @page and @page.public? | 16 | if @page and @page.public? |
| 17 | render( | 17 | render( |
| 18 | :file => @page.valid_template, | 18 | :file => @page.valid_template, |
| 19 | :layout => true | 19 | :layout => true |
| 20 | ) | 20 | ) |
| 21 | else | 21 | else |
| 22 | render( | 22 | render( |
| 23 | :file => File.join(RAILS_ROOT, 'public', '404.html'), | 23 | :file => File.join(RAILS_ROOT, 'public', '404.html'), |
| 24 | :status => 404 | 24 | :status => 404 |
| 25 | ) | 25 | ) |
| 26 | end | 26 | end |
| 27 | 27 | ||
| 28 | end | 28 | end |
| 29 | 29 | ||
| 30 | def render_gallery | 30 | def render_gallery |
| @@ -35,10 +35,14 @@ class ContentController < ApplicationController | |||
| 35 | render :nothing => true, :status => 404 | 35 | render :nothing => true, :status => 404 |
| 36 | end | 36 | end |
| 37 | end | 37 | end |
| 38 | 38 | ||
| 39 | private | 39 | private |
| 40 | def find_page | 40 | def find_page |
| 41 | path = params[:page_path].join('/') | 41 | path = params[:page_path].join('/') |
| 42 | @page = Node.find_page(path) | 42 | if path =~ /^[a-zA-Z\:\/\/\.\-\d_]+$/ |
| 43 | @page = Node.find_page(path) | ||
| 44 | else | ||
| 45 | @page = nil | ||
| 46 | end | ||
| 43 | end | 47 | end |
| 44 | end | 48 | end |
diff --git a/app/controllers/tags_controller.rb b/app/controllers/tags_controller.rb index 565cdd4..bf64b73 100644 --- a/app/controllers/tags_controller.rb +++ b/app/controllers/tags_controller.rb | |||
| @@ -1,33 +1,40 @@ | |||
| 1 | class TagsController < ApplicationController | 1 | class TagsController < ApplicationController |
| 2 | 2 | ||
| 3 | # Public | 3 | # Public |
| 4 | 4 | ||
| 5 | def index | 5 | def index |
| 6 | @page = Page.new :title => "Tags" | 6 | @page = Page.new :title => "Tags" |
| 7 | 7 | ||
| 8 | @tags = Tag.all(:limit => 500) | 8 | @tags = Tag.all(:limit => 500) |
| 9 | end | 9 | end |
| 10 | 10 | ||
| 11 | def show | 11 | def show |
| 12 | @tag = Tag.find_by_name(params[:id]) | 12 | tag_name = params[:id] |
| 13 | 13 | ||
| 14 | @tag = @tag ? @tag.name : params[:id] | 14 | if tag_name.match(/^[a-zA-Z0-9_\w\s\-\.\']+$/) |
| 15 | 15 | @tag = Tag.find_by_name(tag_name) | |
| 16 | @page = Page.new | 16 | @tag = @tag ? @tag.name : tag_name |
| 17 | @page = Page.new | ||
| 17 | 18 | ||
| 18 | params[:page] = ( params[:page].is_a?(Fixnum) ? params[:page] : 1 ) | 19 | params[:page] = ( params[:page].is_a?(Fixnum) ? params[:page] : 1 ) |
| 19 | 20 | ||
| 20 | @pages = Page.heads.paginate( | 21 | @pages = Page.heads.paginate( |
| 21 | Page.find_options_for_find_tagged_with(@tag).merge( | 22 | Page.find_options_for_find_tagged_with(@tag).merge( |
| 22 | :order => 'published_at DESC', | 23 | :order => 'published_at DESC', |
| 23 | :page=>params[:page], | 24 | :page=>params[:page], |
| 24 | :per_page => 23 | 25 | :per_page => 23 |
| 26 | ) | ||
| 25 | ) | 27 | ) |
| 26 | ) | 28 | |
| 27 | 29 | respond_to do |format| | |
| 28 | respond_to do |format| | 30 | format.html {} |
| 29 | format.html {} | 31 | end |
| 32 | else | ||
| 33 | respond_to do |format| | ||
| 34 | format.html { render :nothing => true, :status => 400 } | ||
| 35 | end | ||
| 30 | end | 36 | end |
| 37 | |||
| 31 | end | 38 | end |
| 32 | 39 | ||
| 33 | end | 40 | end |
diff --git a/app/helpers/admin_helper.rb b/app/helpers/admin_helper.rb index da8945e..232862b 100644 --- a/app/helpers/admin_helper.rb +++ b/app/helpers/admin_helper.rb | |||
| @@ -3,9 +3,9 @@ module AdminHelper | |||
| 3 | def language_selector | 3 | def language_selector |
| 4 | case I18n.locale | 4 | case I18n.locale |
| 5 | when :de | 5 | when :de |
| 6 | link_to 'English', url_for(:overwrite_params => {:locale => :en}) | 6 | link_to 'English (Aktiv: Deutsch)', url_for(:overwrite_params => {:locale => :en}) |
| 7 | when :en | 7 | when :en |
| 8 | link_to 'Deutsch', url_for(:overwrite_params => {:locale => :de}) | 8 | link_to 'Deutsch (Active: English)', url_for(:overwrite_params => {:locale => :de}) |
| 9 | end | 9 | end |
| 10 | end | 10 | end |
| 11 | end \ No newline at end of file | 11 | end |
diff --git a/app/helpers/content_helper.rb b/app/helpers/content_helper.rb index d6c96f1..7286976 100644 --- a/app/helpers/content_helper.rb +++ b/app/helpers/content_helper.rb | |||
| @@ -9,13 +9,13 @@ module ContentHelper | |||
| 9 | end | 9 | end |
| 10 | 10 | ||
| 11 | def calendar | 11 | def calendar |
| 12 | occurrences = Occurrence.find_in_range(Time.now, (Time.now+14.days)) | 12 | occurrences = Occurrence.find_in_range(Time.now, (Time.now+6.weeks)) |
| 13 | 13 | ||
| 14 | if occurrences.empty? | 14 | if occurrences.empty? |
| 15 | occurrences = Occurrence.find_next | 15 | occurrences = Occurrence.find_next |
| 16 | end | 16 | end |
| 17 | 17 | ||
| 18 | occurrences = occurrences.reject { |o| o.node.head.nil? } | 18 | occurrences = occurrences.reject { |o| o.node.nil? || o.node.head.nil? } |
| 19 | 19 | ||
| 20 | render( | 20 | render( |
| 21 | :partial => 'content/front_page_calendar', | 21 | :partial => 'content/front_page_calendar', |
| @@ -75,6 +75,8 @@ module ContentHelper | |||
| 75 | def aggregate? content | 75 | def aggregate? content |
| 76 | options = {} | 76 | options = {} |
| 77 | 77 | ||
| 78 | cccms_attributes = ActionView::Base.sanitized_allowed_attributes + [ 'lang' ] | ||
| 79 | |||
| 78 | begin | 80 | begin |
| 79 | if content =~ /<aggregate([^<>]*)>/ | 81 | if content =~ /<aggregate([^<>]*)>/ |
| 80 | tag = $~.to_s | 82 | tag = $~.to_s |
| @@ -87,13 +89,13 @@ module ContentHelper | |||
| 87 | 89 | ||
| 88 | options[:partial] = select_partial( options[:partial] ) | 90 | options[:partial] = select_partial( options[:partial] ) |
| 89 | 91 | ||
| 90 | sanitize( content.sub(tag, render_collection(options)) ) | 92 | sanitize( content.sub(tag, render_collection(options)), :attributes => cccms_attributes ) |
| 91 | else | 93 | else |
| 92 | sanitize( content ) | 94 | sanitize( content, :attributes => cccms_attributes ) |
| 93 | end | 95 | end |
| 94 | 96 | ||
| 95 | rescue | 97 | rescue |
| 96 | sanitize( content ) | 98 | sanitize( content, :atttributes => cccms_attributes ) |
| 97 | end | 99 | end |
| 98 | end | 100 | end |
| 99 | 101 | ||
diff --git a/app/helpers/nodes_helper.rb b/app/helpers/nodes_helper.rb index d889719..204ad8a 100644 --- a/app/helpers/nodes_helper.rb +++ b/app/helpers/nodes_helper.rb | |||
| @@ -4,6 +4,10 @@ module NodesHelper | |||
| 4 | if node.head | 4 | if node.head |
| 5 | node.head.title | 5 | node.head.title |
| 6 | else | 6 | else |
| 7 | if not node.draft or not node.draft.title | ||
| 8 | logger.error "Missing title in node #{node.id}" | ||
| 9 | return "NO TITLE" | ||
| 10 | end | ||
| 7 | node.draft.title | 11 | node.draft.title |
| 8 | end | 12 | end |
| 9 | end | 13 | end |
diff --git a/app/models/occurrence.rb b/app/models/occurrence.rb index 591e1e0..62432d5 100644 --- a/app/models/occurrence.rb +++ b/app/models/occurrence.rb | |||
| @@ -16,7 +16,8 @@ class Occurrence < ActiveRecord::Base | |||
| 16 | :include => :node, | 16 | :include => :node, |
| 17 | :conditions => [ | 17 | :conditions => [ |
| 18 | "start_time > ? AND end_time < ?", start_time, end_time | 18 | "start_time > ? AND end_time < ?", start_time, end_time |
| 19 | ] | 19 | ], |
| 20 | :order => "start_time" | ||
| 20 | ) | 21 | ) |
| 21 | end | 22 | end |
| 22 | 23 | ||
diff --git a/app/models/page.rb b/app/models/page.rb index c5da386..0cfad53 100644 --- a/app/models/page.rb +++ b/app/models/page.rb | |||
| @@ -149,6 +149,16 @@ class Page < ActiveRecord::Base | |||
| 149 | published_at.nil? ? true : published_at < Time.now | 149 | published_at.nil? ? true : published_at < Time.now |
| 150 | end | 150 | end |
| 151 | 151 | ||
| 152 | def effective_lang | ||
| 153 | if translated_locales.empty? | ||
| 154 | return 'de' | ||
| 155 | elsif translated_locales.include?(I18n.locale) | ||
| 156 | return I18n.locale | ||
| 157 | else | ||
| 158 | return translated_locales.first | ||
| 159 | end | ||
| 160 | end | ||
| 161 | |||
| 152 | # Returns true if a page has translations where one of them is significantly | 162 | # Returns true if a page has translations where one of them is significantly |
| 153 | # older than the other. | 163 | # older than the other. |
| 154 | # Takes the I18n.default locale and a second :locale to test if the | 164 | # Takes the I18n.default locale and a second :locale to test if the |
| @@ -238,4 +248,4 @@ class Page < ActiveRecord::Base | |||
| 238 | end | 248 | end |
| 239 | end | 249 | end |
| 240 | 250 | ||
| 241 | end \ No newline at end of file | 251 | end |
diff --git a/app/views/content/_featured_articles.html.erb b/app/views/content/_featured_articles.html.erb index 75e2e1d..0220abb 100644 --- a/app/views/content/_featured_articles.html.erb +++ b/app/views/content/_featured_articles.html.erb | |||
| @@ -1,5 +1,14 @@ | |||
| 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 | image_tag( 'chaosradio.png' ), |
| 5 | "http://chaosradio.ccc.de/", | 14 | "http://chaosradio.ccc.de/", |
| @@ -8,6 +17,13 @@ | |||
| 8 | )%> | 17 | )%> |
| 9 | 18 | ||
| 10 | <%= link_to( | 19 | <%= link_to( |
| 20 | image_tag( 'media-ccc-de-banner.svg', :size => '155x45' ), | ||
| 21 | "https://media.ccc.de", | ||
| 22 | :id => "media_ccc_de_icon", | ||
| 23 | :title => "Media Dot CCC Dot de" | ||
| 24 | )%> | ||
| 25 | |||
| 26 | <%= link_to( | ||
| 11 | image_tag( 'ds.png' ), | 27 | image_tag( 'ds.png' ), |
| 12 | "http://ds.ccc.de/", | 28 | "http://ds.ccc.de/", |
| 13 | :id => "ds_icon", | 29 | :id => "ds_icon", |
| @@ -22,10 +38,19 @@ | |||
| 22 | )%> | 38 | )%> |
| 23 | 39 | ||
| 24 | <%= link_to( | 40 | <%= link_to( |
| 25 | image_tag( 'twitter.png' ), | 41 | image_tag( 'Fediverse.svg', :size => '64x64' ), |
| 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 | image_tag( 'Bluesky_Logo.svg', :size => '64x64' ), | ||
| 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..a984512 100644 --- a/app/views/content/_main_navigation.html.erb +++ b/app/views/content/_main_navigation.html.erb | |||
| @@ -3,5 +3,11 @@ | |||
| 3 | <% menu_items.each do |item| %> | 3 | <% menu_items.each do |item| %> |
| 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 | <li> | ||
| 7 | <%= language_selector %> | ||
| 8 | </li> | ||
| 9 | <li id="light-mode-li"> | ||
| 10 | <input id="light-mode" type="checkbox" /><label for="light-mode">lights on</label> | ||
| 11 | </li> | ||
| 6 | </ul> | 12 | </ul> |
| 7 | </div> \ No newline at end of file | 13 | </div> |
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_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/layouts/application.html.erb b/app/views/layouts/application.html.erb index 3c95d75..e6efccf 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb | |||
| @@ -4,6 +4,11 @@ | |||
| 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 name="description" content="Der Chaos Computer Club ist eine galaktische Gemeinschaft von Lebewesen für Informationsfreiheit und Technikfolgenabschätzung."> | ||
| 9 | |||
| 10 | <meta property="og:image" content="https://www.ccc.de/images/chaosknoten.svg" /> | ||
| 11 | <meta property="og:description" content="Der Chaos Computer Club ist eine galaktische Gemeinschaft von Lebewesen für Informationsfreiheit und Technikfolgenabschätzung." /> | ||
| 7 | 12 | ||
| 8 | <title><%= page_title %></title> | 13 | <title><%= page_title %></title> |
| 9 | <%= stylesheet_link_tag "ccc" %> | 14 | <%= stylesheet_link_tag "ccc" %> |
| @@ -16,7 +21,7 @@ | |||
| 16 | <%= auto_discovery_link_tag(:rss, {:locale => :de, :controller => "rss", :action => "updates", :format => :rdf}) %> | 21 | <%= auto_discovery_link_tag(:rss, {:locale => :de, :controller => "rss", :action => "updates", :format => :rdf}) %> |
| 17 | </head> | 22 | </head> |
| 18 | 23 | ||
| 19 | <body> | 24 | <body lang="<%= @page.effective_lang %>"> |
| 20 | <div id="wrapper"> | 25 | <div id="wrapper"> |
| 21 | <div id="header"> | 26 | <div id="header"> |
| 22 | <%= link_to_path(image_tag("header.png"), "/home") %> | 27 | <%= link_to_path(image_tag("header.png"), "/home") %> |
| @@ -27,22 +32,16 @@ | |||
| 27 | <div id="left_column"> | 32 | <div id="left_column"> |
| 28 | <%= main_menu %> | 33 | <%= main_menu %> |
| 29 | 34 | ||
| 30 | <%= language_selector %> | ||
| 31 | <% if current_user && @page.node %> | 35 | <% if current_user && @page.node %> |
| 32 | <%= link_to "Edit", node_path(:id => @page.node) %> | 36 | <%= link_to "Edit", node_path(:id => @page.node) %> |
| 33 | <% end %> | 37 | <% end %> |
| 34 | 38 | ||
| 35 | <%= calendar %> | 39 | <%= calendar %> |
| 36 | </div> | 40 | </div> |
| 37 | <div id="center_column"> | 41 | <div id="center_column"> |
| 38 | <%= yield :layout %> | 42 | <%= yield :layout %> |
| 39 | 43 | ||
| 40 | <div id="footer"> | 44 | <div id="footer"> |
| 41 | <br /> | ||
| 42 | <br /> | ||
| 43 | <p style="text-align: center"> | ||
| 44 | <%= link_to t(:sponsors), content_path("sponsors") %> | ||
| 45 | </p> | ||
| 46 | </div> | 45 | </div> |
| 47 | </div> | 46 | </div> |
| 48 | <div id="right_column"> | 47 | <div id="right_column"> |
| @@ -51,4 +50,4 @@ | |||
| 51 | </div> | 50 | </div> |
| 52 | </div> | 51 | </div> |
| 53 | </body> | 52 | </body> |
| 54 | </html> \ No newline at end of file | 53 | </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/nodes/edit.html.erb b/app/views/nodes/edit.html.erb index 8e27d0f..b9260d2 100644 --- a/app/views/nodes/edit.html.erb +++ b/app/views/nodes/edit.html.erb | |||
| @@ -107,4 +107,4 @@ | |||
| 107 | </table> | 107 | </table> |
| 108 | <% end %> | 108 | <% end %> |
| 109 | <% end %> | 109 | <% end %> |
| 110 | </div> \ No newline at end of file | 110 | </div> |
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..cc63201 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(item.title) |
| 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(item.abstract) |
| 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..6afcd56 100644 --- a/app/views/rss/updates.xml.builder +++ b/app/views/rss/updates.xml.builder | |||
| @@ -2,13 +2,13 @@ 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") |
| 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 |
| @@ -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(item.abstract) | ||
| 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 %> |
