time zone

This commit is contained in:
Andreas Stephanides
2015-04-29 15:25:10 +02:00
parent 2d2931cdb8
commit 19959b083e
3 changed files with 6 additions and 5 deletions

View File

@@ -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

View File

@@ -1,11 +1,12 @@
<div class="hidden-print">
<%= link_to "Back to parent" , @document.parent, class: "btn" %>
<div class="btn-group">
<%= 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 %>
</div>
</div>
<h2><%= @document.name %></h2>

View File

@@ -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]