Refactoring of articles and article_categories. articles are now a nested resource of supplier.
This commit is contained in:
parent
b38025869a
commit
936e6ef69a
36 changed files with 597 additions and 589 deletions
|
|
@ -1,29 +1,73 @@
|
|||
%h1 Manage die Artikeldatenbank
|
||||
.left_column{:style => "width:44%"}
|
||||
.box_title
|
||||
%h2 Artikel anzeigen
|
||||
.column_content
|
||||
%p
|
||||
%i
|
||||
Hier kannst du Artikel anzeigen, ändern und neue erstellen
|
||||
%br/
|
||||
Wähle einen Lieferanten:
|
||||
%ul
|
||||
- @suppliers.each do |supplier|
|
||||
%li
|
||||
%b= link_to supplier.name, :action => "list", :id => supplier.id
|
||||
(
|
||||
= supplier.articles.count
|
||||
Artikel )
|
||||
%hr/
|
||||
%p
|
||||
%i
|
||||
hier kannst du neue Artikel aus einer csv-Datei in die Datenbank
|
||||
= link_to 'hochladen', :action => 'upload_articles'
|
||||
- title "Artikel von #{@supplier.name}"
|
||||
|
||||
.right_column{:style => "width:53%"}
|
||||
.box_title
|
||||
%h2 Artikelkategorien
|
||||
.column_content#categories
|
||||
#category_form.box.edit_form{:style => "display:none;margin-bottom:1em;"}
|
||||
#category_list= render :partial => 'article_categories/list'
|
||||
// import menu
|
||||
- unless @supplier.shared_supplier.nil?
|
||||
.menu{:style => 'width: 14em'}
|
||||
%ul
|
||||
%li
|
||||
=_ 'External database'
|
||||
%ul
|
||||
%li= link_to_function _('search/import'), "Element.toggle('import')"
|
||||
%li= link_to _('sync'), sync_supplier_articles_path(@supplier), :method => :post
|
||||
|
||||
|
||||
#change_supplier{:style => "padding:0 0 0.5em 0.7em;"}
|
||||
%span{:style => "float:left"}
|
||||
=_ 'Change supplier:'
|
||||
- form_tag do
|
||||
= select_tag :switch_supplier, |
|
||||
options_for_select( Supplier.all.collect {|s| [s.name, url_for(supplier_articles_path(s))] }, |
|
||||
url_for(supplier_articles_path(@supplier)) ), |
|
||||
:onchange => "redirectTo(this)", |
|
||||
:style => "font-size: 0.9em;margin-left:1em;" |
|
||||
|
||||
- unless @supplier.shared_supplier.nil?
|
||||
#import.single_column{:style => "display:none; clear:both"}
|
||||
.box_title
|
||||
%h2=_ 'Import articles'
|
||||
.column_content
|
||||
#search{:style => "padding-bottom:3em"}
|
||||
- form_remote_tag :url => shared_supplier_articles_path(@supplier), |
|
||||
:before => "Element.show('loader')", :success => "Element.hide('loader')", |
|
||||
:method => :get do |
|
||||
= text_field_tag :import_query, params['import_query'], :size => 10
|
||||
= submit_tag _('Search articles')
|
||||
- if @supplier.shared_supplier.lists
|
||||
=_ "Search in following lists: "
|
||||
- @supplier.shared_supplier.lists.each do |token, name|
|
||||
= check_box_tag "lists[#{token}]", "1", true
|
||||
= name
|
||||
|
|
||||
=_ "only regional:"
|
||||
= check_box_tag "regional", "1", false
|
||||
#search_results
|
||||
// "import_search_results" will be rendered
|
||||
= link_to_function _('Close'), "Element.hide('import')"
|
||||
|
||||
.single_column{:style => 'width:100%; clear:both'}
|
||||
.box_title
|
||||
.column_content
|
||||
#links
|
||||
%b= link_to_remote _('New article'), :url => new_supplier_article_path(@supplier), :before => "Element.show('loader')", :success => "Element.hide('loader')", :method => :get
|
||||
|
|
||||
= link_to _('Edit all'), edit_all_supplier_articles_path(@supplier)
|
||||
|
|
||||
= link_to _('Upload articles'), upload_supplier_articles_path(@supplier)
|
||||
|
|
||||
= link_to_if @current_user.role_orders?, _('Create order'), {:controller => 'orders', :action => 'new', :id => @supplier }
|
||||
|
||||
#article_filter
|
||||
#article_search_form{:style=>"display:inline;"}
|
||||
- form_remote_tag :url => supplier_articles_path(@supplier), |
|
||||
:before => "Element.show('loader')", :success => "Element.hide('loader')", |
|
||||
:method => :get do |
|
||||
%label{:for => 'article_name'}=_ "Search in article name: "
|
||||
= text_field_tag("query", params['query'], :size => 10 )
|
||||
= submit_tag _('Search')
|
||||
|
||||
%form{ :action => url_for(update_selected_supplier_articles_path(@supplier)), :method => "post", :id => "articlesInListForm" }
|
||||
#table= render :partial => 'articles'
|
||||
|
||||
%br/
|
||||
= link_to _('Back'), :action => 'index'
|
||||
#edit_article{:style => "display:none"}
|
||||
Loading…
Add table
Add a link
Reference in a new issue