Fixed broken links in tasks-module. Translated some views into german.

This commit is contained in:
Benjamin Meichsner 2009-02-06 20:51:14 +01:00
parent 85eb27079f
commit 96442477d1
24 changed files with 141 additions and 274 deletions

2
.gitignore vendored
View File

@ -4,4 +4,4 @@ config/*.yml
db/*.sqlite3
nbproject/
config/environments/development.rb
capfile

View File

@ -14,7 +14,7 @@ class HomeController < ApplicationController
tasks = Task.find(:all, :conditions => ["assigned = ? and done = ?", false, false])
@unassigned_tasks_number = 0
for task in tasks
(@unassigned_tasks_number += 1) unless task.workgroup && !current_user.is_member_of(task.workgroup)
(@unassigned_tasks_number += 1) unless task.workgroup && !current_user.member_of?(task.workgroup)
end
end

View File

@ -3,7 +3,7 @@ class TasksController < ApplicationController
def index
@non_group_tasks = Task.non_group
@groups = Group.find :all, :conditions => "type != 'Ordergroup'"
@groups = Workgroup.all
end
def myTasks
@ -86,7 +86,7 @@ class TasksController < ApplicationController
task.assignments.create(:user => current_user, :accepted => true)
end
flash[:notice] = "Du hast die Aufgabe übernommen"
redirect_to :action => "myTasks"
redirect_to my_tasks_path
end
# deletes assignment between current_user and given task
@ -103,7 +103,7 @@ class TasksController < ApplicationController
# Shows all tasks, which are already done
def archive
@tasks = Task.find :all, :conditions => "done = 1", :order => "due_date DESC"
@tasks = Task.done
end
# shows workgroup (normal group) to edit weekly_tasks_template

View File

@ -20,7 +20,8 @@ class Task < ActiveRecord::Base
has_many :users, :through => :assignments
belongs_to :workgroup
named_scope :non_group, :conditions => { :workgroup_id => nil, :done => false }, :order => "due_date ASC"
named_scope :non_group, :conditions => { :workgroup_id => nil, :done => false }
named_scope :done, :conditions => {:done => true}, :order => "due_date ASC"
# form will send user in string. responsibilities will added later
attr_protected :users

View File

@ -181,8 +181,8 @@ class User < ActiveRecord::Base
end
# returns true if user is a member of a given group
def is_member_of(group)
return true if group.users.detect {|user| user == self}
def member_of?(group)
group.users.exists?(self.id)
end
#Returns an array with the users groups (but without the Ordergroups -> because tpye=>"")

View File

@ -8,14 +8,12 @@
<p><b>Kontostand:</b> <%= number_to_currency(@ordergroup.account_balance) %></p>
<h2>Personen</h2>
<ul style="list-style-type:decimal;">
<% for membership in @ordergroup.memberships %>
<li>
<%= link_to membership.user.nick, :controller => 'index', :action => 'showUser', :id => membership.user %>
</li>
<% end %>
<% for membership in @ordergroup.memberships -%>
<li><%= membership.user.nick -%></li>
<% end -%>
</ul>
<%= link_to('Hinzufügen/entfernen', :action => 'members', :id => @ordergroup) %> |
<%= link_to('Person einladen', :action => 'invite', :id => @ordergroup) %>
<%= link_to('Hinzufügen/entfernen', :controller => 'foodcoop', :action => 'memberships', :id => @ordergroup) %> |
<%= link_to('Person einladen', :controller => 'foodcoop', :action => 'invite', :id => @ordergroup) %>
</div>
</div>

View File

@ -3,27 +3,28 @@
tabs = [
{ :name => "Start", :url => root_path, :active => ["index", "messages", "home"],
:subnav => [
{ :name => "Messages", :url => "/messages"},
{ :name => "My tasks", :url => "/home/tasks" },
{ :name => "My ordergroup", :url => "/home/ordergroup"},
{ :name => "My profile", :url => "/home/profile"}
{ :name => "Nachrichten", :url => "/messages"},
{ :name => "Meine Aufgaben", :url => "/home/tasks" },
{ :name => "Meine Bestellgruppe", :url => "/home/ordergroup"},
{ :name => "Mein Profil", :url => "/home/profile"}
]
},
{ :name => "Foodcoop", :url => "/foodcoop/members", :active => ["foodcoop", "tasks"],
:subnav => [
{ :name => "Members", :url => "/foodcoop/members"},
{ :name => "Workgroups", :url => "/foodcoop/workgroups"},
{ :name => "Tasks", :url => "/tasks"}
{ :name => "Mitglieder", :url => "/foodcoop/members"},
{ :name => "Abeitsgruppen", :url => "/foodcoop/workgroups"},
{ :name => "Aufgaben", :url => "/tasks"}
]
},
{ :name => "Orders", :url => "/ordering", :active => ["orders", "ordering"],
{ :name => "Bestellungen", :url => u.ordergroup ? "/ordering/" : "/orders",
:active => ["orders", "ordering"],
:subnav => [
{ :name => "Order", :url => "/ordering" },
{ :name => "My orders", :url => "/ordering/myOrders" },
{ :name => "Manage orders", :url => "/orders", :access_denied? => (!u.role_orders?) }
{ :name => "Bestellen!", :url => "/ordering" },
{ :name => "Meine Bestellungen", :url => "/ordering/myOrders" },
{ :name => "Bestellverwaltung", :url => "/orders", :access_denied? => (!u.role_orders?) }
]
},
{ :name => "Articles", :url => "/suppliers",
{ :name => "Artikel", :url => "/suppliers",
:active => ["articles", "suppliers", "deliveries", "article_categories", "stockit"],
:access_denied? => (!u.role_article_meta? && !u.role_suppliers?),
:subnav => [
@ -33,22 +34,22 @@
{ :name => "Kategorien", :url => "/article_categories"}
]
},
{ :name => "Finance", :url => "/finance",
{ :name => "Finanzen", :url => "/finance",
:active => ["finance/invoices", "finance/transactions", "finance/balancing"],
:access_denied? => (!u.role_finance?),
:subnav => [
{ :name => "Manage accounts", :url => "/finance/transactions" },
{ :name => "Balance orders", :url => "/finance/balancing/list" },
{ :name => "Invoices", :url => finance_invoices_path }
{ :name => "Konten verwalten", :url => "/finance/transactions" },
{ :name => "Bestellungen abrechnen", :url => "/finance/balancing/list" },
{ :name => "Rechnungen", :url => finance_invoices_path }
]
},
{ :name => "Administration", :url => "/admin",
:active => ["admin", "admin/users", "admin/ordergroups", "admin/workgroups"],
:access_denied? => (!u.role_admin?),
:subnav => [
{ :name => "Users", :url => admin_users_path },
{ :name => "Ordergroups", :url => admin_ordergroups_path },
{ :name => "Workgroups", :url => admin_workgroups_path }
{ :name => "Benutzerinnen", :url => admin_users_path },
{ :name => "Bestellgruppen", :url => admin_ordergroups_path },
{ :name => "Arbeitsgruppen", :url => admin_workgroups_path }
]
}
]

View File

@ -0,0 +1,18 @@
- title "Passwort vergessen?"
- if flash[:error]
%p{:style => "color: red"}= flash[:error]
%p
Kein Problem, Du kannst dir einfach ein neues Passwort zulegen.
%p
Dazu musst hier die E-Mail-Adresse eingeben, mit der Du in der FoodSoft angemeldet bist.
Du erhälst dann eine E-Mail mit weiteren Instruktionen.
.edit_form{:style => "width:25em"}
- form_tag(:action => 'reset_passwort') do
%p
E-Mail:
%br/
= text_field 'login', 'email'
= submit_tag 'Neues Passwort anfordern'
|
= link_to 'Abbrechen', :action => 'login'

View File

@ -1,12 +0,0 @@
<% title _('Forgot password?') %>
<% if flash[:error] %>
<p style="color: red"><%= flash[:error] %></p><% end %>
<p><%= _('No problem: You can enter a new password here.') -%></p>
<p><%= _("Just enter your email address. Then you'll receive an email with the detailed instructions.") %></p>
<div class="edit_form" style="width:25em">
<% form_tag(:action => 'reset_password') do %>
<p><label for="user">Email</label><br/>
<%= text_field 'login', 'email' %></p>
<%= submit_tag _("Reset your password") %> | <%= link_to _("Back"), :action => 'login' %>
<% end %>
</div>

View File

@ -1,4 +1,5 @@
%h1=_ 'Login'
- title "Login"
.edit_form{:style => "width:25em"}
- form_tag :action => 'login' do
- if flash[:notice]
@ -6,17 +7,17 @@
- if flash[:error]
%div.error= flash[:error]
%p
%label{:for => 'user'}=_ 'Username'
%label{:for => 'user'} Benutzerin
%br/
= text_field 'login', 'user'
%p
%label{:for => 'password'}=_ 'Password'
%label{:for => 'password'} Passwort
%br/
= password_field 'login', 'password'
= submit_tag _('Login!')
= submit_tag "Anmelden"
|
= link_to _('Forgot Password?'), :action => 'forgot_password'
= link_to "Passwort vergessen?", :action => 'forgot_password'
%br/
%br/
%i{:style => 'font-size:0.8em;'}=_ 'Cookies must be accepted!'
%i{:style => 'font-size:0.8em;'} Kekse und Javascript müssen erlaubt sein!
= javascript_tag("$('login_user').focus()")

View File

@ -0,0 +1,17 @@
- title "Neues Passwort"
%p=h "Bitte neues Passwort für #{@user.nick} eingeben."
- if flash[:error]
%p{:style => "color: red"}= flash[:error]
.edit_form{:style => "width:25em"}
- form_tag(:action => 'new', :id => @user.id, :token => @user.reset_password_token) do
%p
Neues Passwort
%br/
= password_field_tag "user[password]"
%p
Passwort wiederholen
%br/
= password_field_tag "user[password_confirmation]"
= submit_tag 'Speichern'
|
= link_to 'abbrechen', :action => 'login'

View File

@ -1,11 +0,0 @@
<h1>Neues Passwort</h1>
<p>Bitte neues Passwort für <%=h @user.nick %> eingeben.</p>
<% if flash[:error] %><p style="color: red"><%= flash[:error] %></p><% end %>
<div class="edit_form" style="width:25em">
<% form_tag(:action => 'new', :id => @user.id, :token => @user.reset_password_token) do %>
<p><label for="user">Neues Passwort</label><br/>
<%= password_field_tag "user[password]" %></p>
<p><label for="user">Passwort wiederholen</label><br/>
<%= password_field_tag "user[password_confirmation]" %></p>
<%= submit_tag 'Speichern' %> | <%= link_to 'abbrechen', :action => 'login' %>
<% end %>

View File

@ -1,4 +1,4 @@
- @task.assignments.each do |ass|
= ass.user.nick
%small= link_to _('Remove'), {:action => "drop_assignment", :id => ass}, :confirm => 'Bist du sicher?', :method => "post"
%small= link_to icon(:delete), {:action => "drop_assignment", :id => ass}, :confirm => 'Bist du sicher?', :method => "post"
%br/

View File

@ -1,37 +1,30 @@
= error_messages_for "task"
= form.error_messages
%p
%label{:for => "task_name"}
%b=_ 'Subject'
%b= form.label :name
%br/
= text_field :task, :name
= form.text_field :name
%p
%label{:for => "task_description"}
%b=_ 'Description'
%b= form.label :description
%br/
= text_area :task, :description, :cols => 50, :rows => 10
= form.text_area :description, :cols => 50, :rows => 10
%p
%label{:for => "task_user"}
%b=_ 'Responsible people'
%b= form.label :user
%small=_ 'tasks can have multiple assignments'
/%br/
/= render :partial => "assignments"
%p
%small=_ 'use commas to seperate the names'
%br/
/= text_field_with_auto_complete :user, :nick, {}, {:tokens => ","}
= text_field_with_auto_complete :task, :user_list, {}, {:tokens => ","}
%p
%label{:for => "task_required_users"}
%b= _("How many users are altogether required?")
%b= form.label :required_users, "How many users are altogether required?"
%br/
= text_field :task, :required_users, :size => 3
= form.text_field :required_users, :size => 3
%p
%label{:for => "task_group"}
%b=_ 'Group'
%b= form.label :workgroup
%br/
= select(:task, :group_id, Group.find(:all, :conditions => "type != 'Ordergroup'", :order => 'name').collect {|g| [ g.name, g.id ] }, { :include_blank => true })
= form.select :workgroup_id, Workgroup.all(:order => 'name').collect {|g| [ g.name, g.id ] }, { :include_blank => true }
%p
%label{:for => "task_due_date"}
%b=_ 'Due date'
%b= form.label :due_date
%br/
= date_select :task, :due_date, :start_year => 2007, :include_blank => true
= form.date_select :due_date, :start_year => 2007, :include_blank => true

View File

@ -1,12 +1,13 @@
%table
%tr
%th= _('Due date')
%th= _('Subject')
%th Fälligkeit
%th Betreff
%th{:colspan => '2'}
= _('Who will make it?')
%small= "(" + _("How many are still required?") + ")"
Wer machts?
%small (Wie viele werden noch benötigt?)
- for task in @tasks
%tr{:class => cycle('even','odd', :name => "tasks") + (task.done ? " done" : "") }
- done = task.done ? " done" : ""
%tr{:class => cycle('even','odd', :name => "tasks") + done }
%td= format_date(task.due_date) unless task.due_date.nil?
%td= link_to task.name, :controller => "tasks", :action => "show", :id => task
%td
@ -22,11 +23,11 @@
= highlighted_required_users task
%td
- unless task.is_accepted?(@current_user)
%span{:style => "float:left"}= button_to _('Accept task'), :controller => "tasks", :action => "accept", :id => task
= button_to _("Reject task"), :controller => "tasks", :action => "reject", :id => task if task.is_assigned?(@current_user)
%span{:style => "float:left"}= button_to "Aufgabe übernehmen", :controller => "tasks", :action => "accept", :id => task
= button_to "Aufgabe ablehnen", :controller => "tasks", :action => "reject", :id => task if task.is_assigned?(@current_user)
- else
- form_for :task, :url => {:action => "update_status", :id => task} do |f|
= _("Done") + "?"
= f.check_box :done, {:onchange => "submit()"}
= _("Done") if task.done
Erledigt?
= f.check_box :done, {:onchange => "submit()", :title => "Die Aufgabe wandert in das Archiv"}
= "Erledigt" if task.done
- reset_cycle("tasks")

View File

@ -1,19 +1,19 @@
#start_nav{:style => "float:right"}
%h2=_ 'TaskMenu'
%h2 Aufgabenmenü
%ul
%li
=_ 'Actions'
Aktionen
%ul
%li= link_to _('New task'), :action => "new"
%li= link_to "Neue Aufgabe erstellen", :action => "new"
%li
=_ 'Pages'
Seiten
%ul
%li= link_to _('My tasks'), :action => "myTasks"
%li= link_to _('All tasks'), :action => "index"
%li= link_to _('Tasks done'), :action => "archive"
%li= link_to "Meine Aufgaben", my_tasks_path
%li= link_to "Alle Aufgaben", :action => "index"
%li= link_to "Erledigt Aufgaben (Archiv)", :action => "archive"
%li
=_ 'Group tasks'
Gruppenaufgaben
%ul
- for group in Group.find :all, :conditions => "type != 'Ordergroup'"
- for group in Workgroup.all
%li= link_to group.name, :action => "workgroup", :id => group

View File

@ -1,11 +1,11 @@
- title _('Task archive')
- title "Aufgabenarchiv"
= render :partial => "nav"
%table{:style => "width: 76%"}
%tr
%th=_ 'Due date'
%th=_ 'Subject'
%th=_ 'Responsible people'
%th Fälligkeitsdatum
%th Betreff
%th Verantwortliche Menschen
%th
- for task in @tasks
%tr{:class => cycle('even','odd')}

View File

@ -1,12 +1,12 @@
- title _('Edit task')
- title "Aufgabe bearbeiten"
#form{:style => "float:left; width:39em"}
- form_tag :action => 'update', :id => @task do
= render :partial => 'form'
= submit_tag _('Save changes')
- form_for :task, @task, :url => {:action => 'update', :id => @task} do |form|
= render :partial => 'form', :locals => {:form => form}
= submit_tag "Speichern"
|
= link_to _('Cancel'), :action => "show", :id => @task
= link_to "Abbrechen", :action => "show", :id => @task
#workgroup_members{:style => "padding-left:41em"}
%h3=_ 'Members of the workgroups'
%h3 Mitglieder der Gruppe
#list
= render :partial => "shared/workgroup_members"

View File

@ -1,11 +1,11 @@
- title _('Arrange tasks')
- title "Aufgabenübersicht"
= render :partial => "nav"
- unless @non_group_tasks.empty?
.left_column{:style => "width:75%"}
- @tasks = @non_group_tasks
.box_title
%h2=_ 'Tasks for all'
%h2 Aufgaben für alle!
.column_content
= render :partial => "list"

View File

@ -1,4 +1,4 @@
- title _("My tasks")
- title "Meine Aufgaben"
= render :partial => "nav"
- @tasks = @unaccepted_tasks

View File

@ -1,11 +1,11 @@
- title _('Create new task')
- title "Neue Aufgabe erstellen"
#form{:style => "float:left; width:39em"}
- form_tag :action => 'create' do
= render :partial => 'form'
= submit_tag _('Create task')
- form_for :task, @task, :url => {:action => 'create'} do |form|
= render :partial => 'form', :locals => {:form => form}
= submit_tag "Aufgabe erstellen"
#workgroup_members{:style => "padding-left:41em"}
%h3=_ 'Members of the workgroups'
%h3 Mitglieder der Gruppe
#list
= render :partial => "shared/workgroup_members"

View File

@ -1,35 +1,35 @@
- title _('Task in detail')
- title "Aufgabe im Detail"
= render :partial => "nav"
#task{:style => 'width:70%'}
%table
%tr
%td{:style => "width: 10em"}= _'Name'
%td{:style => "width: 10em"} Name
%td
%b= @task.name
%tr
%td{:style => "vertical-align:top;"}=_ 'Description'
%td{:style => "vertical-align:top;"} Beschreibung
%td= simple_format(@task.description)
%tr
%td=_ 'Due date'
%td Fälligkeitsdatum
%td= format_date(@task.due_date)
%tr
%td=_ 'Responsible people'
%td Verantwortliche Menschen
%td= render :partial => "assignments"
%tr
%td=_ 'Group'
%td Arbeitsgruppe
%td
- if @task.workgroup
= link_to @task.workgroup.name, :action => "workgroup", :id => @task.workgroup
%tr
%td{:colspan => "2"}
%div{:style => "float:left"}=_ 'Done'
%div{:style => "float:left"} Als erledigt markieren
- form_for :task, :url => {:action => "update_status", :id => @task} do |f|
= f.check_box :done, {:onchange => "submit()"}
= f.check_box :done, {:onchange => "submit()", :title => "Die Aufgabe wandert in das Archiv"}
%p
= link_to _('Edit'), :action => "edit", :id => @task
= link_to "Bearbeiten", :action => "edit", :id => @task
|
= link_to _('Delete'), {:action => "destroy", :id => @task}, :method => "post", :confirm => _('Delete the task?')
= link_to "Löschen", {:action => "destroy", :id => @task}, :method => "post", :confirm => "Die Aufgabe wirklich löschen?"

View File

@ -1,12 +1,12 @@
%h1
= _('Arrange tasks for')
Aufgaben verwalten für
= @group.name
= render :partial => "nav"
.left_column{:style => "width:45em"}
.box_title
%h2
= _('Weekly tasks') + ':'
Wöchentliche Aufgaben
= @group.task_name
.column_content
- if @group.weekly_task
@ -45,7 +45,8 @@
%br/
- else
= _('No weekly tasks defined yet')
= link_to _('Edit weekly tasks'), :controller => "index", :action => "editGroup", :id => @group
- if @current_user.member_of?(@group) or @current_user.role_admin?
= link_to _('Edit weekly tasks'), :controller => "foodcoop", :action => "edit_group", :id => @group
.left_column{:style => "width:75%"}
.box_title

141
capfile
View File

@ -1,141 +0,0 @@
role :libs, "root@webserver"
set :root_path, "/var/www/vhosts/foodcoops.net/railsapps/"
set :backup_path, "/var/www/vhosts/foodcoops.net/railsapps/backup/"
set :foodsoft_path, "/var/www/vhosts/foodcoops.net/railsapps/foodsoft/"
set :sandbox, {:subdomain => "sandbox"}
set :sharedLists,
{
:subdomain => "/var/www/vhosts/foodcoops.net/railsapps/sharedLists/",
:db_user => "fcnet_shared",
:db_name => "fcnet_shared",
:db_pwd => "dhj450lw"
}
set :foodcoops, [
{
:subdomain => "sandbox",
:db_user => "fs2_sandbox",
:db_name => "fs2_sandbox",
:db_pwd => "gruenbarsch"},
{
:subdomain => "fcschinke09",
:db_user => "fs2_fcschinke09",
:db_name => "fs2_fcschinke09",
:db_pwd => "gruenbarsch"},
{
:subdomain => "fc-fruchtzwerge",
:db_user => "fs2_fruchtzwerge",
:db_name => "fs2_fruchtzwerge",
:db_pwd => "fruchtblub234"},
{
:subdomain => "fcnova",
:db_user => "fs2_fcnova",
:db_name => "fs2_fcnova",
:db_pwd => "suppenkueche2"},
{
:subdomain => "mosa",
:db_user => "fs2_mosa",
:db_name => "fs2_mosa",
:db_pwd => "skh489ndp"},
{
:subdomain => "mainz",
:db_user => "fs2_mainz",
:db_name => "fs2_mainz",
:db_pwd => "sdfh2987s2m"},
{
:subdomain => "bioparadeis",
:db_user => "fs2_bioparadeis",
:db_name => "fs2_bioparadeis",
:db_pwd => "sdfh4872bs00"},
{
:subdomain => "fcduncker",
:db_user => "fs2_fcduncker",
:db_name => "fs2_fcduncker",
:db_pwd => "sdf89gh3"},
{
:subdomain => "leipzig",
:db_user => "fs2_leipzig",
:db_name => "fs2_leipzig",
:db_pwd => "dfh2098q1hja"},
{
:subdomain => "fcfutterneid",
:db_user => "fs2_fcfutterneid",
:db_name => "fs2_fcfutterneid",
:db_pwd => "lreiugh277ah2l"}
]
desc "backup code and databases"
task :backup do
run "tar cfz #{backup_path}foodsoft.tar.gz #{foodsoft_path}" #code-backup
for fc in foodcoops
# backup db and compress
run "mysqldump -u #{fc[:db_user]} --password=#{fc[:db_pwd]} #{fc[:db_name]} | gzip > #{backup_path + fc[:subdomain]}/#{fc[:subdomain]}_#{Time.now.strftime('%Y-%m-%d_%H:%M')}.sql.gz"
end
end
desc "backup code and databases, updates foodsoft-code, runs migrations for every foodcoop-db, restart passenger"
task :update_and_migrate do
run "tar cfz #{backup_path}foodsoft.tar.gz #{foodsoft_path}" #code-backup
run "svn up #{foodsoft_path}" # code-update
for fc in foodcoops
# backup db and compress
run "mysqldump -u #{fc[:db_user]} --password=#{fc[:db_pwd]} #{fc[:db_name]} | gzip > #{backup_path + fc[:subdomain]}/#{fc[:subdomain]}_#{Time.now.strftime('%Y-%m-%d_%H:%M')}.sql.gz"
# migrations
run "cd #{foodsoft_path} && rake db:migrate RAILS_ENV=#{fc[:subdomain]}"
end
run "touch #{foodsoft_path}tmp/restart.txt"
run "chown -R www-data:www-data #{foodsoft_path}app"
end
desc "backup and update code, restart passenger"
task :update do
#run "tar cfz #{backup_path}foodsoft.tar.gz #{foodsoft_path}" #code-backup
run "svn up #{foodsoft_path}" # code-update
for fc in foodcoops
# backup db and compress
run "mysqldump -u #{fc[:db_user]} --password=#{fc[:db_pwd]} #{fc[:db_name]} | gzip > #{backup_path + fc[:subdomain]}/#{fc[:subdomain]}_#{Time.now.strftime('%Y-%m-%d_%H:%M')}.sql.gz"
end
run "touch #{foodsoft_path}tmp/restart.txt"
run "chown -R www-data:www-data #{foodsoft_path}app"
end
desc "only update, no backups -> use for small! fixes"
task :only_update do
run "svn up #{foodsoft_path}" # code-update
run "touch #{foodsoft_path}tmp/restart.txt"
run "chown -R www-data:www-data #{foodsoft_path}app"
end
desc "sharedLists: backup, update, migration, restart server"
task :update_sharedLists do
end
desc "create fcschinke09 database dump, download and fills up the development db"
task :dump do
run "mysqldump -u #{foodcoops[1][:db_user]} --password=#{foodcoops[1][:db_pwd]} #{foodcoops[1][:db_name]} | gzip > #{backup_path + foodcoops[1][:subdomain]}/fcschinke09_tmp.sql.gz"
puts "download mysqldump"
puts `scp server:"#{backup_path + foodcoops[1][:subdomain]}"/fcschinke09_tmp.sql.gz ../`
puts "load dump into database"
puts `gunzip ../fcschinke09_tmp.sql.gz`
puts `mysql -u root foodsoft_development < ../fcschinke09_tmp.sql`
end
desc "dump databases to backup-dir"
task :dump_to_backup do
for fc in foodcoops
run "mysqldump -u #{fc[:db_user]} --password=#{fc[:db_pwd]} #{fc[:db_name]} | gzip > #{backup_path}/#{fc[:subdomain]}.sql.gz"
end
end
desc "load last mysql-dumps in backup-path"
task :load_dumps do
for fc in foodcoops
run "gunzip -c #{backup_path}/#{fc[:subdomain]}.sql.gz | mysql -u #{fc[:db_user]} --password=#{fc[:db_pwd]} #{fc[:db_name]}"
end
end