Fixed admin, orders, wiki views. Converted all erb to haml.
This commit is contained in:
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 |
|
@ -42,6 +42,27 @@ section {
|
|||
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 ..
|
||||
.accepted {
|
||||
color: #468847;
|
||||
|
@ -60,3 +81,68 @@ section {
|
|||
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;
|
||||
}
|
||||
|
|
|
@ -10,12 +10,7 @@ class Admin::OrdergroupsController < Admin::BaseController
|
|||
@ordergroups = @ordergroups.where('name LIKE ?', "%#{params[:query]}%")
|
||||
end
|
||||
|
||||
@ordergroups = @ordergroups.paginate(:page => params[:page], :per_page => @per_page)
|
||||
|
||||
respond_to do |format|
|
||||
format.html # index.html.haml
|
||||
format.js { render :layout => false } # index.js.erb
|
||||
end
|
||||
@ordergroups = @ordergroups.page(params[:page]).per(@per_page)
|
||||
end
|
||||
|
||||
def destroy
|
||||
|
|
|
@ -5,15 +5,11 @@ class Admin::UsersController < Admin::BaseController
|
|||
@users = User.order('nick ASC')
|
||||
|
||||
# if somebody uses the search field:
|
||||
unless params[:query].blank?
|
||||
@users = @users.where(({:first_name.matches => "%#{params[:query]}%"}) | ({:last_name.matches => "%#{params[:query]}%"}) | ({:nick.matches => "%#{params[:query]}%"}))
|
||||
unless params[:user_name].blank?
|
||||
@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
|
||||
|
||||
@users = @users.paginate(:page => params[:page], :per_page => @per_page)
|
||||
|
||||
respond_to do |format|
|
||||
format.html # index.html.haml
|
||||
format.js { render :layout => false } # index.js.erb
|
||||
end
|
||||
@users = @users.page(params[:page]).per(@per_page)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -7,12 +7,7 @@ class Admin::WorkgroupsController < Admin::BaseController
|
|||
# if somebody uses the search field:
|
||||
@workgroups = @workgroups.where('name LIKE ?', "%#{params[:query]}%") unless params[:query].blank?
|
||||
|
||||
@workgroups = @workgroups.paginate(:page => params[:page], :per_page => @per_page)
|
||||
|
||||
respond_to do |format|
|
||||
format.html # index.html.haml
|
||||
format.js { render :layout => false } # index.js.erb
|
||||
end
|
||||
@workgroups = @workgroups.page(params[:page]).per(@per_page)
|
||||
end
|
||||
|
||||
def destroy
|
||||
|
|
|
@ -54,8 +54,7 @@ class GroupOrdersController < ApplicationController
|
|||
# if selected, it shows all orders of the foodcoop
|
||||
def archive
|
||||
# get only orders belonging to the ordergroup
|
||||
@closed_orders = Order.paginate :page => params[:page], :per_page => 10,
|
||||
:conditions => { :state => 'closed' }, :order => "orders.ends DESC"
|
||||
@closed_orders = Order.closed.page(params[:page]).per(10)
|
||||
|
||||
respond_to do |format|
|
||||
format.html # archive.html.haml
|
||||
|
|
|
@ -11,9 +11,15 @@ class InvitesController < ApplicationController
|
|||
@invite = Invite.new(params[:invite])
|
||||
if @invite.save
|
||||
Mailer.delay.invite(FoodsoftConfig.scope, @invite.id)
|
||||
|
||||
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
|
||||
logger.debug "[debug] errors: #{@invite.errors.messages}"
|
||||
render action: :new
|
||||
end
|
||||
end
|
||||
|
|
|
@ -20,18 +20,7 @@ class OrdersController < ApplicationController
|
|||
else
|
||||
sort = "ends DESC"
|
||||
end
|
||||
@orders = Order.paginate :page => params[:page], :per_page => @per_page,
|
||||
: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
|
||||
@orders = Order.page(params[:page]).per(@per_page).order(sort).where("state != 'open'").includes(:supplier)
|
||||
end
|
||||
|
||||
# Gives a view for the results to a specific order
|
||||
|
@ -43,7 +32,7 @@ class OrdersController < ApplicationController
|
|||
format.html
|
||||
format.js do
|
||||
@partial = case params[:view]
|
||||
when 'normal' then "articles"
|
||||
when 'default' then "articles"
|
||||
when 'groups'then 'shared/articles_by_groups'
|
||||
when 'articles'then 'shared/articles_by_articles'
|
||||
else 'articles'
|
||||
|
|
|
@ -68,7 +68,9 @@ module ApplicationHelper
|
|||
|
||||
# Generates a link to the top of the website
|
||||
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
|
||||
|
||||
# Returns the weekday. 0 is sunday, 1 is monday and so on
|
||||
|
|
|
@ -2,18 +2,17 @@
|
|||
module OrdersHelper
|
||||
|
||||
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
|
||||
|
||||
def order_pdf(order, document)
|
||||
link_to image_tag("save_pdf.png", :size => "16x16", :border => "0", :alt => "PDF erstellen"),
|
||||
order_path(order, :document => document, :format => :pdf), { :title => "PDF erstellen" }
|
||||
def order_pdf(order, document, text)
|
||||
link_to text, order_path(order, document: document, format: :pdf), title: "PDF erstellen"
|
||||
end
|
||||
|
||||
def options_for_suppliers_to_select
|
||||
options = [["Lieferantin/Lager auswählen"]]
|
||||
options += Supplier.all.map {|s| [ s.name, url_for(:action => "new", :supplier_id => s)] }
|
||||
options += [["Lager", url_for(:action => 'new', :supplier_id => 0)]]
|
||||
options += Supplier.all.map {|s| [ s.name, url_for(action: "new", supplier_id: s)] }
|
||||
options += [["Lager", url_for(action: 'new', supplier_id: 0)]]
|
||||
options_for_select(options)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -2,11 +2,12 @@
|
|||
|
||||
%p
|
||||
%i Hier kannst Du die Gruppen und Benutzerinnen der Foodsoft verwalten.
|
||||
.left_column{:style => "width:48%"}
|
||||
.box_title
|
||||
.row-fluid
|
||||
.span6
|
||||
%section
|
||||
%h2 Neuste Benutzerinnen
|
||||
.column_content
|
||||
%table
|
||||
%table.table.table-striped
|
||||
%thead
|
||||
%tr
|
||||
%th Benutzername
|
||||
%th Name
|
||||
|
@ -16,16 +17,14 @@
|
|||
%td= link_to user.nick, [:admin, user]
|
||||
%td=h user.name
|
||||
%td= format_date(user.created_on)
|
||||
%br/
|
||||
= link_to 'Alle Benutzerinnen', admin_users_path
|
||||
|
|
||||
= link_to "Neue Benutzerin", new_admin_user_path
|
||||
|
||||
.right_column{:style => "width:48%"}
|
||||
.box_title
|
||||
= link_to "Neue Benutzerin", new_admin_user_path, class: 'btn btn-primary btn-small'
|
||||
.span6
|
||||
%section
|
||||
%h2 Neuste Gruppen
|
||||
.column_content
|
||||
%table
|
||||
%table.table.table-striped
|
||||
%thead
|
||||
%tr
|
||||
%th Gruppenname
|
||||
%th Typ
|
||||
|
@ -35,11 +34,10 @@
|
|||
%td= link_to group.name, [:admin, group]
|
||||
%td= group.class.model_name.human
|
||||
%td= group.users.size
|
||||
%br/
|
||||
= link_to 'Alle Bestellgruppen', admin_ordergroups_path
|
||||
|
|
||||
= link_to "Neue Bestellgruppe", new_admin_ordergroup_path
|
||||
= link_to "Neue Bestellgruppe", new_admin_ordergroup_path, class: 'btn btn-primary btn-small'
|
||||
|
|
||||
= link_to 'Alle Arbeitsgruppen', admin_workgroups_path
|
||||
|
|
||||
= link_to "Neue Arbeitsgruppe", new_admin_workgroup_path
|
||||
= link_to "Neue Arbeitsgruppe", new_admin_workgroup_path, class: 'btn btn-primary btn-small'
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
- unless @ordergroup.new_record?
|
||||
%p
|
||||
Neue Mitglieder kannst du
|
||||
= link_to "hier", new_invite_path(id: @ordergroup.id)
|
||||
= link_to "hier", new_invite_path(id: @ordergroup.id), remote: true
|
||||
einladen.
|
||||
= simple_form_for [:admin, @ordergroup] do |f|
|
||||
= render :layout => 'shared/group_form_fields', :locals => {:f => f} do
|
||||
|
@ -8,5 +9,6 @@
|
|||
= f.input :contact_phone
|
||||
= f.input :contact_address
|
||||
= f.input :ignore_apple_restriction
|
||||
= f.submit
|
||||
= link_to "oder abbrechen", admin_ordergroups_path
|
||||
.form-actions
|
||||
= f.button :submit
|
||||
= link_to "oder abbrechen", :back
|
||||
|
|
|
@ -1,18 +1,14 @@
|
|||
%p
|
||||
%table{:style => "width:100%"}
|
||||
%tr
|
||||
%td
|
||||
= pagination_links_remote @ordergroups
|
||||
%td{:style => "text-align:right"}
|
||||
- if Ordergroup.count > 20
|
||||
= items_per_page
|
||||
%table.list
|
||||
= pagination_links_remote @ordergroups
|
||||
%table.table.table-striped
|
||||
%thead
|
||||
%tr
|
||||
%th Name
|
||||
%th Kontakt
|
||||
%th Adresse
|
||||
%th Mitglieder
|
||||
%th
|
||||
%th Aktionen
|
||||
%tbody
|
||||
- for ordergroup in @ordergroups
|
||||
%tr{:class => cycle('even','odd', :name => 'groups')}
|
||||
|
@ -21,6 +17,6 @@
|
|||
%td= link_to_gmaps ordergroup.contact_address
|
||||
%td= ordergroup.users.size
|
||||
%td
|
||||
= link_to icon(:edit), edit_admin_ordergroup_path(ordergroup)
|
||||
= link_to icon(:delete), [:admin, ordergroup], :confirm => "Willst du #{ordergroup.name} wirklich löschen?",
|
||||
:method => :delete
|
||||
= link_to "Bearbeiten", edit_admin_ordergroup_path(ordergroup), class: 'btn btn-mini'
|
||||
= link_to "Löschen", [:admin, ordergroup], :confirm => "Willst du #{ordergroup.name} wirklich löschen?",
|
||||
:method => :delete, class: 'btn btn-mini btn-danger'
|
|
@ -1,11 +1,11 @@
|
|||
- title "Bestellgruppen"
|
||||
|
||||
- content_for :sidebar do
|
||||
%p= link_to "Neue Bestellgruppe anlegen", new_admin_ordergroup_path, class: 'btn btn-primary'
|
||||
%p
|
||||
%i
|
||||
Hier kannst du
|
||||
= link_to 'neue Bestellgruppen', new_admin_ordergroup_path
|
||||
anlegen, Gruppen bearbeiten und löschen.
|
||||
|
||||
%p
|
||||
Beachte dabei den <em>Unterschied zwischen Gruppe und Bestellgruppe</em>:
|
||||
Eine Bestellgruppe hat ein Konto und kann Essen bestellen. In einer
|
||||
|
@ -13,14 +13,11 @@
|
|||
(z.b. 'Soritiergruppe')
|
||||
koordinieren sich die Mitglieder mittels Aufgaben und Nachrichten.
|
||||
Nutzer_innen können immer nur einer Bestellgruppe, aber beliebig vielen anderen Gruppen angehören.
|
||||
.left_column{:style => "width:100%"}
|
||||
.box_title
|
||||
%h2 Gruppenübersicht
|
||||
.column_content
|
||||
#group_filter
|
||||
= form_tag admin_ordergroups_path, :method => :get, :style=>"display:inline;", :id => 'ordergroup_search',
|
||||
:remote => true, 'data-submit-onchange' => true do
|
||||
%label{:for => 'article_name'} Suche nach Name:
|
||||
= text_field_tag :query, params[:query], :size => 10
|
||||
|
||||
.well.well-small
|
||||
= form_tag admin_ordergroups_path, :method => :get, :remote => true,
|
||||
'data-submit-onchange' => true, class: 'form-search' do
|
||||
= text_field_tag :query, params[:query], class: 'input-medium search-query',
|
||||
placeholder: 'Name ...'
|
||||
#ordergroups
|
||||
= render :partial => "ordergroups"
|
||||
= render "ordergroups"
|
|
@ -1 +0,0 @@
|
|||
$('#ordergroups').html('<%= escape_javascript(render("ordergroups")) %>');
|
1
app/views/admin/ordergroups/index.js.haml
Normal file
1
app/views/admin/ordergroups/index.js.haml
Normal file
|
@ -0,0 +1 @@
|
|||
$('#ordergroups').html('#{escape_javascript(render("ordergroups"))}');
|
|
@ -1,3 +1,3 @@
|
|||
- title "Bestellgruppe anlegen"
|
||||
|
||||
= render :partial => 'form'
|
||||
= render 'form'
|
|
@ -1,13 +1,6 @@
|
|||
- title "Bestellgruppe #{@ordergroup.name}"
|
||||
.left_column{:style => "width:45em"}
|
||||
.box_title
|
||||
%h2 Übersicht
|
||||
.column_content
|
||||
= render :partial => 'shared/group', :locals => { :group => @ordergroup }
|
||||
%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
|
||||
|
||||
%section= render 'shared/group', group: @ordergroup
|
||||
= link_to 'Gruppe/Mitglieder bearbeiten', edit_admin_ordergroup_path(@ordergroup), class: 'btn'
|
||||
= link_to 'Löschen', [:admin, @ordergroup], :confirm => 'Bist Du sicher?', :method => :delete, class: 'btn btn-danger'
|
||||
= link_to 'Nachricht senden', new_message_path(:message => {:group_id => @ordergroup.id}), class: 'btn'
|
||||
|
|
5
app/views/admin/users/_form.html.haml
Normal file
5
app/views/admin/users/_form.html.haml
Normal 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
|
|
@ -1,12 +1,7 @@
|
|||
%p
|
||||
%table{:style => "width:100%"}
|
||||
%tr
|
||||
%td
|
||||
= pagination_links_remote @users
|
||||
%td{:style => "text-align:right"}
|
||||
- if @users.size > 20
|
||||
- if User.count > 20
|
||||
= items_per_page
|
||||
%table.list
|
||||
= pagination_links_remote @users
|
||||
%table.table.table-striped
|
||||
%thead
|
||||
%tr
|
||||
%th Login
|
||||
|
@ -14,17 +9,16 @@
|
|||
%th Email
|
||||
%th Zugriff auf
|
||||
%th Letzter login
|
||||
%th{:style => "width:3em"}
|
||||
%th Aktionen
|
||||
%tbody
|
||||
- for user in @users
|
||||
|
||||
%tr{:class => cycle('even','odd', :name => 'users')}
|
||||
%tr
|
||||
%td= link_to user.nick, [:admin, user]
|
||||
%td=h user.name
|
||||
%td=h user.email
|
||||
%td=h format_roles(user)
|
||||
%td=h format_time(user.last_login)
|
||||
%td
|
||||
= link_to icon(:edit), edit_admin_user_path(user)
|
||||
= link_to icon(:delete), [:admin, user], :confirm => "Willst du #{user.name} wirklich löschen?",
|
||||
:method => :delete
|
||||
= link_to 'Bearbeiten', edit_admin_user_path(user), class: 'btn btn-mini'
|
||||
= link_to 'Löschen', [:admin, user], :confirm => "Willst du #{user.name} wirklich löschen?",
|
||||
:method => :delete, class: 'btn btn-danger btn-mini'
|
||||
|
|
|
@ -1,9 +1,3 @@
|
|||
%h1 Benutzerin bearbeiten
|
||||
#newUser{:style => "width:65em"}
|
||||
.box_title
|
||||
%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
|
||||
- title "Benutzerin bearbeiten"
|
||||
|
||||
= render 'form'
|
||||
|
|
|
@ -1,18 +1,16 @@
|
|||
- title "Admin/Benutzerinnen"
|
||||
|
||||
- content_for :sidebar do
|
||||
%p= link_to 'Neue Benutzerin anlegen', new_admin_user_path, class: 'btn btn-primary'
|
||||
%p
|
||||
%i
|
||||
Hier kannst du Benutzer_innen
|
||||
= link_to 'neu Anlegen', new_admin_user_path
|
||||
, bearbeiten und natürlich auch löschen.
|
||||
.left_column{:style => "width:100%"}
|
||||
.box_title
|
||||
%h2 Benutzerinnenübersicht
|
||||
.column_content
|
||||
#user_filter{:style => "float:left; margin-right:2em;"}
|
||||
= form_tag admin_users_path, :method => :get, :style=>"display:inline;", :id => 'user_search',
|
||||
:remote => true, 'data-submit-onchange' => true do
|
||||
%label{:for => 'article_name'} Suche nach Name:
|
||||
= text_field_tag :query, params[:query], :size => 10
|
||||
Hier kannst du Benutzer_innen #{link_to 'neu Anlegen', new_admin_user_path},
|
||||
bearbeiten und natürlich auch löschen.
|
||||
|
||||
.well.well-small
|
||||
= form_tag admin_users_path, :method => :get, :remote => true,
|
||||
'data-submit-onchange' => true, class: 'form-search' do
|
||||
= text_field_tag :user_name, params[:user_name], class: 'input-medium search-query',
|
||||
placeholder: 'Name ...'
|
||||
|
||||
#users
|
||||
= render :partial => "users"
|
||||
%p= link_to 'Neue Benutzerin', new_admin_user_path
|
||||
= render "users"
|
|
@ -1 +0,0 @@
|
|||
$('#users').html('<%= escape_javascript(render("users")) %>');
|
1
app/views/admin/users/index.js.haml
Normal file
1
app/views/admin/users/index.js.haml
Normal file
|
@ -0,0 +1 @@
|
|||
$('#users').html('#{escape_javascript(render("users"))}');
|
|
@ -1,11 +1,3 @@
|
|||
- title "Neue Benutzerin"
|
||||
- title "Neue Benutzerin anlegen"
|
||||
|
||||
#newUser
|
||||
.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
|
||||
= render 'form'
|
|
@ -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>
|
39
app/views/admin/users/show.html.haml
Normal file
39
app/views/admin/users/show.html.haml
Normal 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'
|
|
@ -4,11 +4,12 @@
|
|||
einladen.
|
||||
= simple_form_for [:admin, @workgroup] do |f|
|
||||
= render :layout => 'shared/group_form_fields', :locals => {:f => f} do
|
||||
%h3 Zugriff auf ..
|
||||
%h4 Zugriff auf
|
||||
= f.input :role_admin
|
||||
= f.input :role_finance
|
||||
= f.input :role_suppliers
|
||||
= f.input :role_article_meta
|
||||
= f.input :role_orders
|
||||
= f.submit
|
||||
= link_to "oder abbrechen", admin_workgroups_path
|
||||
.form-actions
|
||||
= f.button :submit
|
||||
= link_to "oder abbrechen", :back
|
||||
|
|
|
@ -1,24 +1,20 @@
|
|||
%p
|
||||
%table{:style => "width:100%"}
|
||||
%tr
|
||||
%td
|
||||
= pagination_links_remote @workgroups
|
||||
%td{:style => "text-align:right"}
|
||||
- if Workgroup.count > 20
|
||||
= items_per_page
|
||||
%table.list
|
||||
= pagination_links_remote @workgroups
|
||||
%table.table.table-striped
|
||||
%thead
|
||||
%tr
|
||||
%th Name
|
||||
%th Mitglieder
|
||||
%th Zugriff auf
|
||||
%th
|
||||
%th Aktionen
|
||||
%tbody
|
||||
- for workgroup in @workgroups
|
||||
%tr{:class => cycle('even','odd', :name => 'groups')}
|
||||
%tr
|
||||
%td= link_to workgroup.name, [:admin, workgroup]
|
||||
%td= workgroup.users.size
|
||||
%td= format_roles(workgroup)
|
||||
%td
|
||||
= link_to icon(:edit), edit_admin_workgroup_path(workgroup)
|
||||
= link_to icon(:delete), [:admin, workgroup], :confirm => 'Willst du ' + workgroup.name + ' wirklich löschen?',
|
||||
:method => :delete
|
||||
= link_to "Bearbeiten", edit_admin_workgroup_path(workgroup), class: 'btn btn-mini'
|
||||
= link_to "Löschen", [:admin, workgroup], :confirm => 'Willst du ' + workgroup.name + ' wirklich löschen?',
|
||||
:method => :delete, class: 'btn btn-mini btn-danger'
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
- title "Arbeitsgruppe bearbeiten"
|
||||
|
||||
= render :partial => 'form'
|
||||
= render 'form'
|
|
@ -1,26 +1,22 @@
|
|||
- title "List workgroups"
|
||||
- title "Arbeitsgruppen"
|
||||
|
||||
- content_for :sidebar do
|
||||
%p= link_to "Neue Arbeitsgruppe anlegen", new_admin_workgroup_path, class: 'btn btn-primary'
|
||||
%p
|
||||
%i
|
||||
Hier kannst du
|
||||
= link_to 'neue Arbeitsgruppen', new_admin_workgroup_path
|
||||
anlegen, Gruppen bearbeiten und löschen.
|
||||
|
||||
%p
|
||||
Beachte dabei den <em>Unterschied zwischen Gruppe und Bestellgruppe</em>:
|
||||
Eine
|
||||
%em= link_to 'Bestellgruppe', '/admin/ordergroups'
|
||||
Beachte dabei den <strong>Unterschied zwischen Gruppe und Bestellgruppe</strong>:
|
||||
Eine #{link_to 'Bestellgruppe', '/admin/ordergroups'}
|
||||
hat ein Konto und kann Essen bestellen. In einer Arbeitsgruppe (z.b. 'Soritiergruppe')
|
||||
koordinieren sich die Mitglieder mittels Aufgaben und Nachrichten.
|
||||
Nutzer_innen können immer nur einer Bestellgruppe, aber beliebig vielen anderen Gruppen angehören.
|
||||
.left_column{:style => "width:100%"}
|
||||
.box_title
|
||||
%h2 Gruppenübersicht
|
||||
.column_content
|
||||
#group_filter
|
||||
= form_tag admin_workgroups_path, :method => :get, :style=>"display:inline;", :id => 'ordergroup_search',
|
||||
:remote => true, 'data-submit-onchange' => true do
|
||||
%label{:for => 'article_name'} Suche nach Name:
|
||||
= text_field_tag :query, params[:query], :size => 10
|
||||
|
||||
.well.well-small
|
||||
= form_tag admin_workgroups_path, :method => :get, :remote => true,
|
||||
'data-submit-onchange' => true, class: 'form-search' do
|
||||
= text_field_tag :query, params[:query], class: 'input-medium search-query',
|
||||
placeholder: 'Name ...'
|
||||
#workgroups
|
||||
= render :partial => "workgroups"
|
||||
= render "workgroups"
|
|
@ -1 +0,0 @@
|
|||
$('#workgroups').html('<%= escape_javascript(render("workgroups")) %>');
|
1
app/views/admin/workgroups/index.js.haml
Normal file
1
app/views/admin/workgroups/index.js.haml
Normal file
|
@ -0,0 +1 @@
|
|||
$('#workgroups').html('#{escape_javascript(render("workgroups"))}');
|
|
@ -1,3 +1,3 @@
|
|||
- title "Erstelle Arbeitsgruppe"
|
||||
- title "Arbeitsgruppe anlegen"
|
||||
|
||||
= render :partial => 'form'
|
||||
= render 'form'
|
|
@ -1,14 +1,6 @@
|
|||
- title "Arbeitsgruppe #{@workgroup.name}"
|
||||
.left_column{:style => "width:45em"}
|
||||
.box_title
|
||||
%h2 Übersicht
|
||||
.column_content
|
||||
= render :partial => 'shared/group', :locals => { :group => @workgroup }
|
||||
|
||||
%p
|
||||
= link_to 'Gruppe/Mitglieder bearbeiten', edit_admin_workgroup_path(@workgroup)
|
||||
|
|
||||
= link_to 'Löschen', [:admin, @workgroup], :confirm => 'Bist Du sicher?', :method => :delete
|
||||
|
|
||||
= link_to 'Nachricht senden', new_message_path(:message => {:group_id => @workgroup.id})
|
||||
%p{:style => "clear:both"}= link_to "Gruppenübersicht", admin_workgroups_path
|
||||
%section= render :partial => 'shared/group', :locals => { :group => @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_new_message(message_params: {group_id: @workgroup.id})
|
|
@ -1,2 +0,0 @@
|
|||
$('#listbody').prepend('<%= escape_javascript(render(@article)) %>');
|
||||
$.fancybox.close();
|
2
app/views/articles/create.js.haml
Normal file
2
app/views/articles/create.js.haml
Normal file
|
@ -0,0 +1,2 @@
|
|||
$('#listbody').prepend('#{escape_javascript(render(@article))}');
|
||||
$.fancybox.close();
|
|
@ -1,5 +0,0 @@
|
|||
<% if @order %>
|
||||
$('#article_<%= @article.id %>').after('<%= escape_javascript(render("destroy_active_article")) %>');
|
||||
<% else %>
|
||||
$('#article_<%= @article.id %>').remove();
|
||||
<% end %>
|
4
app/views/articles/destroy.js.haml
Normal file
4
app/views/articles/destroy.js.haml
Normal file
|
@ -0,0 +1,4 @@
|
|||
- if @order
|
||||
$('#article_#{@article.id}').after('#{escape_javascript(render("destroy_active_article"))}');
|
||||
- else
|
||||
$('#article_#{@article.id}').remove();
|
|
@ -1 +0,0 @@
|
|||
$('#table').html('<%= escape_javascript(render("articles")) %>');
|
1
app/views/articles/index.js.haml
Normal file
1
app/views/articles/index.js.haml
Normal file
|
@ -0,0 +1 @@
|
|||
$('#table').html('#{escape_javascript(render("articles"))}');
|
|
@ -1 +0,0 @@
|
|||
$.fancybox('<%= escape_javascript(render("form")) %>');
|
1
app/views/articles/new.js.haml
Normal file
1
app/views/articles/new.js.haml
Normal file
|
@ -0,0 +1 @@
|
|||
$.fancybox('#{escape_javascript(render("form"))}');
|
|
@ -1 +0,0 @@
|
|||
$('#search_results').html('<%= escape_javascript(render("import_search_results")) %>');
|
1
app/views/articles/shared.js.haml
Normal file
1
app/views/articles/shared.js.haml
Normal file
|
@ -0,0 +1 @@
|
|||
$('#search_results').html('#{escape_javascript(render("import_search_results"))}');
|
|
@ -1,2 +0,0 @@
|
|||
$('#article_<%= @article.id %>').replaceWith('<%= escape_javascript(render(@article)) %>');
|
||||
$.fancybox.close();
|
2
app/views/articles/update.js.haml
Normal file
2
app/views/articles/update.js.haml
Normal file
|
@ -0,0 +1,2 @@
|
|||
$('#article_#{@article.id}').replaceWith('#{escape_javascript(render(@article))}');
|
||||
$.fancybox.close();
|
|
@ -1 +0,0 @@
|
|||
$('#stock_changes').append('<%= escape_javascript(render(:partial => 'stock_change', :locals => {:stock_change => StockChange.new, :supplier => @supplier})) %>');
|
1
app/views/deliveries/add_stock_change.js.haml
Normal file
1
app/views/deliveries/add_stock_change.js.haml
Normal file
|
@ -0,0 +1 @@
|
|||
$('#stock_changes').append('#{escape_javascript(render(:partial => 'stock_change', :locals => {:stock_change => StockChange.new, :supplier => @supplier}))}');
|
|
@ -1 +0,0 @@
|
|||
$.fancybox('<%= escape_javascript(render("edit_note")) %>');
|
1
app/views/finance/balancing/edit_note.js.haml
Normal file
1
app/views/finance/balancing/edit_note.js.haml
Normal file
|
@ -0,0 +1 @@
|
|||
$.fancybox('#{escape_javascript(render("edit_note"))}');
|
|
@ -1 +0,0 @@
|
|||
$('#results').html('<%= escape_javascript(render(partial: balancing_view_partial, locals: {order: @order})) %>');
|
1
app/views/finance/balancing/new.js.haml
Normal file
1
app/views/finance/balancing/new.js.haml
Normal file
|
@ -0,0 +1 @@
|
|||
$('#results').html('#{escape_javascript(render(partial: balancing_view_partial, locals: {order: @order}))}');
|
|
@ -1,2 +0,0 @@
|
|||
$.fancybox.close();
|
||||
$('#note').html('<%= escape_javascript(simple_format(@order.note)) %>');
|
2
app/views/finance/balancing/update_note.js.haml
Normal file
2
app/views/finance/balancing/update_note.js.haml
Normal file
|
@ -0,0 +1,2 @@
|
|||
$.fancybox.close();
|
||||
$('#note').html('#{escape_javascript(simple_format(@order.note))}');
|
|
@ -1 +0,0 @@
|
|||
$('#transactions').html('<%= escape_javascript(render("transactions")) %>');
|
1
app/views/finance/financial_transactions/index.js.haml
Normal file
1
app/views/finance/financial_transactions/index.js.haml
Normal file
|
@ -0,0 +1 @@
|
|||
$('#transactions').html('#{escape_javascript(render("transactions"))}');
|
|
@ -1 +0,0 @@
|
|||
$.fancybox('<%= escape_javascript(render('form')) %>');
|
1
app/views/finance/group_order_articles/edit.js.haml
Normal file
1
app/views/finance/group_order_articles/edit.js.haml
Normal file
|
@ -0,0 +1 @@
|
|||
$.fancybox('#{escape_javascript(render('form'))}');
|
|
@ -1 +0,0 @@
|
|||
$.fancybox('<%= escape_javascript(render("form")) %>');
|
1
app/views/finance/group_order_articles/new.js.haml
Normal file
1
app/views/finance/group_order_articles/new.js.haml
Normal file
|
@ -0,0 +1 @@
|
|||
$.fancybox('#{escape_javascript(render("form"))}');
|
|
@ -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})) %>');
|
5
app/views/finance/group_order_articles/update.js.haml
Normal file
5
app/views/finance/group_order_articles/update.js.haml
Normal 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}))}');
|
|
@ -1,6 +0,0 @@
|
|||
<% title "Rechnung bearbeiten" %>
|
||||
|
||||
<%= render :partial => 'form' %>
|
||||
|
||||
<%= link_to "Anzeigen", [:finance, @invoice] %> |
|
||||
<%= link_to 'Zurück', finance_invoices_path %>
|
5
app/views/finance/invoices/edit.html.haml
Normal file
5
app/views/finance/invoices/edit.html.haml
Normal file
|
@ -0,0 +1,5 @@
|
|||
- title "Rechnung bearbeiten"
|
||||
= render :partial => 'form'
|
||||
= link_to "Anzeigen", [:finance, @invoice]
|
||||
|
|
||||
\#{link_to 'Zurück', finance_invoices_path}
|
|
@ -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 %>
|
30
app/views/finance/invoices/index.html.haml
Normal file
30
app/views/finance/invoices/index.html.haml
Normal 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
|
|
@ -1,4 +0,0 @@
|
|||
<% title "Neue Rechnung anlegen" -%>
|
||||
|
||||
<%= render :partial => 'form' %>
|
||||
<%= link_to 'Zurück', finance_invoices_path %>
|
3
app/views/finance/invoices/new.html.haml
Normal file
3
app/views/finance/invoices/new.html.haml
Normal file
|
@ -0,0 +1,3 @@
|
|||
- title "Neue Rechnung anlegen"
|
||||
= render :partial => 'form'
|
||||
= link_to 'Zurück', finance_invoices_path
|
|
@ -1,3 +0,0 @@
|
|||
$.fancybox.close();
|
||||
$('#result_table').
|
||||
prepend('<%= escape_javascript(render(partial: 'finance/balancing/order_article_result', locals: {order_article: @order_article}))%>');
|
3
app/views/finance/order_articles/create.js.haml
Normal file
3
app/views/finance/order_articles/create.js.haml
Normal file
|
@ -0,0 +1,3 @@
|
|||
$.fancybox.close();
|
||||
$('#result_table').
|
||||
prepend('#{escape_javascript(render(partial: 'finance/balancing/order_article_result', locals: {order_article: @order_article}))}');
|
|
@ -1 +0,0 @@
|
|||
$('#order_article_<%= @order_article.id %>, #group_order_articles_<%= @order_article.id %>').hide();
|
1
app/views/finance/order_articles/destroy.js.haml
Normal file
1
app/views/finance/order_articles/destroy.js.haml
Normal file
|
@ -0,0 +1 @@
|
|||
$('#order_article_#{@order_article.id}, #group_order_articles_#{@order_article.id}').hide();
|
|
@ -1 +0,0 @@
|
|||
$.fancybox('<%= escape_javascript(render("edit")) %>');
|
1
app/views/finance/order_articles/edit.js.haml
Normal file
1
app/views/finance/order_articles/edit.js.haml
Normal file
|
@ -0,0 +1 @@
|
|||
$.fancybox('#{escape_javascript(render("edit"))}');
|
|
@ -1 +0,0 @@
|
|||
$.fancybox('<%= escape_javascript(render("new")) %>');
|
1
app/views/finance/order_articles/new.js.haml
Normal file
1
app/views/finance/order_articles/new.js.haml
Normal file
|
@ -0,0 +1 @@
|
|||
$.fancybox('#{escape_javascript(render("new"))}');
|
|
@ -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})) %>');
|
3
app/views/finance/order_articles/update.js.haml
Normal file
3
app/views/finance/order_articles/update.js.haml
Normal 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}))}');
|
|
@ -1 +0,0 @@
|
|||
$('#ordergroups').html('<%= escape_javascript(render("ordergroups")) %>');
|
1
app/views/finance/ordergroups/index.js.haml
Normal file
1
app/views/finance/ordergroups/index.js.haml
Normal file
|
@ -0,0 +1 @@
|
|||
$('#ordergroups').html('#{escape_javascript(render("ordergroups"))}');
|
|
@ -1 +0,0 @@
|
|||
$('#ordergroups').html('<%= escape_javascript(render("ordergroups")) %>');
|
1
app/views/foodcoop/ordergroups/index.js.haml
Normal file
1
app/views/foodcoop/ordergroups/index.js.haml
Normal file
|
@ -0,0 +1 @@
|
|||
$('#ordergroups').html('#{escape_javascript(render("ordergroups"))}');
|
|
@ -1 +0,0 @@
|
|||
$('#users').html('<%= escape_javascript(render("users")) %>');
|
1
app/views/foodcoop/users/index.js.haml
Normal file
1
app/views/foodcoop/users/index.js.haml
Normal file
|
@ -0,0 +1 @@
|
|||
$('#users').html('#{escape_javascript(render("users"))}');
|
|
@ -1,4 +1,4 @@
|
|||
- content_for :head do
|
||||
- content_for :javascript do
|
||||
:javascript
|
||||
$(function() {
|
||||
#{data_to_js(@ordering_data)}
|
||||
|
@ -10,74 +10,58 @@
|
|||
|
||||
- title "Bestellen"
|
||||
|
||||
.left_column{:style => "width:49em"}
|
||||
.box_title
|
||||
%h2=h @order.name
|
||||
.column_content
|
||||
%table
|
||||
%tr{:valign => "top"}
|
||||
%td{:width => "60%"}
|
||||
%p
|
||||
%b Lieferantin:
|
||||
=h @order.name
|
||||
%p
|
||||
%b Ende:
|
||||
=h format_time(@order.ends)
|
||||
- if @group_order && @group_order.updated_by
|
||||
%p
|
||||
%b Zuletzt bestellt:
|
||||
=h @group_order.updated_by.nick if @group_order.updated_by
|
||||
= "(#{format_time(@group_order.updated_on)})"
|
||||
%p
|
||||
%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
|
||||
.well.pull-left
|
||||
%h2= @order.name
|
||||
%dl.dl-horizontal
|
||||
- unless @order.note.blank?
|
||||
%dt Notiz
|
||||
%dd= @order.note
|
||||
%dt Ende
|
||||
%dd= format_time(@order.ends)
|
||||
- unless @order.stockit? or @order.supplier.min_order_quantity.blank?
|
||||
%dt Mindestbestellmenge
|
||||
%dd= @order.supplier.min_order_quantity
|
||||
%dt Gesamtbestellmenge bisher:
|
||||
%dd= number_to_currency @order.sum
|
||||
%dt Zuletzt bestellt
|
||||
%dd
|
||||
= @group_order.updated_by.nick if @group_order.updated_by
|
||||
(#{format_time(@group_order.updated_on)})
|
||||
%dt Guthaben
|
||||
%dd= number_to_currency(@ordering_data[:available_funds])
|
||||
|
||||
= render :partial => 'switch_order', :locals => {:current_order => @order}
|
||||
.well.pull-right
|
||||
= render 'switch_order', current_order: @order
|
||||
|
||||
= form_for @group_order do |f|
|
||||
= f.hidden_field :lock_version
|
||||
= f.hidden_field :order_id
|
||||
= f.hidden_field :updated_by_user_id
|
||||
= f.hidden_field :ordergroup_id
|
||||
.single_column{:style => "clear:both;margin-bottom:7em;"}
|
||||
.box_title
|
||||
%h2 Artikel
|
||||
.column_content
|
||||
%table#order.list
|
||||
%table.table.table-hover
|
||||
%thead
|
||||
%tr
|
||||
%th Name
|
||||
%th{:style => "width:13px;"}
|
||||
%th{:style => "width:4.5em;"} Preis
|
||||
%th{:style => "width:4.5em;"} Einheit
|
||||
%th{style: "width:13px;"}
|
||||
%th{style: "width:4.5em;"} Preis
|
||||
%th{style: "width:4.5em;"} Einheit
|
||||
- unless @order.stockit?
|
||||
%th{:style => "width:70px;"} Fehlende Einheiten
|
||||
%th{style: "width:70px;"} Fehlende Einheiten
|
||||
%th#col_required Menge
|
||||
%th#col_tolerance Toleranz
|
||||
- else
|
||||
%th(style="width:20px") Verfügbar
|
||||
%th#col_required Menge
|
||||
%th{:style => "width:15px;"} Summe
|
||||
%th{style: "width:15px;"} Summe
|
||||
%tbody
|
||||
- @order.articles_grouped_by_category.each do |category, order_articles|
|
||||
%tr{:style => "background-color:#EFEFEF"}
|
||||
%td{:style => "text-align:left"}
|
||||
%b= h category
|
||||
%td{:colspan => "9"}
|
||||
%tr.article-category
|
||||
%td
|
||||
= category
|
||||
%i.icon-tag
|
||||
%td{colspan: "9"}
|
||||
- order_articles.each do |order_article|
|
||||
%tr{:class => "#{cycle('even', 'odd', :name => 'articles')} order-article", :valign => "top"}
|
||||
%tr{class: "#{cycle('even', 'odd', name: 'articles')} order-article", valign: "top"}
|
||||
%td.name= order_article.article.name
|
||||
%td= h order_article.article.origin
|
||||
%td= number_to_currency(@ordering_data[:order_articles][order_article.id][:price])
|
||||
|
@ -86,41 +70,41 @@
|
|||
- if @order.stockit?
|
||||
= @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]
|
||||
%span{id: "missing_units_#{order_article.id}"}= @ordering_data[:order_articles][order_article.id][:missing_units]
|
||||
|
||||
%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]}/
|
||||
%span.used{:id => "q_used_#{order_article.id}"}= @ordering_data[:order_articles][order_article.id][:used_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.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-decrease_quantity' => order_article.id}
|
||||
%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-decrease_quantity' => order_article.id}
|
||||
|
||||
%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]}/
|
||||
%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]}/
|
||||
- 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]
|
||||
%input{:type => 'button', :value => '+', 'data-increase_tolerance' => order_article.id}
|
||||
%input{:type => 'button', :value => '-', 'data-decrease_tolerance' => order_article.id}
|
||||
%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-decrease_tolerance' => order_article.id}
|
||||
|
||||
%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 => "")
|
||||
%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: "")
|
||||
€
|
||||
.article-info
|
||||
%h3= order_article.article.name
|
||||
.right
|
||||
.article-name= order_article.article.name
|
||||
.pull-right
|
||||
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/
|
||||
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/
|
||||
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/
|
||||
.left
|
||||
.pull-left
|
||||
Hersteller: #{order_article.article.manufacturer}
|
||||
%br/
|
||||
Gebinde: #{@order.stockit? ? order_article.article.quantity_available : @ordering_data[:order_articles][order_article.id][:unit]} * #{h order_article.article.unit}
|
||||
|
@ -146,7 +130,7 @@
|
|||
%span#new_balance= @ordergroup.account_balance - @group_order.price
|
||||
€
|
||||
#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}
|
||||
%input#total_balance{:name => "total_balance", :type => "hidden", :value => @ordergroup.account_balance - @group_order.price}/
|
||||
%input{:name => "version", :type => "hidden", :value => @version}/
|
||||
%input#total_balance{name: "total_balance", type: "hidden", value: @ordergroup.account_balance - @group_order.price}/
|
||||
%input{name: "version", type: "hidden", value: @version}/
|
|
@ -1,6 +1,4 @@
|
|||
- if pagination
|
||||
= pagination_links_remote @closed_orders, :per_page => 10, :update => 'closed_orders'
|
||||
%table.list
|
||||
%table.table.table-striped
|
||||
%thead
|
||||
%tr
|
||||
%th Lieferantin
|
||||
|
@ -13,5 +11,6 @@
|
|||
%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= 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
|
|
@ -1,12 +1,9 @@
|
|||
- orders = Order.open.reject{ |order| order == current_order }
|
||||
- unless orders.empty?
|
||||
.right_column{:style => "width:22em"}
|
||||
.box_title
|
||||
%h2 Laufende Bestellungen
|
||||
.column_content
|
||||
%table
|
||||
- for order in orders
|
||||
%tr
|
||||
%td
|
||||
%ul.unstyled
|
||||
- orders.each do |order|
|
||||
%li
|
||||
= link_to_ordering(order, 'data-confirm_switch_order' => true)
|
||||
%td= "noch #{time_ago_in_words(order.ends)}" if order.ends
|
||||
- if order.ends
|
||||
noch #{time_ago_in_words(order.ends)}
|
|
@ -3,15 +3,12 @@
|
|||
Siehe hier alle
|
||||
= link_to "laufenden Bestellungen.", group_orders_path
|
||||
|
||||
.single_column{:style => "width:50em"}
|
||||
.box_title
|
||||
.row-fluid
|
||||
.span6
|
||||
%h2 beendet/nicht abgerechnet
|
||||
.column_content
|
||||
= render :partial => "orders", :locals => {:orders => Order.finished_not_closed, :pagination => false}
|
||||
|
||||
.single_column{:style => "width:50em"}
|
||||
.box_title
|
||||
.span6
|
||||
%h2 abgerechnet
|
||||
.column_content
|
||||
#closed_orders
|
||||
= render :partial => "orders", :locals => {:orders => @closed_orders, :pagination => true}
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
$('#closed_orders').html('<%= escape_javascript(render("orders", orders: @closed_orders, pagination: true)) %>');
|
1
app/views/group_orders/archive.js.haml
Normal file
1
app/views/group_orders/archive.js.haml
Normal file
|
@ -0,0 +1 @@
|
|||
$('#closed_orders').html('#{escape_javascript(render("orders", orders: @closed_orders, pagination: true))}');
|
|
@ -1,32 +1,29 @@
|
|||
- title "Bestellüberblick"
|
||||
|
||||
- content_for :sidebar do
|
||||
.well.well-small
|
||||
// Ordergroups Account Balance
|
||||
.left_column{:style => "width:26%"}
|
||||
.box_title
|
||||
%h2=h @ordergroup.name
|
||||
.column_content
|
||||
%table
|
||||
%h2 Guthaben
|
||||
%table.table.table-striped
|
||||
%tr
|
||||
%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
|
||||
%td= "- laufende Bestellungen:"
|
||||
%td{:class => "currency"}= number_to_currency(@ordergroup.value_of_open_orders)
|
||||
%td - laufende Bestellungen:
|
||||
%td.numeric= number_to_currency(@ordergroup.value_of_open_orders)
|
||||
%tr
|
||||
%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
|
||||
%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}
|
||||
|
||||
// finished orders
|
||||
- unless Order.finished.empty?
|
||||
.box_title
|
||||
%section
|
||||
%h2 Nicht abgerechnete Bestellungen
|
||||
.column_content
|
||||
= render :partial => "orders", :locals => {:orders => Order.finished_not_closed, :pagination => false}
|
||||
- if @ordergroup.value_of_finished_orders > 0
|
||||
%p
|
||||
|
@ -35,9 +32,8 @@
|
|||
|
||||
// closed orders
|
||||
- unless Order.closed.empty?
|
||||
.box_title
|
||||
%section
|
||||
%h2 Abgerechnete Bestellungen
|
||||
.column_content
|
||||
= render :partial => "orders", :locals => {:orders => Order.closed.all(:limit => 5), :pagination => false}
|
||||
%br/
|
||||
= link_to "mehr...", archive_group_orders_path
|
|
@ -1,4 +1,4 @@
|
|||
- content_for :head do
|
||||
- content_for :javascript do
|
||||
:javascript
|
||||
$(function() {
|
||||
$('tr.ignored').hide();
|
||||
|
@ -6,55 +6,42 @@
|
|||
|
||||
- title "Dein Bestellergebnis für #{@order.name}"
|
||||
|
||||
.well
|
||||
// Order summary
|
||||
.left_column{:style => "width:45em"}
|
||||
.box_title
|
||||
%h2 Zusammenfassung
|
||||
.column_content
|
||||
%table
|
||||
%tr{:valign => "top"}
|
||||
%td{:style => "width:50%"}
|
||||
%p
|
||||
Lieferantin:
|
||||
%b=h @order.name
|
||||
- unless @order.note.blank?
|
||||
%p
|
||||
Notiz:
|
||||
=h @order.note
|
||||
%p
|
||||
Ende:
|
||||
%b=h format_time(@order.ends)
|
||||
%p
|
||||
Bestellsumme:
|
||||
%dl.dl-horizontal
|
||||
%dt Lieferantin
|
||||
%dd= @order.name
|
||||
%dt Notiz
|
||||
%dd= @order.note
|
||||
%dt Ende
|
||||
%dd= format_time(@order.ends)
|
||||
%dt Bestellsumme
|
||||
%dd
|
||||
- if @group_order
|
||||
%b=h number_to_currency(@group_order.price)
|
||||
= number_to_currency(@group_order.price)
|
||||
- else
|
||||
%b Du hast nicht bestellt.
|
||||
Du hast nicht bestellt.
|
||||
- if @order.closed?
|
||||
%p
|
||||
= "Abgerechnet von #{@order.updated_by.nick}"
|
||||
%p Abgerechnet von #{@order.updated_by.nick}
|
||||
= link_to "Kommentare lesen/schreiben", "#comments"
|
||||
|
||||
= render :partial => "switch_order", :locals => {:current_order => @order}
|
||||
|
||||
// Article box
|
||||
.single_column{:style => "clear:both; width:70em;"}
|
||||
.box_title
|
||||
%section
|
||||
%h2 Artikelübersicht
|
||||
.column_content#result
|
||||
- if @group_order
|
||||
%p(style="float: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?
|
||||
%table.list
|
||||
%p.pull-right= link_to "Zeige/Verstecke nicht bestellte Artikel", '#', 'data-toggle-this' => 'tr.ignored'
|
||||
%p= link_to("Bestellung anpassen", edit_group_order_path(@group_order, order_id: @order.id), class: 'btn btn-primary') if @order.open?
|
||||
%table.table.table-hover
|
||||
%thead
|
||||
%tr
|
||||
%th{:style => "width:40%"} Name
|
||||
%th{style: "width:40%"} Name
|
||||
%th Gebinde
|
||||
%th Einzelpreis
|
||||
%th
|
||||
%abbr{:title => "Menge + Toleranz"} Bestellt
|
||||
%abbr{title: "Menge + Toleranz"} Bestellt
|
||||
%th
|
||||
%abbr{:title => "Unter Berücksichtigung der derzeitigen Bestellungen aller Gruppen"}
|
||||
%abbr{title: "Unter Berücksichtigung der derzeitigen Bestellungen aller Gruppen"}
|
||||
- if @order.open?
|
||||
Zu
|
||||
Erhalten
|
||||
|
@ -62,9 +49,11 @@
|
|||
%tbody
|
||||
- total = 0 #set counter for order-sum
|
||||
- for category_name, order_articles in @order.articles_grouped_by_category
|
||||
%tr{:style => "background-color:#EFEFEF"}
|
||||
%td{:style => "text-align:left;"}=h category_name
|
||||
%td{:colspan => "9"}
|
||||
%tr.article-category
|
||||
%td
|
||||
= category_name
|
||||
%i.icon-tag
|
||||
%td{colspan: "9"}
|
||||
- for oa in order_articles
|
||||
- # get the order-results for the ordergroup
|
||||
- goa = oa.group_order_articles.find_by_group_order_id(@group_order.id)
|
||||
|
@ -73,11 +62,11 @@
|
|||
- result = goa.result
|
||||
- sub_total = goa.total_price
|
||||
- total += sub_total
|
||||
%tr{:class => cycle('even', 'odd', :name => 'articles') + " " + order_article_class_name(quantity, tolerance, result)}
|
||||
%td{:style => "width:40%"}
|
||||
%tr{class: cycle('even', 'odd', name: 'articles') + " " + order_article_class_name(quantity, tolerance, result)}
|
||||
%td{style: "width:40%"}
|
||||
=h oa.article.name
|
||||
- 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= number_to_currency(oa.price.fc_price)
|
||||
%td
|
||||
|
@ -86,26 +75,24 @@
|
|||
%td= result > 0 ? result : "0"
|
||||
%td= number_to_currency(sub_total)
|
||||
- unless oa.article.note.blank?
|
||||
%tr{:id => "note_#{oa.id}", :class => "note even", :style => "display:none"}
|
||||
%td{:colspan => "6"}=h oa.article.note
|
||||
%tr{:class => cycle('even', 'odd', :name => 'articles')}
|
||||
%th{:colspan => "5"} Summe
|
||||
%tr{id: "note_#{oa.id}", class: "note even", style: "display:none"}
|
||||
%td{colspan: "6"}=h oa.article.note
|
||||
%tr{class: cycle('even', 'odd', name: 'articles')}
|
||||
%th{colspan: "5"} Summe
|
||||
%th= number_to_currency(total)
|
||||
%br/
|
||||
= link_to_top
|
||||
- else
|
||||
- if @order.open?
|
||||
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
|
||||
Die Bestellung is leider schon zu Ende. Beim nächsten mal früher aufstehen...
|
||||
|
||||
// Comments box
|
||||
.single_column{:style => "width:70em;"}
|
||||
.box_title
|
||||
%section
|
||||
%h2 Kommentare
|
||||
.column_content
|
||||
#comments
|
||||
= render :partial => 'shared/comments', :locals => { :comments => @order.comments }
|
||||
#new_comment= render :partial => 'order_comments/form', :locals => { :order_comment => @order.comments.build(:user => current_user)}
|
||||
= render 'shared/comments', comments: @order.comments
|
||||
#new_comment= render 'order_comments/form', order_comment: @order.comments.build(user: current_user)
|
||||
= link_to_top
|
||||
|
|
|
@ -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 %>
|
||||
|
35
app/views/home/ordergroup.html.haml
Normal file
35
app/views/home/ordergroup.html.haml
Normal 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();
|
||||
});
|
||||
})
|
||||
|
|
@ -1 +0,0 @@
|
|||
$('#transactions').html('<%= escape_javascript(render("finance/transactions/list")) %>');
|
1
app/views/home/ordergroup.js.haml
Normal file
1
app/views/home/ordergroup.js.haml
Normal file
|
@ -0,0 +1 @@
|
|||
$('#transactions').html('#{escape_javascript(render("finance/transactions/list"))}');
|
12
app/views/invites/_modal_form.html.haml
Normal file
12
app/views/invites/_modal_form.html.haml
Normal 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
Loading…
Reference in a new issue