2009-01-08 16:33:27 +01:00
|
|
|
<%
|
|
|
|
u = @current_user
|
|
|
|
tabs = [
|
2009-03-06 19:38:06 +01:00
|
|
|
{ :name => "Start", :url => root_path, :active => ["index", "home"],
|
2009-01-08 16:33:27 +01:00
|
|
|
:subnav => [
|
2010-03-20 13:45:58 +01:00
|
|
|
{ :name => "Meine Aufgaben", :url => user_tasks_path },
|
|
|
|
{ :name => "Meine Bestellgruppe", :url => my_ordergroup_path, :access_denied? => (!u.ordergroup)},
|
|
|
|
{ :name => "Mein Profil", :url => my_profile_path}
|
2009-01-15 12:14:01 +01:00
|
|
|
]
|
|
|
|
},
|
2010-03-20 13:45:58 +01:00
|
|
|
{ :name => "Foodcoop", :url => tasks_path,
|
2009-08-02 19:01:45 +02:00
|
|
|
:active => ["foodcoop", "tasks", "messages", "foodcoop/ordergroups", "foodcoop/workgroups", "foodcoop/users"],
|
2009-01-15 12:14:01 +01:00
|
|
|
:subnav => [
|
2010-03-20 13:45:58 +01:00
|
|
|
{ :name => "Mitglieder", :url => foodcoop_users_path},
|
|
|
|
{ :name => "Abeitsgruppen", :url => foodcoop_workgroups_path},
|
|
|
|
{ :name => "Bestellgruppen", :url => foodcoop_ordergroups_path},
|
|
|
|
{ :name => "Nachrichten", :url => messages_path},
|
|
|
|
{ :name => "Aufgaben", :url => tasks_path}
|
2009-01-08 16:33:27 +01:00
|
|
|
]
|
|
|
|
},
|
2010-03-20 13:45:58 +01:00
|
|
|
{ :name => "Wiki", :url => wiki_path, :active => ["pages", "wiki"],
|
2009-09-28 15:05:00 +02:00
|
|
|
:subnav => [
|
2010-03-20 13:45:58 +01:00
|
|
|
{ :name => "Startseite", :url => wiki_path },
|
|
|
|
{ :name => "Alle Seiten", :url => all_pages_path }
|
2009-09-28 15:05:00 +02:00
|
|
|
]
|
|
|
|
},
|
2012-08-24 11:11:40 +02:00
|
|
|
{ :name => "Bestellungen", :url => u.ordergroup ? group_orders_path : orders_path,
|
2009-02-06 20:51:14 +01:00
|
|
|
:active => ["orders", "ordering"],
|
2009-01-08 16:33:27 +01:00
|
|
|
:subnav => [
|
2012-08-24 11:11:40 +02:00
|
|
|
{ :name => "Bestellen!", :url => group_orders_path },
|
2011-06-19 15:30:33 +02:00
|
|
|
{ :name => "Meine Bestellungen", :url => archive_group_orders_path },
|
2010-03-20 13:45:58 +01:00
|
|
|
{ :name => "Bestellverwaltung", :url => orders_path, :access_denied? => (!u.role_orders?) }
|
2009-01-08 16:33:27 +01:00
|
|
|
]
|
|
|
|
},
|
2010-03-20 13:45:58 +01:00
|
|
|
{ :name => "Artikel", :url => suppliers_path,
|
2009-02-12 18:32:20 +01:00
|
|
|
:active => ["articles", "suppliers", "deliveries", "article_categories", "stockit", "stock_takings"],
|
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 => [
|
2010-05-25 23:36:05 +02:00
|
|
|
{ :name => "Artikel", :url => suppliers_path },
|
2010-03-20 13:45:58 +01:00
|
|
|
{ :name => "Lager", :url => stock_articles_path },
|
2009-02-03 21:14:48 +01:00
|
|
|
{ :name => "Lieferantinnen", :url => suppliers_path, :access_denied? => (!u.role_suppliers?) },
|
2010-03-20 13:45:58 +01:00
|
|
|
{ :name => "Kategorien", :url => article_categories_path }
|
2009-01-08 16:33:27 +01:00
|
|
|
]
|
|
|
|
},
|
2010-03-20 13:45:58 +01:00
|
|
|
{ :name => "Finanzen", :url => finance_root_path,
|
2011-06-09 21:35:05 +02:00
|
|
|
:active => ["finance/"],
|
2009-02-03 21:14:48 +01:00
|
|
|
:access_denied? => (!u.role_finance?),
|
2009-01-08 16:33:27 +01:00
|
|
|
:subnav => [
|
2011-06-09 21:35:05 +02:00
|
|
|
{ :name => "Konten verwalten", :url => finance_ordergroups_path },
|
2010-03-20 13:45:58 +01:00
|
|
|
{ :name => "Bestellungen abrechnen", :url => finance_balancing_path },
|
2009-02-06 20:51:14 +01:00
|
|
|
{ :name => "Rechnungen", :url => finance_invoices_path }
|
2009-01-08 16:33:27 +01:00
|
|
|
]
|
|
|
|
},
|
2010-03-20 13:45:58 +01:00
|
|
|
{ :name => "Administration", :url => admin_root_path,
|
2010-03-22 01:58:37 +01:00
|
|
|
:active => ["admin/"],
|
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-02-18 12:01:51 +01:00
|
|
|
<li class="<%= 'current' if tab_is_active?(tab) %>">
|
2009-01-08 16:33:27 +01:00
|
|
|
<%= link_to tab[:name], tab[:url] %>
|
2009-02-18 12:01:51 +01:00
|
|
|
<ul>
|
2009-01-08 16:33:27 +01:00
|
|
|
<% 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 -%>
|
2009-02-18 12:01:51 +01:00
|
|
|
</ul>
|
2009-01-08 16:33:27 +01:00
|
|
|
</li>
|
|
|
|
<% end -%>
|
|
|
|
<% end -%>
|
2010-03-22 01:58:37 +01:00
|
|
|
</ul>
|