Second (last) part of multiple foodcoop installation.

* When before_filter select_foodcoop is activated,
  the database and configs will be loaded on each request.
* Replaced APP_CONFIG with new Foodsoft.config method.
This commit is contained in:
Benjamin Meichsner 2009-03-24 17:25:33 +01:00
parent 1c24127928
commit ffc3adf907
18 changed files with 51 additions and 57 deletions

View file

@ -17,7 +17,7 @@
#logo
%a{:href => "/"}
<span>food</span>soft
%span{:style => "color:white; font-size:45%; letter-spacing: -1px;"}= APP_CONFIG[:name]
%span{:style => "color:white; font-size:45%; letter-spacing: -1px;"}= Foodsoft.config[:name]
#nav= render :partial => 'layouts/main_tabnav'
#main

View file

@ -2,5 +2,5 @@
--
FoodSoft: <%= @foodsoftUrl %>
Foodcoop-Homepage: <%= APP_CONFIG[:base_url] %>
Hilfe/Help: <%= APP_CONFIG[:help_url] %>
Foodcoop-Homepage: <%= Foodsoft.config[:base_url] %>
Hilfe/Help: <%= Foodsoft.config[:help_url] %>

View file

@ -12,4 +12,4 @@
= yield
#meta
Foodcoop
= link_to_if APP_CONFIG[:homepage], APP_CONFIG[:name], APP_CONFIG[:homepage]
= link_to_if Foodsoft.config[:homepage], Foodsoft.config[:name], Foodsoft.config[:homepage]

View file

@ -1,4 +1,4 @@
- title "Einladung in die #{APP_CONFIG[:name]}"
- title "Einladung in die #{Foodsoft.config[:name]}"
%p
Du bist eingeladen worden in der Foodcoop
%b= @invite.group.name

View file

@ -6,4 +6,4 @@ Es wurden <%= @transaction.amount %> für "<%= @transaction.note %>" abgebucht,
Bitte zahlt so bald wie möglich wieder Geld ein, um das Gruppenkonto auszugleichen.
Viele Grüße von <%= APP_CONFIG[:name] %>
Viele Grüße von <%= Foodsoft.config[:name] %>

View file

@ -9,6 +9,6 @@ Für Euch wurden die folgenden Artikel bestellt:
<% end -%>
Gesamtpreis: <%= @group_order.price %>
Bestellung online einsehen: <%= "#{APP_CONFIG[:base_url]}/ordering/my_order_result/#{@order.id}" %>
Bestellung online einsehen: <%= "#{Foodsoft.config[:base_url]}/ordering/my_order_result/#{@order.id}" %>
Viele Grüße von <%= APP_CONFIG[:name] %>
Viele Grüße von <%= Foodsoft.config[:name] %>

View file

@ -11,6 +11,6 @@ Aufgaben für die nächste Woche:
<% end -%>
<% end -%>
Meine Aufgaben: <%= APP_CONFIG[:base_url] %>/home/tasks
Meine Aufgaben: <%= Foodsoft.config[:base_url] %>/home/tasks
Viele Grüße von <%= APP_CONFIG[:name] %>
Viele Grüße von <%= Foodsoft.config[:name] %>

View file

@ -6,19 +6,19 @@
%p
Empfängerinnen
%fieldset
- if APP_CONFIG[:mailing_list].blank?
- if Foodsoft.config[:mailing_list].blank?
= f.check_box :sent_to_all, :onchange => "Element.toggle('recipients')"
gesamte Foodcoop
- else
%b Nachrichten an alle
verschickst Du bitte über den Verteiler:
= mail_to APP_CONFIG[:mailing_list]
= mail_to Foodsoft.config[:mailing_list]
%br/
%small{:style => "color:grey"}
Eventuell musst Du Dich dem Verteiler erst bekannt machen.
%br/
z.b. mit einer Mail an
= mail_to APP_CONFIG[:mailing_list_subscribe]
= mail_to Foodsoft.config[:mailing_list_subscribe]
%table#recipients
%tr
%td

View file

@ -1,5 +1,5 @@
# Get ActiveRecord objects
contact = APP_CONFIG[:contact].symbolize_keys
contact = Foodsoft.config[:contact].symbolize_keys
# Define header and footer
#pdf.header [pdf.margin_box.left,pdf.margin_box.top+30] do
@ -12,7 +12,7 @@ end
# From paragraph
pdf.bounding_box [pdf.margin_box.right-200,pdf.margin_box.top], :width => 200 do
pdf.text APP_CONFIG[:name], :align => :right
pdf.text Foodsoft.config[:name], :align => :right
pdf.move_down 5
pdf.text contact[:street], :align => :right
pdf.move_down 5

View file

@ -2,7 +2,7 @@
%li
= image_tag 'b_user.png' , :size => '7x10', :border => 0, :alt => _("User")
= link_to h(@current_user.nick), my_profile_path, { :title => _("User Settings") }
- if APP_CONFIG[:homepage]
%li= link_to APP_CONFIG[:name], APP_CONFIG[:homepage], { :title => _("Go to your FoodCoop-Hompage") }
- if Foodsoft.config[:homepage]
%li= link_to Foodsoft.config[:name], Foodsoft.config[:homepage], { :title => _("Go to your FoodCoop-Hompage") }
%li= link_to _("Hilfe"), 'http://dev.foodcoops.net/wiki/FoodsoftDoku'
%li= link_to _("Logout"), :controller => '/login', :action => 'logout'