From 19959b083e0b805ab87e8fcafdec0d0fda775c9c Mon Sep 17 00:00:00 2001 From: Andreas Stephanides Date: Wed, 29 Apr 2015 15:25:10 +0200 Subject: [PATCH] time zone --- app/models/neuigkeit.rb | 6 +++--- app/views/documents/show.html.erb | 3 ++- config/application.rb | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/app/models/neuigkeit.rb b/app/models/neuigkeit.rb index c8170f1..cec9114 100755 --- a/app/models/neuigkeit.rb +++ b/app/models/neuigkeit.rb @@ -31,8 +31,8 @@ class Neuigkeit < ActiveRecord::Base default_scope order(:cache_order) scope :recent, -> { published.limit(10)} - scope :unpublished, -> {where("datum > ? OR datum IS NULL", Date.today)} - scope :published_scope, ->{where("datum <= ? AND datum IS NOT NULL", Date.today)} + scope :unpublished, -> {where("datum > ? OR datum IS NULL", Time.now)} + scope :published_scope, ->{where("datum <= ? AND datum IS NOT NULL", Time.now)} scope :public, ->{includes(:rubrik).where("rubriken.public"=>true)} scope :intern, ->{includes(:rubrik).where("rubriken.public"=>false)} @@ -74,7 +74,7 @@ class Neuigkeit < ActiveRecord::Base self.rubrik.public end def published? - self.datum_nilsave<=Time.now. + self.datum_nilsave<=Time.now end def publish diff --git a/app/views/documents/show.html.erb b/app/views/documents/show.html.erb index f367a44..2d51a43 100644 --- a/app/views/documents/show.html.erb +++ b/app/views/documents/show.html.erb @@ -1,11 +1,12 @@
- <%= link_to "Back to parent" , @document.parent, class: "btn" %>
+<%= link_to "PDF", document_path(@document, :format=>"pdf"),class: "btn" %> <%= link_to ff_icon("icon-pencil") + "Edit", write_document_path(@document), class: "btn" %> <%= link_to ff_icon("icon-refresh")+"Refresh from Etherpad", read_from_etherpad_document_path(@document), class: "btn" if @document.is_etherpad? %> <%= link_to "Copy Document to Etherpad", dump_to_etherpad_document_path(@document) , confirm: "Sicher? Löscht alle Änderungen im Etherpad" , class: "btn" %> <%= link_to 'Delete', @document, method: :delete, data: { confirm: 'Are you sure?' } , remote: true, class: "btn btn-danger" if can? :delete, @document %> +

<%= @document.name %>

diff --git a/config/application.rb b/config/application.rb index eccce65..3de221a 100755 --- a/config/application.rb +++ b/config/application.rb @@ -29,7 +29,7 @@ module Fetsite # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone. # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC. - # config.time_zone = 'Central Time (US & Canada)' + config.time_zone = 'Vienna' #'Central Time (US & Canada)' # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded. # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]