Fixed admin, orders, wiki views. Converted all erb to haml.

This commit is contained in:
benni 2012-10-15 21:19:17 +02:00
parent 699fb9b233
commit 552c553b77
169 changed files with 1158 additions and 1307 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 351 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 356 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 341 B

View file

@ -1,6 +1,6 @@
@import "twitter/bootstrap/bootstrap"; @import "twitter/bootstrap/bootstrap";
body { body {
padding-top: 60px; padding-top: 60px;
} }
@import "twitter/bootstrap/responsive"; @import "twitter/bootstrap/responsive";
@ -42,6 +42,27 @@ section {
border-bottom: 1px solid #d3d3d3; border-bottom: 1px solid #d3d3d3;
} }
footer {
margin-top: 50px;
padding-top: 20px;
border-top: 1px solid lightGrey;
}
table {
tr.article-category {
background-color: #efefef;
td:first-child {
text-align: left;
}
}
th.numeric, td.numeric {
text-align: right;
}
td.odd {
background-color: @tableBackgroundAccent;
}
}
// Tasks .. // Tasks ..
.accepted { .accepted {
color: #468847; color: #468847;
@ -59,4 +80,69 @@ section {
color: @textColor; color: @textColor;
text-decoration: none; text-decoration: none;
} }
} }
// ordering
span.used {
color: green;
}
span.unused {
color: red;
}
#order-footer, .article-info {
text-align: left;
z-index: 1;
position: fixed;
bottom: 0;
background-color: #E4EED6;
border-top: 2px solid #78B74E;
#total-sum {
width: 22em;
margin: .5em 2em 0 0;
float: right;
#order-button {
margin: .5em 0;
input:disabled {
background-color: red; }
}
}
}
#order-footer {
width: 100%;
right: 0;
left: 0;
}
.article-info {
z-index: 2;
width: 40em;
height: 8em;
border: none;
left: 30px;
.article-name {
text-align: center;
margin: 2px 0;
margin-bottom: 5px;
width: 100%;
font-weight: bold;
}
.pull-right {
width: 35%;
}
.pull-left {
width: 60%;
}
}
tr.order-article .article-info {
display: none;
}
tr.order-article:hover .article-info {
display: block;
}

View file

@ -10,12 +10,7 @@ class Admin::OrdergroupsController < Admin::BaseController
@ordergroups = @ordergroups.where('name LIKE ?', "%#{params[:query]}%") @ordergroups = @ordergroups.where('name LIKE ?', "%#{params[:query]}%")
end end
@ordergroups = @ordergroups.paginate(:page => params[:page], :per_page => @per_page) @ordergroups = @ordergroups.page(params[:page]).per(@per_page)
respond_to do |format|
format.html # index.html.haml
format.js { render :layout => false } # index.js.erb
end
end end
def destroy def destroy

View file

@ -5,15 +5,11 @@ class Admin::UsersController < Admin::BaseController
@users = User.order('nick ASC') @users = User.order('nick ASC')
# if somebody uses the search field: # if somebody uses the search field:
unless params[:query].blank? unless params[:user_name].blank?
@users = @users.where(({:first_name.matches => "%#{params[:query]}%"}) | ({:last_name.matches => "%#{params[:query]}%"}) | ({:nick.matches => "%#{params[:query]}%"})) @users = @users.where("first_name LIKE :user_name OR last_name LIKE :user_name OR nick LIKE :user_name",
user_name: "%#{params[:user_name]}%")
end end
@users = @users.paginate(:page => params[:page], :per_page => @per_page) @users = @users.page(params[:page]).per(@per_page)
respond_to do |format|
format.html # index.html.haml
format.js { render :layout => false } # index.js.erb
end
end end
end end

View file

@ -7,12 +7,7 @@ class Admin::WorkgroupsController < Admin::BaseController
# if somebody uses the search field: # if somebody uses the search field:
@workgroups = @workgroups.where('name LIKE ?', "%#{params[:query]}%") unless params[:query].blank? @workgroups = @workgroups.where('name LIKE ?', "%#{params[:query]}%") unless params[:query].blank?
@workgroups = @workgroups.paginate(:page => params[:page], :per_page => @per_page) @workgroups = @workgroups.page(params[:page]).per(@per_page)
respond_to do |format|
format.html # index.html.haml
format.js { render :layout => false } # index.js.erb
end
end end
def destroy def destroy

View file

@ -54,8 +54,7 @@ class GroupOrdersController < ApplicationController
# if selected, it shows all orders of the foodcoop # if selected, it shows all orders of the foodcoop
def archive def archive
# get only orders belonging to the ordergroup # get only orders belonging to the ordergroup
@closed_orders = Order.paginate :page => params[:page], :per_page => 10, @closed_orders = Order.closed.page(params[:page]).per(10)
:conditions => { :state => 'closed' }, :order => "orders.ends DESC"
respond_to do |format| respond_to do |format|
format.html # archive.html.haml format.html # archive.html.haml

View file

@ -11,9 +11,15 @@ class InvitesController < ApplicationController
@invite = Invite.new(params[:invite]) @invite = Invite.new(params[:invite])
if @invite.save if @invite.save
Mailer.delay.invite(FoodsoftConfig.scope, @invite.id) Mailer.delay.invite(FoodsoftConfig.scope, @invite.id)
redirect_to back_or_default_path, notice: "Benutzerin wurde erfolgreich eingeladen."
respond_to do |format|
format.html do
redirect_to back_or_default_path, notice: "Benutzerin wurde erfolgreich eingeladen."
end
format.js { render layout: false }
end
else else
logger.debug "[debug] errors: #{@invite.errors.messages}"
render action: :new render action: :new
end end
end end

View file

@ -20,18 +20,7 @@ class OrdersController < ApplicationController
else else
sort = "ends DESC" sort = "ends DESC"
end end
@orders = Order.paginate :page => params[:page], :per_page => @per_page, @orders = Order.page(params[:page]).per(@per_page).order(sort).where("state != 'open'").includes(:supplier)
:order => sort, :conditions => "state != 'open'",
:include => :supplier
respond_to do |format|
format.html
format.js do
render :update do |page|
page.replace_html 'orders_table', :partial => "orders"
end
end
end
end end
# Gives a view for the results to a specific order # Gives a view for the results to a specific order
@ -43,7 +32,7 @@ class OrdersController < ApplicationController
format.html format.html
format.js do format.js do
@partial = case params[:view] @partial = case params[:view]
when 'normal' then "articles" when 'default' then "articles"
when 'groups'then 'shared/articles_by_groups' when 'groups'then 'shared/articles_by_groups'
when 'articles'then 'shared/articles_by_articles' when 'articles'then 'shared/articles_by_articles'
else 'articles' else 'articles'

View file

@ -68,7 +68,9 @@ module ApplicationHelper
# Generates a link to the top of the website # Generates a link to the top of the website
def link_to_top def link_to_top
link_to image_tag("arrow_up_red.png", :size => "16x16", :border => "0", :alt => "Nach oben"), "#" link_to '#' do
content_tag :i, nil, class: 'icon-arrow-up icon-large'
end
end end
# Returns the weekday. 0 is sunday, 1 is monday and so on # Returns the weekday. 0 is sunday, 1 is monday and so on

View file

@ -2,18 +2,17 @@
module OrdersHelper module OrdersHelper
def update_articles_link(order, text, view) def update_articles_link(order, text, view)
link_to text, order_path(order, :view => view), :remote => true link_to text, order_path(order, view: view), remote: true
end end
def order_pdf(order, document) def order_pdf(order, document, text)
link_to image_tag("save_pdf.png", :size => "16x16", :border => "0", :alt => "PDF erstellen"), link_to text, order_path(order, document: document, format: :pdf), title: "PDF erstellen"
order_path(order, :document => document, :format => :pdf), { :title => "PDF erstellen" }
end end
def options_for_suppliers_to_select def options_for_suppliers_to_select
options = [["Lieferantin/Lager auswählen"]] options = [["Lieferantin/Lager auswählen"]]
options += Supplier.all.map {|s| [ s.name, url_for(:action => "new", :supplier_id => s)] } options += Supplier.all.map {|s| [ s.name, url_for(action: "new", supplier_id: s)] }
options += [["Lager", url_for(:action => 'new', :supplier_id => 0)]] options += [["Lager", url_for(action: 'new', supplier_id: 0)]]
options_for_select(options) options_for_select(options)
end end
end end

View file

@ -2,44 +2,42 @@
%p %p
%i Hier kannst Du die Gruppen und Benutzerinnen der Foodsoft verwalten. %i Hier kannst Du die Gruppen und Benutzerinnen der Foodsoft verwalten.
.left_column{:style => "width:48%"} .row-fluid
.box_title .span6
%h2 Neuste Benutzerinnen %section
.column_content %h2 Neuste Benutzerinnen
%table %table.table.table-striped
%tr %thead
%th Benutzername %tr
%th Name %th Benutzername
%th Erstellt am %th Name
- for user in @users %th Erstellt am
%tr{:class => cycle('even','odd', :name => 'users')} - for user in @users
%td= link_to user.nick, [:admin, user] %tr{:class => cycle('even','odd', :name => 'users')}
%td=h user.name %td= link_to user.nick, [:admin, user]
%td= format_date(user.created_on) %td=h user.name
%br/ %td= format_date(user.created_on)
= link_to 'Alle Benutzerinnen', admin_users_path = link_to 'Alle Benutzerinnen', admin_users_path
| |
= link_to "Neue Benutzerin", new_admin_user_path = link_to "Neue Benutzerin", new_admin_user_path, class: 'btn btn-primary btn-small'
.span6
.right_column{:style => "width:48%"} %section
.box_title %h2 Neuste Gruppen
%h2 Neuste Gruppen %table.table.table-striped
.column_content %thead
%table %tr
%tr %th Gruppenname
%th Gruppenname %th Typ
%th Typ %th Mitglieder
%th Mitglieder - for group in @groups
- for group in @groups %tr{:class => cycle('even','odd', :name => 'groups')}
%tr{:class => cycle('even','odd', :name => 'groups')} %td= link_to group.name, [:admin, group]
%td= link_to group.name, [:admin, group] %td= group.class.model_name.human
%td= group.class.model_name.human %td= group.users.size
%td= group.users.size = link_to 'Alle Bestellgruppen', admin_ordergroups_path
%br/ |
= link_to 'Alle Bestellgruppen', admin_ordergroups_path = link_to "Neue Bestellgruppe", new_admin_ordergroup_path, class: 'btn btn-primary btn-small'
| |
= link_to "Neue Bestellgruppe", new_admin_ordergroup_path = link_to 'Alle Arbeitsgruppen', admin_workgroups_path
| |
= link_to 'Alle Arbeitsgruppen', admin_workgroups_path = link_to "Neue Arbeitsgruppe", new_admin_workgroup_path, class: 'btn btn-primary btn-small'
|
= link_to "Neue Arbeitsgruppe", new_admin_workgroup_path

View file

@ -1,12 +1,14 @@
%p - unless @ordergroup.new_record?
Neue Mitglieder kannst du %p
= link_to "hier", new_invite_path(id: @ordergroup.id) Neue Mitglieder kannst du
einladen. = link_to "hier", new_invite_path(id: @ordergroup.id), remote: true
einladen.
= simple_form_for [:admin, @ordergroup] do |f| = simple_form_for [:admin, @ordergroup] do |f|
= render :layout => 'shared/group_form_fields', :locals => {:f => f} do = render :layout => 'shared/group_form_fields', :locals => {:f => f} do
= f.input :contact_person = f.input :contact_person
= f.input :contact_phone = f.input :contact_phone
= f.input :contact_address = f.input :contact_address
= f.input :ignore_apple_restriction = f.input :ignore_apple_restriction
= f.submit .form-actions
= link_to "oder abbrechen", admin_ordergroups_path = f.button :submit
= link_to "oder abbrechen", :back

View file

@ -1,18 +1,14 @@
%p - if Ordergroup.count > 20
%table{:style => "width:100%"} = items_per_page
%tr = pagination_links_remote @ordergroups
%td %table.table.table-striped
= pagination_links_remote @ordergroups
%td{:style => "text-align:right"}
= items_per_page
%table.list
%thead %thead
%tr %tr
%th Name %th Name
%th Kontakt %th Kontakt
%th Adresse %th Adresse
%th Mitglieder %th Mitglieder
%th %th Aktionen
%tbody %tbody
- for ordergroup in @ordergroups - for ordergroup in @ordergroups
%tr{:class => cycle('even','odd', :name => 'groups')} %tr{:class => cycle('even','odd', :name => 'groups')}
@ -21,6 +17,6 @@
%td= link_to_gmaps ordergroup.contact_address %td= link_to_gmaps ordergroup.contact_address
%td= ordergroup.users.size %td= ordergroup.users.size
%td %td
= link_to icon(:edit), edit_admin_ordergroup_path(ordergroup) = link_to "Bearbeiten", edit_admin_ordergroup_path(ordergroup), class: 'btn btn-mini'
= link_to icon(:delete), [:admin, ordergroup], :confirm => "Willst du #{ordergroup.name} wirklich löschen?", = link_to "Löschen", [:admin, ordergroup], :confirm => "Willst du #{ordergroup.name} wirklich löschen?",
:method => :delete :method => :delete, class: 'btn btn-mini btn-danger'

View file

@ -1,26 +1,23 @@
- title "Bestellgruppen" - title "Bestellgruppen"
%p - content_for :sidebar do
%i %p= link_to "Neue Bestellgruppe anlegen", new_admin_ordergroup_path, class: 'btn btn-primary'
%p
Hier kannst du Hier kannst du
= link_to 'neue Bestellgruppen', new_admin_ordergroup_path = link_to 'neue Bestellgruppen', new_admin_ordergroup_path
anlegen, Gruppen bearbeiten und löschen. anlegen, Gruppen bearbeiten und löschen.
%p
%p Beachte dabei den <em>Unterschied zwischen Gruppe und Bestellgruppe</em>:
Beachte dabei den <em>Unterschied zwischen Gruppe und Bestellgruppe</em>: Eine Bestellgruppe hat ein Konto und kann Essen bestellen. In einer
Eine Bestellgruppe hat ein Konto und kann Essen bestellen. In einer %em= link_to 'Arbeitsgruppe', admin_workgroups_path
%em= link_to 'Arbeitsgruppe', admin_workgroups_path (z.b. 'Soritiergruppe')
(z.b. 'Soritiergruppe') koordinieren sich die Mitglieder mittels Aufgaben und Nachrichten.
koordinieren sich die Mitglieder mittels Aufgaben und Nachrichten. Nutzer_innen können immer nur einer Bestellgruppe, aber beliebig vielen anderen Gruppen angehören.
Nutzer_innen können immer nur einer Bestellgruppe, aber beliebig vielen anderen Gruppen angehören.
.left_column{:style => "width:100%"} .well.well-small
.box_title = form_tag admin_ordergroups_path, :method => :get, :remote => true,
%h2 Gruppenübersicht 'data-submit-onchange' => true, class: 'form-search' do
.column_content = text_field_tag :query, params[:query], class: 'input-medium search-query',
#group_filter placeholder: 'Name ...'
= form_tag admin_ordergroups_path, :method => :get, :style=>"display:inline;", :id => 'ordergroup_search', #ordergroups
:remote => true, 'data-submit-onchange' => true do = render "ordergroups"
%label{:for => 'article_name'} Suche nach Name:
= text_field_tag :query, params[:query], :size => 10
#ordergroups
= render :partial => "ordergroups"

View file

@ -1 +0,0 @@
$('#ordergroups').html('<%= escape_javascript(render("ordergroups")) %>');

View file

@ -0,0 +1 @@
$('#ordergroups').html('#{escape_javascript(render("ordergroups"))}');

View file

@ -1,3 +1,3 @@
- title "Bestellgruppe anlegen" - title "Bestellgruppe anlegen"
= render :partial => 'form' = render 'form'

View file

@ -1,13 +1,6 @@
- title "Bestellgruppe #{@ordergroup.name}" - title "Bestellgruppe #{@ordergroup.name}"
.left_column{:style => "width:45em"}
.box_title %section= render 'shared/group', group: @ordergroup
%h2 Übersicht = link_to 'Gruppe/Mitglieder bearbeiten', edit_admin_ordergroup_path(@ordergroup), class: 'btn'
.column_content = link_to 'Löschen', [:admin, @ordergroup], :confirm => 'Bist Du sicher?', :method => :delete, class: 'btn btn-danger'
= render :partial => 'shared/group', :locals => { :group => @ordergroup } = link_to 'Nachricht senden', new_message_path(:message => {:group_id => @ordergroup.id}), class: 'btn'
%p
= link_to 'Gruppe/Mitglieder bearbeiten', edit_admin_ordergroup_path(@ordergroup)
|
= link_to 'Löschen', [:admin, @ordergroup], :confirm => 'Bist Du sicher?', :method => :delete
|
= link_to 'Nachricht senden', new_message_path(:message => {:group_id => @ordergroup.id})
%p{:style => "clear:both"}= link_to "Gruppenübersicht", admin_ordergroups_path

View file

@ -0,0 +1,5 @@
= simple_form_for([:admin, @user]) do |f|
= render :partial => 'shared/user_form_fields', :locals => {:f => f}
.form-actions
= f.submit
= link_to 'oder abbrechen', :back

View file

@ -1,12 +1,7 @@
%p - if User.count > 20
%table{:style => "width:100%"} = items_per_page
%tr = pagination_links_remote @users
%td %table.table.table-striped
= pagination_links_remote @users
%td{:style => "text-align:right"}
- if @users.size > 20
= items_per_page
%table.list
%thead %thead
%tr %tr
%th Login %th Login
@ -14,17 +9,16 @@
%th Email %th Email
%th Zugriff auf %th Zugriff auf
%th Letzter login %th Letzter login
%th{:style => "width:3em"} %th Aktionen
%tbody %tbody
- for user in @users - for user in @users
%tr
%tr{:class => cycle('even','odd', :name => 'users')}
%td= link_to user.nick, [:admin, user] %td= link_to user.nick, [:admin, user]
%td=h user.name %td=h user.name
%td=h user.email %td=h user.email
%td=h format_roles(user) %td=h format_roles(user)
%td=h format_time(user.last_login) %td=h format_time(user.last_login)
%td %td
= link_to icon(:edit), edit_admin_user_path(user) = link_to 'Bearbeiten', edit_admin_user_path(user), class: 'btn btn-mini'
= link_to icon(:delete), [:admin, user], :confirm => "Willst du #{user.name} wirklich löschen?", = link_to 'Löschen', [:admin, user], :confirm => "Willst du #{user.name} wirklich löschen?",
:method => :delete :method => :delete, class: 'btn btn-danger btn-mini'

View file

@ -1,9 +1,3 @@
%h1 Benutzerin bearbeiten - title "Benutzerin bearbeiten"
#newUser{:style => "width:65em"}
.box_title = render 'form'
%h2 Benutzerin bearbeiten
#userForm.column_content
- simple_form_for([:admin, @user]) do |f|
= render :partial => 'shared/user_form_fields', :locals => {:f => f}
= f.submit
= link_to 'oder abbrechen', admin_users_path

View file

@ -1,18 +1,16 @@
- title "Admin/Benutzerinnen" - title "Admin/Benutzerinnen"
%p
%i - content_for :sidebar do
Hier kannst du Benutzer_innen %p= link_to 'Neue Benutzerin anlegen', new_admin_user_path, class: 'btn btn-primary'
= link_to 'neu Anlegen', new_admin_user_path %p
, bearbeiten und natürlich auch löschen. Hier kannst du Benutzer_innen #{link_to 'neu Anlegen', new_admin_user_path},
.left_column{:style => "width:100%"} bearbeiten und natürlich auch löschen.
.box_title
%h2 Benutzerinnenübersicht .well.well-small
.column_content = form_tag admin_users_path, :method => :get, :remote => true,
#user_filter{:style => "float:left; margin-right:2em;"} 'data-submit-onchange' => true, class: 'form-search' do
= form_tag admin_users_path, :method => :get, :style=>"display:inline;", :id => 'user_search', = text_field_tag :user_name, params[:user_name], class: 'input-medium search-query',
:remote => true, 'data-submit-onchange' => true do placeholder: 'Name ...'
%label{:for => 'article_name'} Suche nach Name:
= text_field_tag :query, params[:query], :size => 10 #users
#users = render "users"
= render :partial => "users"
%p= link_to 'Neue Benutzerin', new_admin_user_path

View file

@ -1 +0,0 @@
$('#users').html('<%= escape_javascript(render("users")) %>');

View file

@ -0,0 +1 @@
$('#users').html('#{escape_javascript(render("users"))}');

View file

@ -1,11 +1,3 @@
- title "Neue Benutzerin" - title "Neue Benutzerin anlegen"
#newUser = render 'form'
.box_title
%h2 Neue Benutzerin
.column_content#userForm
= simple_form_for([:admin, @user]) do |f|
= render :partial => 'shared/user_form_fields', :locals => {:f => f}
= f.submit
= link_to 'oder abbrechen', admin_users_path
%p= link_to 'Benutzerinnenübersicht', admin_users_path

View file

@ -1,52 +0,0 @@
<h1><%=h @user.nick %></h1>
<div class="left_column" style="width:100%">
<div class="box_title">
<h2>Übersicht</h2>
</div>
<div class="column_content">
<p>
Mitglied seit <%= distance_of_time_in_words(Time.now, @user.created_on) -%>
</p>
<div style="float:left;margin:5px; margin-right:10px;" class="box">
<p><b>Person</b></p>
<p><b>Nick:</b> <%=h @user.nick %></p>
<p><b>Name:</b> <%=h @user.name %></p>
<p><b>Email:</b> <%=h @user.email %></p>
<p><b>Telefon:</b> <%=h @user.phone %></p>
</div>
<div style="float:left; margin:5px;" class="box">
<p>
<b>Einstellungen</b>
</p>
<table style="width:26em">
<tbody>
<% for setting in User::setting_keys.keys -%>
<tr>
<td><%= User::setting_keys[setting] %></td>
<td><%= @user.settings[setting] == '1' ? 'ja' : 'nein' %></td>
</tr>
<% end -%>
</tbody>
</table>
<p>
<b>Benutzer_in hat Zugriff auf:</b>
</p>
<p>
<%=h format_roles(@user) %>
</p>
</div>
<p style="clear:both">
<%= link_to 'Bearbeiten', edit_admin_user_path(@user) %>
| <%= link_to 'Löschen', [:admin, @user], :confirm => "Willst du #{@user.first_name} wirklich rausschmeißen?", :method => :delete %>
| <%= link_to "Nachricht senden", new_message_path(:message => {:mail_to => @user.id}) %>
</p>
</div>
<div class="box_title"><h2>Gruppenabos</h2></div>
<div class="column_content">
<% for membership in Membership.find_all_by_user_id(@user.id) -%>
<p>
<%= link_to(membership.group.name, [:admin, membership.group]) %>
</p>
<% end -%>
</div>
</div>

View file

@ -0,0 +1,39 @@
- title @user.nick
.row-fluid
.span3
.well
%h4 Person
%p Mitglied seit #{distance_of_time_in_words(Time.now, @user.created_on)}
%dl
%dt Nick
%dd= @user.nick
%dt Name
%dd= h @user.name
%dt Email
%dd= @user.email
%dt Telefon
%dd= @user.phone
%dt Zugriff auf
%dd= format_roles(@user)
.span5
.well
%h4 Einstellungen
%table.table
- for setting in User::setting_keys.keys
%tr
%td= User::setting_keys[setting]
%td= @user.settings[setting] == '1' ? 'ja' : 'nein'
.span3
.well
%h4 Gruppenabos
%ul.unstyled
- for membership in Membership.find_all_by_user_id(@user.id)
%li= link_to(membership.group.name, [:admin, membership.group])
%hr/
%p
= link_to 'Bearbeiten', edit_admin_user_path(@user), class: 'btn'
= link_to 'Löschen', [:admin, @user], :confirm => "Willst du #{@user.first_name} wirklich rausschmeißen?",
:method => :delete, class: 'btn btn-danger'
= link_to "Nachricht senden", new_message_path(:message => {:mail_to => @user.id}), class: 'btn'

View file

@ -4,11 +4,12 @@
einladen. einladen.
= simple_form_for [:admin, @workgroup] do |f| = simple_form_for [:admin, @workgroup] do |f|
= render :layout => 'shared/group_form_fields', :locals => {:f => f} do = render :layout => 'shared/group_form_fields', :locals => {:f => f} do
%h3 Zugriff auf .. %h4 Zugriff auf
= f.input :role_admin = f.input :role_admin
= f.input :role_finance = f.input :role_finance
= f.input :role_suppliers = f.input :role_suppliers
= f.input :role_article_meta = f.input :role_article_meta
= f.input :role_orders = f.input :role_orders
= f.submit .form-actions
= link_to "oder abbrechen", admin_workgroups_path = f.button :submit
= link_to "oder abbrechen", :back

View file

@ -1,24 +1,20 @@
%p - if Workgroup.count > 20
%table{:style => "width:100%"} = items_per_page
%tr = pagination_links_remote @workgroups
%td %table.table.table-striped
= pagination_links_remote @workgroups
%td{:style => "text-align:right"}
= items_per_page
%table.list
%thead %thead
%tr %tr
%th Name %th Name
%th Mitglieder %th Mitglieder
%th Zugriff auf %th Zugriff auf
%th %th Aktionen
%tbody %tbody
- for workgroup in @workgroups - for workgroup in @workgroups
%tr{:class => cycle('even','odd', :name => 'groups')} %tr
%td= link_to workgroup.name, [:admin, workgroup] %td= link_to workgroup.name, [:admin, workgroup]
%td= workgroup.users.size %td= workgroup.users.size
%td= format_roles(workgroup) %td= format_roles(workgroup)
%td %td
= link_to icon(:edit), edit_admin_workgroup_path(workgroup) = link_to "Bearbeiten", edit_admin_workgroup_path(workgroup), class: 'btn btn-mini'
= link_to icon(:delete), [:admin, workgroup], :confirm => 'Willst du ' + workgroup.name + ' wirklich löschen?', = link_to "Löschen", [:admin, workgroup], :confirm => 'Willst du ' + workgroup.name + ' wirklich löschen?',
:method => :delete :method => :delete, class: 'btn btn-mini btn-danger'

View file

@ -1,3 +1,3 @@
- title "Arbeitsgruppe bearbeiten" - title "Arbeitsgruppe bearbeiten"
= render :partial => 'form' = render 'form'

View file

@ -1,26 +1,22 @@
- title "List workgroups" - title "Arbeitsgruppen"
%p - content_for :sidebar do
%i %p= link_to "Neue Arbeitsgruppe anlegen", new_admin_workgroup_path, class: 'btn btn-primary'
%p
Hier kannst du Hier kannst du
= link_to 'neue Arbeitsgruppen', new_admin_workgroup_path = link_to 'neue Arbeitsgruppen', new_admin_workgroup_path
anlegen, Gruppen bearbeiten und löschen. anlegen, Gruppen bearbeiten und löschen.
%p
%p Beachte dabei den <strong>Unterschied zwischen Gruppe und Bestellgruppe</strong>:
Beachte dabei den <em>Unterschied zwischen Gruppe und Bestellgruppe</em>: Eine #{link_to 'Bestellgruppe', '/admin/ordergroups'}
Eine hat ein Konto und kann Essen bestellen. In einer Arbeitsgruppe (z.b. 'Soritiergruppe')
%em= link_to 'Bestellgruppe', '/admin/ordergroups' koordinieren sich die Mitglieder mittels Aufgaben und Nachrichten.
hat ein Konto und kann Essen bestellen. In einer Arbeitsgruppe (z.b. 'Soritiergruppe') Nutzer_innen können immer nur einer Bestellgruppe, aber beliebig vielen anderen Gruppen angehören.
koordinieren sich die Mitglieder mittels Aufgaben und Nachrichten.
Nutzer_innen können immer nur einer Bestellgruppe, aber beliebig vielen anderen Gruppen angehören. .well.well-small
.left_column{:style => "width:100%"} = form_tag admin_workgroups_path, :method => :get, :remote => true,
.box_title 'data-submit-onchange' => true, class: 'form-search' do
%h2 Gruppenübersicht = text_field_tag :query, params[:query], class: 'input-medium search-query',
.column_content placeholder: 'Name ...'
#group_filter #workgroups
= form_tag admin_workgroups_path, :method => :get, :style=>"display:inline;", :id => 'ordergroup_search', = render "workgroups"
:remote => true, 'data-submit-onchange' => true do
%label{:for => 'article_name'} Suche nach Name:
= text_field_tag :query, params[:query], :size => 10
#workgroups
= render :partial => "workgroups"

View file

@ -1 +0,0 @@
$('#workgroups').html('<%= escape_javascript(render("workgroups")) %>');

View file

@ -0,0 +1 @@
$('#workgroups').html('#{escape_javascript(render("workgroups"))}');

View file

@ -1,3 +1,3 @@
- title "Erstelle Arbeitsgruppe" - title "Arbeitsgruppe anlegen"
= render :partial => 'form' = render 'form'

View file

@ -1,14 +1,6 @@
- title "Arbeitsgruppe #{@workgroup.name}" - title "Arbeitsgruppe #{@workgroup.name}"
.left_column{:style => "width:45em"}
.box_title
%h2 Übersicht
.column_content
= render :partial => 'shared/group', :locals => { :group => @workgroup }
%p %section= render :partial => 'shared/group', :locals => { :group => @workgroup }
= link_to 'Gruppe/Mitglieder bearbeiten', edit_admin_workgroup_path(@workgroup) = link_to 'Gruppe/Mitglieder bearbeiten', edit_admin_workgroup_path(@workgroup), class: 'btn'
| = link_to 'Löschen', [:admin, @workgroup], :confirm => 'Bist Du sicher?', :method => :delete, class: 'btn btn-danger'
= link_to 'Löschen', [:admin, @workgroup], :confirm => 'Bist Du sicher?', :method => :delete = link_to_new_message(message_params: {group_id: @workgroup.id})
|
= link_to 'Nachricht senden', new_message_path(:message => {:group_id => @workgroup.id})
%p{:style => "clear:both"}= link_to "Gruppenübersicht", admin_workgroups_path

View file

@ -1,2 +0,0 @@
$('#listbody').prepend('<%= escape_javascript(render(@article)) %>');
$.fancybox.close();

View file

@ -0,0 +1,2 @@
$('#listbody').prepend('#{escape_javascript(render(@article))}');
$.fancybox.close();

View file

@ -1,5 +0,0 @@
<% if @order %>
$('#article_<%= @article.id %>').after('<%= escape_javascript(render("destroy_active_article")) %>');
<% else %>
$('#article_<%= @article.id %>').remove();
<% end %>

View file

@ -0,0 +1,4 @@
- if @order
$('#article_#{@article.id}').after('#{escape_javascript(render("destroy_active_article"))}');
- else
$('#article_#{@article.id}').remove();

View file

@ -1 +0,0 @@
$('#table').html('<%= escape_javascript(render("articles")) %>');

View file

@ -0,0 +1 @@
$('#table').html('#{escape_javascript(render("articles"))}');

View file

@ -1 +0,0 @@
$.fancybox('<%= escape_javascript(render("form")) %>');

View file

@ -0,0 +1 @@
$.fancybox('#{escape_javascript(render("form"))}');

View file

@ -1 +0,0 @@
$('#search_results').html('<%= escape_javascript(render("import_search_results")) %>');

View file

@ -0,0 +1 @@
$('#search_results').html('#{escape_javascript(render("import_search_results"))}');

View file

@ -1,2 +0,0 @@
$('#article_<%= @article.id %>').replaceWith('<%= escape_javascript(render(@article)) %>');
$.fancybox.close();

View file

@ -0,0 +1,2 @@
$('#article_#{@article.id}').replaceWith('#{escape_javascript(render(@article))}');
$.fancybox.close();

View file

@ -1 +0,0 @@
$('#stock_changes').append('<%= escape_javascript(render(:partial => 'stock_change', :locals => {:stock_change => StockChange.new, :supplier => @supplier})) %>');

View file

@ -0,0 +1 @@
$('#stock_changes').append('#{escape_javascript(render(:partial => 'stock_change', :locals => {:stock_change => StockChange.new, :supplier => @supplier}))}');

View file

@ -1 +0,0 @@
$.fancybox('<%= escape_javascript(render("edit_note")) %>');

View file

@ -0,0 +1 @@
$.fancybox('#{escape_javascript(render("edit_note"))}');

View file

@ -1 +0,0 @@
$('#results').html('<%= escape_javascript(render(partial: balancing_view_partial, locals: {order: @order})) %>');

View file

@ -0,0 +1 @@
$('#results').html('#{escape_javascript(render(partial: balancing_view_partial, locals: {order: @order}))}');

View file

@ -1,2 +0,0 @@
$.fancybox.close();
$('#note').html('<%= escape_javascript(simple_format(@order.note)) %>');

View file

@ -0,0 +1,2 @@
$.fancybox.close();
$('#note').html('#{escape_javascript(simple_format(@order.note))}');

View file

@ -1 +0,0 @@
$('#transactions').html('<%= escape_javascript(render("transactions")) %>');

View file

@ -0,0 +1 @@
$('#transactions').html('#{escape_javascript(render("transactions"))}');

View file

@ -1 +0,0 @@
$.fancybox('<%= escape_javascript(render('form')) %>');

View file

@ -0,0 +1 @@
$.fancybox('#{escape_javascript(render('form'))}');

View file

@ -1 +0,0 @@
$.fancybox('<%= escape_javascript(render("form")) %>');

View file

@ -0,0 +1 @@
$.fancybox('#{escape_javascript(render("form"))}');

View file

@ -1,5 +0,0 @@
$.fancybox.close();
$('#order_article_<%= @order_article.id %>').
html('<%= escape_javascript(render(partial: 'finance/balancing/order_article', locals: {order_article: @order_article})) %>');
$('#group_order_articles_<%= @order_article.id %>').
html('<%= escape_javascript(render(partial: 'finance/balancing/group_order_articles', locals: {order_article: @order_article})) %>');

View file

@ -0,0 +1,5 @@
$.fancybox.close();
$('#order_article_#{@order_article.id}').
html('#{escape_javascript(render(partial: 'finance/balancing/order_article', locals: {order_article: @order_article}))}');
$('#group_order_articles_#{@order_article.id}').
html('#{escape_javascript(render(partial: 'finance/balancing/group_order_articles', locals: {order_article: @order_article}))}');

View file

@ -1,6 +0,0 @@
<% title "Rechnung bearbeiten" %>
<%= render :partial => 'form' %>
<%= link_to "Anzeigen", [:finance, @invoice] %> |
<%= link_to 'Zurück', finance_invoices_path %>

View file

@ -0,0 +1,5 @@
- title "Rechnung bearbeiten"
= render :partial => 'form'
= link_to "Anzeigen", [:finance, @invoice]
|
\#{link_to 'Zurück', finance_invoices_path}

View file

@ -1,40 +0,0 @@
<% title "Rechnungen" %>
<p><%= will_paginate @invoices %></p>
<table class="list" style="width:70em">
<thead>
<tr>
<th>Nummer</th>
<th>Lieferantin</th>
<th>Datum</th>
<th>Bezahlt am</th>
<th>Betrag</th>
<th>Lieferung</th>
<th>Bestellung</th>
<th>Note</th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
<% for invoice in @invoices %>
<tr>
<td><%= link_to h(invoice.number), finance_invoice_path(invoice)%></td>
<td><%= invoice.supplier.name %></td>
<td><%= format_date invoice.date %></td>
<td><%= format_date invoice.paid_on %></td>
<td><%= number_to_currency invoice.amount %></td>
<td><%= link_to "Lieferung", [invoice.supplier,invoice.delivery] if invoice.delivery %></td>
<td><%= link_to format_date(invoice.order.ends), new_finance_order_path(order_id: invoice.order_id) if invoice.order %></td>
<td><%= truncate(invoice.note) %></td>
<td><%= link_to icon(:edit), edit_finance_invoice_path(invoice) %></td>
<td><%= link_to icon(:delete), finance_invoice_path(invoice), :confirm => 'Are you sure?', :method => :delete %></td>
</tr>
<% end %>
</tbody>
</table>
<br />
<%= link_to 'Neue Rechnung anlegen', new_finance_invoice_path %>

View file

@ -0,0 +1,30 @@
- title "Rechnungen"
%p= will_paginate @invoices
%table.list{:style => "width:70em"}
%thead
%tr
%th Nummer
%th Lieferantin
%th Datum
%th Bezahlt am
%th Betrag
%th Lieferung
%th Bestellung
%th Note
%th
%th
%tbody
- for invoice in @invoices
%tr
%td= link_to h(invoice.number), finance_invoice_path(invoice)
%td= invoice.supplier.name
%td= format_date invoice.date
%td= format_date invoice.paid_on
%td= number_to_currency invoice.amount
%td= link_to "Lieferung", [invoice.supplier,invoice.delivery] if invoice.delivery
%td= link_to format_date(invoice.order.ends), new_finance_order_path(order_id: invoice.order_id) if invoice.order
%td= truncate(invoice.note)
%td= link_to icon(:edit), edit_finance_invoice_path(invoice)
%td= link_to icon(:delete), finance_invoice_path(invoice), :confirm => 'Are you sure?', :method => :delete
%br/
= link_to 'Neue Rechnung anlegen', new_finance_invoice_path

View file

@ -1,4 +0,0 @@
<% title "Neue Rechnung anlegen" -%>
<%= render :partial => 'form' %>
<%= link_to 'Zurück', finance_invoices_path %>

View file

@ -0,0 +1,3 @@
- title "Neue Rechnung anlegen"
= render :partial => 'form'
= link_to 'Zurück', finance_invoices_path

View file

@ -1,3 +0,0 @@
$.fancybox.close();
$('#result_table').
prepend('<%= escape_javascript(render(partial: 'finance/balancing/order_article_result', locals: {order_article: @order_article}))%>');

View file

@ -0,0 +1,3 @@
$.fancybox.close();
$('#result_table').
prepend('#{escape_javascript(render(partial: 'finance/balancing/order_article_result', locals: {order_article: @order_article}))}');

View file

@ -1 +0,0 @@
$('#order_article_<%= @order_article.id %>, #group_order_articles_<%= @order_article.id %>').hide();

View file

@ -0,0 +1 @@
$('#order_article_#{@order_article.id}, #group_order_articles_#{@order_article.id}').hide();

View file

@ -1 +0,0 @@
$.fancybox('<%= escape_javascript(render("edit")) %>');

View file

@ -0,0 +1 @@
$.fancybox('#{escape_javascript(render("edit"))}');

View file

@ -1 +0,0 @@
$.fancybox('<%= escape_javascript(render("new")) %>');

View file

@ -0,0 +1 @@
$.fancybox('#{escape_javascript(render("new"))}');

View file

@ -1,3 +0,0 @@
$.fancybox.close();
$('#order_article_<%= @order_article.id %>').
html('<%= escape_javascript(render(partial: 'finance/balancing/order_article', locals: {order_article: @order_article})) %>');

View file

@ -0,0 +1,3 @@
$.fancybox.close();
$('#order_article_#{@order_article.id}').
html('#{escape_javascript(render(partial: 'finance/balancing/order_article', locals: {order_article: @order_article}))}');

View file

@ -1 +0,0 @@
$('#ordergroups').html('<%= escape_javascript(render("ordergroups")) %>');

View file

@ -0,0 +1 @@
$('#ordergroups').html('#{escape_javascript(render("ordergroups"))}');

View file

@ -1 +0,0 @@
$('#ordergroups').html('<%= escape_javascript(render("ordergroups")) %>');

View file

@ -0,0 +1 @@
$('#ordergroups').html('#{escape_javascript(render("ordergroups"))}');

View file

@ -1 +0,0 @@
$('#users').html('<%= escape_javascript(render("users")) %>');

View file

@ -0,0 +1 @@
$('#users').html('#{escape_javascript(render("users"))}');

View file

@ -1,4 +1,4 @@
- content_for :head do - content_for :javascript do
:javascript :javascript
$(function() { $(function() {
#{data_to_js(@ordering_data)} #{data_to_js(@ordering_data)}
@ -10,123 +10,107 @@
- title "Bestellen" - title "Bestellen"
.left_column{:style => "width:49em"} .well.pull-left
.box_title %h2= @order.name
%h2=h @order.name %dl.dl-horizontal
.column_content - unless @order.note.blank?
%table %dt Notiz
%tr{:valign => "top"} %dd= @order.note
%td{:width => "60%"} %dt Ende
%p %dd= format_time(@order.ends)
%b Lieferantin: - unless @order.stockit? or @order.supplier.min_order_quantity.blank?
=h @order.name %dt Mindestbestellmenge
%p %dd= @order.supplier.min_order_quantity
%b Ende: %dt Gesamtbestellmenge bisher:
=h format_time(@order.ends) %dd= number_to_currency @order.sum
- if @group_order && @group_order.updated_by %dt Zuletzt bestellt
%p %dd
%b Zuletzt bestellt: = @group_order.updated_by.nick if @group_order.updated_by
=h @group_order.updated_by.nick if @group_order.updated_by (#{format_time(@group_order.updated_on)})
= "(#{format_time(@group_order.updated_on)})" %dt Guthaben
%p %dd= number_to_currency(@ordering_data[:available_funds])
%b Verfügbares Guthaben:
= number_to_currency(@ordering_data[:available_funds])
%td
- unless @order.note.empty?
%p
%b Notiz:
= simple_format(@order.note)
- unless @order.stockit? || @order.supplier.min_order_quantity.blank?
%p
%b Mindestellmenge:
=h @order.supplier.min_order_quantity
%p
%b Gesamtbestellmenge bisher:
= number_to_currency @order.sum
= render :partial => 'switch_order', :locals => {:current_order => @order} .well.pull-right
= render 'switch_order', current_order: @order
= form_for @group_order do |f| = form_for @group_order do |f|
= f.hidden_field :lock_version = f.hidden_field :lock_version
= f.hidden_field :order_id = f.hidden_field :order_id
= f.hidden_field :updated_by_user_id = f.hidden_field :updated_by_user_id
= f.hidden_field :ordergroup_id = f.hidden_field :ordergroup_id
.single_column{:style => "clear:both;margin-bottom:7em;"} %table.table.table-hover
.box_title %thead
%h2 Artikel %tr
.column_content %th Name
%table#order.list %th{style: "width:13px;"}
%thead %th{style: "width:4.5em;"} Preis
%tr %th{style: "width:4.5em;"} Einheit
%th Name - unless @order.stockit?
%th{:style => "width:13px;"} %th{style: "width:70px;"} Fehlende Einheiten
%th{:style => "width:4.5em;"} Preis %th#col_required Menge
%th{:style => "width:4.5em;"} Einheit %th#col_tolerance Toleranz
- unless @order.stockit? - else
%th{:style => "width:70px;"} Fehlende Einheiten %th(style="width:20px") Verfügbar
%th#col_required Menge %th#col_required Menge
%th#col_tolerance Toleranz %th{style: "width:15px;"} Summe
- else %tbody
%th(style="width:20px") Verfügbar - @order.articles_grouped_by_category.each do |category, order_articles|
%th#col_required Menge %tr.article-category
%th{:style => "width:15px;"} Summe %td
%tbody = category
- @order.articles_grouped_by_category.each do |category, order_articles| %i.icon-tag
%tr{:style => "background-color:#EFEFEF"} %td{colspan: "9"}
%td{:style => "text-align:left"} - order_articles.each do |order_article|
%b= h category %tr{class: "#{cycle('even', 'odd', name: 'articles')} order-article", valign: "top"}
%td{:colspan => "9"} %td.name= order_article.article.name
- order_articles.each do |order_article| %td= h order_article.article.origin
%tr{:class => "#{cycle('even', 'odd', :name => 'articles')} order-article", :valign => "top"} %td= number_to_currency(@ordering_data[:order_articles][order_article.id][:price])
%td.name= order_article.article.name %td= order_article.article.unit
%td= h order_article.article.origin %td
%td= number_to_currency(@ordering_data[:order_articles][order_article.id][:price]) - if @order.stockit?
%td= order_article.article.unit = @ordering_data[:order_articles][order_article.id][:quantity_available]
%td - else
- if @order.stockit? %span{id: "missing_units_#{order_article.id}"}= @ordering_data[:order_articles][order_article.id][:missing_units]
= @ordering_data[:order_articles][order_article.id][:quantity_available]
- else
%span{:id => "missing_units_#{order_article.id}"}= @ordering_data[:order_articles][order_article.id][:missing_units]
%td.quantity %td.quantity
%input{:id => "q_#{order_article.id}", :name => "group_order[group_order_articles_attributes][#{order_article.id}][quantity]", :size => "2", :type => "hidden", :value => @ordering_data[:order_articles][order_article.id][:quantity]}/ %input{id: "q_#{order_article.id}", name: "group_order[group_order_articles_attributes][#{order_article.id}][quantity]", size: "2", type: "hidden", value: @ordering_data[:order_articles][order_article.id][:quantity]}/
%span.used{:id => "q_used_#{order_article.id}"}= @ordering_data[:order_articles][order_article.id][:used_quantity] %span.used{id: "q_used_#{order_article.id}"}= @ordering_data[:order_articles][order_article.id][:used_quantity]
+ +
%span.unused{:id => "q_unused_#{order_article.id}"}= @ordering_data[:order_articles][order_article.id][:quantity] - @ordering_data[:order_articles][order_article.id][:used_quantity] %span.unused{id: "q_unused_#{order_article.id}"}= @ordering_data[:order_articles][order_article.id][:quantity] - @ordering_data[:order_articles][order_article.id][:used_quantity]
%input{:type => 'button', :value => '+', 'data-increase_quantity' => order_article.id} %input{type: 'button', value: '+', 'data-increase_quantity' => order_article.id}
%input{:type => 'button', :value => '-', 'data-decrease_quantity' => order_article.id} %input{type: 'button', value: '-', 'data-decrease_quantity' => order_article.id}
%td.tolerance{:style => ('display:none' if @order.stockit?)} %td.tolerance{style: ('display:none' if @order.stockit?)}
%input{:id => "t_#{order_article.id}", :name => "group_order[group_order_articles_attributes][#{order_article.id}][tolerance]", :size => "2", :type => "hidden", :value => @ordering_data[:order_articles][order_article.id][:tolerance]}/ %input{id: "t_#{order_article.id}", name: "group_order[group_order_articles_attributes][#{order_article.id}][tolerance]", size: "2", type: "hidden", value: @ordering_data[:order_articles][order_article.id][:tolerance]}/
- if (@ordering_data[:order_articles][order_article.id][:unit] > 1) - if (@ordering_data[:order_articles][order_article.id][:unit] > 1)
%span.used{:id => "t_used_#{order_article.id}"}= @ordering_data[:order_articles][order_article.id][:used_tolerance] %span.used{id: "t_used_#{order_article.id}"}= @ordering_data[:order_articles][order_article.id][:used_tolerance]
+ +
%span.unused{:id => "t_unused_#{order_article.id}"}= @ordering_data[:order_articles][order_article.id][:tolerance] - @ordering_data[:order_articles][order_article.id][:used_tolerance] %span.unused{id: "t_unused_#{order_article.id}"}= @ordering_data[:order_articles][order_article.id][:tolerance] - @ordering_data[:order_articles][order_article.id][:used_tolerance]
%input{:type => 'button', :value => '+', 'data-increase_tolerance' => order_article.id} %input{type: 'button', value: '+', 'data-increase_tolerance' => order_article.id}
%input{:type => 'button', :value => '-', 'data-decrease_tolerance' => order_article.id} %input{type: 'button', value: '-', 'data-decrease_tolerance' => order_article.id}
%td{:id => "td_price_#{order_article.id}", :style => "text-align:right; padding-right:10px; width:4em"} %td{id: "td_price_#{order_article.id}", style: "text-align:right; padding-right:10px; width:4em"}
%span{:id => "price_#{order_article.id}_display"}= number_to_currency(@ordering_data[:order_articles][order_article.id][:total_price], :unit => "") %span{id: "price_#{order_article.id}_display"}= number_to_currency(@ordering_data[:order_articles][order_article.id][:total_price], unit: "")
.article-info .article-info
%h3= order_article.article.name .article-name= order_article.article.name
.right .pull-right
Volle Gebinde: Volle Gebinde:
%span{:id => "units_#{order_article.id}"}= order_article.units_to_order %span{id: "units_#{order_article.id}"}= order_article.units_to_order
%br/ %br/
Gesamt-Einheiten: Gesamt-Einheiten:
%span{:id => "q_total_#{order_article.id}"}= @ordering_data[:order_articles][order_article.id][:quantity] + @ordering_data[:order_articles][order_article.id][:others_quantity] %span{id: "q_total_#{order_article.id}"}= @ordering_data[:order_articles][order_article.id][:quantity] + @ordering_data[:order_articles][order_article.id][:others_quantity]
%br/ %br/
Gesamt-Toleranz: Gesamt-Toleranz:
%span{:id => "t_total_#{order_article.id}"}= @ordering_data[:order_articles][order_article.id][:tolerance] + @ordering_data[:order_articles][order_article.id][:others_tolerance] %span{id: "t_total_#{order_article.id}"}= @ordering_data[:order_articles][order_article.id][:tolerance] + @ordering_data[:order_articles][order_article.id][:others_tolerance]
%br/ %br/
.left .pull-left
Hersteller: #{order_article.article.manufacturer} Hersteller: #{order_article.article.manufacturer}
%br/ %br/
Gebinde: #{@order.stockit? ? order_article.article.quantity_available : @ordering_data[:order_articles][order_article.id][:unit]} * #{h order_article.article.unit} Gebinde: #{@order.stockit? ? order_article.article.quantity_available : @ordering_data[:order_articles][order_article.id][:unit]} * #{h order_article.article.unit}
%br/ %br/
Notiz: #{order_article.article.note} Notiz: #{order_article.article.note}
%br/ %br/
#order-footer #order-footer
#info-box #info-box
#total-sum #total-sum
@ -146,7 +130,7 @@
%span#new_balance= @ordergroup.account_balance - @group_order.price %span#new_balance= @ordergroup.account_balance - @group_order.price
#order-button #order-button
= submit_tag( "Bestellung speichern", :id => 'submit_button' ) = submit_tag( "Bestellung speichern", id: 'submit_button', class: 'btn btn-primary' )
oder #{link_to "abbrechen", group_orders_path} oder #{link_to "abbrechen", group_orders_path}
%input#total_balance{:name => "total_balance", :type => "hidden", :value => @ordergroup.account_balance - @group_order.price}/ %input#total_balance{name: "total_balance", type: "hidden", value: @ordergroup.account_balance - @group_order.price}/
%input{:name => "version", :type => "hidden", :value => @version}/ %input{name: "version", type: "hidden", value: @version}/

View file

@ -1,6 +1,4 @@
- if pagination %table.table.table-striped
= pagination_links_remote @closed_orders, :per_page => 10, :update => 'closed_orders'
%table.list
%thead %thead
%tr %tr
%th Lieferantin %th Lieferantin
@ -13,5 +11,6 @@
%tr{:class=> cycle('even', 'odd', :name => 'orders'), :style => order_class} %tr{:class=> cycle('even', 'odd', :name => 'orders'), :style => order_class}
%td= group_order.present? ? link_to(order.name, group_order_path(group_order)) : order.name %td= group_order.present? ? link_to(order.name, group_order_path(group_order)) : order.name
%td= format_time(order.ends) %td= format_time(order.ends)
%td{:class => "currency"}= group_order ? number_to_currency(group_order.price) : "--" %td.numeric= group_order ? number_to_currency(group_order.price) : "--"
- if pagination
= pagination_links_remote @closed_orders

View file

@ -1,12 +1,9 @@
- orders = Order.open.reject{ |order| order == current_order } - orders = Order.open.reject{ |order| order == current_order }
- unless orders.empty? - unless orders.empty?
.right_column{:style => "width:22em"} %h2 Laufende Bestellungen
.box_title %ul.unstyled
%h2 Laufende Bestellungen - orders.each do |order|
.column_content %li
%table = link_to_ordering(order, 'data-confirm_switch_order' => true)
- for order in orders - if order.ends
%tr noch #{time_ago_in_words(order.ends)}
%td
= link_to_ordering(order, 'data-confirm_switch_order' => true)
%td= "noch #{time_ago_in_words(order.ends)}" if order.ends

View file

@ -3,15 +3,12 @@
Siehe hier alle Siehe hier alle
= link_to "laufenden Bestellungen.", group_orders_path = link_to "laufenden Bestellungen.", group_orders_path
.single_column{:style => "width:50em"} .row-fluid
.box_title .span6
%h2 beendet/nicht abgerechnet %h2 beendet/nicht abgerechnet
.column_content
= render :partial => "orders", :locals => {:orders => Order.finished_not_closed, :pagination => false} = render :partial => "orders", :locals => {:orders => Order.finished_not_closed, :pagination => false}
.single_column{:style => "width:50em"} .span6
.box_title
%h2 abgerechnet %h2 abgerechnet
.column_content
#closed_orders #closed_orders
= render :partial => "orders", :locals => {:orders => @closed_orders, :pagination => true} = render :partial => "orders", :locals => {:orders => @closed_orders, :pagination => true}

View file

@ -1 +0,0 @@
$('#closed_orders').html('<%= escape_javascript(render("orders", orders: @closed_orders, pagination: true)) %>');

View file

@ -0,0 +1 @@
$('#closed_orders').html('#{escape_javascript(render("orders", orders: @closed_orders, pagination: true))}');

View file

@ -1,43 +1,39 @@
- title "Bestellüberblick" - title "Bestellüberblick"
// Ordergroups Account Balance - content_for :sidebar do
.left_column{:style => "width:26%"} .well.well-small
.box_title // Ordergroups Account Balance
%h2=h @ordergroup.name %h2 Guthaben
.column_content %table.table.table-striped
%table
%tr %tr
%td Kontostand: %td Kontostand:
%td{:class => "currency", :style => "width:5em"}= number_to_currency(@ordergroup.account_balance) %td.numeric{:style => "width:5em"}= number_to_currency(@ordergroup.account_balance)
%tr %tr
%td= "- laufende Bestellungen:" %td - laufende Bestellungen:
%td{:class => "currency"}= number_to_currency(@ordergroup.value_of_open_orders) %td.numeric= number_to_currency(@ordergroup.value_of_open_orders)
%tr %tr
%td= "- nicht abgerechnete Bestellungen:" %td= "- nicht abgerechnete Bestellungen:"
%td{:class => "currency"}= number_to_currency(@ordergroup.value_of_finished_orders) %td.numeric= number_to_currency(@ordergroup.value_of_finished_orders)
%tr %tr
%th verfügbares Guthaben: %th verfügbares Guthaben:
%th{:class => "currency"}= number_to_currency(@ordergroup.get_available_funds) %th.numeric= number_to_currency(@ordergroup.get_available_funds)
.right_column{:style => "width:70%"} = render :partial => "shared/open_orders", :locals => {:ordergroup => @ordergroup}
= render :partial => "shared/open_orders", :locals => {:ordergroup => @ordergroup}
// finished orders // finished orders
- unless Order.finished.empty? - unless Order.finished.empty?
.box_title %section
%h2 Nicht abgerechnete Bestellungen %h2 Nicht abgerechnete Bestellungen
.column_content = render :partial => "orders", :locals => {:orders => Order.finished_not_closed, :pagination => false}
= render :partial => "orders", :locals => {:orders => Order.finished_not_closed, :pagination => false} - if @ordergroup.value_of_finished_orders > 0
- if @ordergroup.value_of_finished_orders > 0 %p
%p Gesamtsumme:
Gesamtsumme: %b= number_to_currency(@ordergroup.value_of_finished_orders)
%b= number_to_currency(@ordergroup.value_of_finished_orders)
// closed orders // closed orders
- unless Order.closed.empty? - unless Order.closed.empty?
.box_title %section
%h2 Abgerechnete Bestellungen %h2 Abgerechnete Bestellungen
.column_content = render :partial => "orders", :locals => {:orders => Order.closed.all(:limit => 5), :pagination => false}
= render :partial => "orders", :locals => {:orders => Order.closed.all(:limit => 5), :pagination => false} %br/
%br/ = link_to "mehr...", archive_group_orders_path
= link_to "mehr...", archive_group_orders_path

View file

@ -1,4 +1,4 @@
- content_for :head do - content_for :javascript do
:javascript :javascript
$(function() { $(function() {
$('tr.ignored').hide(); $('tr.ignored').hide();
@ -6,55 +6,42 @@
- title "Dein Bestellergebnis für #{@order.name}" - title "Dein Bestellergebnis für #{@order.name}"
// Order summary .well
.left_column{:style => "width:45em"} // Order summary
.box_title %dl.dl-horizontal
%h2 Zusammenfassung %dt Lieferantin
.column_content %dd= @order.name
%table %dt Notiz
%tr{:valign => "top"} %dd= @order.note
%td{:style => "width:50%"} %dt Ende
%p %dd= format_time(@order.ends)
Lieferantin: %dt Bestellsumme
%b=h @order.name %dd
- unless @order.note.blank? - if @group_order
%p = number_to_currency(@group_order.price)
Notiz: - else
=h @order.note Du hast nicht bestellt.
%p - if @order.closed?
Ende: %p Abgerechnet von #{@order.updated_by.nick}
%b=h format_time(@order.ends) = link_to "Kommentare lesen/schreiben", "#comments"
%p
Bestellsumme:
- if @group_order
%b=h number_to_currency(@group_order.price)
- else
%b Du hast nicht bestellt.
- if @order.closed?
%p
= "Abgerechnet von #{@order.updated_by.nick}"
= link_to "Kommentare lesen/schreiben", "#comments"
= render :partial => "switch_order", :locals => {:current_order => @order}
// Article box // Article box
.single_column{:style => "clear:both; width:70em;"} %section
.box_title %h2 Artikelübersicht
%h2 Artikelübersicht
.column_content#result .column_content#result
- if @group_order - if @group_order
%p(style="float:right")= link_to "Zeige/Verstecke nicht bestellte Artikel", '#', 'data-toggle-this' => 'tr.ignored' %p.pull-right= link_to "Zeige/Verstecke nicht bestellte Artikel", '#', 'data-toggle-this' => 'tr.ignored'
%p= link_to("Bestellung ändern", edit_group_order_path(@group_order, :order_id => @order.id)) if @order.open? %p= link_to("Bestellung anpassen", edit_group_order_path(@group_order, order_id: @order.id), class: 'btn btn-primary') if @order.open?
%table.list %table.table.table-hover
%thead %thead
%tr %tr
%th{:style => "width:40%"} Name %th{style: "width:40%"} Name
%th Gebinde %th Gebinde
%th Einzelpreis %th Einzelpreis
%th %th
%abbr{:title => "Menge + Toleranz"} Bestellt %abbr{title: "Menge + Toleranz"} Bestellt
%th %th
%abbr{:title => "Unter Berücksichtigung der derzeitigen Bestellungen aller Gruppen"} %abbr{title: "Unter Berücksichtigung der derzeitigen Bestellungen aller Gruppen"}
- if @order.open? - if @order.open?
Zu Zu
Erhalten Erhalten
@ -62,9 +49,11 @@
%tbody %tbody
- total = 0 #set counter for order-sum - total = 0 #set counter for order-sum
- for category_name, order_articles in @order.articles_grouped_by_category - for category_name, order_articles in @order.articles_grouped_by_category
%tr{:style => "background-color:#EFEFEF"} %tr.article-category
%td{:style => "text-align:left;"}=h category_name %td
%td{:colspan => "9"} = category_name
%i.icon-tag
%td{colspan: "9"}
- for oa in order_articles - for oa in order_articles
- # get the order-results for the ordergroup - # get the order-results for the ordergroup
- goa = oa.group_order_articles.find_by_group_order_id(@group_order.id) - goa = oa.group_order_articles.find_by_group_order_id(@group_order.id)
@ -73,11 +62,11 @@
- result = goa.result - result = goa.result
- sub_total = goa.total_price - sub_total = goa.total_price
- total += sub_total - total += sub_total
%tr{:class => cycle('even', 'odd', :name => 'articles') + " " + order_article_class_name(quantity, tolerance, result)} %tr{class: cycle('even', 'odd', name: 'articles') + " " + order_article_class_name(quantity, tolerance, result)}
%td{:style => "width:40%"} %td{style: "width:40%"}
=h oa.article.name =h oa.article.name
- unless oa.article.note.blank? - unless oa.article.note.blank?
= image_tag("lamp_grey.png", {:alt => "Notiz anzeigen", :size => "15x16", :border => "0", :onmouseover => "$('note_#{oa.id}').show();", :onmouseout => "$('note_#{oa.id}').hide();"}) = image_tag("lamp_grey.png", {alt: "Notiz anzeigen", size: "15x16", border: "0", onmouseover: "$('note_#{oa.id}').show();", onmouseout: "$('note_#{oa.id}').hide();"})
%td= "#{oa.price.unit_quantity} x #{oa.article.unit}" %td= "#{oa.price.unit_quantity} x #{oa.article.unit}"
%td= number_to_currency(oa.price.fc_price) %td= number_to_currency(oa.price.fc_price)
%td %td
@ -86,26 +75,24 @@
%td= result > 0 ? result : "0" %td= result > 0 ? result : "0"
%td= number_to_currency(sub_total) %td= number_to_currency(sub_total)
- unless oa.article.note.blank? - unless oa.article.note.blank?
%tr{:id => "note_#{oa.id}", :class => "note even", :style => "display:none"} %tr{id: "note_#{oa.id}", class: "note even", style: "display:none"}
%td{:colspan => "6"}=h oa.article.note %td{colspan: "6"}=h oa.article.note
%tr{:class => cycle('even', 'odd', :name => 'articles')} %tr{class: cycle('even', 'odd', name: 'articles')}
%th{:colspan => "5"} Summe %th{colspan: "5"} Summe
%th= number_to_currency(total) %th= number_to_currency(total)
%br/ %br/
= link_to_top = link_to_top
- else - else
- if @order.open? - if @order.open?
Du hast noch nicht bestellt. Du hast noch nicht bestellt.
= link_to "Das ist Deine Chance!", :action => "order", :id => @order = link_to "Das ist Deine Chance!", action: "order", id: @order
- else - else
Die Bestellung is leider schon zu Ende. Beim nächsten mal früher aufstehen... Die Bestellung is leider schon zu Ende. Beim nächsten mal früher aufstehen...
// Comments box // Comments box
.single_column{:style => "width:70em;"} %section
.box_title %h2 Kommentare
%h2 Kommentare #comments
.column_content = render 'shared/comments', comments: @order.comments
#comments #new_comment= render 'order_comments/form', order_comment: @order.comments.build(user: current_user)
= render :partial => 'shared/comments', :locals => { :comments => @order.comments } = link_to_top
#new_comment= render :partial => 'order_comments/form', :locals => { :order_comment => @order.comments.build(:user => current_user)}
= link_to_top

View file

@ -1,47 +0,0 @@
<h1>Meine Bestellgruppe</h1>
<div class="left_column">
<div class="box_title"><h2><%=h @ordergroup.name %></h2></div>
<div class="column_content">
<p>
<b>Beschreibung:</b> <%=h @ordergroup.description %>
</p>
<p>
<b>Verfügbares Guthaben:</b> <%= number_to_currency(@ordergroup.get_available_funds()) %>
</p>
<h2>Personen</h2>
<ul style="list-style-type:decimal;">
<% for membership in @ordergroup.memberships -%>
<li><%= membership.user.nick -%></li>
<% end -%>
</ul>
<%= link_to('Person einladen', new_invite_path(:id => @ordergroup), :remote => true) %>
</div>
</div>
<div class="right_column">
<div class="box_title">
<h2>Kontoauszug</h2>
</div>
<div class="column_content">
<%= form_tag my_ordergroup_url, :method => :get, :style => 'display:inline;', :id => 'transactions_search',
:remote => true do %>
<%= label_tag "financial_transaction_note", "Filter für Notizen:" %>
<%= text_field_tag("query", params['query'], :size => 10 ) %>
<% end %>
<div id="transactions">
<%= render :partial => "/finance/transactions/list" %>
</div>
</div>
</div>
<div id="edit_box" style="display:none"></div>
<% content_for :head do %>
<script type="text/javascript">
$(function() {
$('#query').observe_field(1, function() {
$('#transactions_search').submit();
});
})
</script>
<% end %>

View file

@ -0,0 +1,35 @@
%h1 Meine Bestellgruppe
.left_column
.box_title
%h2= h @ordergroup.name
.column_content
%p
%b Beschreibung:
= h @ordergroup.description
%p
%b Verfügbares Guthaben:
= number_to_currency(@ordergroup.get_available_funds())
%h2 Personen
%ul{:style => "list-style-type:decimal;"}
- for membership in @ordergroup.memberships
%li= membership.user.nick
= link_to('Person einladen', new_invite_path(:id => @ordergroup), :remote => true)
.right_column
.box_title
%h2 Kontoauszug
.column_content
= form_tag my_ordergroup_url, :method => :get, :style => 'display:inline;', :id => 'transactions_search', |
:remote => true do |
= label_tag "financial_transaction_note", "Filter für Notizen:"
= text_field_tag("query", params['query'], :size => 10 )
#transactions
= render :partial => "/finance/transactions/list"
#edit_box{:style => "display:none"}
- content_for :head do
:javascript
$(function() {
$('#query').observe_field(1, function() {
$('#transactions_search').submit();
});
})

View file

@ -1 +0,0 @@
$('#transactions').html('<%= escape_javascript(render("finance/transactions/list")) %>');

View file

@ -0,0 +1 @@
$('#transactions').html('#{escape_javascript(render("finance/transactions/list"))}');

View file

@ -0,0 +1,12 @@
#modalForm.modal(tabindex="-1" role="dialog")
= simple_form_for @invite, remote: true do |form|
.modal-header
= button_tag "x", class: 'close', data: {dismiss: 'modal'}
%h3 Person in die Gruppe #{@invite.group.name} einladen
.modal-body
= form.hidden_field :user_id
= form.hidden_field :group_id
= form.input :email
.modal-footer
= button_tag "Schließen", class: 'btn', data: {dismiss: 'modal'}
= form.submit class: 'btn btn-primary'

Some files were not shown because too many files have changed in this diff Show more