enju_inventory 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/MIT-LICENSE +20 -0
- data/README.rdoc +3 -0
- data/Rakefile +36 -0
- data/app/controllers/inventories_controller.rb +8 -0
- data/app/controllers/inventory_files_controller.rb +83 -0
- data/app/models/inventory.rb +25 -0
- data/app/models/inventory_file.rb +49 -0
- data/app/views/inventories/edit.html.erb +33 -0
- data/app/views/inventories/index.html.erb +34 -0
- data/app/views/inventories/new.html.erb +32 -0
- data/app/views/inventories/show.html.erb +29 -0
- data/app/views/inventory_files/edit.html.erb +45 -0
- data/app/views/inventory_files/index.html.erb +39 -0
- data/app/views/inventory_files/new.html.erb +25 -0
- data/app/views/inventory_files/show.html.erb +44 -0
- data/config/routes.rb +4 -0
- data/db/migrate/20081117143156_create_inventory_files.rb +20 -0
- data/db/migrate/20081117143455_create_inventories.rb +17 -0
- data/db/migrate/20090706125521_add_attachments_inventory_to_inventory_file.rb +15 -0
- data/lib/enju_inventory.rb +4 -0
- data/lib/enju_inventory/engine.rb +11 -0
- data/lib/enju_inventory/version.rb +3 -0
- data/lib/tasks/enju_inventory_tasks.rake +4 -0
- data/spec/controllers/inventories_controller_spec.rb +162 -0
- data/spec/controllers/inventory_files_controller_spec.rb +289 -0
- data/spec/dummy/Rakefile +7 -0
- data/spec/dummy/app/assets/javascripts/application.js +9 -0
- data/spec/dummy/app/assets/stylesheets/application.css +7 -0
- data/spec/dummy/app/controllers/application_controller.rb +65 -0
- data/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/spec/dummy/app/models/ability.rb +18 -0
- data/spec/dummy/app/models/item.rb +20 -0
- data/spec/dummy/app/models/role.rb +5 -0
- data/spec/dummy/app/models/user.rb +28 -0
- data/spec/dummy/app/models/user_has_role.rb +4 -0
- data/spec/dummy/app/views/layouts/application.html.erb +14 -0
- data/spec/dummy/app/views/page/403.html.erb +9 -0
- data/spec/dummy/app/views/page/403.mobile.erb +5 -0
- data/spec/dummy/app/views/page/403.xml.erb +4 -0
- data/spec/dummy/app/views/page/404.html.erb +9 -0
- data/spec/dummy/app/views/page/404.mobile.erb +5 -0
- data/spec/dummy/app/views/page/404.xml.erb +4 -0
- data/spec/dummy/config.ru +4 -0
- data/spec/dummy/config/application.rb +45 -0
- data/spec/dummy/config/boot.rb +10 -0
- data/spec/dummy/config/database.yml +25 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/development.rb +30 -0
- data/spec/dummy/config/environments/production.rb +60 -0
- data/spec/dummy/config/environments/test.rb +39 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy/config/initializers/devise.rb +209 -0
- data/spec/dummy/config/initializers/inflections.rb +10 -0
- data/spec/dummy/config/initializers/mime_types.rb +6 -0
- data/spec/dummy/config/initializers/secret_token.rb +7 -0
- data/spec/dummy/config/initializers/session_store.rb +8 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/spec/dummy/config/locales/en.yml +5 -0
- data/spec/dummy/config/routes.rb +60 -0
- data/spec/dummy/db/migrate/006_create_items.rb +36 -0
- data/spec/dummy/db/migrate/20111201121844_create_roles.rb +12 -0
- data/spec/dummy/db/migrate/20111201155456_create_users.rb +13 -0
- data/spec/dummy/db/migrate/20111201155513_add_devise_to_users.rb +31 -0
- data/spec/dummy/db/migrate/20111201163718_create_user_has_roles.rb +10 -0
- data/spec/dummy/db/schema.rb +113 -0
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/log/test.log +8481 -0
- data/spec/dummy/private/system/inventories/4/original/inventory_file_sample.tsv +7 -0
- data/spec/dummy/public/404.html +26 -0
- data/spec/dummy/public/422.html +26 -0
- data/spec/dummy/public/500.html +26 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/dummy/script/rails +6 -0
- data/spec/factories/user.rb +31 -0
- data/spec/fixtures/inventories.yml +26 -0
- data/spec/fixtures/inventory_files.yml +43 -0
- data/spec/fixtures/roles.yml +21 -0
- data/spec/fixtures/user_has_roles.yml +41 -0
- data/spec/fixtures/users.yml +69 -0
- data/spec/models/inventory_file_spec.rb +32 -0
- data/spec/models/inventory_spec.rb +20 -0
- data/spec/spec_helper.rb +33 -0
- data/spec/support/controller_macros.rb +48 -0
- data/spec/support/devise.rb +4 -0
- metadata +311 -0
data/MIT-LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright 2011 YOURNAME
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.rdoc
ADDED
data/Rakefile
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
#!/usr/bin/env rake
|
2
|
+
begin
|
3
|
+
require 'bundler/setup'
|
4
|
+
rescue LoadError
|
5
|
+
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
|
6
|
+
end
|
7
|
+
begin
|
8
|
+
require 'rdoc/task'
|
9
|
+
rescue LoadError
|
10
|
+
require 'rdoc/rdoc'
|
11
|
+
require 'rake/rdoctask'
|
12
|
+
RDoc::Task = Rake::RDocTask
|
13
|
+
end
|
14
|
+
|
15
|
+
RDoc::Task.new(:rdoc) do |rdoc|
|
16
|
+
rdoc.rdoc_dir = 'rdoc'
|
17
|
+
rdoc.title = 'EnjuInventory'
|
18
|
+
rdoc.options << '--line-numbers'
|
19
|
+
rdoc.rdoc_files.include('README.rdoc')
|
20
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
21
|
+
end
|
22
|
+
|
23
|
+
APP_RAKEFILE = File.expand_path("../spec/dummy/Rakefile", __FILE__)
|
24
|
+
load 'rails/tasks/engine.rake'
|
25
|
+
|
26
|
+
|
27
|
+
Bundler::GemHelper.install_tasks
|
28
|
+
|
29
|
+
require 'rspec/core'
|
30
|
+
require 'rspec/core/rake_task'
|
31
|
+
|
32
|
+
RSpec::Core::RakeTask.new(:spec) do |spec|
|
33
|
+
spec.pattern = FileList['spec/**/*_spec.rb']
|
34
|
+
end
|
35
|
+
|
36
|
+
task :default => :spec
|
@@ -0,0 +1,83 @@
|
|
1
|
+
class InventoryFilesController < ApplicationController
|
2
|
+
load_and_authorize_resource
|
3
|
+
|
4
|
+
# GET /inventory_files
|
5
|
+
# GET /inventory_files.xml
|
6
|
+
def index
|
7
|
+
@inventory_files = InventoryFile.page(params[:page])
|
8
|
+
|
9
|
+
respond_to do |format|
|
10
|
+
format.html # index.html.erb
|
11
|
+
format.xml { render :xml => @inventory_files }
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
# GET /inventory_files/1
|
16
|
+
# GET /inventory_files/1.xml
|
17
|
+
def show
|
18
|
+
respond_to do |format|
|
19
|
+
format.html # show.html.erb
|
20
|
+
format.xml { render :xml => @inventory_file }
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
# GET /inventory_files/new
|
25
|
+
# GET /inventory_files/new.xml
|
26
|
+
def new
|
27
|
+
@inventory_file = InventoryFile.new
|
28
|
+
|
29
|
+
respond_to do |format|
|
30
|
+
format.html # new.html.erb
|
31
|
+
format.xml { render :xml => @inventory_file }
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
# GET /inventory_files/1/edit
|
36
|
+
def edit
|
37
|
+
end
|
38
|
+
|
39
|
+
# POST /inventory_files
|
40
|
+
# POST /inventory_files.xml
|
41
|
+
def create
|
42
|
+
@inventory_file = InventoryFile.new(params[:inventory_file])
|
43
|
+
@inventory_file.user = current_user
|
44
|
+
|
45
|
+
respond_to do |format|
|
46
|
+
if @inventory_file.save
|
47
|
+
flash[:notice] = t('controller.successfully_created', :model => t('activerecord.models.inventory_file'))
|
48
|
+
@inventory_file.import
|
49
|
+
format.html { redirect_to(@inventory_file) }
|
50
|
+
format.xml { render :xml => @inventory_file, :status => :created, :location => @inventory_file }
|
51
|
+
else
|
52
|
+
format.html { render :action => "new" }
|
53
|
+
format.xml { render :xml => @inventory_file.errors, :status => :unprocessable_entity }
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
# PUT /inventory_files/1
|
59
|
+
# PUT /inventory_files/1.xml
|
60
|
+
def update
|
61
|
+
respond_to do |format|
|
62
|
+
if @inventory_file.update_attributes(params[:inventory_file])
|
63
|
+
flash[:notice] = t('controller.successfully_updated', :model => t('activerecord.models.inventory_file'))
|
64
|
+
format.html { redirect_to(@inventory_file) }
|
65
|
+
format.xml { head :ok }
|
66
|
+
else
|
67
|
+
format.html { render :action => "edit" }
|
68
|
+
format.xml { render :xml => @inventory_file.errors, :status => :unprocessable_entity }
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
# DELETE /inventory_files/1
|
74
|
+
# DELETE /inventory_files/1.xml
|
75
|
+
def destroy
|
76
|
+
@inventory_file.destroy
|
77
|
+
|
78
|
+
respond_to do |format|
|
79
|
+
format.html { redirect_to(inventory_files_url) }
|
80
|
+
format.xml { head :ok }
|
81
|
+
end
|
82
|
+
end
|
83
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
class Inventory < ActiveRecord::Base
|
2
|
+
belongs_to :item
|
3
|
+
belongs_to :inventory_file
|
4
|
+
|
5
|
+
validates_associated :item, :inventory_file
|
6
|
+
validates_presence_of :item, :inventory_file
|
7
|
+
validates_uniqueness_of :item_id, :scope => :inventory_file_id
|
8
|
+
|
9
|
+
def self.per_page
|
10
|
+
10
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
# == Schema Information
|
15
|
+
#
|
16
|
+
# Table name: inventories
|
17
|
+
#
|
18
|
+
# id :integer not null, primary key
|
19
|
+
# item_id :integer
|
20
|
+
# inventory_file_id :integer
|
21
|
+
# note :text
|
22
|
+
# created_at :datetime
|
23
|
+
# updated_at :datetime
|
24
|
+
#
|
25
|
+
|
@@ -0,0 +1,49 @@
|
|
1
|
+
class InventoryFile < ActiveRecord::Base
|
2
|
+
has_many :inventories, :dependent => :destroy
|
3
|
+
has_many :items, :through => :inventories
|
4
|
+
belongs_to :user
|
5
|
+
has_attached_file :inventory, :path => ":rails_root/private:url"
|
6
|
+
validates_attachment_content_type :inventory, :content_type => ['text/csv', 'text/plain', 'text/tab-separated-values']
|
7
|
+
validates_attachment_presence :inventory
|
8
|
+
validates_presence_of :user
|
9
|
+
|
10
|
+
def self.per_page
|
11
|
+
10
|
12
|
+
end
|
13
|
+
|
14
|
+
def import
|
15
|
+
self.reload
|
16
|
+
file = File.open(self.inventory.path)
|
17
|
+
reader = file.read
|
18
|
+
reader.split.each do |row|
|
19
|
+
item = Item.where(:item_identifier => row.to_s.strip).first
|
20
|
+
if item
|
21
|
+
unless self.items.where(:id => item.id).select('items.id').first
|
22
|
+
self.items << item
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
file.close
|
27
|
+
true
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
# == Schema Information
|
32
|
+
#
|
33
|
+
# Table name: inventory_files
|
34
|
+
#
|
35
|
+
# id :integer not null, primary key
|
36
|
+
# filename :string(255)
|
37
|
+
# content_type :string(255)
|
38
|
+
# size :integer
|
39
|
+
# file_hash :string(255)
|
40
|
+
# user_id :integer
|
41
|
+
# note :text
|
42
|
+
# created_at :datetime
|
43
|
+
# updated_at :datetime
|
44
|
+
# inventory_file_name :string(255)
|
45
|
+
# inventory_content_type :string(255)
|
46
|
+
# inventory_file_size :integer
|
47
|
+
# inventory_updated_at :datetime
|
48
|
+
#
|
49
|
+
|
@@ -0,0 +1,33 @@
|
|
1
|
+
<div id="content_detail" class="ui-corner-all">
|
2
|
+
<h1 class="title"><%= t('page.editing', :model => t('activerecord.models.inventory')) -%> </h1>
|
3
|
+
<div id="content_list">
|
4
|
+
|
5
|
+
<%= form_for(@inventory) do |f| -%>
|
6
|
+
<%= f.error_messages -%>
|
7
|
+
|
8
|
+
<div class="field">
|
9
|
+
<%= f.label :item_id -%><br />
|
10
|
+
<%= f.text_field :item_id -%>
|
11
|
+
</div>
|
12
|
+
<div class="field">
|
13
|
+
<%= f.label :inventory_file_id -%><br />
|
14
|
+
<%= f.text_field :inventory_file_id -%>
|
15
|
+
</div>
|
16
|
+
<div class="field">
|
17
|
+
<%= f.label :note -%><br />
|
18
|
+
<%= f.text_area :note -%>
|
19
|
+
</div>
|
20
|
+
<div class="actions">
|
21
|
+
<%= f.submit %>
|
22
|
+
</div>
|
23
|
+
<%- end -%>
|
24
|
+
|
25
|
+
</div>
|
26
|
+
</div>
|
27
|
+
|
28
|
+
<div id="submenu" class="ui-corner-all">
|
29
|
+
<ul>
|
30
|
+
<li><%= link_to t('page.show'), @inventory -%></li>
|
31
|
+
<li><%= link_to t('page.back'), inventories_path -%></li>
|
32
|
+
</ul>
|
33
|
+
</div>
|
@@ -0,0 +1,34 @@
|
|
1
|
+
<div id="content_detail" class="ui-corner-all">
|
2
|
+
<h1 class="title"><%= t('page.listing', :model => t('activerecord.models.inventory')) -%></h1>
|
3
|
+
<div id="content_list">
|
4
|
+
|
5
|
+
<table class="index">
|
6
|
+
<tr>
|
7
|
+
<th><%= t('activerecord.models.inventory_file') -%> </th>
|
8
|
+
<th><%= t('activerecord.models.item') -%> </th>
|
9
|
+
<th></th>
|
10
|
+
</tr>
|
11
|
+
|
12
|
+
<%- @inventories.each do |inventory| -%>
|
13
|
+
<tr class="line<%= cycle("0", "1") -%>">
|
14
|
+
<td><%= link_to inventory.inventory_file_id, inventory.inventory_file -%></td>
|
15
|
+
<td><%= link_to inventory.item.item_identifier, inventory.item -%></td>
|
16
|
+
<td>
|
17
|
+
<%= link_to t('page.show'), inventory -%>
|
18
|
+
<%= link_to t('page.edit'), edit_inventory_path(inventory) -%>
|
19
|
+
<%= link_to t('page.destroy'), inventory, :confirm => t('page.are_you_sure'), :method => :delete -%>
|
20
|
+
</td>
|
21
|
+
</tr>
|
22
|
+
<%- end -%>
|
23
|
+
</table>
|
24
|
+
|
25
|
+
<%= will_paginate(@inventories) -%>
|
26
|
+
|
27
|
+
</div>
|
28
|
+
</div>
|
29
|
+
|
30
|
+
<div id="submenu" class="ui-corner-all">
|
31
|
+
<ul>
|
32
|
+
<li><%= link_to t('page.new', :model => t('activerecord.models.inventory')), new_inventory_path -%></li>
|
33
|
+
</ul>
|
34
|
+
</div>
|
@@ -0,0 +1,32 @@
|
|
1
|
+
<div id="content_detail" class="ui-corner-all">
|
2
|
+
<h1 class="title"><%= t('page.new', :model => t('activerecord.models.inventory')) -%> </h1>
|
3
|
+
<div id="content_list">
|
4
|
+
|
5
|
+
<%= form_for(@inventory) do |f| -%>
|
6
|
+
<%= f.error_messages -%>
|
7
|
+
|
8
|
+
<div class="field">
|
9
|
+
<%= f.label :item_id -%> <br />
|
10
|
+
<%= f.text_field :item_id -%>
|
11
|
+
</div>
|
12
|
+
<div class="field">
|
13
|
+
<%= f.label :inventory_file_id -%> <br />
|
14
|
+
<%= f.text_field :inventory_file_id -%>
|
15
|
+
</div>
|
16
|
+
<div class="field">
|
17
|
+
<%= f.label :note -%> <br />
|
18
|
+
<%= f.text_area :note -%>
|
19
|
+
</div>
|
20
|
+
<div class="actions">
|
21
|
+
<%= f.submit %>
|
22
|
+
</div>
|
23
|
+
<%- end -%>
|
24
|
+
|
25
|
+
</div>
|
26
|
+
</div>
|
27
|
+
|
28
|
+
<div id="submenu" class="ui-corner-all">
|
29
|
+
<ul>
|
30
|
+
<li><%= link_to t('page.back'), inventories_path -%></li>
|
31
|
+
</ul>
|
32
|
+
</div>
|
@@ -0,0 +1,29 @@
|
|
1
|
+
<div id="content_detail" class="ui-corner-all">
|
2
|
+
<h1 class="title"><%= t('page.showing', :model => t('activerecord.models.inventory')) -%> </h1>
|
3
|
+
<div id="content_list">
|
4
|
+
<p id="notice"><%= notice %></p>
|
5
|
+
|
6
|
+
<p>
|
7
|
+
<strong><%= t('activerecord.models.item') -%>:</strong>
|
8
|
+
<%= link_to @inventory.item.item_identifier, @inventory.item -%>
|
9
|
+
</p>
|
10
|
+
|
11
|
+
<p>
|
12
|
+
<strong><%= t('activerecord.models.inventory_file') -%>:</strong>
|
13
|
+
<%= link_to @inventory.inventory_file.id, @inventory.inventory_file -%>
|
14
|
+
</p>
|
15
|
+
|
16
|
+
<p>
|
17
|
+
<strong><%= t('activerecord.attributes.inventory.note') -%>:</strong>
|
18
|
+
<%= @inventory.note -%>
|
19
|
+
</p>
|
20
|
+
|
21
|
+
</div>
|
22
|
+
</div>
|
23
|
+
|
24
|
+
<div id="submenu" class="ui-corner-all">
|
25
|
+
<ul>
|
26
|
+
<li><%= link_to t('page.edit'), edit_inventory_path(@inventory) -%></li>
|
27
|
+
<li><%= back_to_index(flash[:page_info]) -%></li>
|
28
|
+
</ul>
|
29
|
+
</div>
|
@@ -0,0 +1,45 @@
|
|
1
|
+
<div id="content_detail" class="ui-corner-all">
|
2
|
+
<h1 class="title"><%= t('page.editing', :model => t('activerecord.models.inventory_file')) -%></h1>
|
3
|
+
<div id="content_list">
|
4
|
+
|
5
|
+
<%= form_for(@inventory_file) do |f| -%>
|
6
|
+
<%= f.error_messages -%>
|
7
|
+
|
8
|
+
<div class="field">
|
9
|
+
<%= f.label :inventory_file_name -%> <br />
|
10
|
+
<%= f.text_field :inventory_file_name -%>
|
11
|
+
</div>
|
12
|
+
<div class="field">
|
13
|
+
<%= f.label :inventory_content_type -%> <br />
|
14
|
+
<%= f.text_field :inventory_content_type -%>
|
15
|
+
</div>
|
16
|
+
<div class="field">
|
17
|
+
<%= f.label :inventory_file_size -%> <br />
|
18
|
+
<%= f.text_field :inventory_file_size -%>
|
19
|
+
</div>
|
20
|
+
<div class="field">
|
21
|
+
<%= f.label :file_hash -%> <br />
|
22
|
+
<%= f.text_field :file_hash -%>
|
23
|
+
</div>
|
24
|
+
<div class="field">
|
25
|
+
<%= f.label :user_id -%> <br />
|
26
|
+
<%= f.text_field :user_id -%>
|
27
|
+
</div>
|
28
|
+
<div class="field">
|
29
|
+
<%= f.label :note -%> <br />
|
30
|
+
<%= f.text_area :note -%>
|
31
|
+
</div>
|
32
|
+
<div class="actions">
|
33
|
+
<%= f.submit %>
|
34
|
+
</div>
|
35
|
+
<%- end -%>
|
36
|
+
|
37
|
+
</div>
|
38
|
+
</div>
|
39
|
+
|
40
|
+
<div id="submenu" class="ui-corner-all">
|
41
|
+
<ul>
|
42
|
+
<li><%= link_to t('page.show'), @inventory_file -%></li>
|
43
|
+
<li><%= link_to t('page.back'), inventory_files_path -%></li>
|
44
|
+
</ul>
|
45
|
+
</div>
|
@@ -0,0 +1,39 @@
|
|
1
|
+
<div id="content_detail" class="ui-corner-all">
|
2
|
+
<h1 class="title"><%= t('page.listing', :model => t('activerecord.models.inventory_file')) -%></h1>
|
3
|
+
<div id="content_list">
|
4
|
+
|
5
|
+
<table class="index">
|
6
|
+
<tr>
|
7
|
+
<th><%= t('activerecord.attributes.inventory_file.inventory_file_name') -%> </th>
|
8
|
+
<th><%= t('activerecord.attributes.inventory_file.inventory_content_type') -%> </th>
|
9
|
+
<th><%= t('activerecord.attributes.inventory_file.inventory_file_size') -%> </th>
|
10
|
+
<th><%= t('activerecord.attributes.inventory_file.file_hash') -%> </th>
|
11
|
+
<th><%= t('activerecord.models.user') -%> </th>
|
12
|
+
<th><%= t('activerecord.attributes.inventory_file.note') -%> </th>
|
13
|
+
</tr>
|
14
|
+
|
15
|
+
<%- @inventory_files.each do |inventory_file| -%>
|
16
|
+
<tr class="line<%= cycle("0", "1") -%>">
|
17
|
+
<td><%= inventory_file.inventory_file_name -%> </td>
|
18
|
+
<td><%= inventory_file.inventory_content_type -%> </td>
|
19
|
+
<td><%= inventory_file.inventory_file_size -%> </td>
|
20
|
+
<td><%= inventory_file.file_hash -%> </td>
|
21
|
+
<td><%= link_to inventory_file.user.username, inventory_file.user -%> </td>
|
22
|
+
<td><%= inventory_file.note -%> </td>
|
23
|
+
<td><%= link_to t('page.show'), inventory_file -%> </td>
|
24
|
+
<td><%= link_to t('page.edit'), edit_inventory_file_path(inventory_file) -%> </td>
|
25
|
+
<td><%= link_to t('page.destroy'), inventory_file, :confirm => t('page.are_you_sure'), :method => :delete -%> </td>
|
26
|
+
</tr>
|
27
|
+
<%- end -%>
|
28
|
+
</table>
|
29
|
+
|
30
|
+
<%= will_paginate(@inventory_files) -%>
|
31
|
+
</div>
|
32
|
+
</div>
|
33
|
+
|
34
|
+
<div id="submenu" class="ui-corner-all">
|
35
|
+
<ul>
|
36
|
+
<li><%= link_to t('page.new', :model => t('activerecord.models.inventory_file')), new_inventory_file_path -%></li>
|
37
|
+
</ul>
|
38
|
+
</div>
|
39
|
+
|