diff options
| -rw-r--r-- | app/controllers/content_controller.rb | 3 | ||||
| -rw-r--r-- | app/controllers/nodes_controller.rb | 12 | ||||
| -rw-r--r-- | app/helpers/link_helper.rb | 13 | ||||
| -rw-r--r-- | app/models/node.rb | 5 | ||||
| -rw-r--r-- | app/models/page.rb | 67 | ||||
| -rw-r--r-- | app/views/layouts/admin.html.erb | 3 | ||||
| -rw-r--r-- | app/views/layouts/application.html.erb | 9 | ||||
| -rw-r--r-- | app/views/nodes/_preview.html.erb | 5 | ||||
| -rw-r--r-- | app/views/nodes/edit.html.erb | 7 | ||||
| -rw-r--r-- | app/views/nodes/index.html.erb | 4 | ||||
| -rw-r--r-- | app/views/nodes/show.html.erb | 6 | ||||
| -rw-r--r-- | config/environment.rb | 12 | ||||
| -rw-r--r-- | config/locales/de.yml | 119 | ||||
| -rw-r--r-- | lib/tasks/development_init.rake | 28 | ||||
| -rw-r--r-- | public/stylesheets/admin.css | 6 | ||||
| -rwxr-xr-x | public/stylesheets/styled.css | 13 | ||||
| -rw-r--r-- | test/functional/nodes_controller_test.rb | 2 | ||||
| m--------- | vendor/rails | 0 |
18 files changed, 249 insertions, 65 deletions
diff --git a/app/controllers/content_controller.rb b/app/controllers/content_controller.rb index 706cfcd..d548a34 100644 --- a/app/controllers/content_controller.rb +++ b/app/controllers/content_controller.rb | |||
| @@ -10,7 +10,7 @@ class ContentController < ApplicationController | |||
| 10 | 10 | ||
| 11 | @page = Node.find_page(path) | 11 | @page = Node.find_page(path) |
| 12 | 12 | ||
| 13 | if @page | 13 | if @page and @page.public? |
| 14 | template = @page.valid_template | 14 | template = @page.valid_template |
| 15 | 15 | ||
| 16 | render( | 16 | render( |
| @@ -25,4 +25,5 @@ class ContentController < ApplicationController | |||
| 25 | end | 25 | end |
| 26 | 26 | ||
| 27 | end | 27 | end |
| 28 | |||
| 28 | end | 29 | end |
diff --git a/app/controllers/nodes_controller.rb b/app/controllers/nodes_controller.rb index 81ead62..0c961b7 100644 --- a/app/controllers/nodes_controller.rb +++ b/app/controllers/nodes_controller.rb | |||
| @@ -32,7 +32,7 @@ class NodesController < ApplicationController | |||
| 32 | 32 | ||
| 33 | if parent and @node.save | 33 | if parent and @node.save |
| 34 | @node.move_to_child_of parent | 34 | @node.move_to_child_of parent |
| 35 | redirect_to(@node) | 35 | redirect_to(edit_node_path(@node)) |
| 36 | else | 36 | else |
| 37 | @node.errors.add("Parent node") | 37 | @node.errors.add("Parent node") |
| 38 | render :action => :new | 38 | render :action => :new |
| @@ -40,7 +40,15 @@ class NodesController < ApplicationController | |||
| 40 | end | 40 | end |
| 41 | 41 | ||
| 42 | def show | 42 | def show |
| 43 | @nodes = Node.find(params[:id]).children | 43 | @page = Node.find(params[:id]).draft |
| 44 | |||
| 45 | if @page | ||
| 46 | template = @page.valid_template | ||
| 47 | render( | ||
| 48 | :file => template, | ||
| 49 | :layout => "application" | ||
| 50 | ) | ||
| 51 | end | ||
| 44 | end | 52 | end |
| 45 | 53 | ||
| 46 | def edit | 54 | def edit |
diff --git a/app/helpers/link_helper.rb b/app/helpers/link_helper.rb index 68586c1..33d8a06 100644 --- a/app/helpers/link_helper.rb +++ b/app/helpers/link_helper.rb | |||
| @@ -1,11 +1,14 @@ | |||
| 1 | module LinkHelper | 1 | module LinkHelper |
| 2 | 2 | ||
| 3 | def link_to_path path | 3 | def link_to_path title, path |
| 4 | url_for( | 4 | params[:locale] ||= I18n.locale |
| 5 | |||
| 6 | link_to( | ||
| 7 | title, | ||
| 5 | :controller => :content, | 8 | :controller => :content, |
| 6 | :action => :render_page, | 9 | :action => :render_page, |
| 7 | :language => I18n.locale, | 10 | :locale => params[:locale], |
| 8 | :page_path => path | 11 | :page_path => path |
| 9 | ) | 12 | ) |
| 10 | end | 13 | end |
| 11 | 14 | ||
diff --git a/app/models/node.rb b/app/models/node.rb index 7f2bca6..d2db4ba 100644 --- a/app/models/node.rb +++ b/app/models/node.rb | |||
| @@ -59,7 +59,6 @@ class Node < ActiveRecord::Base | |||
| 59 | def create_new_draft user | 59 | def create_new_draft user |
| 60 | empty_page = self.pages.new | 60 | empty_page = self.pages.new |
| 61 | empty_page.user = user | 61 | empty_page.user = user |
| 62 | |||
| 63 | empty_page.clone_attributes_from self.head | 62 | empty_page.clone_attributes_from self.head |
| 64 | 63 | ||
| 65 | self.draft = empty_page | 64 | self.draft = empty_page |
| @@ -70,11 +69,9 @@ class Node < ActiveRecord::Base | |||
| 70 | def publish_draft! | 69 | def publish_draft! |
| 71 | if self.draft | 70 | if self.draft |
| 72 | self.head = self.draft | 71 | self.head = self.draft |
| 72 | self.head.save! | ||
| 73 | self.draft = nil | 73 | self.draft = nil |
| 74 | self.save! | 74 | self.save! |
| 75 | |||
| 76 | self.head.published_at = Time.now | ||
| 77 | self.head.save! | ||
| 78 | else | 75 | else |
| 79 | nil | 76 | nil |
| 80 | end | 77 | end |
diff --git a/app/models/page.rb b/app/models/page.rb index a4817a3..af820e3 100644 --- a/app/models/page.rb +++ b/app/models/page.rb | |||
| @@ -1,3 +1,5 @@ | |||
| 1 | require 'xml' | ||
| 2 | |||
| 1 | class Page < ActiveRecord::Base | 3 | class Page < ActiveRecord::Base |
| 2 | 4 | ||
| 3 | PUBLIC_TEMPLATE_PATH = File.join(%w(custom page_templates public)) | 5 | PUBLIC_TEMPLATE_PATH = File.join(%w(custom page_templates public)) |
| @@ -17,7 +19,7 @@ class Page < ActiveRecord::Base | |||
| 17 | before_save :rewrite_links_in_body | 19 | before_save :rewrite_links_in_body |
| 18 | 20 | ||
| 19 | # Security | 21 | # Security |
| 20 | attr_accessible :title, :abstract, :body, :template_name | 22 | attr_accessible :title, :abstract, :body, :template_name, :published_at |
| 21 | 23 | ||
| 22 | # Class Methods | 24 | # Class Methods |
| 23 | 25 | ||
| @@ -57,24 +59,6 @@ class Page < ActiveRecord::Base | |||
| 57 | end | 59 | end |
| 58 | 60 | ||
| 59 | # Instance Methods | 61 | # Instance Methods |
| 60 | |||
| 61 | def clone_attributes_from page | ||
| 62 | return nil unless page | ||
| 63 | |||
| 64 | self.tag_list = page.tag_list.join(", ") | ||
| 65 | |||
| 66 | locale_before = I18n.locale | ||
| 67 | |||
| 68 | I18n.available_locales.each do |l| | ||
| 69 | next if l == :root | ||
| 70 | I18n.locale = l | ||
| 71 | self.title = page.title | ||
| 72 | self.abstract = page.abstract | ||
| 73 | self.body = page.body | ||
| 74 | end | ||
| 75 | |||
| 76 | I18n.locale = locale_before | ||
| 77 | end | ||
| 78 | 62 | ||
| 79 | def public_template_path | 63 | def public_template_path |
| 80 | File.join(PUBLIC_TEMPLATE_PATH, template_name) | 64 | File.join(PUBLIC_TEMPLATE_PATH, template_name) |
| @@ -104,8 +88,13 @@ class Page < ActiveRecord::Base | |||
| 104 | def clone_attributes_from page | 88 | def clone_attributes_from page |
| 105 | return nil unless page | 89 | return nil unless page |
| 106 | 90 | ||
| 91 | # Clone untranslated attributes | ||
| 92 | |||
| 107 | self.tag_list = page.tag_list.join(", ") | 93 | self.tag_list = page.tag_list.join(", ") |
| 108 | self.template_name = page.template_name | 94 | self.template_name = page.template_name |
| 95 | self.published_at = page.published_at | ||
| 96 | |||
| 97 | # Clone translated attributes | ||
| 109 | 98 | ||
| 110 | locale_before = I18n.locale | 99 | locale_before = I18n.locale |
| 111 | 100 | ||
| @@ -120,27 +109,35 @@ class Page < ActiveRecord::Base | |||
| 120 | I18n.locale = locale_before | 109 | I18n.locale = locale_before |
| 121 | end | 110 | end |
| 122 | 111 | ||
| 112 | def public? | ||
| 113 | published_at.nil? ? true : published_at < Time.now | ||
| 114 | end | ||
| 115 | |||
| 123 | private | 116 | private |
| 124 | 117 | ||
| 125 | def rewrite_links_in_body | 118 | def rewrite_links_in_body |
| 126 | if self.body | 119 | begin |
| 127 | tmp_body = "<div>#{self.body}</div>" | 120 | if self.body |
| 128 | xml_string = XML::Parser.string( tmp_body ) | 121 | tmp_body = "<div>#{self.body}</div>" |
| 129 | xml_doc = xml_string.parse | 122 | xml_string = XML::Parser.string( tmp_body ) |
| 130 | links = xml_doc.find("a[not(starts-with(@href, 'http://'))]") | 123 | xml_doc = xml_string.parse |
| 131 | 124 | links = xml_doc.find("//a[not(starts-with(@href, 'http://'))]") | |
| 132 | locales = I18n.available_locales.reject {|l| l == :root} | 125 | |
| 133 | 126 | locales = I18n.available_locales.reject {|l| l == :root} | |
| 134 | links.each do |link| | 127 | |
| 135 | unless locales.include? link[:href].slice(1,2).to_sym | 128 | links.each do |link| |
| 136 | link[:href] = link[:href].sub(/^\//, "/#{I18n.locale}/") | 129 | unless locales.include? link[:href].slice(1,2).to_sym |
| 130 | link[:href] = link[:href].sub(/^\//, "/#{I18n.locale}/") | ||
| 131 | end | ||
| 137 | end | 132 | end |
| 133 | |||
| 134 | tmp_body = xml_doc.to_s.gsub(/(\n\<div\>|\<\/div\>\n)/, "") | ||
| 135 | tmp_body.gsub!("<?xml version=\"1.0\" encoding=\"UTF-8\"?>", "") | ||
| 136 | |||
| 137 | self.body = tmp_body | ||
| 138 | end | 138 | end |
| 139 | 139 | rescue | |
| 140 | tmp_body = xml_doc.to_s.gsub(/(\n\<div\>|\<\/div\>\n)/, "") | 140 | nil |
| 141 | tmp_body.gsub!("<?xml version=\"1.0\" encoding=\"UTF-8\"?>", "") | ||
| 142 | |||
| 143 | self.body = tmp_body | ||
| 144 | end | 141 | end |
| 145 | end | 142 | end |
| 146 | 143 | ||
diff --git a/app/views/layouts/admin.html.erb b/app/views/layouts/admin.html.erb index 840c37c..bede781 100644 --- a/app/views/layouts/admin.html.erb +++ b/app/views/layouts/admin.html.erb | |||
| @@ -20,7 +20,8 @@ | |||
| 20 | theme_advanced_buttons2 : "", | 20 | theme_advanced_buttons2 : "", |
| 21 | theme_advanced_buttons3 : "", | 21 | theme_advanced_buttons3 : "", |
| 22 | extended_valid_elements : "aggregate[tags|limit|order_by|order_direction|partial]", | 22 | extended_valid_elements : "aggregate[tags|limit|order_by|order_direction|partial]", |
| 23 | relative_urls : false | 23 | relative_urls : false, |
| 24 | entity_encoding : "raw" | ||
| 24 | }); | 25 | }); |
| 25 | </script> | 26 | </script> |
| 26 | </head> | 27 | </head> |
diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index be7e044..e6317fd 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb | |||
| @@ -12,10 +12,11 @@ | |||
| 12 | <![endif]--> | 12 | <![endif]--> |
| 13 | </head> | 13 | </head> |
| 14 | <body> | 14 | <body> |
| 15 | <%= render :partial => 'nodes/preview' if params[:action] == "show" %> | ||
| 15 | <div id="logo"> | 16 | <div id="logo"> |
| 16 | <a href="index.html" title="Startseite"><img src="/images/chaosknot.gif" alt="Chaosknoten" /></a> | 17 | <a href="index.html" title="Startseite"><img src="/images/chaosknot.gif" alt="Chaosknoten" /></a> |
| 17 | </div> | 18 | </div> |
| 18 | <!-- HEAD --> | 19 | <!-- HEAD --> |
| 19 | <div id="header"> | 20 | <div id="header"> |
| 20 | <div id="yellow"> | 21 | <div id="yellow"> |
| 21 | </div> | 22 | </div> |
| @@ -25,19 +26,19 @@ | |||
| 25 | <div id="topnav"> | 26 | <div id="topnav"> |
| 26 | <ul id="navlist"> | 27 | <ul id="navlist"> |
| 27 | <li> | 28 | <li> |
| 28 | <a href="<%= params[:locale] %>/club">Kennenlernen</a> | 29 | <%= link_to_path "Kennenlernen", "club" %> |
| 29 | </li> | 30 | </li> |
| 30 | <li> | 31 | <li> |
| 31 | • | 32 | • |
| 32 | </li> | 33 | </li> |
| 33 | <li> | 34 | <li> |
| 34 | <a href="<%= params[:locale] %>/support">Unterstützen</a> | 35 | <%= link_to_path "Unterstützen", "support" %> |
| 35 | </li> | 36 | </li> |
| 36 | <li> | 37 | <li> |
| 37 | • | 38 | • |
| 38 | </li> | 39 | </li> |
| 39 | <li> | 40 | <li> |
| 40 | <a href="<%= params[:locale] %>/contact">Erreichen</a> | 41 | <%= link_to_path "Erreichen", "contact" %> |
| 41 | </li> | 42 | </li> |
| 42 | <% if current_user %> | 43 | <% if current_user %> |
| 43 | <li> | 44 | <li> |
diff --git a/app/views/nodes/_preview.html.erb b/app/views/nodes/_preview.html.erb new file mode 100644 index 0000000..e8d7b9f --- /dev/null +++ b/app/views/nodes/_preview.html.erb | |||
| @@ -0,0 +1,5 @@ | |||
| 1 | <div id="preview_disclaimer"> | ||
| 2 | <strong>Preview draft.</strong> | ||
| 3 | Clicking on links will redirected you to the public site. | ||
| 4 | <%= link_to 'Back to admin interface', nodes_path %> | ||
| 5 | </div \ No newline at end of file | ||
diff --git a/app/views/nodes/edit.html.erb b/app/views/nodes/edit.html.erb index 929bbf6..2dade0f 100644 --- a/app/views/nodes/edit.html.erb +++ b/app/views/nodes/edit.html.erb | |||
| @@ -13,9 +13,14 @@ | |||
| 13 | <%= f.error_messages %> | 13 | <%= f.error_messages %> |
| 14 | 14 | ||
| 15 | <% fields_for @draft do |d| %> | 15 | <% fields_for @draft do |d| %> |
| 16 | |||
| 17 | <p> | ||
| 18 | <%= d.label :published_at %><br /> | ||
| 19 | <%= d.datetime_select :published_at %> | ||
| 20 | </p> | ||
| 16 | <p> | 21 | <p> |
| 17 | <%= d.label :template_name %> | 22 | <%= d.label :template_name %> |
| 18 | <%= d.select :template_name, custom_page_templates %> | 23 | <%= d.select :template_name, custom_page_templates, {:prompt => 'Select Template'} %> |
| 19 | </p> | 24 | </p> |
| 20 | <p> | 25 | <p> |
| 21 | <%= d.label :title %><br /> | 26 | <%= d.label :title %><br /> |
diff --git a/app/views/nodes/index.html.erb b/app/views/nodes/index.html.erb index 833ffed..a2a42b1 100644 --- a/app/views/nodes/index.html.erb +++ b/app/views/nodes/index.html.erb | |||
| @@ -11,6 +11,7 @@ | |||
| 11 | <th class="path">Path</th> | 11 | <th class="path">Path</th> |
| 12 | <th class="actions">Actions</th> | 12 | <th class="actions">Actions</th> |
| 13 | <th class="editor">Locked by</th> | 13 | <th class="editor">Locked by</th> |
| 14 | <th class="revision">Rev.</th> | ||
| 14 | </tr> | 15 | </tr> |
| 15 | <% @nodes.each do |node| %> | 16 | <% @nodes.each do |node| %> |
| 16 | <tr class="<%= cycle("even", "odd") %>"> | 17 | <tr class="<%= cycle("even", "odd") %>"> |
| @@ -29,6 +30,9 @@ | |||
| 29 | <td> | 30 | <td> |
| 30 | <%= "#{node.draft.user.login}" if node.draft && node.draft.user %> | 31 | <%= "#{node.draft.user.login}" if node.draft && node.draft.user %> |
| 31 | </td> | 32 | </td> |
| 33 | <td> | ||
| 34 | <%= node.head.revision if node.head %> | ||
| 35 | </td> | ||
| 32 | </tr> | 36 | </tr> |
| 33 | <% end %> | 37 | <% end %> |
| 34 | </table> | 38 | </table> |
diff --git a/app/views/nodes/show.html.erb b/app/views/nodes/show.html.erb index dd37c28..67dd7fc 100644 --- a/app/views/nodes/show.html.erb +++ b/app/views/nodes/show.html.erb | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | <h1>Node</h1> | 1 | <h1>Node</h1> |
| 2 | 2 | ||
| 3 | <%= @node.unique_name %> | 3 | There is no draft to preview. Click <%= link_to 'edit', edit_node_path %> to |
| 4 | 4 | create one or view the currently | |
| 5 | <%= link_to 'Edit', edit_node_path %> \ No newline at end of file | 5 | <%= link_to_path 'published version', @node.unique_path %>. \ No newline at end of file |
diff --git a/config/environment.rb b/config/environment.rb index a3fcfa3..20b38b6 100644 --- a/config/environment.rb +++ b/config/environment.rb | |||
| @@ -20,12 +20,12 @@ Rails::Initializer.run do |config| | |||
| 20 | # config.gem "sqlite3-ruby", :lib => "sqlite3" | 20 | # config.gem "sqlite3-ruby", :lib => "sqlite3" |
| 21 | # config.gem "aws-s3", :lib => "aws/s3" | 21 | # config.gem "aws-s3", :lib => "aws/s3" |
| 22 | 22 | ||
| 23 | config.gem "rake", :version => ">= 0.8.3" | 23 | # config.gem "rake", :version => ">= 0.8.3" |
| 24 | config.gem "rack", :version => ">= 0.9.1" | 24 | # config.gem "rack", :version => ">= 0.9.1" |
| 25 | config.gem "mongrel", :version => ">= 1.1.5" | 25 | # config.gem "mongrel", :version => ">= 1.1.5" |
| 26 | config.gem "libxml-ruby", :lib => 'xml' | 26 | # config.gem "libxml-ruby", :lib => 'xml' |
| 27 | config.gem "vpim" | 27 | # config.gem "vpim" |
| 28 | config.gem "spicycode-rcov", :lib => 'rcov', :souce => "http://gems.github.com" | 28 | # config.gem "spicycode-rcov", :lib => 'rcov', :souce => "http://gems.github.com" |
| 29 | 29 | ||
| 30 | # Only load the plugins named here, in the order given (default is alphabetical). | 30 | # Only load the plugins named here, in the order given (default is alphabetical). |
| 31 | # :all can be used as a placeholder for all plugins not explicitly named | 31 | # :all can be used as a placeholder for all plugins not explicitly named |
diff --git a/config/locales/de.yml b/config/locales/de.yml index 3ddfada..f6bb1b7 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml | |||
| @@ -1,2 +1,119 @@ | |||
| 1 | # German translations for Ruby on Rails | ||
| 2 | # by Clemens Kofler (clemens@railway.at) | ||
| 3 | |||
| 1 | de: | 4 | de: |
| 2 | hello: "Hello World" \ No newline at end of file | 5 | date: |
| 6 | formats: | ||
| 7 | default: "%d.%m.%Y" | ||
| 8 | short: "%e. %b" | ||
| 9 | long: "%e. %B %Y" | ||
| 10 | only_day: "%e" | ||
| 11 | |||
| 12 | day_names: [Sonntag, Montag, Dienstag, Mittwoch, Donnerstag, Freitag, Samstag] | ||
| 13 | abbr_day_names: [So, Mo, Di, Mi, Do, Fr, Sa] | ||
| 14 | month_names: [~, Januar, Februar, März, April, Mai, Juni, Juli, August, September, Oktober, November, Dezember] | ||
| 15 | abbr_month_names: [~, Jan, Feb, Mär, Apr, Mai, Jun, Jul, Aug, Sep, Okt, Nov, Dez] | ||
| 16 | order: [ :day, :month, :year ] | ||
| 17 | |||
| 18 | time: | ||
| 19 | formats: | ||
| 20 | default: "%A, %e. %B %Y, %H:%M Uhr" | ||
| 21 | short: "%e. %B, %H:%M Uhr" | ||
| 22 | long: "%A, %e. %B %Y, %H:%M Uhr" | ||
| 23 | time: "%H:%M" | ||
| 24 | |||
| 25 | am: "vormittags" | ||
| 26 | pm: "nachmittags" | ||
| 27 | |||
| 28 | datetime: | ||
| 29 | distance_in_words: | ||
| 30 | half_a_minute: 'eine halbe Minute' | ||
| 31 | less_than_x_seconds: | ||
| 32 | zero: 'weniger als 1 Sekunde' | ||
| 33 | one: 'weniger als 1 Sekunde' | ||
| 34 | other: 'weniger als {{count}} Sekunden' | ||
| 35 | x_seconds: | ||
| 36 | one: '1 Sekunde' | ||
| 37 | other: '{{count}} Sekunden' | ||
| 38 | less_than_x_minutes: | ||
| 39 | zero: 'weniger als 1 Minute' | ||
| 40 | one: 'weniger als eine Minute' | ||
| 41 | other: 'weniger als {{count}} Minuten' | ||
| 42 | x_minutes: | ||
| 43 | one: '1 Minute' | ||
| 44 | other: '{{count}} Minuten' | ||
| 45 | about_x_hours: | ||
| 46 | one: 'etwa 1 Stunde' | ||
| 47 | other: 'etwa {{count}} Stunden' | ||
| 48 | x_days: | ||
| 49 | one: '1 Tag' | ||
| 50 | other: '{{count}} Tage' | ||
| 51 | about_x_months: | ||
| 52 | one: 'etwa 1 Monat' | ||
| 53 | other: 'etwa {{count}} Monate' | ||
| 54 | x_months: | ||
| 55 | one: '1 Monat' | ||
| 56 | other: '{{count}} Monate' | ||
| 57 | about_x_years: | ||
| 58 | one: 'etwa 1 Jahr' | ||
| 59 | other: 'etwa {{count}} Jahre' | ||
| 60 | over_x_years: | ||
| 61 | one: 'mehr als 1 Jahr' | ||
| 62 | other: 'mehr als {{count}} Jahre' | ||
| 63 | |||
| 64 | number: | ||
| 65 | format: | ||
| 66 | precision: 2 | ||
| 67 | separator: ',' | ||
| 68 | delimiter: '.' | ||
| 69 | currency: | ||
| 70 | format: | ||
| 71 | unit: '€' | ||
| 72 | format: '%n%u' | ||
| 73 | separator: | ||
| 74 | delimiter: | ||
| 75 | precision: | ||
| 76 | percentage: | ||
| 77 | format: | ||
| 78 | delimiter: "" | ||
| 79 | precision: | ||
| 80 | format: | ||
| 81 | delimiter: "" | ||
| 82 | human: | ||
| 83 | format: | ||
| 84 | delimiter: "" | ||
| 85 | precision: 1 | ||
| 86 | |||
| 87 | support: | ||
| 88 | array: | ||
| 89 | sentence_connector: "und" | ||
| 90 | skip_last_comma: true | ||
| 91 | |||
| 92 | activerecord: | ||
| 93 | errors: | ||
| 94 | template: | ||
| 95 | header: | ||
| 96 | one: "Konnte dieses {{model}} Objekt nicht speichern: 1 Fehler." | ||
| 97 | other: "Konnte dieses {{model}} Objekt nicht speichern: {{count}} Fehler." | ||
| 98 | body: "Bitte überprüfen Sie die folgenden Felder:" | ||
| 99 | |||
| 100 | messages: | ||
| 101 | inclusion: "ist kein gültiger Wert" | ||
| 102 | exclusion: "ist nicht verfügbar" | ||
| 103 | invalid: "ist nicht gültig" | ||
| 104 | confirmation: "stimmt nicht mit der Bestätigung überein" | ||
| 105 | accepted: "muss akzeptiert werden" | ||
| 106 | empty: "muss ausgefüllt werden" | ||
| 107 | blank: "muss ausgefüllt werden" | ||
| 108 | too_long: "ist zu lang (nicht mehr als {{count}} Zeichen)" | ||
| 109 | too_short: "ist zu kurz (nicht weniger als {{count}} Zeichen)" | ||
| 110 | wrong_length: "hat die falsche Länge (muss genau {{count}} Zeichen haben)" | ||
| 111 | taken: "ist bereits vergeben" | ||
| 112 | not_a_number: "ist keine Zahl" | ||
| 113 | greater_than: "muss größer als {{count}} sein" | ||
| 114 | greater_than_or_equal_to: "muss größer oder gleich {{count}} sein" | ||
| 115 | equal_to: "muss genau {{count}} sein" | ||
| 116 | less_than: "muss kleiner als {{count}} sein" | ||
| 117 | less_than_or_equal_to: "muss kleiner oder gleich {{count}} sein" | ||
| 118 | odd: "muss ungerade sein" | ||
| 119 | even: "muss gerade sein" \ No newline at end of file | ||
diff --git a/lib/tasks/development_init.rake b/lib/tasks/development_init.rake index 22553fc..789cdf6 100644 --- a/lib/tasks/development_init.rake +++ b/lib/tasks/development_init.rake | |||
| @@ -58,4 +58,32 @@ namespace :cccms do | |||
| 58 | 58 | ||
| 59 | n.publish_draft! | 59 | n.publish_draft! |
| 60 | end | 60 | end |
| 61 | |||
| 62 | desc "Convert Entities to real charactes" | ||
| 63 | task :convert_entities => :environment do |t| | ||
| 64 | Page.all.each do |page| | ||
| 65 | if page.body && page.body != "" | ||
| 66 | puts ">> #{page.id} -- #{page.node.unique_name if page.node}" | ||
| 67 | tmp_body = page.body.dup | ||
| 68 | tmp_body.gsub!(/ä/, "ä") | ||
| 69 | tmp_body.gsub!(/ö/, "ö") | ||
| 70 | tmp_body.gsub!(/ü/, "ü") | ||
| 71 | tmp_body.gsub!(/Ä/, "ä") | ||
| 72 | tmp_body.gsub!(/Ö/, "ö") | ||
| 73 | tmp_body.gsub!(/Ü/, "ü") | ||
| 74 | tmp_body.gsub!(/ß/, "ß") | ||
| 75 | tmp_body.gsub!(/ /, " ") | ||
| 76 | tmp_body.gsub!(/–/, "–") | ||
| 77 | tmp_body.gsub!(/µ/, "µ") | ||
| 78 | tmp_body.gsub!(/³/, "³") | ||
| 79 | tmp_body.gsub!(/é/, "é") | ||
| 80 | tmp_body.gsub!(/§/, "§") | ||
| 81 | tmp_body.gsub!(/“/, "“") | ||
| 82 | tmp_body.gsub!(/”/, "”") | ||
| 83 | tmp_body.gsub!(/„/, "„") | ||
| 84 | page.body = tmp_body | ||
| 85 | page.save | ||
| 86 | end | ||
| 87 | end | ||
| 88 | end | ||
| 61 | end \ No newline at end of file | 89 | end \ No newline at end of file |
diff --git a/public/stylesheets/admin.css b/public/stylesheets/admin.css index 5fe88f1..3e67231 100644 --- a/public/stylesheets/admin.css +++ b/public/stylesheets/admin.css | |||
| @@ -22,7 +22,7 @@ th { | |||
| 22 | } | 22 | } |
| 23 | 23 | ||
| 24 | th.title { | 24 | th.title { |
| 25 | width: 400px; | 25 | width: 370px; |
| 26 | } | 26 | } |
| 27 | 27 | ||
| 28 | th.path { | 28 | th.path { |
| @@ -37,6 +37,10 @@ th.editor { | |||
| 37 | width: 120px; | 37 | width: 120px; |
| 38 | } | 38 | } |
| 39 | 39 | ||
| 40 | th.revision { | ||
| 41 | width: 30px; | ||
| 42 | } | ||
| 43 | |||
| 40 | td { | 44 | td { |
| 41 | padding: 3px; | 45 | padding: 3px; |
| 42 | } | 46 | } |
diff --git a/public/stylesheets/styled.css b/public/stylesheets/styled.css index 707905e..d0312a7 100755 --- a/public/stylesheets/styled.css +++ b/public/stylesheets/styled.css | |||
| @@ -13,6 +13,19 @@ | |||
| 13 | * #eab407 = Content Headers | 13 | * #eab407 = Content Headers |
| 14 | * #fbb03b = Orange, Teaserbar Subheaders | 14 | * #fbb03b = Orange, Teaserbar Subheaders |
| 15 | */ | 15 | */ |
| 16 | |||
| 17 | body div#preview_disclaimer { | ||
| 18 | font-size: 16px; | ||
| 19 | background-color: #ff0000; | ||
| 20 | color: #ffffff; | ||
| 21 | padding-left: 20px; | ||
| 22 | padding-bottom: 5px; | ||
| 23 | } | ||
| 24 | |||
| 25 | body div#preview_disclaimer a { | ||
| 26 | color: #ffffff; | ||
| 27 | text-decoration: underline; | ||
| 28 | } | ||
| 16 | 29 | ||
| 17 | #wrapper { | 30 | #wrapper { |
| 18 | margin:0; | 31 | margin:0; |
diff --git a/test/functional/nodes_controller_test.rb b/test/functional/nodes_controller_test.rb index fdeb6cb..edc49b6 100644 --- a/test/functional/nodes_controller_test.rb +++ b/test/functional/nodes_controller_test.rb | |||
| @@ -19,7 +19,7 @@ class NodesControllerTest < ActionController::TestCase | |||
| 19 | def test_create | 19 | def test_create |
| 20 | login_as :quentin | 20 | login_as :quentin |
| 21 | post :create, :node => {:slug => 'foobar'}, :parent_id => Node.root.id | 21 | post :create, :node => {:slug => 'foobar'}, :parent_id => Node.root.id |
| 22 | assert_redirected_to node_path(Node.last) | 22 | assert_redirected_to edit_node_path(Node.last) |
| 23 | end | 23 | end |
| 24 | 24 | ||
| 25 | def test_editing_a_node | 25 | def test_editing_a_node |
diff --git a/vendor/rails b/vendor/rails | |||
| Subproject c7b50558a42811f1fa60bb1adb7122f0322bc65 | Subproject bc5c984c3e2dd3ae63cb89216e581a24cd76bd0 | ||
