diff options
Diffstat (limited to 'app')
| -rw-r--r-- | app/controllers/application_controller.rb | 11 | ||||
| -rw-r--r-- | app/models/node.rb | 6 | ||||
| -rw-r--r-- | app/models/page.rb | 6 | ||||
| -rw-r--r-- | app/views/content/_featured_articles.html.erb | 14 | ||||
| -rw-r--r-- | app/views/layouts/admin.html.erb | 11 | ||||
| -rw-r--r-- | app/views/layouts/application.html.erb | 12 | ||||
| -rw-r--r-- | app/views/revisions/diff.html.erb | 2 |
7 files changed, 31 insertions, 31 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 32c7373..75f92c3 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb | |||
| @@ -1,10 +1,7 @@ | |||
| 1 | # Filters added to this controller apply to all controllers in the application. | ||
| 2 | # Likewise, all the methods added will be available for all controllers. | ||
| 3 | |||
| 4 | class ApplicationController < ActionController::Base | 1 | class ApplicationController < ActionController::Base |
| 5 | include AuthenticatedSystem | 2 | include AuthenticatedSystem |
| 6 | 3 | ||
| 7 | protect_from_forgery # See ActionController::RequestForgeryProtection for details | 4 | protect_from_forgery |
| 8 | 5 | ||
| 9 | before_action :set_locale | 6 | before_action :set_locale |
| 10 | 7 | ||
| @@ -14,7 +11,11 @@ class ApplicationController < ActionController::Base | |||
| 14 | if params[:locale] && I18n.available_locales.include?(params[:locale].to_sym) | 11 | if params[:locale] && I18n.available_locales.include?(params[:locale].to_sym) |
| 15 | I18n.locale = params[:locale].to_sym | 12 | I18n.locale = params[:locale].to_sym |
| 16 | else | 13 | else |
| 17 | params.delete(:locale) | 14 | I18n.locale = I18n.default_locale |
| 18 | end | 15 | end |
| 19 | end | 16 | end |
| 17 | |||
| 18 | def default_url_options | ||
| 19 | { locale: I18n.locale == I18n.default_locale ? nil : I18n.locale } | ||
| 20 | end | ||
| 20 | end | 21 | end |
diff --git a/app/models/node.rb b/app/models/node.rb index 59a9d7c..92ecc12 100644 --- a/app/models/node.rb +++ b/app/models/node.rb | |||
| @@ -4,11 +4,11 @@ class Node < ApplicationRecord | |||
| 4 | 4 | ||
| 5 | # Associations | 5 | # Associations |
| 6 | has_many :pages, -> { order("revision ASC") }, :dependent => :destroy | 6 | has_many :pages, -> { order("revision ASC") }, :dependent => :destroy |
| 7 | belongs_to :head, :class_name => "Page", :foreign_key => :head_id, :dependent => :destroy | 7 | belongs_to :head, :class_name => "Page", :foreign_key => :head_id, :dependent => :destroy, optional: true |
| 8 | belongs_to :draft, :class_name => "Page", :foreign_key => :draft_id, :dependent => :destroy | 8 | belongs_to :draft, :class_name => "Page", :foreign_key => :draft_id, :dependent => :destroy, optional: true |
| 9 | has_many :permissions, :dependent => :destroy | 9 | has_many :permissions, :dependent => :destroy |
| 10 | has_one :event, :dependent => :destroy | 10 | has_one :event, :dependent => :destroy |
| 11 | belongs_to :lock_owner, :class_name => "User", :foreign_key => :locking_user_id | 11 | belongs_to :lock_owner, :class_name => "User", :foreign_key => :locking_user_id, optional: true |
| 12 | 12 | ||
| 13 | # Callbacks | 13 | # Callbacks |
| 14 | after_create :initialize_empty_page | 14 | after_create :initialize_empty_page |
diff --git a/app/models/page.rb b/app/models/page.rb index ca3a8be..67db50a 100644 --- a/app/models/page.rb +++ b/app/models/page.rb | |||
| @@ -12,9 +12,9 @@ class Page < ApplicationRecord | |||
| 12 | translates :title, :abstract, :body # Globalize2 | 12 | translates :title, :abstract, :body # Globalize2 |
| 13 | 13 | ||
| 14 | # Associations | 14 | # Associations |
| 15 | belongs_to :node | 15 | belongs_to :node, optional: true |
| 16 | belongs_to :user | 16 | belongs_to :user, optional: true |
| 17 | belongs_to :editor, :class_name => "User" | 17 | belongs_to :editor, :class_name => "User", optional: true |
| 18 | has_many :related_assets | 18 | has_many :related_assets |
| 19 | has_many :assets, -> { order("position ASC") }, :through => :related_assets | 19 | has_many :assets, -> { order("position ASC") }, :through => :related_assets |
| 20 | 20 | ||
diff --git a/app/views/content/_featured_articles.html.erb b/app/views/content/_featured_articles.html.erb index c69911f..6717c51 100644 --- a/app/views/content/_featured_articles.html.erb +++ b/app/views/content/_featured_articles.html.erb | |||
| @@ -10,35 +10,35 @@ | |||
| 10 | )% --> | 10 | )% --> |
| 11 | 11 | ||
| 12 | <%= link_to( | 12 | <%= link_to( |
| 13 | image_tag( 'chaosradio.png' ), | 13 | '<img src="/images/chaosradio.png" alt="Chaosradio">'.html_safe, |
| 14 | "https://chaosradio.ccc.de/", | 14 | "https://chaosradio.ccc.de/", |
| 15 | :id => "chaosradio_icon", | 15 | :id => "chaosradio_icon", |
| 16 | :title => "Chaosradio" | 16 | :title => "Chaosradio" |
| 17 | )%> | 17 | )%> |
| 18 | 18 | ||
| 19 | <%= link_to( | 19 | <%= link_to( |
| 20 | image_tag( 'media-ccc-de-banner.svg', :size => '155x45' ), | 20 | '<img src="/images/media-ccc-de-banner.svg" width="155" height="45" alt="Media Dot CCC Dot de">'.html_safe, |
| 21 | "https://media.ccc.de", | 21 | "https://media.ccc.de", |
| 22 | :id => "media_ccc_de_icon", | 22 | :id => "media_ccc_de_icon", |
| 23 | :title => "Media Dot CCC Dot de" | 23 | :title => "Media Dot CCC Dot de" |
| 24 | )%> | 24 | )%> |
| 25 | 25 | ||
| 26 | <%= link_to( | 26 | <%= link_to( |
| 27 | image_tag( 'ds.png' ), | 27 | '<img src="/images/ds.png" alt="Datenschleuder">'.html_safe, |
| 28 | "https://ds.ccc.de/", | 28 | "https://ds.ccc.de/", |
| 29 | :id => "ds_icon", | 29 | :id => "ds_icon", |
| 30 | :title => "Datenschleuder" | 30 | :title => "Datenschleuder" |
| 31 | )%> | 31 | )%> |
| 32 | 32 | ||
| 33 | <%= link_to( | 33 | <%= link_to( |
| 34 | image_tag( 'events.png' ), | 34 | '<img src="/images/events.png" alt="Events-Blog">'.html_safe, |
| 35 | "https://events.ccc.de/", | 35 | "https://events.ccc.de/", |
| 36 | :id => "events_icon", | 36 | :id => "events_icon", |
| 37 | :title => "Events Blog" | 37 | :title => "Events-Blog" |
| 38 | )%> | 38 | )%> |
| 39 | 39 | ||
| 40 | <%= link_to( | 40 | <%= link_to( |
| 41 | image_tag( 'Fediverse.svg', :size => '64x64' ), | 41 | '<img src="/images/Fediverse.svg" width="64" height="64" alt="Fediverse">'.html_safe, |
| 42 | "https://social.bau-ha.us/@ccc", | 42 | "https://social.bau-ha.us/@ccc", |
| 43 | :rel => 'me', | 43 | :rel => 'me', |
| 44 | :id => "fediverse_icon", | 44 | :id => "fediverse_icon", |
| @@ -46,7 +46,7 @@ | |||
| 46 | )%> | 46 | )%> |
| 47 | 47 | ||
| 48 | <%= link_to( | 48 | <%= link_to( |
| 49 | image_tag( 'Bluesky_Logo.svg', :size => '64x64' ), | 49 | '<img src="/images/Bluesky_Logo.svg" width="64" height="64" alt="bsky">'.html_safe, |
| 50 | "https://bsky.app/profile/ccc.de", | 50 | "https://bsky.app/profile/ccc.de", |
| 51 | :id => "bluesky_icon", | 51 | :id => "bluesky_icon", |
| 52 | :title => "bsky" | 52 | :title => "bsky" |
diff --git a/app/views/layouts/admin.html.erb b/app/views/layouts/admin.html.erb index 2a90786..890aeaa 100644 --- a/app/views/layouts/admin.html.erb +++ b/app/views/layouts/admin.html.erb | |||
| @@ -7,13 +7,12 @@ | |||
| 7 | <%= csrf_meta_tags %> | 7 | <%= csrf_meta_tags %> |
| 8 | 8 | ||
| 9 | <title><%= "#{params[:controller]} | #{params[:action]}" %></title> | 9 | <title><%= "#{params[:controller]} | #{params[:action]}" %></title> |
| 10 | <%= javascript_include_tag 'admin_bundle' %> | ||
| 11 | <%= javascript_include_tag 'tiny_mce/jquery.tinymce.js' %> | ||
| 12 | <%= javascript_tag "var AUTH_TOKEN = #{form_authenticity_token.inspect};" if protect_against_forgery? %> | 10 | <%= javascript_tag "var AUTH_TOKEN = #{form_authenticity_token.inspect};" if protect_against_forgery? %> |
| 13 | <%= stylesheet_link_tag 'admin' %> | 11 | <%= javascript_include_tag 'admin_bundle' %> |
| 14 | <%= javascript_include_tag 'admin_search.js' %> | 12 | <%= tinymce_assets %> |
| 15 | <%= javascript_include_tag 'admin_interface.js' %> | 13 | <link rel="stylesheet" href="/stylesheets/admin.css"> |
| 16 | <%= stylesheet_link_tag 'admin' %> | 14 | <script src="/javascripts/admin_search.js"></script> |
| 15 | <script src="/javascripts/admin_interface.js"></script> | ||
| 17 | </head> | 16 | </head> |
| 18 | 17 | ||
| 19 | <body> | 18 | <body> |
diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index c5cbf14..48e0a5b 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb | |||
| @@ -10,11 +10,11 @@ | |||
| 10 | <meta property="og:description" content="Der Chaos Computer Club ist eine galaktische Gemeinschaft von Lebewesen für Informationsfreiheit und Technikfolgenabschätzung." /> | 10 | <meta property="og:description" content="Der Chaos Computer Club ist eine galaktische Gemeinschaft von Lebewesen für Informationsfreiheit und Technikfolgenabschätzung." /> |
| 11 | 11 | ||
| 12 | <title><%= page_title %></title> | 12 | <title><%= page_title %></title> |
| 13 | <%= stylesheet_link_tag "ccc" %> | 13 | <link rel="stylesheet" href="/stylesheets/ccc.css"> |
| 14 | <%= javascript_include_tag 'jquery-1.3.2.min' %> | 14 | <script src="/javascripts/jquery-1.3.2.min.js"></script> |
| 15 | <%= javascript_include_tag 'shadowbox/shadowbox' %> | 15 | <script src="/javascripts/shadowbox/shadowbox.js"></script> |
| 16 | <%= stylesheet_link_tag "shadowbox" %> | 16 | <link rel="stylesheet" href="/stylesheets/shadowbox.css"> |
| 17 | <%= javascript_include_tag 'public' %> | 17 | <script src="/javascripts/public.js"></script> |
| 18 | 18 | ||
| 19 | <%= auto_discovery_link_tag(:atom, '/rss/updates.xml', title: "ATOM") %> | 19 | <%= auto_discovery_link_tag(:atom, '/rss/updates.xml', title: "ATOM") %> |
| 20 | <%= auto_discovery_link_tag(:rss, '/rss/updates.rdf', title: "RSS") %> | 20 | <%= auto_discovery_link_tag(:rss, '/rss/updates.rdf', title: "RSS") %> |
| @@ -31,7 +31,7 @@ | |||
| 31 | <body lang="<%= @page ? @page.effective_lang : 'de' %>"> | 31 | <body lang="<%= @page ? @page.effective_lang : 'de' %>"> |
| 32 | <div id="wrapper"> | 32 | <div id="wrapper"> |
| 33 | <div id="header"> | 33 | <div id="header"> |
| 34 | <%= image_tag("header.png") %> | 34 | <img src="/images/header.png" alt=""> |
| 35 | </div> | 35 | </div> |
| 36 | <div id="toolbox"> | 36 | <div id="toolbox"> |
| 37 | <div id="search"> | 37 | <div id="search"> |
diff --git a/app/views/revisions/diff.html.erb b/app/views/revisions/diff.html.erb index efda85d..b8d061d 100644 --- a/app/views/revisions/diff.html.erb +++ b/app/views/revisions/diff.html.erb | |||
| @@ -38,7 +38,7 @@ | |||
| 38 | </div> | 38 | </div> |
| 39 | </pre> | 39 | </pre> |
| 40 | 40 | ||
| 41 | <%= javascript_include_tag 'cacycle_diff' %> | 41 | <script src="/javascripts/cacycle_diff.js"></script> |
| 42 | <script type="text/javascript" charset="utf-8"> | 42 | <script type="text/javascript" charset="utf-8"> |
| 43 | window.onload = function() { | 43 | window.onload = function() { |
| 44 | title1 = document.getElementById('start_title').innerHTML; | 44 | title1 = document.getElementById('start_title').innerHTML; |
