diff options
31 files changed, 427 insertions, 189 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 627aa14..f0017ee 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,12 +32,11 @@ | |||
| 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 %> |
| @@ -43,17 +47,6 @@ | |||
| 43 | </div> | 47 | </div> |
| 44 | </div> | 48 | </div> |
| 45 | 49 | ||
| 46 | <div id="footer"> | 50 | <div id="footer"> </div> |
| 47 | <br /> | ||
| 48 | <br /> | ||
| 49 | <p style="text-align: center"> | ||
| 50 | <%= link_to t(:sponsors), content_path("sponsors") %> | ||
| 51 | </p> | ||
| 52 | <p id="quote"> | ||
| 53 | <em>»They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.«</em> | ||
| 54 | <br /> | ||
| 55 | Benjamin Franklin | ||
| 56 | </p> | ||
| 57 | </div> | ||
| 58 | </body> | 51 | </body> |
| 59 | </html> \ No newline at end of file | 52 | </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 %> |
diff --git a/config/boot.rb b/config/boot.rb index dd5e3b6..9834fc4 100644 --- a/config/boot.rb +++ b/config/boot.rb | |||
| @@ -2,6 +2,7 @@ | |||
| 2 | # Configure your app in config/environment.rb and config/environments/*.rb | 2 | # Configure your app in config/environment.rb and config/environments/*.rb |
| 3 | 3 | ||
| 4 | RAILS_ROOT = "#{File.dirname(__FILE__)}/.." unless defined?(RAILS_ROOT) | 4 | RAILS_ROOT = "#{File.dirname(__FILE__)}/.." unless defined?(RAILS_ROOT) |
| 5 | ENV['NLS_LANG'] = 'de_DE.UTF8' | ||
| 5 | 6 | ||
| 6 | module Rails | 7 | module Rails |
| 7 | class << self | 8 | class << self |
diff --git a/config/environment.rb b/config/environment.rb index ec7ffa9..57b9ef2 100644 --- a/config/environment.rb +++ b/config/environment.rb | |||
| @@ -1,11 +1,33 @@ | |||
| 1 | # Be sure to restart your server when you modify this file | 1 | # Be sure to restart your server when you modify this file |
| 2 | 2 | ||
| 3 | # Specifies gem version of Rails to use when vendor/rails is not present | 3 | # Specifies gem version of Rails to use when vendor/rails is not present |
| 4 | RAILS_GEM_VERSION = '2.3.11' unless defined? RAILS_GEM_VERSION | 4 | RAILS_GEM_VERSION = '2.3.15' unless defined? RAILS_GEM_VERSION |
| 5 | 5 | ||
| 6 | # Bootstrap the Rails environment, frameworks, and default configuration | 6 | # Bootstrap the Rails environment, frameworks, and default configuration |
| 7 | require File.join(File.dirname(__FILE__), 'boot') | 7 | require File.join(File.dirname(__FILE__), 'boot') |
| 8 | 8 | ||
| 9 | # monkey patch for 2.0. Will ignore vendor gems. | ||
| 10 | if RUBY_VERSION >= "2.0.0" | ||
| 11 | module Gem | ||
| 12 | def self.source_index | ||
| 13 | sources | ||
| 14 | end | ||
| 15 | |||
| 16 | def self.cache | ||
| 17 | sources | ||
| 18 | end | ||
| 19 | |||
| 20 | SourceIndex = Specification | ||
| 21 | |||
| 22 | class SourceList | ||
| 23 | # If you want vendor gems, this is where to start writing code. | ||
| 24 | def search( *args ); []; end | ||
| 25 | def each( &block ); end | ||
| 26 | include Enumerable | ||
| 27 | end | ||
| 28 | end | ||
| 29 | end | ||
| 30 | |||
| 9 | Rails::Initializer.run do |config| | 31 | Rails::Initializer.run do |config| |
| 10 | # Settings in config/environments/* take precedence over those specified here. | 32 | # Settings in config/environments/* take precedence over those specified here. |
| 11 | # Application configuration should go into files in config/initializers | 33 | # Application configuration should go into files in config/initializers |
| @@ -23,7 +45,7 @@ Rails::Initializer.run do |config| | |||
| 23 | # config.gem "rake", :version => ">= 0.8.3" | 45 | # config.gem "rake", :version => ">= 0.8.3" |
| 24 | # config.gem "rack", :version => ">= 0.9.1" | 46 | # config.gem "rack", :version => ">= 0.9.1" |
| 25 | config.gem "pg" | 47 | config.gem "pg" |
| 26 | config.gem "thinking-sphinx", :lib => 'thinking_sphinx', :version => '1.4.3' | 48 | config.gem "thinking-sphinx", :lib => 'thinking_sphinx', :version => '1.5.0' |
| 27 | config.gem "libxml-ruby", :lib => 'xml' | 49 | config.gem "libxml-ruby", :lib => 'xml' |
| 28 | config.gem "erdgeist-chaos_calendar", :lib => "chaos_calendar", :source => "http://gems.github.com" | 50 | config.gem "erdgeist-chaos_calendar", :lib => "chaos_calendar", :source => "http://gems.github.com" |
| 29 | 51 | ||
| @@ -55,9 +77,10 @@ Rails::Initializer.run do |config| | |||
| 55 | # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded. | 77 | # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded. |
| 56 | # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}')] | 78 | # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}')] |
| 57 | config.i18n.default_locale = :de | 79 | config.i18n.default_locale = :de |
| 80 | |||
| 58 | end | 81 | end |
| 59 | 82 | ||
| 60 | require 'awesome_patch' | 83 | require 'awesome_patch' |
| 61 | 84 | ||
| 62 | ExceptionNotifier.exception_recipients = %w(hukl@berlin.ccc.de) | 85 | ExceptionNotifier.exception_recipients = %w(erdgeist@ccc.de) |
| 63 | ExceptionNotifier.sender_address = %("CCCMS Error" <error@ccc.de>) | 86 | ExceptionNotifier.sender_address = %("CCCMS Error" <error@www.ccc.de>) |
diff --git a/config/environments/production.rb b/config/environments/production.rb index 68ceccd..3195745 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb | |||
| @@ -32,4 +32,5 @@ ActionMailer::Base.sendmail_settings = { | |||
| 32 | :arguments => '-i -t' | 32 | :arguments => '-i -t' |
| 33 | } | 33 | } |
| 34 | ActionMailer::Base.perform_deliveries = true | 34 | ActionMailer::Base.perform_deliveries = true |
| 35 | ActionMailer::Base.raise_delivery_errors = true \ No newline at end of file | 35 | ActionMailer::Base.raise_delivery_errors = true |
| 36 | |||
diff --git a/config/sphinx.yml b/config/sphinx.yml index a01c216..3dc9195 100644 --- a/config/sphinx.yml +++ b/config/sphinx.yml | |||
| @@ -8,4 +8,5 @@ production: | |||
| 8 | config_file: "/usr/local/etc/sphinx.conf" | 8 | config_file: "/usr/local/etc/sphinx.conf" |
| 9 | searchd_log_file: "/var/log/searchd.log" | 9 | searchd_log_file: "/var/log/searchd.log" |
| 10 | query_log_file: "/var/log/searchd.query.log" | 10 | query_log_file: "/var/log/searchd.query.log" |
| 11 | pid_file: "/var/run/sphinxsearch/searchd.pid" \ No newline at end of file | 11 | max_matches: 10000 |
| 12 | pid_file: "/var/run/sphinxsearch/searchd.pid" | ||
diff --git a/public/stylesheets/ccc.css b/public/stylesheets/ccc.css index 9d9054f..c782b1f 100644 --- a/public/stylesheets/ccc.css +++ b/public/stylesheets/ccc.css | |||
| @@ -1,29 +1,51 @@ | |||
| 1 | body { | 1 | body { |
| 2 | background-color: #FFFFFF; | ||
| 3 | margin: 0; | 2 | margin: 0; |
| 4 | padding: 0; | 3 | padding: 0; |
| 5 | text-align: center; | 4 | text-align: center; |
| 6 | font-family: Verdana, Helvetica, Arial, sans-serif; | 5 | font-family: Verdana, Helvetica, Arial, sans-serif; |
| 7 | font-size: 11px; | 6 | background-color: Canvas; |
| 8 | line-height: 16px; | 7 | hyphens: auto; |
| 9 | background-color: #ffffff; | 8 | color: color-mix(in srgb, CanvasText, #808080 30%); |
| 10 | color: #535353; | 9 | color-scheme: light dark; |
| 10 | } | ||
| 11 | |||
| 12 | body:has(#light-mode:checked) { | ||
| 13 | color-scheme: light; | ||
| 14 | } | ||
| 15 | |||
| 16 | @media (prefers-color-scheme: light) { | ||
| 17 | #light-mode-li, #light-mode, label[for=light-mode] { | ||
| 18 | display: none; | ||
| 19 | } | ||
| 20 | } | ||
| 21 | |||
| 22 | @media (prefers-color-scheme: dark) { | ||
| 23 | body:not(:has(#light-mode:checked)) #header img, | ||
| 24 | body:not(:has(#light-mode:checked)) div#left_column::before | ||
| 25 | { | ||
| 26 | filter: invert(50%); | ||
| 27 | } | ||
| 11 | } | 28 | } |
| 12 | 29 | ||
| 13 | div#header { | 30 | p { |
| 14 | height: 224px; | 31 | line-height: 1.5em; |
| 32 | } | ||
| 33 | |||
| 34 | img { | ||
| 35 | max-width: 100%; | ||
| 15 | } | 36 | } |
| 16 | 37 | ||
| 17 | div#header img { | 38 | div#header img { |
| 18 | border: none; | 39 | border: none; |
| 19 | } | 40 | } |
| 20 | 41 | ||
| 21 | div#wrapper { | 42 | @media(min-width:1016px) { |
| 22 | position: relative; | 43 | div#wrapper { |
| 23 | width: 909px; | 44 | position: relative; |
| 24 | margin-left: 90px; | 45 | width: 909px; |
| 25 | text-align: left; | 46 | margin: 0 auto 0 auto; |
| 26 | min-height: 750px; | 47 | text-align: left; |
| 48 | } | ||
| 27 | } | 49 | } |
| 28 | 50 | ||
| 29 | pre { | 51 | pre { |
| @@ -52,18 +74,17 @@ a:hover { | |||
| 52 | /*------------------headlines-------------------*/ | 74 | /*------------------headlines-------------------*/ |
| 53 | 75 | ||
| 54 | h2 { | 76 | h2 { |
| 55 | font-size: 15px; | 77 | font-size: 1.5rem; |
| 56 | line-height: 20px; | 78 | font-family: Helvetica, Arial, sans-serif; |
| 57 | font-family: Helvetica; | ||
| 58 | } | 79 | } |
| 59 | 80 | ||
| 60 | div#center_column h2 a { | 81 | div#center_column h2 a { |
| 61 | color: #535353; | 82 | color: color-mix(in srgb, CanvasText, #808080 80%); |
| 62 | text-decoration: none; | 83 | text-decoration: none; |
| 63 | } | 84 | } |
| 64 | 85 | ||
| 65 | div#center_column h2 a:hover { | 86 | div#center_column h2 a:hover { |
| 66 | color: #8e8e8e; | 87 | color: color-mix(in srgb, CanvasText, #808080 10%); |
| 67 | } | 88 | } |
| 68 | 89 | ||
| 69 | div#center_column h2.headline { | 90 | div#center_column h2.headline { |
| @@ -77,31 +98,65 @@ div.article_partial h2 a { | |||
| 77 | } | 98 | } |
| 78 | 99 | ||
| 79 | h3 { | 100 | h3 { |
| 80 | font-size: 13px; | 101 | font-size: 1.3rem; |
| 81 | text-decoration: none; | 102 | text-decoration: none; |
| 82 | 103 | ||
| 83 | } | 104 | } |
| 84 | 105 | ||
| 85 | h4 { | 106 | h4 { |
| 86 | font-size: 11px; | 107 | font-size: 1.0rem; |
| 87 | text-decoration: bold; | 108 | text-decoration: bold; |
| 88 | } | 109 | } |
| 89 | 110 | ||
| 111 | #left_column { | ||
| 112 | font-size: .8em; | ||
| 113 | line-height: 1.5em; | ||
| 114 | } | ||
| 115 | |||
| 90 | /*------------------main-navigation-------------------*/ | 116 | /*------------------main-navigation-------------------*/ |
| 91 | 117 | ||
| 92 | div.main_navigation ul { | 118 | div.main_navigation ul { |
| 93 | margin-left: 0; | 119 | margin-left: 0; |
| 94 | padding-left: 0; | 120 | padding-left: 0; |
| 95 | line-height: 18px; | 121 | padding-left: 15px; |
| 122 | padding-right: 15px; | ||
| 123 | text-align: left; | ||
| 96 | } | 124 | } |
| 97 | 125 | ||
| 98 | div.main_navigation li { | 126 | div.main_navigation li { |
| 99 | list-style-type: none; | 127 | list-style-type: none; |
| 128 | display: inline-block; | ||
| 129 | line-height: 1.75em; | ||
| 130 | } | ||
| 131 | |||
| 132 | div.main_navigation li::after { | ||
| 133 | content: '-'; | ||
| 134 | color: #aeadad; | ||
| 135 | margin-left: .3em; | ||
| 136 | } | ||
| 137 | |||
| 138 | div.main_navigation li:last-child::after { | ||
| 139 | content: none; | ||
| 140 | } | ||
| 141 | |||
| 142 | @media(min-width:1016px) { | ||
| 143 | div.main_navigation ul { | ||
| 144 | padding: 0; | ||
| 145 | text-align: right; | ||
| 146 | } | ||
| 147 | |||
| 148 | div.main_navigation li { | ||
| 149 | display: block; | ||
| 150 | line-height: 1.45em; | ||
| 151 | } | ||
| 152 | |||
| 153 | div.main_navigation li::after { | ||
| 154 | content: none; | ||
| 155 | } | ||
| 100 | } | 156 | } |
| 101 | 157 | ||
| 102 | div.main_navigation a { | 158 | div.main_navigation a { |
| 103 | text-decoration: none; | 159 | text-decoration: none; |
| 104 | font-size: 14px; | ||
| 105 | } | 160 | } |
| 106 | 161 | ||
| 107 | div.main_navigation a.inactive:hover { | 162 | div.main_navigation a.inactive:hover { |
| @@ -109,34 +164,68 @@ div.main_navigation a.inactive:hover { | |||
| 109 | } | 164 | } |
| 110 | 165 | ||
| 111 | div.main_navigation a.active { | 166 | div.main_navigation a.active { |
| 112 | color: #000000; | 167 | color: CanvasText; |
| 113 | text-decoration: none; | 168 | text-decoration: none; |
| 114 | font-size: 13px; | ||
| 115 | } | 169 | } |
| 116 | 170 | ||
| 117 | div.main_navigation a.inactive { | 171 | div.main_navigation a.inactive { |
| 118 | color: #aeadad; | 172 | color: #aeadad; |
| 119 | font-size: 13px; | ||
| 120 | } | 173 | } |
| 121 | 174 | ||
| 122 | /*------------------calendar-featured-tags-------------------*/ | 175 | /*------------------calendar-featured-tags-------------------*/ |
| 123 | 176 | ||
| 124 | div#frontpage_calendar { | 177 | div#frontpage_calendar { |
| 125 | margin-top: 30px; | 178 | display: none; |
| 179 | margin-top: 10px; | ||
| 180 | } | ||
| 181 | |||
| 182 | @media(min-width:1016px) { | ||
| 183 | div#frontpage_calendar { | ||
| 184 | margin-top: 30px; | ||
| 185 | } | ||
| 126 | } | 186 | } |
| 127 | 187 | ||
| 128 | div#frontpage_calendar h2, div#tags h2, div#featured_articles h2 { | 188 | div#frontpage_calendar h2, div#tags h2, div#featured_articles h2 { |
| 129 | color: #aeadad; | 189 | color: #aeadad; |
| 130 | border-top: 2px solid #aeadad; | 190 | border-top: 2px solid #aeadad; |
| 131 | border-bottom: 2px solid #aeadad; | 191 | border-bottom: 2px solid #aeadad; |
| 132 | font-size: 16px; | 192 | font-size: 1.1em; |
| 133 | padding-top: 2px; | 193 | padding-top: 2px; |
| 134 | padding-bottom: 2px; | 194 | padding-bottom: 2px; |
| 135 | } | 195 | } |
| 136 | 196 | ||
| 197 | div#frontpage_calendar h2 { | ||
| 198 | display: none; | ||
| 199 | border-top: none; | ||
| 200 | margin-left: auto; | ||
| 201 | margin-right: auto; | ||
| 202 | padding-left: 0.5em; | ||
| 203 | padding-right: 0.5em; | ||
| 204 | margin-top: 0; | ||
| 205 | } | ||
| 206 | |||
| 207 | @media(min-width:1016px) { | ||
| 208 | div#frontpage_calendar h2, div#tags h2, div#featured_articles h2 { | ||
| 209 | font-size: 16px; | ||
| 210 | } | ||
| 211 | |||
| 212 | div#frontpage_calendar h2 { | ||
| 213 | display: block; | ||
| 214 | border-top: 2px solid #aeadad; | ||
| 215 | padding: 2px 0; | ||
| 216 | } | ||
| 217 | } | ||
| 218 | |||
| 137 | div#frontpage_calendar ul, div#tags ul, div#featured_articles ul { | 219 | div#frontpage_calendar ul, div#tags ul, div#featured_articles ul { |
| 138 | padding: 0px; | 220 | padding: 0px; |
| 139 | font-size: 11px; | 221 | font-size: 0.8em; |
| 222 | line-height: 1.5em; | ||
| 223 | } | ||
| 224 | |||
| 225 | @media(min-width:1016px) { | ||
| 226 | div#tags ul { | ||
| 227 | font-size: 0.8rem; | ||
| 228 | } | ||
| 140 | } | 229 | } |
| 141 | 230 | ||
| 142 | div#featured_articles #ds_icon img { | 231 | div#featured_articles #ds_icon img { |
| @@ -171,40 +260,63 @@ div#featured_articles li a:hover { | |||
| 171 | 260 | ||
| 172 | div.author_and_date { | 261 | div.author_and_date { |
| 173 | font-style: italic; | 262 | font-style: italic; |
| 174 | padding-left: 15px; | 263 | padding-left: 2em; |
| 175 | font-family: Georgia; | 264 | font-family: Georgia; |
| 176 | } | 265 | } |
| 177 | 266 | ||
| 178 | div#left_column { | 267 | @media(min-width:1016px) { |
| 179 | position: absolute; | 268 | div#left_column::before { |
| 180 | background-image: url(/images/left_column.png); | 269 | content: " "; |
| 181 | background-position: top right; | 270 | position: absolute; |
| 182 | background-repeat: no-repeat; | 271 | left: 0; |
| 183 | left: 0px; | 272 | top: 0; |
| 184 | width: 115px; | 273 | width: 100%; |
| 185 | min-height: 100px; | 274 | height: 100%; |
| 186 | text-align: right; | 275 | box-sizing: border-box; |
| 187 | padding-right: 70px; | 276 | background-image: url(/images/left_column.png); |
| 277 | background-position: top right; | ||
| 278 | background-repeat: no-repeat; | ||
| 279 | z-index: -10; | ||
| 280 | } | ||
| 281 | div#left_column { | ||
| 282 | position: absolute; | ||
| 283 | left: 0px; | ||
| 284 | width: 115px; | ||
| 285 | min-height: 100px; | ||
| 286 | text-align: right; | ||
| 287 | padding-right: 70px; | ||
| 288 | } | ||
| 289 | |||
| 290 | div#left_column > a { | ||
| 291 | font-size: 0.8rem; | ||
| 292 | } | ||
| 188 | } | 293 | } |
| 189 | 294 | ||
| 190 | 295 | ||
| 191 | div#center_column { | 296 | div#center_column { |
| 192 | position: absolute; | ||
| 193 | background-color: #ffffff; | ||
| 194 | left: 200px; | ||
| 195 | width: 460px; | ||
| 196 | padding-left: 15px; | 297 | padding-left: 15px; |
| 197 | padding-right: 15px; | 298 | padding-right: 15px; |
| 198 | padding-bottom: 0px; | 299 | padding-bottom: 40px; |
| 199 | } | 300 | } |
| 200 | 301 | ||
| 201 | div#right_column { | 302 | @media(min-width: 1016px) { |
| 202 | position: absolute; | 303 | div#center_column { |
| 203 | background-color: #ffffff; | 304 | position: absolute; |
| 204 | padding-left: 70px; | 305 | background-color: Canvas; |
| 205 | left: 675px; | 306 | left: 200px; |
| 206 | width: 155px; | 307 | width: 460px; |
| 207 | height: 100px; | 308 | } |
| 309 | } | ||
| 310 | |||
| 311 | @media(min-width:1016px) { | ||
| 312 | div#right_column { | ||
| 313 | position: absolute; | ||
| 314 | background-color: Canvas; | ||
| 315 | padding-left: 70px; | ||
| 316 | left: 675px; | ||
| 317 | width: 155px; | ||
| 318 | height: 100px; | ||
| 319 | } | ||
| 208 | } | 320 | } |
| 209 | 321 | ||
| 210 | div.teaser_ruler { | 322 | div.teaser_ruler { |
| @@ -220,21 +332,26 @@ div.article_partial { | |||
| 220 | 332 | ||
| 221 | 333 | ||
| 222 | div.article_partial p.excerpt { | 334 | div.article_partial p.excerpt { |
| 223 | color: #404040; | 335 | color: color-mix(in srgb, CanvasText, #808080 50%); |
| 224 | } | 336 | } |
| 225 | 337 | ||
| 226 | div#center_column div.body, | 338 | /* Search bar */ |
| 227 | div#center_column div.abstract { | 339 | #search form table { |
| 228 | font-size: 11px; | 340 | display: inline-table; |
| 229 | line-height: 16px; | ||
| 230 | } | 341 | } |
| 231 | 342 | ||
| 232 | div#search { | 343 | @media(min-width:1016px) { |
| 233 | position: absolute; | 344 | #search form table { |
| 234 | top: 145px; | 345 | display: table; |
| 235 | left: 676px; | 346 | } |
| 236 | height: 20px; | 347 | |
| 237 | vertical-align: top; | 348 | div#search { |
| 349 | position: absolute; | ||
| 350 | top: 145px; | ||
| 351 | left: 676px; | ||
| 352 | height: 20px; | ||
| 353 | vertical-align: top; | ||
| 354 | } | ||
| 238 | } | 355 | } |
| 239 | 356 | ||
| 240 | div#search input[type=button] { | 357 | div#search input[type=button] { |
| @@ -249,24 +366,61 @@ div#search input[type=text] { | |||
| 249 | height: 20px; | 366 | height: 20px; |
| 250 | width: 132px; | 367 | width: 132px; |
| 251 | line-height: 20px; | 368 | line-height: 20px; |
| 252 | border: none; | 369 | border: solid Canvas 1px; |
| 370 | border-radius: 5px; | ||
| 253 | background-image: url(/images/search_field.png); | 371 | background-image: url(/images/search_field.png); |
| 254 | background-repeat:no-repeat; | 372 | background-repeat:no-repeat; |
| 255 | padding-right: 5px; | ||
| 256 | margin-right: 5px; | 373 | margin-right: 5px; |
| 257 | background-position: top top; | 374 | text-indent: 0.5rem; |
| 375 | background-position: top; | ||
| 376 | color: #000; | ||
| 258 | } | 377 | } |
| 259 | 378 | ||
| 260 | div#footer { | 379 | /* Header */ |
| 261 | position: relative; | 380 | #header > a { |
| 262 | width: 1024px; | 381 | display: block; |
| 263 | height: 240px; | 382 | line-height: 0; |
| 264 | background-image: url(/images/footer.png); | ||
| 265 | background-repeat: no-repeat; | ||
| 266 | } | 383 | } |
| 267 | 384 | ||
| 268 | p#quote { | 385 | /* Main section */ |
| 269 | position: absolute; | 386 | .article, .article_partial { |
| 270 | left: 320px; | 387 | font-size: .9rem; |
| 271 | top: 90px; | 388 | text-align: left; |
| 272 | } \ No newline at end of file | 389 | } |
| 390 | |||
| 391 | /* | ||
| 392 | @media(min-width:1016px) { | ||
| 393 | .article, .article_partial { | ||
| 394 | font-size: 11px; | ||
| 395 | } | ||
| 396 | } | ||
| 397 | */ | ||
| 398 | |||
| 399 | h1, h2, h3 { | ||
| 400 | word-wrap: anywhere; | ||
| 401 | hyphens:auto; | ||
| 402 | } | ||
| 403 | |||
| 404 | .pagination { | ||
| 405 | margin-bottom: .5em; | ||
| 406 | } | ||
| 407 | |||
| 408 | li { | ||
| 409 | line-height: 1.5em; | ||
| 410 | margin-block-start: 1em; | ||
| 411 | margin-block-end: 1em; | ||
| 412 | } | ||
| 413 | |||
| 414 | /* Footer */ | ||
| 415 | #footer { | ||
| 416 | border-bottom: 2px solid #aeadad; | ||
| 417 | border-top: 2px solid #aeadad; | ||
| 418 | } | ||
| 419 | |||
| 420 | #footer > br { | ||
| 421 | display: none; | ||
| 422 | } | ||
| 423 | |||
| 424 | #footer p { | ||
| 425 | margin: .5em auto; | ||
| 426 | } | ||
diff --git a/vendor/plugins/routing-filter/lib/routing_filter/locale.rb b/vendor/plugins/routing-filter/lib/routing_filter/locale.rb index 6fc3e11..7c86a40 100644 --- a/vendor/plugins/routing-filter/lib/routing_filter/locale.rb +++ b/vendor/plugins/routing-filter/lib/routing_filter/locale.rb | |||
| @@ -17,14 +17,14 @@ module RoutingFilter | |||
| 17 | def around_recognize(path, env, &block) | 17 | def around_recognize(path, env, &block) |
| 18 | locale = nil | 18 | locale = nil |
| 19 | path.sub! %r(^/([a-zA-Z]{2})(?=/|$)) do locale = $1; '' end | 19 | path.sub! %r(^/([a-zA-Z]{2})(?=/|$)) do locale = $1; '' end |
| 20 | returning yield do |params| | 20 | yield.tap do |params| |
| 21 | params[:locale] = locale if locale | 21 | params[:locale] = locale if locale |
| 22 | end | 22 | end |
| 23 | end | 23 | end |
| 24 | 24 | ||
| 25 | def around_generate(*args, &block) | 25 | def around_generate(*args, &block) |
| 26 | locale = args.extract_options!.delete(:locale) || I18n.locale | 26 | locale = args.extract_options!.delete(:locale) || I18n.locale |
| 27 | returning yield do |result| | 27 | yield.tap do |result| |
| 28 | if locale.to_sym != @@default_locale | 28 | if locale.to_sym != @@default_locale |
| 29 | target = result.is_a?(Array) ? result.first : result | 29 | target = result.is_a?(Array) ? result.first : result |
| 30 | target.sub!(%r(^(http.?://[^/]*)?(.*))){ "#{$1}/#{locale}#{$2}" } | 30 | target.sub!(%r(^(http.?://[^/]*)?(.*))){ "#{$1}/#{locale}#{$2}" } |
| @@ -32,4 +32,4 @@ module RoutingFilter | |||
| 32 | end | 32 | end |
| 33 | end | 33 | end |
| 34 | end | 34 | end |
| 35 | end \ No newline at end of file | 35 | end |
