2009-01-08 16:33:27 +01:00
|
|
|
<%
|
|
|
|
u = @current_user
|
|
|
|
tabs = [
|
2009-01-15 12:14:01 +01:00
|
|
|
{ :name => "Start", :url => root_path, :active => ["index", "messages", "home"],
|
2009-01-08 16:33:27 +01:00
|
|
|
:subnav => [
|
2009-02-06 20:51:14 +01:00
|
|
|
{ :name => "Nachrichten", :url => "/messages"},
|
|
|
|
{ :name => "Meine Aufgaben", :url => "/home/tasks" },
|
|
|
|
{ :name => "Meine Bestellgruppe", :url => "/home/ordergroup"},
|
|
|
|
{ :name => "Mein Profil", :url => "/home/profile"}
|
2009-01-15 12:14:01 +01:00
|
|
|
]
|
|
|
|
},
|
|
|
|
{ :name => "Foodcoop", :url => "/foodcoop/members", :active => ["foodcoop", "tasks"],
|
|
|
|
:subnav => [
|
2009-02-06 20:51:14 +01:00
|
|
|
{ :name => "Mitglieder", :url => "/foodcoop/members"},
|
|
|
|
{ :name => "Abeitsgruppen", :url => "/foodcoop/workgroups"},
|
|
|
|
{ :name => "Aufgaben", :url => "/tasks"}
|
2009-01-08 16:33:27 +01:00
|
|
|
]
|
|
|
|
},
|
2009-02-06 20:51:14 +01:00
|
|
|
{ :name => "Bestellungen", :url => u.ordergroup ? "/ordering/" : "/orders",
|
|
|
|
:active => ["orders", "ordering"],
|
2009-01-08 16:33:27 +01:00
|
|
|
:subnav => [
|
2009-02-06 20:51:14 +01:00
|
|
|
{ :name => "Bestellen!", :url => "/ordering" },
|
|
|
|
{ :name => "Meine Bestellungen", :url => "/ordering/myOrders" },
|
|
|
|
{ :name => "Bestellverwaltung", :url => "/orders", :access_denied? => (!u.role_orders?) }
|
2009-01-08 16:33:27 +01:00
|
|
|
]
|
|
|
|
},
|
2009-02-06 20:51:14 +01:00
|
|
|
{ :name => "Artikel", :url => "/suppliers",
|
2009-01-18 17:42:51 +01:00
|
|
|
:active => ["articles", "suppliers", "deliveries", "article_categories", "stockit"],
|
2009-02-03 21:14:48 +01:00
|
|
|
:access_denied? => (!u.role_article_meta? && !u.role_suppliers?),
|
2009-01-08 16:33:27 +01:00
|
|
|
:subnav => [
|
2009-01-18 17:42:51 +01:00
|
|
|
{ :name => "Artikel", :url => supplier_articles_path(Supplier.first) },
|
|
|
|
{ :name => "Lager", :url => "/stockit" },
|
2009-02-03 21:14:48 +01:00
|
|
|
{ :name => "Lieferantinnen", :url => suppliers_path, :access_denied? => (!u.role_suppliers?) },
|
2009-01-18 17:42:51 +01:00
|
|
|
{ :name => "Kategorien", :url => "/article_categories"}
|
2009-01-08 16:33:27 +01:00
|
|
|
]
|
|
|
|
},
|
2009-02-06 20:51:14 +01:00
|
|
|
{ :name => "Finanzen", :url => "/finance",
|
2009-01-19 16:40:06 +01:00
|
|
|
:active => ["finance/invoices", "finance/transactions", "finance/balancing"],
|
2009-02-03 21:14:48 +01:00
|
|
|
:access_denied? => (!u.role_finance?),
|
2009-01-08 16:33:27 +01:00
|
|
|
:subnav => [
|
2009-02-06 20:51:14 +01:00
|
|
|
{ :name => "Konten verwalten", :url => "/finance/transactions" },
|
|
|
|
{ :name => "Bestellungen abrechnen", :url => "/finance/balancing/list" },
|
|
|
|
{ :name => "Rechnungen", :url => finance_invoices_path }
|
2009-01-08 16:33:27 +01:00
|
|
|
]
|
|
|
|
},
|
2009-01-12 18:26:09 +01:00
|
|
|
{ :name => "Administration", :url => "/admin",
|
2009-01-14 12:46:01 +01:00
|
|
|
:active => ["admin", "admin/users", "admin/ordergroups", "admin/workgroups"],
|
2009-02-03 21:14:48 +01:00
|
|
|
:access_denied? => (!u.role_admin?),
|
2009-01-08 16:33:27 +01:00
|
|
|
:subnav => [
|
2009-02-06 20:51:14 +01:00
|
|
|
{ :name => "Benutzerinnen", :url => admin_users_path },
|
|
|
|
{ :name => "Bestellgruppen", :url => admin_ordergroups_path },
|
|
|
|
{ :name => "Arbeitsgruppen", :url => admin_workgroups_path }
|
2009-01-08 16:33:27 +01:00
|
|
|
]
|
|
|
|
}
|
|
|
|
]
|
|
|
|
-%>
|
|
|
|
<ul>
|
|
|
|
<% for tab in tabs -%>
|
2009-02-03 21:14:48 +01:00
|
|
|
<% unless tab[:access_denied?] -%>
|
2009-01-08 16:33:27 +01:00
|
|
|
<li class="<%= 'current' if tab_is_active?(tab) %>">
|
|
|
|
<%= link_to tab[:name], tab[:url] %>
|
|
|
|
<ul>
|
|
|
|
<% for subtab in tab[:subnav] -%>
|
2009-02-03 21:14:48 +01:00
|
|
|
<% unless subtab[:access_denied?] -%>
|
2009-01-08 16:33:27 +01:00
|
|
|
<li><%= link_to subtab[:name], subtab[:url] %></li>
|
|
|
|
<% end -%>
|
|
|
|
<% end -%>
|
|
|
|
</ul>
|
|
|
|
</li>
|
|
|
|
<% end -%>
|
|
|
|
<% end -%>
|
|
|
|
</ul>
|