2009-01-08 16:33:27 +01:00
|
|
|
<%
|
|
|
|
u = @current_user
|
|
|
|
tabs = [
|
|
|
|
{ :name => "Start", :url => root_path, :active => ["index", "messages", "tasks"],
|
|
|
|
:subnav => [
|
|
|
|
{ :name => "Members", :url => "/index/foodcoop_members"},
|
|
|
|
{ :name => "Workgroups", :url => "/index/workgroups"},
|
|
|
|
{ :name => "Tasks", :url => "/tasks"},
|
|
|
|
{ :name => "Messages", :url => "/messages/inbox"},
|
|
|
|
{ :name => "My Ordergroup", :url => my_order_group_path},
|
|
|
|
{ :name => "My Ordergroup", :url => my_profile_path}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{ :name => "Orders", :url => "/ordering", :active => ["orders", "ordering"],
|
|
|
|
:subnav => [
|
|
|
|
{ :name => "Order", :url => "/ordering" },
|
|
|
|
{ :name => "My orders", :url => "/ordering/myOrders" },
|
|
|
|
{ :name => "Manage orders", :url => "/orders", :access? => (u.role_orders?) }
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{ :name => "Articles", :url => "/articles", :active => ["articles", "suppliers"],
|
|
|
|
:access? => (u.role_article_meta? || u.role_suppliers?),
|
|
|
|
:subnav => [
|
|
|
|
{ :name => "Show articles", :url => "/articles/list" },
|
|
|
|
{ :name => "Categories", :url => "/articles" },
|
|
|
|
{ :name => "Suppliers", :url => suppliers_path, :access? => (u.role_suppliers?) }
|
|
|
|
]
|
|
|
|
},
|
2009-01-12 18:26:09 +01:00
|
|
|
{ :name => "Finance", :url => "/finance",
|
|
|
|
:active => ["finance", "finance/invoices", "finance/transactions", "finance/balancing"],
|
2009-01-08 16:33:27 +01:00
|
|
|
:access? => (u.role_finance?),
|
|
|
|
:subnav => [
|
2009-01-10 21:28:22 +01:00
|
|
|
{ :name => "Manage accounts", :url => "/finance/transactions" },
|
2009-01-10 22:22:16 +01:00
|
|
|
{ :name => "Balance orders", :url => "/finance/balancing" },
|
2009-01-10 19:36:58 +01:00
|
|
|
{ :name => "Invoices", :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-13 19:01:56 +01:00
|
|
|
:active => ["admin", "admin/users", "admin/workgroups"],
|
2009-01-08 16:33:27 +01:00
|
|
|
:access? => (u.role_admin?),
|
|
|
|
:subnav => [
|
2009-01-12 18:26:09 +01:00
|
|
|
{ :name => "Users", :url => "/admin/users" },
|
2009-01-13 19:01:56 +01:00
|
|
|
{ :name => "Workgroups", :url => "/admin/workgroups" }
|
2009-01-08 16:33:27 +01:00
|
|
|
]
|
|
|
|
}
|
|
|
|
]
|
|
|
|
-%>
|
|
|
|
<ul>
|
|
|
|
<% for tab in tabs -%>
|
|
|
|
<% unless tab[:access?] and tab[:access?] == false %>
|
|
|
|
<li class="<%= 'current' if tab_is_active?(tab) %>">
|
|
|
|
<%= link_to tab[:name], tab[:url] %>
|
|
|
|
<ul>
|
|
|
|
<% for subtab in tab[:subnav] -%>
|
|
|
|
<% unless subtab[:access?] and subtab[:access?] == false %>
|
|
|
|
<li><%= link_to subtab[:name], subtab[:url] %></li>
|
|
|
|
<% end -%>
|
|
|
|
<% end -%>
|
|
|
|
</ul>
|
|
|
|
</li>
|
|
|
|
<% end -%>
|
|
|
|
<% end -%>
|
|
|
|
</ul>
|