Added twitter bootstrap layout. Adapt home page.
This commit is contained in:
parent
31735f35ab
commit
f20ae890dd
18 changed files with 334 additions and 264 deletions
|
|
@ -1,14 +1,10 @@
|
|||
Engagement Deiner Bestellgruppe
|
||||
.stats-bar{style: "width:#{apple_bar.length_of_group_bar}px; background-color:#{apple_bar.group_bar_color}"}
|
||||
= apple_bar.apples
|
||||
= " Äpfel" if apple_bar.length_of_group_bar > 50
|
||||
|
||||
Durchschnittsengagement
|
||||
.stats-bar{style: "width:#{apple_bar.length_of_global_bar}px"}
|
||||
100 Birnen
|
||||
Deine aktueller Äpfelpunktestand: #{apple_bar.apples}
|
||||
.progress
|
||||
%div{class: "bar bar-#{apple_bar.group_bar_state}", style: "width: #{apple_bar.group_bar_width}%"}
|
||||
|
||||
%span.description
|
||||
Abgebildet ist das Verhältnis von erledigten Aufgaben zu dem Bestellvolumen Deiner Bestellgruppe im Vergleich zum Durchschnitt in der Foodcoop.
|
||||
Konkret: Pro #{number_to_currency(apple_bar.mean_order_amount_per_job, :precision => 0 )} Bestellsumme solltest Du eine Aufgabe machen!
|
||||
- if FoodsoftConfig[:stop_ordering_under].present?
|
||||
Achtung, hast Du weniger als #{FoodsoftConfig[:stop_ordering_under]} Äpfel, darfst Du nicht mehr bestellen!
|
||||
%strong Achtung,
|
||||
hast Du weniger als #{FoodsoftConfig[:stop_ordering_under]} Äpfel, darfst Du nicht mehr bestellen!
|
||||
|
|
@ -1,44 +1,34 @@
|
|||
%h2 Direkt zu ...
|
||||
%ul
|
||||
%li
|
||||
Foodcoop
|
||||
%ul
|
||||
%li= link_to "Mitglieder", foodcoop_users_path
|
||||
%li= link_to "Meine Aufgaben", user_tasks_path
|
||||
%li= link_to "Nachricht schreiben", :controller => "messages", :action => "new"
|
||||
|
||||
// Orders
|
||||
- has_ordergroup = !@current_user.ordergroup.nil?
|
||||
- has_orders_role = @current_user.role_orders?
|
||||
- if has_ordergroup || has_orders_role
|
||||
%li
|
||||
Bestellungen
|
||||
%ul
|
||||
- if has_ordergroup
|
||||
%li= link_to "Bestellübersicht", group_orders_path
|
||||
- if has_orders_role
|
||||
%li= link_to "Bestellungen beenden", :controller => 'orders'
|
||||
// Articles
|
||||
- if @current_user.role_article_meta? || @current_user.role_suppliers?
|
||||
%li
|
||||
Artikelverwaltung
|
||||
%ul
|
||||
%li= link_to "Artikel aktualisieren", suppliers_path
|
||||
%li= link_to "Lagerverwaltung", :controller => 'stockit'
|
||||
%li= link_to "Lieferanten verwalten", suppliers_path
|
||||
|
||||
// Finance
|
||||
- if @current_user.role_finance?
|
||||
%li
|
||||
Finanzbereich
|
||||
%ul
|
||||
%li= link_to "Konten aktualisieren", finance_new_transaction_collection_path
|
||||
%li= link_to "Bestellungen abrechnen", finance_root_path
|
||||
|
||||
// Administration
|
||||
- if @current_user.role_admin?
|
||||
%li
|
||||
Administration
|
||||
%ul
|
||||
%li= link_to "Neue Bestellgruppe", new_admin_ordergroup_path
|
||||
%li= link_to "Neues Mitglied", new_admin_user_path
|
||||
.well.well-small
|
||||
%h3 Direkt zu ...
|
||||
%ul.nav.nav-list
|
||||
%li.nav-header Foodcoop
|
||||
%li= link_to "Mitglieder", foodcoop_users_path
|
||||
%li= link_to "Meine Aufgaben", user_tasks_path
|
||||
%li= link_to "Nachricht schreiben", :controller => "messages", :action => "new"
|
||||
|
||||
- has_ordergroup = !@current_user.ordergroup.nil?
|
||||
- has_orders_role = @current_user.role_orders?
|
||||
- if has_ordergroup || has_orders_role
|
||||
%li.nav-header Bestellungen
|
||||
- if has_ordergroup
|
||||
%li= link_to "Bestellübersicht", group_orders_path
|
||||
- if has_orders_role
|
||||
%li= link_to "Bestellungen beenden", :controller => 'orders'
|
||||
// Articles
|
||||
- if @current_user.role_article_meta? || @current_user.role_suppliers?
|
||||
%li.nav-header Artikelverwaltung
|
||||
%li= link_to "Artikel aktualisieren", suppliers_path
|
||||
%li= link_to "Lagerverwaltung", :controller => 'stockit'
|
||||
%li= link_to "Lieferanten verwalten", suppliers_path
|
||||
|
||||
// Finance
|
||||
- if @current_user.role_finance?
|
||||
%li.nav-header Finanzbereich
|
||||
%li= link_to "Konten aktualisieren", finance_new_transaction_collection_path
|
||||
%li= link_to "Bestellungen abrechnen", finance_root_path
|
||||
|
||||
// Administration
|
||||
- if @current_user.role_admin?
|
||||
%li.nav-header Administration
|
||||
%li= link_to "Neue Bestellgruppe", new_admin_ordergroup_path
|
||||
%li= link_to "Neues Mitglied", new_admin_user_path
|
||||
|
|
@ -1,78 +1,68 @@
|
|||
- title t('.title')
|
||||
- title t('.title'), false
|
||||
|
||||
#start_nav
|
||||
- content_for(:sidebar) do
|
||||
= render :partial => 'start_nav'
|
||||
|
||||
.right_column{:style => "width:70%"}
|
||||
- unless @unaccepted_tasks.empty? && @next_tasks.empty? && @unassigned_tasks_number == 0
|
||||
.box_title
|
||||
%h2 Aufgaben
|
||||
.column_content
|
||||
-unless @next_tasks.empty?
|
||||
%div{:style => "float:left, margin-bottom:2em"}
|
||||
%h3 Deine Aufgaben für die nächste Woche:
|
||||
%table{:style => "width:25em"}
|
||||
-for task in @next_tasks
|
||||
%tr
|
||||
%td= format_date task.due_date
|
||||
%td
|
||||
%b= task.name
|
||||
- unless @unaccepted_tasks.empty? && @next_tasks.empty? && @unassigned_tasks_number == 0
|
||||
%section.well
|
||||
%h2 Aufgaben
|
||||
-unless @next_tasks.empty?
|
||||
%div{:style => "float:left, margin-bottom:2em"}
|
||||
%strong Deine Aufgaben für die nächste Woche:
|
||||
%table.table(style="width:25em")
|
||||
-for task in @next_tasks
|
||||
%tr
|
||||
%td= format_date task.due_date
|
||||
%td
|
||||
%b= task.name
|
||||
|
||||
- unless @unaccepted_tasks.empty?
|
||||
%h3 Aufgaben übernehmen
|
||||
Du bis für Aufgaben verantwortlich.
|
||||
= link_to "Aufgaben übernehmen/ablehnen", user_tasks_path
|
||||
- unless @unassigned_tasks_number == 0
|
||||
%h3 Offene Aufgaben
|
||||
= "Es gibt #{@unassigned_tasks_number} #{link_to 'offene Aufgabe(n)', :controller => 'tasks'}".html_safe
|
||||
%p{:style => "clear:both"}= link_to "Meine Aufgaben", user_tasks_path
|
||||
- unless @unaccepted_tasks.empty?
|
||||
%h3 Aufgaben übernehmen
|
||||
Du bis für Aufgaben verantwortlich.
|
||||
= link_to "Aufgaben übernehmen/ablehnen", user_tasks_path
|
||||
- unless @unassigned_tasks_number == 0
|
||||
%h3 Offene Aufgaben
|
||||
= "Es gibt #{@unassigned_tasks_number} #{link_to 'offene Aufgabe(n)', :controller => 'tasks'}".html_safe
|
||||
%p= link_to "Meine Aufgaben", user_tasks_path
|
||||
|
||||
- if current_user.ordergroup
|
||||
// Current orders
|
||||
= render :partial => 'shared/open_orders', :locals => {:ordergroup => current_user.ordergroup}
|
||||
- if current_user.ordergroup
|
||||
= render :partial => 'shared/open_orders', :locals => {:ordergroup => current_user.ordergroup}
|
||||
|
||||
// Stats
|
||||
- if current_user.ordergroup
|
||||
.box_title
|
||||
%h2 Engagement Deiner Bestellgruppe
|
||||
.column_content
|
||||
= render :partial => "apple_bar", :locals => {:apple_bar => AppleBar.new(current_user.ordergroup)}
|
||||
// Stats
|
||||
- if current_user.ordergroup
|
||||
%section
|
||||
%h2 Engagement Deiner Bestellgruppe
|
||||
= render :partial => "apple_bar", :locals => {:apple_bar => AppleBar.new(current_user.ordergroup)}
|
||||
|
||||
- unless Message.public.empty?
|
||||
.box_title
|
||||
%h2 Neuste Nachrichten
|
||||
.column_content
|
||||
= render :partial => 'messages/messages',
|
||||
:locals => {:messages => Message.public.order('created_at DESC').limit(5), :subject_length => 70}
|
||||
%br/
|
||||
= link_to "Alle Nachrichten einsehen", messages_path
|
||||
- unless Message.public.empty?
|
||||
%section
|
||||
%h2 Neuste Nachrichten
|
||||
= render :partial => 'messages/messages',
|
||||
:locals => {:messages => Message.public.order('created_at DESC').limit(5), :subject_length => 70}
|
||||
%p= link_to "Alle Nachrichten einsehen", messages_path
|
||||
|
||||
- if current_user.ordergroup
|
||||
// Ordergroup overview
|
||||
.box_title
|
||||
%h2 Meine Bestellgruppe
|
||||
.column_content
|
||||
%p
|
||||
%b= current_user.ordergroup.name
|
||||
|
|
||||
Verfügbares Guthaben:
|
||||
= number_to_currency(current_user.ordergroup.get_available_funds)
|
||||
%span.description
|
||||
(Letzte Aktualisierung ist
|
||||
= distance_of_time_in_words(Time.now, current_user.ordergroup.account_updated) + " her)"
|
||||
%h3 Letzte Transaktionen
|
||||
%table
|
||||
- if current_user.ordergroup
|
||||
// Ordergroup overview
|
||||
%section
|
||||
%h2 Meine Bestellgruppe
|
||||
%p
|
||||
%b= current_user.ordergroup.name
|
||||
| Verfügbares Guthaben:
|
||||
= number_to_currency(current_user.ordergroup.get_available_funds)
|
||||
%small (Letzte Aktualisierung ist #{distance_of_time_in_words(Time.now, current_user.ordergroup.account_updated)} her)
|
||||
%h3 Letzte Transaktionen
|
||||
%table.table.table-striped
|
||||
%tr
|
||||
%th Wann
|
||||
%th Wer
|
||||
%th Notiz
|
||||
%th Betrag
|
||||
- for ft in current_user.ordergroup.financial_transactions.limit(5)
|
||||
%tr
|
||||
%th Wann
|
||||
%th Wer
|
||||
%th Notiz
|
||||
%th Betrag
|
||||
- for ft in current_user.ordergroup.financial_transactions.limit(5)
|
||||
%tr{:class => cycle('even','odd')}
|
||||
%td= format_time(ft.created_on)
|
||||
%td= h(ft.user.nil? ? '?' : ft.user.nick)
|
||||
%td= h(ft.note)
|
||||
- color = ft.amount < 0 ? 'red' : 'black'
|
||||
%td{:style => "color:#{color}; width:5em", :class => "currency"}= number_to_currency(ft.amount)
|
||||
%br/
|
||||
= link_to "mehr ...", my_ordergroup_path
|
||||
%td= format_time(ft.created_on)
|
||||
%td= h(ft.user.nil? ? '?' : ft.user.nick)
|
||||
%td= h(ft.note)
|
||||
- color = ft.amount < 0 ? 'red' : 'black'
|
||||
%td{:style => "color:#{color}; width:5em", :class => "currency"}= number_to_currency(ft.amount)
|
||||
%br/
|
||||
%p= link_to "Kontoauszug anzeigen", my_ordergroup_path
|
||||
|
|
@ -1,80 +0,0 @@
|
|||
<%
|
||||
u = @current_user
|
||||
tabs = [
|
||||
{ :name => "Start", :url => root_path, :active => ["index", "home"],
|
||||
:subnav => [
|
||||
{ :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}
|
||||
]
|
||||
},
|
||||
{ :name => "Foodcoop", :url => tasks_path,
|
||||
:active => ["foodcoop", "tasks", "messages", "foodcoop/ordergroups", "foodcoop/workgroups", "foodcoop/users"],
|
||||
:subnav => [
|
||||
{ :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}
|
||||
]
|
||||
},
|
||||
{ :name => "Wiki", :url => wiki_path, :active => ["pages", "wiki"],
|
||||
:subnav => [
|
||||
{ :name => "Startseite", :url => wiki_path },
|
||||
{ :name => "Alle Seiten", :url => all_pages_path }
|
||||
]
|
||||
},
|
||||
{ :name => "Bestellungen", :url => u.ordergroup ? group_orders_path : orders_path,
|
||||
:active => ["orders", "ordering"],
|
||||
:subnav => [
|
||||
{ :name => "Bestellen!", :url => group_orders_path },
|
||||
{ :name => "Meine Bestellungen", :url => archive_group_orders_path },
|
||||
{ :name => "Bestellverwaltung", :url => orders_path, :access_denied? => (!u.role_orders?) }
|
||||
]
|
||||
},
|
||||
{ :name => "Artikel", :url => suppliers_path,
|
||||
:active => ["articles", "suppliers", "deliveries", "article_categories", "stockit", "stock_takings"],
|
||||
:access_denied? => (!u.role_article_meta? && !u.role_suppliers?),
|
||||
:subnav => [
|
||||
{ :name => "Artikel", :url => suppliers_path },
|
||||
{ :name => "Lager", :url => stock_articles_path },
|
||||
{ :name => "Lieferantinnen", :url => suppliers_path, :access_denied? => (!u.role_suppliers?) },
|
||||
{ :name => "Kategorien", :url => article_categories_path }
|
||||
]
|
||||
},
|
||||
{ :name => "Finanzen", :url => finance_root_path,
|
||||
:active => ["finance/"],
|
||||
:access_denied? => (!u.role_finance?),
|
||||
:subnav => [
|
||||
{ :name => "Konten verwalten", :url => finance_ordergroups_path },
|
||||
{ :name => "Bestellungen abrechnen", :url => finance_balancing_path },
|
||||
{ :name => "Rechnungen", :url => finance_invoices_path }
|
||||
]
|
||||
},
|
||||
{ :name => "Administration", :url => admin_root_path,
|
||||
:active => ["admin/"],
|
||||
:access_denied? => (!u.role_admin?),
|
||||
:subnav => [
|
||||
{ :name => "Benutzerinnen", :url => admin_users_path },
|
||||
{ :name => "Bestellgruppen", :url => admin_ordergroups_path },
|
||||
{ :name => "Arbeitsgruppen", :url => admin_workgroups_path }
|
||||
]
|
||||
}
|
||||
]
|
||||
-%>
|
||||
<ul>
|
||||
<% for tab in tabs -%>
|
||||
<% unless tab[:access_denied?] -%>
|
||||
<li class="<%= 'current' if tab_is_active?(tab) %>">
|
||||
<%= link_to tab[:name], tab[:url] %>
|
||||
<ul>
|
||||
<% for subtab in tab[:subnav] -%>
|
||||
<% unless subtab[:access_denied?] -%>
|
||||
<li><%= link_to subtab[:name], subtab[:url] %></li>
|
||||
<% end -%>
|
||||
<% end -%>
|
||||
</ul>
|
||||
</li>
|
||||
<% end -%>
|
||||
<% end -%>
|
||||
</ul>
|
||||
|
|
@ -1,32 +1,58 @@
|
|||
!!!
|
||||
%html
|
||||
!!! 5
|
||||
%html(lang="en")
|
||||
%head
|
||||
%meta{"http-equiv" => "content-type", :content => "text/html;charset=UTF-8"}
|
||||
%title= "FoodSoft - " + (yield(:title) or controller.controller_name)
|
||||
= stylesheet_link_tag 'application'
|
||||
= stylesheet_link_tag "print", :media => "print"
|
||||
<!--[if lte IE 7]>
|
||||
= stylesheet_link_tag 'ie_hacks'
|
||||
<![endif]-->
|
||||
= javascript_include_tag 'application'
|
||||
%meta(charset="utf-8")
|
||||
%meta(http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1")
|
||||
%meta(name="viewport" content="width=device-width, initial-scale=1.0")
|
||||
%title= content_for?(:title) ? yield(:title) : "Foodsoft"
|
||||
= csrf_meta_tags
|
||||
= yield(:head)
|
||||
%body
|
||||
#logininfo= render :partial => 'shared/loginInfo'
|
||||
|
||||
#header
|
||||
#logo
|
||||
= link_to root_path do
|
||||
<span>food</span>soft
|
||||
%span{:style => "color:white; font-size:45%; letter-spacing: -1px;"}= FoodsoftConfig[:name]
|
||||
#nav= render :partial => 'layouts/main_tabnav'
|
||||
/ Le HTML5 shim, for IE6-8 support of HTML elements
|
||||
/[if lt IE 9]
|
||||
= javascript_include_tag "http://html5shim.googlecode.com/svn/trunk/html5.js"
|
||||
= stylesheet_link_tag "application", :media => "all"
|
||||
%link(href="images/apple-touch-icon-144x144.png" rel="apple-touch-icon-precomposed" sizes="144x144")
|
||||
%link(href="images/apple-touch-icon-114x114.png" rel="apple-touch-icon-precomposed" sizes="114x114")
|
||||
%link(href="images/apple-touch-icon-72x72.png" rel="apple-touch-icon-precomposed" sizes="72x72")
|
||||
%link(href="images/apple-touch-icon.png" rel="apple-touch-icon-precomposed")
|
||||
%link(href="images/favicon.ico" rel="shortcut icon")
|
||||
|
||||
#main
|
||||
#content
|
||||
- flash.each do |name, msg|
|
||||
= content_tag :h3, msg, :id => "flash#{name.to_s.camelize}", :class => "flash #{name}"
|
||||
#loader{:style => "display:none;"}= image_tag("loader.gif", :border => 0)
|
||||
- if show_title?
|
||||
%h1= yield(:title)
|
||||
= yield
|
||||
#ajax_box(style="display:none")
|
||||
|
||||
%body
|
||||
.row-fluid
|
||||
|
||||
.navbar.navbar-fixed-top
|
||||
.navbar-inner
|
||||
.container-fluid
|
||||
%a.btn.btn-navbar(data-target=".nav-collapse" data-toggle="collapse")
|
||||
%span.icon-bar
|
||||
%span.icon-bar
|
||||
%span.icon-bar
|
||||
= link_to 'Foodsoft', root_path(anchor: ''), class: 'brand'
|
||||
.container.nav-collapse
|
||||
= render_navigation expand_all: true, renderer: :bootstrap
|
||||
|
||||
.container-fluid
|
||||
.row-fluid
|
||||
- if content_for?(:sidebar)
|
||||
.span2
|
||||
= yield(:sidebar)
|
||||
.span10
|
||||
- if show_title?
|
||||
.page-header
|
||||
%h1= yield(:title)
|
||||
= yield
|
||||
- else
|
||||
- if show_title?
|
||||
.page-header
|
||||
%h1= yield(:title)
|
||||
= yield
|
||||
|
||||
%footer
|
||||
%p
|
||||
Foodsoft, open source software to manage a non-profit food coop.
|
||||
|
||||
/
|
||||
Javascripts
|
||||
\==================================================
|
||||
/ Placed at the end of the document so the pages load faster
|
||||
= javascript_include_tag "application"
|
||||
|
|
|
|||
32
app/views/layouts/application1.html.haml
Normal file
32
app/views/layouts/application1.html.haml
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
!!!
|
||||
%html
|
||||
%head
|
||||
%meta{"http-equiv" => "content-type", :content => "text/html;charset=UTF-8"}
|
||||
%title= "FoodSoft - " + (yield(:title) or controller.controller_name)
|
||||
= stylesheet_link_tag 'application'
|
||||
= stylesheet_link_tag "print", :media => "print"
|
||||
<!--[if lte IE 7]>
|
||||
= stylesheet_link_tag 'ie_hacks'
|
||||
<![endif]-->
|
||||
= javascript_include_tag 'application'
|
||||
= csrf_meta_tags
|
||||
= yield(:head)
|
||||
%body
|
||||
#logininfo= render :partial => 'shared/loginInfo'
|
||||
|
||||
#header
|
||||
#logo
|
||||
= link_to root_path do
|
||||
<span>food</span>soft
|
||||
%span{:style => "color:white; font-size:45%; letter-spacing: -1px;"}= FoodsoftConfig[:name]
|
||||
#nav= render :partial => 'layouts/main_tabnav'
|
||||
|
||||
#main
|
||||
#content
|
||||
- flash.each do |name, msg|
|
||||
= content_tag :h3, msg, :id => "flash#{name.to_s.camelize}", :class => "flash #{name}"
|
||||
#loader{:style => "display:none;"}= image_tag("loader.gif", :border => 0)
|
||||
- if show_title?
|
||||
%h1= yield(:title)
|
||||
= yield
|
||||
#ajax_box(style="display:none")
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
- unless messages.empty?
|
||||
%table.list
|
||||
%table.table.table-striped
|
||||
%tbody
|
||||
- for message in messages
|
||||
%tr{:class => cycle('even','odd', :name => 'messages')}
|
||||
%tr
|
||||
%td= format_subject(message, subject_length)
|
||||
%td= h(message.sender_name)
|
||||
%td= format_time(message.created_at)
|
||||
%td= link_to('Antworten', new_message_path(:message => {:reply_to => message.id}))
|
||||
%td= link_to 'Antworten', new_message_path(:message => {:reply_to => message.id}), class: 'btn'
|
||||
|
|
@ -1,11 +1,9 @@
|
|||
.box_title
|
||||
%section
|
||||
%h2 Laufende Bestellungen
|
||||
.column_content
|
||||
- if ordergroup.not_enough_apples?
|
||||
.warning
|
||||
%p Achtung, Deine Bestellgruppe hat zu wenig Äpfel um Bestellen zu können!
|
||||
.alert Achtung, Deine Bestellgruppe hat zu wenig Äpfel um Bestellen zu können!
|
||||
- unless Order.open.empty?
|
||||
%table.list
|
||||
%table.table.table-striped
|
||||
%thead
|
||||
%tr
|
||||
%th Lieferantin
|
||||
|
|
@ -15,7 +13,7 @@
|
|||
%tbody
|
||||
- total = 0
|
||||
- Order.open.each do |order|
|
||||
%tr{:class => cycle('even', 'odd', :name => 'open_orders')}
|
||||
%tr
|
||||
%td= link_to_ordering(order)
|
||||
%td=h format_time(order.ends) unless order.ends.nil?
|
||||
- if group_order = order.group_order(ordergroup)
|
||||
|
|
@ -24,9 +22,11 @@
|
|||
%td= number_to_currency(group_order.price)
|
||||
- else
|
||||
%td{:colspan => 2}
|
||||
- if total > 0
|
||||
%p
|
||||
Gesamtsumme:
|
||||
%b= number_to_currency(total)
|
||||
- if total > 0
|
||||
%tfooter
|
||||
%tr
|
||||
%th(colspan="2")
|
||||
%th Gesamtsumme:
|
||||
%th= number_to_currency(total)
|
||||
- else
|
||||
%i Derzeit gibt es keine laufenden Bestellungen
|
||||
Loading…
Add table
Add a link
Reference in a new issue