integratedscaffold 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +6 -0
- data/Manifest +85 -0
- data/README +1 -0
- data/README.rdoc +1 -0
- data/Rakefile +14 -0
- data/integratedscaffold.gemspec +38 -0
- data/lib/integratedscaffold.rb +289 -0
- data/lib/templates/actions/create.rb +8 -0
- data/lib/templates/actions/destroy.rb +5 -0
- data/lib/templates/actions/edit.rb +4 -0
- data/lib/templates/actions/index.rb +5 -0
- data/lib/templates/actions/new.rb +4 -0
- data/lib/templates/actions/parse_save_from_excel.rb +45 -0
- data/lib/templates/actions/show.rb +5 -0
- data/lib/templates/actions/update.rb +8 -0
- data/lib/templates/assets/images/background.jpg +0 -0
- data/lib/templates/assets/images/download.png +0 -0
- data/lib/templates/assets/images/inner_texture.jpeg +0 -0
- data/lib/templates/assets/images/logo.png +0 -0
- data/lib/templates/assets/images/new.png +0 -0
- data/lib/templates/assets/images/upload.png +0 -0
- data/lib/templates/assets/images/welcome_icon_1.png +0 -0
- data/lib/templates/assets/images/welcome_icon_2.png +0 -0
- data/lib/templates/assets/images/welcome_icon_3.png +0 -0
- data/lib/templates/assets/images/welcome_icon_4.png +0 -0
- data/lib/templates/assets/images/welcome_image.png +0 -0
- data/lib/templates/assets/javascripts/exclusions/fiddletabs.js +233 -0
- data/lib/templates/assets/javascripts/exclusions/jquery.mousewheel.min.js +12 -0
- data/lib/templates/assets/javascripts/exclusions/jquery.pageslide.js +202 -0
- data/lib/templates/assets/javascripts/jquery.dataTables.min.js +2475 -0
- data/lib/templates/assets/stylesheets/base_classes.css.scss +107 -0
- data/lib/templates/assets/stylesheets/exclusions/fiddletabs.css +77 -0
- data/lib/templates/assets/stylesheets/exclusions/images/Sorting icons.psd +0 -0
- data/lib/templates/assets/stylesheets/exclusions/images/back_disabled.jpg +0 -0
- data/lib/templates/assets/stylesheets/exclusions/images/back_enabled.jpg +0 -0
- data/lib/templates/assets/stylesheets/exclusions/images/favicon.ico +0 -0
- data/lib/templates/assets/stylesheets/exclusions/images/forward_disabled.jpg +0 -0
- data/lib/templates/assets/stylesheets/exclusions/images/forward_enabled.jpg +0 -0
- data/lib/templates/assets/stylesheets/exclusions/images/sort_asc.png +0 -0
- data/lib/templates/assets/stylesheets/exclusions/images/sort_asc_disabled.png +0 -0
- data/lib/templates/assets/stylesheets/exclusions/images/sort_both.png +0 -0
- data/lib/templates/assets/stylesheets/exclusions/images/sort_desc.png +0 -0
- data/lib/templates/assets/stylesheets/exclusions/images/sort_desc_disabled.png +0 -0
- data/lib/templates/assets/stylesheets/exclusions/jquery_data_table.css +513 -0
- data/lib/templates/assets/stylesheets/images/Sorting icons.psd +0 -0
- data/lib/templates/assets/stylesheets/images/back_disabled.jpg +0 -0
- data/lib/templates/assets/stylesheets/images/back_enabled.jpg +0 -0
- data/lib/templates/assets/stylesheets/images/favicon.ico +0 -0
- data/lib/templates/assets/stylesheets/images/forward_disabled.jpg +0 -0
- data/lib/templates/assets/stylesheets/images/forward_enabled.jpg +0 -0
- data/lib/templates/assets/stylesheets/images/sort_asc.png +0 -0
- data/lib/templates/assets/stylesheets/images/sort_asc_disabled.png +0 -0
- data/lib/templates/assets/stylesheets/images/sort_both.png +0 -0
- data/lib/templates/assets/stylesheets/images/sort_desc.png +0 -0
- data/lib/templates/assets/stylesheets/images/sort_desc_disabled.png +0 -0
- data/lib/templates/assets/stylesheets/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/lib/templates/assets/stylesheets/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
- data/lib/templates/assets/stylesheets/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- data/lib/templates/assets/stylesheets/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/lib/templates/assets/stylesheets/images/ui-bg_glass_75_dadada_1x400.png +0 -0
- data/lib/templates/assets/stylesheets/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- data/lib/templates/assets/stylesheets/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- data/lib/templates/assets/stylesheets/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- data/lib/templates/assets/stylesheets/images/ui-icons_222222_256x240.png +0 -0
- data/lib/templates/assets/stylesheets/images/ui-icons_2e83ff_256x240.png +0 -0
- data/lib/templates/assets/stylesheets/images/ui-icons_454545_256x240.png +0 -0
- data/lib/templates/assets/stylesheets/images/ui-icons_888888_256x240.png +0 -0
- data/lib/templates/assets/stylesheets/images/ui-icons_cd0a0a_256x240.png +0 -0
- data/lib/templates/assets/stylesheets/information_page.css.scss +3 -0
- data/lib/templates/assets/stylesheets/jquery_data_table.css +513 -0
- data/lib/templates/controller.rb +4 -0
- data/lib/templates/file_uploader.rb +48 -0
- data/lib/templates/helper.rb +2 -0
- data/lib/templates/layouts/application.html.erb +69 -0
- data/lib/templates/layouts/dummy_data.html.erb +80 -0
- data/lib/templates/layouts/information_page.html.erb +81 -0
- data/lib/templates/layouts/pageslide_form_at.html.erb +2 -0
- data/lib/templates/layouts/welcome.html.erb +71 -0
- data/lib/templates/migration.rb +18 -0
- data/lib/templates/model.rb +7 -0
- data/lib/templates/views/erb/_form.html.erb +32 -0
- data/lib/templates/views/erb/edit.html.erb +11 -0
- data/lib/templates/views/erb/index.html.erb +216 -0
- data/lib/templates/views/erb/new.html.erb +11 -0
- data/lib/templates/views/erb/show.html.erb +0 -0
- metadata +271 -0
@@ -0,0 +1,48 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
class FileUploader < CarrierWave::Uploader::Base
|
4
|
+
|
5
|
+
# Include RMagick or MiniMagick support:
|
6
|
+
# include CarrierWave::RMagick
|
7
|
+
include CarrierWave::MiniMagick
|
8
|
+
|
9
|
+
# Choose what kind of storage to use for this uploader:
|
10
|
+
storage :file
|
11
|
+
# storage :fog
|
12
|
+
|
13
|
+
# Override the directory where uploaded files will be stored.
|
14
|
+
# This is a sensible default for uploaders that are meant to be mounted:
|
15
|
+
def store_dir
|
16
|
+
"#{::Rails.root.to_s}/public/excel_uploaded_files/"
|
17
|
+
end
|
18
|
+
|
19
|
+
# Provide a default URL as a default if there hasn't been a file uploaded:
|
20
|
+
# def default_url
|
21
|
+
# "/images/fallback/" + [version_name, "default.png"].compact.join('_')
|
22
|
+
# end
|
23
|
+
|
24
|
+
# Process files as they are uploaded:
|
25
|
+
# process :scale => [200, 300]
|
26
|
+
#
|
27
|
+
# def scale(width, height)
|
28
|
+
# # do something
|
29
|
+
# end
|
30
|
+
|
31
|
+
# Create different versions of your uploaded files:
|
32
|
+
# version :thumb do
|
33
|
+
# process :scale => [50, 50]
|
34
|
+
# end
|
35
|
+
|
36
|
+
# Add a white list of extensions which are allowed to be uploaded.
|
37
|
+
# For images you might use something like this:
|
38
|
+
def extension_white_list
|
39
|
+
[:xls]
|
40
|
+
end
|
41
|
+
|
42
|
+
# Override the filename of the uploaded files:
|
43
|
+
# Avoid using model.id or version_name here, see uploader/store.rb for details.
|
44
|
+
# def filename
|
45
|
+
# "something.jpg" if original_filename
|
46
|
+
# end
|
47
|
+
|
48
|
+
end
|
@@ -0,0 +1,69 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>BrandName</title>
|
5
|
+
<%%= stylesheet_link_tag "application" %>
|
6
|
+
<%%= javascript_include_tag "application" %>
|
7
|
+
<%%= csrf_meta_tags %>
|
8
|
+
<script type="text/javascript">
|
9
|
+
$(function() {
|
10
|
+
$('a.activate_pageslide').pageslide({direction:"left"});
|
11
|
+
});
|
12
|
+
</script>
|
13
|
+
<%%= yield(:head) %>
|
14
|
+
</head>
|
15
|
+
<body>
|
16
|
+
<div id="wrapper">
|
17
|
+
<div class="topbar" style="z-index: 999999999">
|
18
|
+
<div class="fill">
|
19
|
+
<div class="container">
|
20
|
+
<a class="brand" href="/">BrandName</a>
|
21
|
+
<ul class="nav">
|
22
|
+
<!--<li><a href="#about" style="color:white;">About</a></li>-->
|
23
|
+
<!--<li><a href="#contact" style="color:white;">Contact</a></li>-->
|
24
|
+
</ul>
|
25
|
+
|
26
|
+
<%% if !user_signed_in? %>
|
27
|
+
<%%= form_for(resource, :as => resource_name, :url => session_path(resource_name), :html => {:class => "pull-right"}) do |f| %>
|
28
|
+
<%%= f.text_field :username, :class=>"input-small", :placeholder=>"Username" %>
|
29
|
+
<%%= f.password_field :password, :class=>"input-small", :placeholder=>"Password" %>
|
30
|
+
<%%= f.submit "Sign In", :class=>"primary btn" %>
|
31
|
+
<%% end %>
|
32
|
+
<%% else %>
|
33
|
+
<div class="pull-right" style="margin-top: 10px;color:white;">
|
34
|
+
<%%= current_user.username %>
|
35
|
+
<span class="nav_link">
|
36
|
+
| <%%= link_to "Sign out", destroy_user_session_path, :method => :delete, :style=>"color:white;" %>
|
37
|
+
</span>
|
38
|
+
</div>
|
39
|
+
<%% end %>
|
40
|
+
</div>
|
41
|
+
</div>
|
42
|
+
</div>
|
43
|
+
<div class="container">
|
44
|
+
|
45
|
+
<div class="content">
|
46
|
+
<%%= js extend_gritter :position => :bottom_right %>
|
47
|
+
<%%= js add_gritter(flash[:notice], :image => :success, :title => "Notice", :sticky => false, :time => 2000) %>
|
48
|
+
<%%= js add_gritter(flash[:alert], :image => :warning, :title => "Alert!", :sticky => false, :time => 2000) %>
|
49
|
+
<%%= yield %>
|
50
|
+
</div>
|
51
|
+
|
52
|
+
<%% if request.fullpath=="/" %>
|
53
|
+
|
54
|
+
<footer>
|
55
|
+
<p>A <a href="http://www.ptotem.com">Ptotem Learning Projects</a> Initiative 2011</p>
|
56
|
+
</footer>
|
57
|
+
|
58
|
+
<%% end %>
|
59
|
+
</div>
|
60
|
+
</div>
|
61
|
+
|
62
|
+
<%%= javascript_include_tag "/assets/exclusions/jquery.pageslide" %>
|
63
|
+
|
64
|
+
|
65
|
+
</body>
|
66
|
+
</html>
|
67
|
+
|
68
|
+
|
69
|
+
|
@@ -0,0 +1,80 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>BrandName</title>
|
5
|
+
<%%= stylesheet_link_tag "application" %>
|
6
|
+
<%%= javascript_include_tag "application" %>
|
7
|
+
<%%= csrf_meta_tags %>
|
8
|
+
<script type="text/javascript">
|
9
|
+
$(function() {
|
10
|
+
$('a.activate_pageslide').pageslide({direction:"left"});
|
11
|
+
});
|
12
|
+
</script>
|
13
|
+
<%%= yield(:head) %>
|
14
|
+
<style>
|
15
|
+
table td {
|
16
|
+
border: none;
|
17
|
+
}
|
18
|
+
|
19
|
+
table tr {
|
20
|
+
border: none;
|
21
|
+
}
|
22
|
+
</style>
|
23
|
+
</head>
|
24
|
+
<body>
|
25
|
+
<div id="wrapper">
|
26
|
+
<div class="topbar" style="z-index: 999999999">
|
27
|
+
<div class="fill">
|
28
|
+
<div class="container">
|
29
|
+
<a class="brand" href="/">BrandName</a>
|
30
|
+
<ul class="nav">
|
31
|
+
<!--<li><a href="#about" style="color:white;">About</a></li>-->
|
32
|
+
<!--<li><a href="#contact" style="color:white;">Contact</a></li>-->
|
33
|
+
</ul>
|
34
|
+
|
35
|
+
<%% if !user_signed_in? %>
|
36
|
+
<%%= form_for(resource, :as => resource_name, :url => session_path(resource_name), :html => {:class => "pull-right"}) do |f| %>
|
37
|
+
<%%= f.text_field :username, :class=>"input-small", :placeholder=>"Username" %>
|
38
|
+
<%%= f.password_field :password, :class=>"input-small", :placeholder=>"Password" %>
|
39
|
+
<%%= f.submit "Sign In", :class=>"primary btn" %>
|
40
|
+
<%% end %>
|
41
|
+
<%% else %>
|
42
|
+
<div class="pull-right" style="margin-top: 10px;color:white;">
|
43
|
+
<%%= current_user.username %>
|
44
|
+
<span class="nav_link">
|
45
|
+
| <%%= link_to "Sign out", destroy_user_session_path, :method => :delete, :style=>"color:white;" %>
|
46
|
+
</span>
|
47
|
+
</div>
|
48
|
+
<%% end %>
|
49
|
+
</div>
|
50
|
+
</div>
|
51
|
+
</div>
|
52
|
+
<div class="container">
|
53
|
+
|
54
|
+
<div class="page-header" style="height:100px"></div>
|
55
|
+
<div style="position:absolute;margin-top: -110px;" class="span16">
|
56
|
+
<%%= yield(:page_header) %>
|
57
|
+
</div>
|
58
|
+
|
59
|
+
<div class="content">
|
60
|
+
<%%= js extend_gritter :position => :bottom_right %>
|
61
|
+
<%%= js add_gritter(flash[:notice], :image => :success, :title => "Notice", :sticky => false, :time => 2000) %>
|
62
|
+
<%%= js add_gritter(flash[:alert], :image => :warning, :title => "Alert!", :sticky => false, :time => 2000) %>
|
63
|
+
<%%= yield %>
|
64
|
+
</div>
|
65
|
+
|
66
|
+
<%% if request.fullpath=="/" %>
|
67
|
+
|
68
|
+
<footer>
|
69
|
+
<p>A <a href="http://www.ptotem.com">Ptotem Learning Projects</a> Initiative 2011</p>
|
70
|
+
</footer>
|
71
|
+
|
72
|
+
<%% end %>
|
73
|
+
</div>
|
74
|
+
</div>
|
75
|
+
|
76
|
+
<%%= javascript_include_tag "/assets/exclusions/jquery.pageslide" %>
|
77
|
+
|
78
|
+
|
79
|
+
</body>
|
80
|
+
</html>
|
@@ -0,0 +1,81 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>BrandName</title>
|
5
|
+
<%%= stylesheet_link_tag "application" %>
|
6
|
+
<%%= javascript_include_tag "application" %>
|
7
|
+
<script src='http://www.google.com/jsapi'></script>
|
8
|
+
<%%= csrf_meta_tags %>
|
9
|
+
<script type="text/javascript">
|
10
|
+
$(function() {
|
11
|
+
$('a.activate_pageslide').pageslide({direction:"left"});
|
12
|
+
});
|
13
|
+
</script>
|
14
|
+
<%%= yield(:head) %>
|
15
|
+
<style>
|
16
|
+
table td {
|
17
|
+
border: none;
|
18
|
+
}
|
19
|
+
|
20
|
+
table tr {
|
21
|
+
border: none;
|
22
|
+
}
|
23
|
+
</style>
|
24
|
+
</head>
|
25
|
+
<body>
|
26
|
+
<div id="wrapper">
|
27
|
+
<div class="topbar" style="z-index: 999999999">
|
28
|
+
<div class="fill">
|
29
|
+
<div class="container">
|
30
|
+
<a class="brand" href="/">BrandName</a>
|
31
|
+
<ul class="nav">
|
32
|
+
<!--<li><a href="#about" style="color:white;">About</a></li>-->
|
33
|
+
<!--<li><a href="#contact" style="color:white;">Contact</a></li>-->
|
34
|
+
</ul>
|
35
|
+
|
36
|
+
<%% if !user_signed_in? %>
|
37
|
+
<%%= form_for(resource, :as => resource_name, :url => session_path(resource_name), :html => {:class => "pull-right"}) do |f| %>
|
38
|
+
<%%= f.text_field :username, :class=>"input-small", :placeholder=>"Username" %>
|
39
|
+
<%%= f.password_field :password, :class=>"input-small", :placeholder=>"Password" %>
|
40
|
+
<%%= f.submit "Sign In", :class=>"primary btn" %>
|
41
|
+
<%% end %>
|
42
|
+
<%% else %>
|
43
|
+
<div class="pull-right" style="margin-top: 10px;color:white;">
|
44
|
+
<%%= current_user.username %>
|
45
|
+
<span class="nav_link">
|
46
|
+
| <%%= link_to "Sign out", destroy_user_session_path, :method => :delete, :style=>"color:white;" %>
|
47
|
+
</span>
|
48
|
+
</div>
|
49
|
+
<%% end %>
|
50
|
+
</div>
|
51
|
+
</div>
|
52
|
+
</div>
|
53
|
+
<div class="container">
|
54
|
+
|
55
|
+
<div class="page-header" style="height:100px"></div>
|
56
|
+
<div style="position:absolute;margin-top: -110px;" class="span16">
|
57
|
+
<%%= yield(:page_header) %>
|
58
|
+
</div>
|
59
|
+
|
60
|
+
<div class="content">
|
61
|
+
<%%= js extend_gritter :position => :bottom_right %>
|
62
|
+
<%%= js add_gritter(flash[:notice], :image => :success, :title => "Notice", :sticky => false, :time => 2000) %>
|
63
|
+
<%%= js add_gritter(flash[:alert], :image => :warning, :title => "Alert!", :sticky => false, :time => 2000) %>
|
64
|
+
<%%= yield %>
|
65
|
+
</div>
|
66
|
+
|
67
|
+
<%% if request.fullpath=="/" %>
|
68
|
+
|
69
|
+
<footer>
|
70
|
+
<p>A <a href="http://www.ptotem.com">Ptotem Learning Projects</a> Initiative 2011</p>
|
71
|
+
</footer>
|
72
|
+
|
73
|
+
<%% end %>
|
74
|
+
</div>
|
75
|
+
</div>
|
76
|
+
|
77
|
+
<%%= javascript_include_tag "/assets/exclusions/jquery.pageslide" %>
|
78
|
+
|
79
|
+
|
80
|
+
</body>
|
81
|
+
</html>
|
@@ -0,0 +1,71 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>BrandName</title>
|
5
|
+
<%%= stylesheet_link_tag "application" %>
|
6
|
+
<%%= javascript_include_tag "application" %>
|
7
|
+
<%%= csrf_meta_tags %>
|
8
|
+
<script type="text/javascript">
|
9
|
+
$(function() {
|
10
|
+
$('a.activate_pageslide').pageslide({direction:"left"});
|
11
|
+
});
|
12
|
+
</script>
|
13
|
+
<%%= yield(:head) %>
|
14
|
+
</head>
|
15
|
+
<body>
|
16
|
+
<div id="wrapper">
|
17
|
+
<div class="topbar" style="z-index: 999999999">
|
18
|
+
<div class="fill">
|
19
|
+
<div class="container">
|
20
|
+
<a class="brand" href="/">BrandName</a>
|
21
|
+
<ul class="nav">
|
22
|
+
<!--<li><a href="#about" style="color:white;">About</a></li>-->
|
23
|
+
<!--<li><a href="#contact" style="color:white;">Contact</a></li>-->
|
24
|
+
</ul>
|
25
|
+
|
26
|
+
<%% if !user_signed_in? %>
|
27
|
+
<%%= form_for(resource, :as => resource_name, :url => session_path(resource_name), :html => {:class => "pull-right"}) do |f| %>
|
28
|
+
<%%= f.text_field :username, :class=>"input-small", :placeholder=>"Username" %>
|
29
|
+
<%%= f.password_field :password, :class=>"input-small", :placeholder=>"Password" %>
|
30
|
+
<%%= f.submit "Sign In", :class=>"primary btn" %>
|
31
|
+
<%% end %>
|
32
|
+
<%% else %>
|
33
|
+
<div class="pull-right" style="margin-top: 10px;color:white;">
|
34
|
+
<%%= current_user.username %>
|
35
|
+
<span class="nav_link">
|
36
|
+
| <%%= link_to "Sign out", destroy_user_session_path, :method => :delete, :style=>"color:white;" %>
|
37
|
+
</span>
|
38
|
+
</div>
|
39
|
+
<%% end %>
|
40
|
+
</div>
|
41
|
+
</div>
|
42
|
+
</div>
|
43
|
+
<div class="container">
|
44
|
+
|
45
|
+
<div class="page-header" style="height:100px"></div>
|
46
|
+
<div style="position:absolute;margin-top: -120px">
|
47
|
+
<h1><%%= yield(:page_header) %></h1>
|
48
|
+
</div>
|
49
|
+
|
50
|
+
<div class="content">
|
51
|
+
<%%= js extend_gritter :position => :bottom_right %>
|
52
|
+
<%%= js add_gritter(flash[:notice], :image => :success, :title => "Notice", :sticky => false, :time => 2000) %>
|
53
|
+
<%%= js add_gritter(flash[:alert], :image => :warning, :title => "Alert!", :sticky => false, :time => 2000) %>
|
54
|
+
<%%= yield %>
|
55
|
+
</div>
|
56
|
+
|
57
|
+
<%% if request.fullpath=="/" %>
|
58
|
+
|
59
|
+
<footer>
|
60
|
+
<p>A <a href="http://www.ptotem.com">Ptotem Learning Projects</a> Initiative 2011</p>
|
61
|
+
</footer>
|
62
|
+
|
63
|
+
<%% end %>
|
64
|
+
</div>
|
65
|
+
</div>
|
66
|
+
|
67
|
+
<%%= javascript_include_tag "/assets/exclusions/jquery.pageslide" %>
|
68
|
+
|
69
|
+
|
70
|
+
</body>
|
71
|
+
</html>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
class Create<%= class_name.pluralize.delete('::') %> < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
create_table :<%= table_name || plural_name.split('/').last %> do |t|
|
4
|
+
<%- for attribute in model_attributes -%>
|
5
|
+
t.<%= attribute.type %> :<%= attribute.name %>
|
6
|
+
<%- end -%>
|
7
|
+
<%- unless options[:skip_timestamps] -%>
|
8
|
+
t.timestamps
|
9
|
+
<%- end -%>
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.down
|
14
|
+
drop_table :<%= table_name || plural_name.split('/').last %>
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
|
@@ -0,0 +1,7 @@
|
|
1
|
+
class <%= class_name %> < ActiveRecord::Base
|
2
|
+
<%= " set_table_name :#{table_name}\n" if table_name -%>
|
3
|
+
attr_accessible <%= model_attributes.map { |a| ":#{a.name}" }.join(", ") %>
|
4
|
+
<% model_attributes.each do |attribute| %>
|
5
|
+
validates_presence_of :<%= attribute.name %>
|
6
|
+
<% end %>
|
7
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
<%%= form_for <%= item_path :instance_variable => true %> do |f| %>
|
2
|
+
|
3
|
+
|
4
|
+
<%% if @<%= instance_name %>.errors.any? %>
|
5
|
+
<div id="error_explanation">
|
6
|
+
<h2><%%= pluralize(@<%= instance_name %>.errors.count, "error") %> prohibited this <%= instance_name %>from being saved:</h2>
|
7
|
+
|
8
|
+
<ul>
|
9
|
+
<%% @<%= instance_name %>.errors.full_messages.each do |msg| %>
|
10
|
+
<li><%%= msg %></li>
|
11
|
+
<%% end %>
|
12
|
+
</ul>
|
13
|
+
</div>
|
14
|
+
<%% end %>
|
15
|
+
|
16
|
+
|
17
|
+
|
18
|
+
<table class="condensed-table">
|
19
|
+
<%- for attribute in model_attributes -%>
|
20
|
+
<tr>
|
21
|
+
<td><%%= f.label :<%= attribute.name %> %></td>
|
22
|
+
<td><%%= f.<%= attribute.field_type %> :<%= attribute.name %> %></td>
|
23
|
+
</tr>
|
24
|
+
|
25
|
+
<%- end -%>
|
26
|
+
</table>
|
27
|
+
<br>
|
28
|
+
<br>
|
29
|
+
|
30
|
+
<%%= f.submit "Submit" ,:style=>"margin:auto",:class=>"btn primary large"%>
|
31
|
+
|
32
|
+
<%% end %>
|
@@ -0,0 +1,216 @@
|
|
1
|
+
<%%= content_for :head do %>
|
2
|
+
<%%= stylesheet_link_tag "/assets/exclusions/jquery_data_table" %>
|
3
|
+
|
4
|
+
<%# TODO: Move Script and CSS to unobtrusive files %>
|
5
|
+
<script type="text/javascript">
|
6
|
+
$(function() {
|
7
|
+
$('#example').dataTable({
|
8
|
+
"bJQueryUI": true,
|
9
|
+
"sPaginationType": "full_numbers"
|
10
|
+
});
|
11
|
+
|
12
|
+
|
13
|
+
})
|
14
|
+
</script>
|
15
|
+
<style>
|
16
|
+
|
17
|
+
tr.odd {
|
18
|
+
background-color: #e3f5ac;
|
19
|
+
}
|
20
|
+
|
21
|
+
tr.odd td.sorting_1 {
|
22
|
+
background-color: #d7e99f;
|
23
|
+
}
|
24
|
+
|
25
|
+
tr.even {
|
26
|
+
background-color: #ffffff;
|
27
|
+
}
|
28
|
+
|
29
|
+
tr.even td.sorting_1 {
|
30
|
+
background-color: #f2f2f2;
|
31
|
+
}
|
32
|
+
|
33
|
+
td.options {
|
34
|
+
width: 100px;
|
35
|
+
background: olive;
|
36
|
+
}
|
37
|
+
|
38
|
+
td.options a {
|
39
|
+
color: white;
|
40
|
+
}
|
41
|
+
|
42
|
+
</style>
|
43
|
+
<%% end %>
|
44
|
+
|
45
|
+
<%%= content_for :page_header do %>
|
46
|
+
<div class="pull-left" style="border: none;"><%%= image_tag('logo.png') %></div>
|
47
|
+
<%% end %>
|
48
|
+
|
49
|
+
<div class="row">
|
50
|
+
|
51
|
+
<div class="span4" style="text-align: center">
|
52
|
+
<div class="pageslide_header">
|
53
|
+
<h1 style="color:white">"<%= plural_name.titleize %>"</h1>
|
54
|
+
</div>
|
55
|
+
<br/>
|
56
|
+
<br/>
|
57
|
+
<table>
|
58
|
+
<tr>
|
59
|
+
<td>
|
60
|
+
<a href="#" data-controls-modal="new_form" data-backdrop="static">
|
61
|
+
<%%= image_tag('new.png', :size=>"32x32") %>
|
62
|
+
</a>
|
63
|
+
</td>
|
64
|
+
<td>
|
65
|
+
<a href="#" data-controls-modal="new_form" data-backdrop="static">
|
66
|
+
<h2>Create New</h2>
|
67
|
+
</a>
|
68
|
+
|
69
|
+
<div id="new_form" class="modal hide fade">
|
70
|
+
<div class="modal-header">
|
71
|
+
<a href="#" class="close"> × </a>
|
72
|
+
|
73
|
+
<h3>Create new record</h3>
|
74
|
+
</div>
|
75
|
+
|
76
|
+
<%%= form_for @<%= instance_name %> do |f| %>
|
77
|
+
|
78
|
+
|
79
|
+
<%% if @<%= instance_name %>.errors.any? %>
|
80
|
+
<div id="error_explanation">
|
81
|
+
<h2><%%= pluralize(@<%=instance_name %>.errors.count, "error") %> prohibited this <%= instance_name %> from being
|
82
|
+
saved:</h2>
|
83
|
+
|
84
|
+
<ul>
|
85
|
+
<%% <%= instance_name %>.errors.full_messages.each do |msg| %>
|
86
|
+
<li><%%= msg %></li>
|
87
|
+
<%% end %>
|
88
|
+
</ul>
|
89
|
+
</div>
|
90
|
+
<%% end %>
|
91
|
+
<table class="condensed-table">
|
92
|
+
<%- for attribute in model_attributes -%>
|
93
|
+
<tr>
|
94
|
+
<td><%%= f.label :<%= attribute.name %> %></td>
|
95
|
+
<td><%%= f.<%= attribute.field_type %> :<%= attribute.name %> %></td>
|
96
|
+
</tr>
|
97
|
+
|
98
|
+
<%- end -%>
|
99
|
+
</table>
|
100
|
+
<br>
|
101
|
+
<br>
|
102
|
+
|
103
|
+
|
104
|
+
<div class="modal-footer">
|
105
|
+
<%%= f.submit "Submit", :style=>"margin:auto", :class=>"btn primary large" %>
|
106
|
+
</div>
|
107
|
+
</div>
|
108
|
+
|
109
|
+
<%% end %>
|
110
|
+
</td>
|
111
|
+
</tr>
|
112
|
+
<tr>
|
113
|
+
<td>
|
114
|
+
<a href="#" data-controls-modal="upload_form" data-backdrop="static">
|
115
|
+
<%%= image_tag('upload.png', :size=>"32x32") %>
|
116
|
+
</a>
|
117
|
+
</td>
|
118
|
+
<td>
|
119
|
+
<a href="#" data-controls-modal="upload_form" data-backdrop="static">
|
120
|
+
<h2>Upload</h2>
|
121
|
+
</a>
|
122
|
+
|
123
|
+
<div id="upload_form" class="modal hide fade">
|
124
|
+
<div class="modal-header">
|
125
|
+
<a href="#" class="close"> × </a>
|
126
|
+
|
127
|
+
<h3>Upload Excel File</h3>
|
128
|
+
</div>
|
129
|
+
<%%= form_tag('/<%= instance_name %>/parse_save_from_excel', :multipart => true) do |f| %>
|
130
|
+
<div class="modal-body">
|
131
|
+
Select an Excel File :
|
132
|
+
<%%= file_field_tag :excel_file %>
|
133
|
+
</div>
|
134
|
+
|
135
|
+
<div class="modal-footer">
|
136
|
+
<%%= submit_tag 'Submit', :class=>"large btn primary pull-left" %>
|
137
|
+
</div>
|
138
|
+
<%% end -%>
|
139
|
+
|
140
|
+
</div>
|
141
|
+
|
142
|
+
|
143
|
+
</td>
|
144
|
+
</tr>
|
145
|
+
<tr>
|
146
|
+
<td>
|
147
|
+
<a href="<%%=<%= item_path :action => :new %> %>" class="add_new span3">
|
148
|
+
<%%= image_tag('download.png', :size=>"32x32") %>
|
149
|
+
</a>
|
150
|
+
</td>
|
151
|
+
<td>
|
152
|
+
<a href=" <%%=<%= item_path :action => :new %> %>" class="add_new span3">
|
153
|
+
<h2>Download</h2>
|
154
|
+
</a>
|
155
|
+
</td>
|
156
|
+
</tr>
|
157
|
+
|
158
|
+
</table>
|
159
|
+
|
160
|
+
</div>
|
161
|
+
|
162
|
+
<div class="span12">
|
163
|
+
<table class="jqueried_table display" cellpadding="0" cellspacing="0" border="0" id="example">
|
164
|
+
<thead>
|
165
|
+
<tr>
|
166
|
+
<%- for attribute in @model_attributes -%>
|
167
|
+
<th><%= attribute.human_name.titleize %></th>
|
168
|
+
<%- end -%>
|
169
|
+
<th>Manage</th>
|
170
|
+
</tr>
|
171
|
+
</thead>
|
172
|
+
<tbody>
|
173
|
+
<%% @<%= instances_name %>.each do |<%= instance_name %>| %>
|
174
|
+
<tr>
|
175
|
+
<%- for attribute in @model_attributes -%>
|
176
|
+
<td style="border-right: 1px solid #d3d3d3">
|
177
|
+
<a href="#" data-controls-modal="show_details" data-backdrop="static"><%%= <%= instance_name %>
|
178
|
+
.<%= attribute.name %> %></a>
|
179
|
+
</td>
|
180
|
+
<%- end %>
|
181
|
+
|
182
|
+
<td class="options">
|
183
|
+
<%%= link_to "Edit", <%= item_path :action => :edit %> %> |
|
184
|
+
<%%= link_to "Destroy", <%= item_path %>, :confirm => 'Are you sure?', :method => :delete %>
|
185
|
+
</td>
|
186
|
+
</tr>
|
187
|
+
|
188
|
+
|
189
|
+
<div id="show_details" class="modal hide fade">
|
190
|
+
<div class="modal-header">
|
191
|
+
<a href="#" class="close"> × </a>
|
192
|
+
|
193
|
+
<h3><%%= "<%= singular_name.titleize %>" %></h3>
|
194
|
+
</div>
|
195
|
+
<div class="modal-body">
|
196
|
+
<%- for attribute in model_attributes -%>
|
197
|
+
<p>
|
198
|
+
<strong><%= attribute.human_name.titleize %>:</strong>
|
199
|
+
<%%= <%= instance_name %>.<%= attribute.name %> %>
|
200
|
+
</p>
|
201
|
+
|
202
|
+
<%- end -%>
|
203
|
+
</div>
|
204
|
+
|
205
|
+
<div class="modal-footer">
|
206
|
+
<a href="#" class="close"> Back </a>
|
207
|
+
</div>
|
208
|
+
</div>
|
209
|
+
<%%- end -%>
|
210
|
+
</tbody>
|
211
|
+
</table>
|
212
|
+
|
213
|
+
</div>
|
214
|
+
|
215
|
+
</div>
|
216
|
+
<br/>
|