rails_pivot_table_js 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (59) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.rdoc +3 -0
  4. data/Rakefile +37 -0
  5. data/app/assets/javascripts/rails_pivot_table_js/application.js +13 -0
  6. data/app/assets/javascripts/rails_pivot_table_js/d3_renderers.js +84 -0
  7. data/app/assets/javascripts/rails_pivot_table_js/gchart_renderers.js +183 -0
  8. data/app/assets/javascripts/rails_pivot_table_js/nrecopivottableext.js +356 -0
  9. data/app/assets/javascripts/rails_pivot_table_js/pivot.js +1510 -0
  10. data/app/assets/javascripts/rails_pivot_table_js/pivot.pt.js +83 -0
  11. data/app/assets/stylesheets/rails_pivot_table_js/application.css +15 -0
  12. data/app/assets/stylesheets/rails_pivot_table_js/pivot.css +228 -0
  13. data/app/controllers/rails_pivot_table_js/application_controller.rb +4 -0
  14. data/app/helpers/rails_pivot_table_js/application_helper.rb +7 -0
  15. data/app/views/layouts/rails_pivot_table_js/application.html.erb +14 -0
  16. data/app/views/rails_pivot_table_js/_pivot.html.haml +61 -0
  17. data/config/routes.rb +2 -0
  18. data/lib/rails_pivot_table_js/engine.rb +5 -0
  19. data/lib/rails_pivot_table_js/version.rb +3 -0
  20. data/lib/rails_pivot_table_js.rb +4 -0
  21. data/lib/tasks/rails_pivot_table_js_tasks.rake +4 -0
  22. data/test/dummy/README.rdoc +28 -0
  23. data/test/dummy/Rakefile +6 -0
  24. data/test/dummy/app/assets/javascripts/application.js +13 -0
  25. data/test/dummy/app/assets/stylesheets/application.css +15 -0
  26. data/test/dummy/app/controllers/application_controller.rb +5 -0
  27. data/test/dummy/app/helpers/application_helper.rb +2 -0
  28. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  29. data/test/dummy/bin/bundle +3 -0
  30. data/test/dummy/bin/rails +4 -0
  31. data/test/dummy/bin/rake +4 -0
  32. data/test/dummy/bin/setup +29 -0
  33. data/test/dummy/config/application.rb +26 -0
  34. data/test/dummy/config/boot.rb +5 -0
  35. data/test/dummy/config/database.yml +25 -0
  36. data/test/dummy/config/environment.rb +5 -0
  37. data/test/dummy/config/environments/development.rb +41 -0
  38. data/test/dummy/config/environments/production.rb +79 -0
  39. data/test/dummy/config/environments/test.rb +42 -0
  40. data/test/dummy/config/initializers/assets.rb +11 -0
  41. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  42. data/test/dummy/config/initializers/cookies_serializer.rb +3 -0
  43. data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  44. data/test/dummy/config/initializers/inflections.rb +16 -0
  45. data/test/dummy/config/initializers/mime_types.rb +4 -0
  46. data/test/dummy/config/initializers/session_store.rb +3 -0
  47. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  48. data/test/dummy/config/locales/en.yml +23 -0
  49. data/test/dummy/config/routes.rb +4 -0
  50. data/test/dummy/config/secrets.yml +22 -0
  51. data/test/dummy/config.ru +4 -0
  52. data/test/dummy/public/404.html +67 -0
  53. data/test/dummy/public/422.html +67 -0
  54. data/test/dummy/public/500.html +66 -0
  55. data/test/dummy/public/favicon.ico +0 -0
  56. data/test/integration/navigation_test.rb +8 -0
  57. data/test/rails_pivot_table_js_test.rb +7 -0
  58. data/test/test_helper.rb +21 -0
  59. metadata +158 -0
@@ -0,0 +1,83 @@
1
+ (function() {
2
+ var callWithJQuery;
3
+
4
+ callWithJQuery = function(pivotModule) {
5
+ if (typeof exports === "object" && typeof module === "object") {
6
+ return pivotModule(require("jquery"));
7
+ } else if (typeof define === "function" && define.amd) {
8
+ return define(["jquery"], pivotModule);
9
+ } else {
10
+ return pivotModule(jQuery);
11
+ }
12
+ };
13
+
14
+ callWithJQuery(function($) {
15
+ var frFmt, frFmtInt, frFmtPct, gcr, nf, r, tpl;
16
+ nf = $.pivotUtilities.numberFormat;
17
+ tpl = $.pivotUtilities.aggregatorTemplates;
18
+ r = $.pivotUtilities.renderers;
19
+ gcr = $.pivotUtilities.gchart_renderers;
20
+ frFmt = nf({
21
+ thousandsSep: ".",
22
+ decimalSep: ","
23
+ });
24
+ frFmtInt = nf({
25
+ digitsAfterDecimal: 0,
26
+ thousandsSep: ".",
27
+ decimalSep: ","
28
+ });
29
+ frFmtPct = nf({
30
+ digitsAfterDecimal: 2,
31
+ scaler: 100,
32
+ suffix: "%",
33
+ thousandsSep: ".",
34
+ decimalSep: ","
35
+ });
36
+ return $.pivotUtilities.locales.pt = {
37
+ localeStrings: {
38
+ renderError: "Ocorreu um erro ao renderizar os resultados da Tabela Dinãmica.",
39
+ computeError: "Ocorreu um erro ao computar os resultados da Tabela Dinãmica.",
40
+ uiRenderError: "Ocorreu um erro ao renderizar a interface da Tabela Dinãmica.",
41
+ selectAll: "Selecionar Tudo",
42
+ selectNone: "Selecionar Nenhum",
43
+ tooMany: "(demais para listar)",
44
+ filterResults: "Filtrar resultados",
45
+ totals: "Totais",
46
+ vs: "vs",
47
+ by: "por"
48
+ },
49
+ aggregators: {
50
+ "Contagem": tpl.count(frFmtInt),
51
+ "Contagem de Valores únicos": tpl.countUnique(frFmtInt),
52
+ "Lista de Valores únicos": tpl.listUnique(", "),
53
+ "Soma": tpl.sum(frFmt),
54
+ "Soma de Inteiros": tpl.sum(frFmtInt),
55
+ "Média": tpl.average(frFmt),
56
+ "Soma sobre Soma": tpl.sumOverSum(frFmt),
57
+ "Limite Superior a 80%": tpl.sumOverSumBound80(true, frFmt),
58
+ "Limite Inferior a 80%": tpl.sumOverSumBound80(false, frFmt),
59
+ "Soma como Fração do Total": tpl.fractionOf(tpl.sum(), "total", frFmtPct),
60
+ "Soma como Fração da Linha": tpl.fractionOf(tpl.sum(), "row", frFmtPct),
61
+ "Soma como Fração da Coluna": tpl.fractionOf(tpl.sum(), "col", frFmtPct),
62
+ "Contagem como Fração do Total": tpl.fractionOf(tpl.count(), "total", frFmtPct),
63
+ "Contagem como Fração da Linha": tpl.fractionOf(tpl.count(), "row", frFmtPct),
64
+ "Contagem como Fração da Coluna": tpl.fractionOf(tpl.count(), "col", frFmtPct)
65
+ },
66
+ renderers: {
67
+ "Tabela": r["Table"],
68
+ "Tabela com Barras": r["Table Barchart"],
69
+ "Tabela com Mapa de Calor": r["Heatmap"],
70
+ "Tabela com Mapa de Calor por Linhas": r["Row Heatmap"],
71
+ "Tabela com Mapa de Calor por Colunas": r["Col Heatmap"],
72
+ "Grafico de Linhas": $.pivotUtilities.gchart_renderers["Line Chart"],
73
+ "Grafico de Barras": $.pivotUtilities.gchart_renderers["Bar Chart"],
74
+ "Grafico de Barras Empilhadas": $.pivotUtilities.gchart_renderers["Stacked Bar Chart"],
75
+ "Grafico de Area": $.pivotUtilities.gchart_renderers["Area Chart"],
76
+ "Grafico de Arvore": $.pivotUtilities.d3_renderers["Treemap"],
77
+ }
78
+ };
79
+ });
80
+
81
+ }).call(this);
82
+
83
+ //# sourceMappingURL=pivot.pt.js.map
@@ -0,0 +1,15 @@
1
+ /*
2
+ * This is a manifest file that'll be compiled into application.css, which will include all the files
3
+ * listed below.
4
+ *
5
+ * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6
+ * or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
7
+ *
8
+ * You're free to add application-wide styles to this file and they'll appear at the bottom of the
9
+ * compiled file so the styles you add here take precedence over styles defined in any styles
10
+ * defined in the other CSS/SCSS files in this directory. It is generally better to create a new
11
+ * file per style scope.
12
+ *
13
+ *= require_tree .
14
+ *= require_self
15
+ */
@@ -0,0 +1,228 @@
1
+
2
+ table.pvtTable {
3
+ /*font-family:arial;*/
4
+ font-size: 8pt;
5
+ text-align: left;
6
+ border-collapse: collapse;
7
+ width:100%;
8
+ }
9
+ table.pvtTable tr th, table.pvtTable tr th {
10
+ background-color: #fafafa;
11
+ border: 1px solid #CDCDCD;
12
+ font-size: 8pt;
13
+ padding: 5px;
14
+ }
15
+
16
+ table.pvtTable .pvtColLabel {text-align: center;}
17
+ table.pvtTable .pvtTotalLabel {text-align: right;}
18
+
19
+ table.pvtTable tr td {
20
+ color: #3D3D3D;
21
+ padding: 5px;
22
+ background-color: #FFF;
23
+ border: 1px solid #ddd;
24
+ vertical-align: top;
25
+ text-align: right;
26
+ }
27
+
28
+ .pvtTotal, .pvtGrandTotal { font-weight: bold; }
29
+
30
+ .pvtVals { text-align: center;}
31
+ .pvtAggregator { /*margin-bottom: 5px ;*/ }
32
+
33
+ .pvtAttrDropdown {
34
+ margin-top:5px;
35
+
36
+ }
37
+
38
+ .pvtAxisContainer, .pvtVals {
39
+ /*border: 1px solid gray;
40
+ background: #F0F0F0;*/
41
+ padding: 5px;
42
+ min-width: 20px;
43
+ min-height: 20px;
44
+ }
45
+ .pvtAxisContainer {
46
+ border:1px solid #ddd;
47
+ }
48
+ /*.pvtAxisContainer.pvtCols li span.pvtAttr, .pvtAxisContainer.pvtRows li span.pvtAttr {
49
+ background-color: #ffffff;
50
+ }*/
51
+
52
+ .pvtAxisContainer li {
53
+ list-style-type: none;
54
+ cursor:move;
55
+ display:block;
56
+ float:left;
57
+ }
58
+ .pvtAxisContainer.pvtRows li {
59
+ float:none;
60
+ margin-bottom:5px;
61
+ }
62
+
63
+
64
+ .pvtAxisContainer li.pvtPlaceholder {
65
+ -webkit-border-radius: 5px;
66
+ -moz-border-radius: 5px;
67
+ border-radius: 5px;
68
+ border: 1px dashed #aaa;
69
+ padding: 5px 5px;
70
+ height:34px;
71
+ min-width:100px;
72
+ margin-right:5px;
73
+ content:" ";
74
+ }
75
+
76
+ .pvtAxisContainer li span.pvtAttr {
77
+ background-color: #F0F0F0;
78
+ border: 1px solid #ddd;
79
+ padding: 5px 5px;
80
+ white-space:nowrap;
81
+ -webkit-border-radius: 5px;
82
+ -moz-border-radius: 5px;
83
+ border-radius: 5px;
84
+
85
+ display: inline-block;
86
+ height: 34px;
87
+ vertical-align:middle;
88
+
89
+ margin-right:5px;
90
+ margin-bottom:5px;
91
+ }
92
+
93
+
94
+
95
+ .pvtTriangle {
96
+ cursor:pointer;
97
+ color: grey;
98
+
99
+ border-left: 4px solid transparent;
100
+ border-right: 4px solid transparent;
101
+ border-top: 4px solid;
102
+ display: inline-block;
103
+ height: 0;
104
+ margin-left: 2px;
105
+ vertical-align: middle;
106
+ overflow:hidden;
107
+ width: 0;
108
+ }
109
+
110
+ .pvtHorizList li { display: inline-block; }
111
+ .pvtVertList { vertical-align: top; }
112
+
113
+ .pvtFilteredAttribute { font-style: italic }
114
+
115
+ .pvtFilterBox{
116
+ z-index: 100;
117
+ width: 280px;
118
+ border: 1px solid #ddd;
119
+ background-color: #fff;
120
+ position: absolute;
121
+ padding: 0 10px;
122
+ text-align: center;
123
+ border-radius: 4px
124
+ }
125
+ .pvtFilterBox button {
126
+ border-radius: 3px;
127
+ padding: 5px 10px;
128
+ border: 1px solid #fff;
129
+ border-color: #ccc;
130
+ color: #333;
131
+ margin:5px;
132
+ }
133
+ .pvtFilterBox button:hover {
134
+ background-color: #ebebeb;
135
+ border-color: #adadad;
136
+ color: #333;
137
+ }
138
+
139
+ .pvtFilterBox h4{ margin:5px 0 0 0; }
140
+ .pvtFilterBox>p {
141
+ margin:0px;
142
+ }
143
+ .pvtFilterBox input.pvtSearch {
144
+ width: 100%;
145
+ background-color: #fff;
146
+ background-image: none;
147
+ border: 1px solid #ccc;
148
+ border-radius: 4px;
149
+ transition: border-color 0.15s ease-in-out 0s, box-shadow 0.15s ease-in-out 0s;
150
+ box-shadow: 0 1px 1px rgba(0, 0, 0, 0.075) inset;
151
+ color: #555;
152
+ margin-bottom:5px;
153
+ line-height: 1.5;
154
+ }
155
+ .pvtFilterBox input.pvtSearch:focus {
156
+ outline: 0 none;
157
+ border-color: #66afe9;
158
+ box-shadow: 0 1px 1px rgba(0, 0, 0, 0.075) inset, 0 0 8px rgba(102, 175, 233, 0.6);
159
+ display: block;
160
+ }
161
+
162
+
163
+ .pvtCheckContainer{
164
+ text-align: left;
165
+ overflow: auto;
166
+ width: 100%;
167
+ max-height: 200px;
168
+ padding-top:5px;
169
+ padding-bottom:5px;
170
+ border-top:1px solid #f0f0f0;
171
+ border-bottom:1px solid #f0f0f0;
172
+ }
173
+ .pvtCheckContainer label span {
174
+ margin-left:5px;
175
+ font-weight:normal;
176
+ }
177
+
178
+ .pvtCheckContainer p{ margin: 0px; }
179
+
180
+
181
+
182
+
183
+
184
+ .pvtValDrillDown .pvtVal:hover, .pvtValDrillDown .pvtTotal:hover {
185
+ cursor:pointer;
186
+ background-color:#F0F0F0;
187
+ }
188
+ .pvtValDrillDown .pvtVal[data-value="null"]:hover, .pvtValDrillDown .pvtTotal[data-value="null"]:hover {
189
+ cursor:default;
190
+ background-color:inherit;
191
+ }
192
+
193
+ .pvtColLabel.pvtSortable, .pvtRowLabel.pvtSortable, .pvtTotalColSortable, .pvtTotalRowSortable, .pvtAxisLabel.pvtSortableCol, .pvtAxisLabel.pvtSortableRow {
194
+ cursor:pointer;
195
+ }
196
+ .pvtColLabel.pvtSortable.pvtSortDesc::after, .pvtTotalRowSortable.pvtSortDesc::after {
197
+ content:" ↓";
198
+ }
199
+ .pvtColLabel.pvtSortable.pvtSortAsc::after, .pvtTotalRowSortable.pvtSortAsc::after {
200
+ content:" ↑";
201
+ }
202
+ .pvtRowLabel.pvtSortable.pvtSortDesc::after, .pvtTotalColSortable.pvtSortDesc::after {
203
+ content:" →";
204
+ }
205
+ .pvtRowLabel.pvtSortable.pvtSortAsc::after, .pvtTotalColSortable.pvtSortAsc::after {
206
+ content:" ←";
207
+ }
208
+
209
+ .pvtAxisLabel.pvtSortableCol.pvtSortDesc::after {
210
+ content:" →";
211
+ }
212
+ .pvtAxisLabel.pvtSortableCol.pvtSortAsc::after {
213
+ content:" ←";
214
+ }
215
+ .pvtAxisLabel.pvtSortableRow.pvtSortDesc::after {
216
+ content:" ↓";
217
+ }
218
+ .pvtAxisLabel.pvtSortableRow.pvtSortAsc::after {
219
+ content:" ↑";
220
+ }
221
+
222
+ .pvtUnused {
223
+ max-width: 200px;
224
+ }
225
+
226
+ input.pvtFilter {
227
+ display: inline;
228
+ }
@@ -0,0 +1,4 @@
1
+ module RailsPivotTableJs
2
+ class ApplicationController < ActionController::Base
3
+ end
4
+ end
@@ -0,0 +1,7 @@
1
+ module RailsPivotTableJs
2
+ module ApplicationHelper
3
+ def show_pivot_table(pivot_data, pivot_columns)
4
+ render partial: 'rails_pivot_table_js/pivot', locals: { pivot_data: pivot_data, pivot_columns: pivot_columns }
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,14 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>RailsPivotTableJs</title>
5
+ <%= stylesheet_link_tag "rails_pivot_table_js/application", media: "all" %>
6
+ <%= javascript_include_tag "rails_pivot_table_js/application" %>
7
+ <%= csrf_meta_tags %>
8
+ </head>
9
+ <body>
10
+
11
+ <%= yield %>
12
+
13
+ </body>
14
+ </html>
@@ -0,0 +1,61 @@
1
+ = javascript_include_tag 'https://www.google.com/jsapi'
2
+ = javascript_include_tag 'rails_pivot_table_js/application'
3
+ = stylesheet_link_tag 'rails_pivot_table_js/application'
4
+
5
+ #pivotgrid
6
+
7
+ :javascript
8
+ function setCookie(key, value) {
9
+ var expires = new Date();
10
+ expires.setTime(expires.getTime() + (180 * 24 * 60 * 60 * 1000));
11
+ document.cookie = key + '=' + value + ';expires=' + expires.toUTCString();
12
+ }
13
+
14
+ function getCookie(key) {
15
+ var keyValue = document.cookie.match('(^|;) ?' + key + '=([^;]*)(;|$)');
16
+ return keyValue ? keyValue[2] : null;
17
+ }
18
+
19
+ function pivotSaveConfig(config) {
20
+ var config_copy = JSON.parse(JSON.stringify(config));
21
+ //delete some values which are functions
22
+ delete config_copy["aggregators"];
23
+ delete config_copy["renderers"];
24
+ //delete some bulky default values
25
+ delete config_copy["rendererOptions"];
26
+ delete config_copy["localeStrings"];
27
+ setCookie("pivot_config",JSON.stringify(config_copy));
28
+ }
29
+
30
+
31
+
32
+ $(function(){
33
+
34
+ var entregas = #{pivot_data};
35
+
36
+ //Suporte aos gráficos
37
+ //google.load("visualization", "1", {packages:["corechart", "charteditor"]});
38
+ var default_config = #{pivot_columns.to_json};
39
+ var last_config = JSON.parse(getCookie("taxtime_pivot_config"));
40
+ var config = last_config || default_config;
41
+ config['onRefresh'] = pivotSaveConfig;
42
+
43
+ var nrecoPivotExt = new NRecoPivotTableExtensions();
44
+
45
+ var stdRendererNames = ["Table","Table Barchart","Heatmap","Row Heatmap","Col Heatmap"];
46
+ var wrappedRenderers = $.extend( {}, $.pivotUtilities.renderers);
47
+ $.each(stdRendererNames, function() {
48
+ var rName = this;
49
+ wrappedRenderers[rName] = nrecoPivotExt.wrapTableRenderer(wrappedRenderers[rName]);
50
+ });
51
+ config['renderers'] = wrappedRenderers
52
+ jQuery("#pivotgrid").pivotUI(
53
+ entregas,
54
+ config,
55
+ false,
56
+ 'pt'
57
+ );
58
+ });
59
+
60
+
61
+
data/config/routes.rb ADDED
@@ -0,0 +1,2 @@
1
+ RailsPivotTableJs::Engine.routes.draw do
2
+ end
@@ -0,0 +1,5 @@
1
+ module RailsPivotTableJs
2
+ class Engine < ::Rails::Engine
3
+ isolate_namespace RailsPivotTableJs
4
+ end
5
+ end
@@ -0,0 +1,3 @@
1
+ module RailsPivotTableJs
2
+ VERSION = "0.0.1"
3
+ end
@@ -0,0 +1,4 @@
1
+ require "rails_pivot_table_js/engine"
2
+
3
+ module RailsPivotTableJs
4
+ end
@@ -0,0 +1,4 @@
1
+ # desc "Explaining what the task does"
2
+ # task :rails_pivot_table_js do
3
+ # # Task goes here
4
+ # end
@@ -0,0 +1,28 @@
1
+ == README
2
+
3
+ This README would normally document whatever steps are necessary to get the
4
+ application up and running.
5
+
6
+ Things you may want to cover:
7
+
8
+ * Ruby version
9
+
10
+ * System dependencies
11
+
12
+ * Configuration
13
+
14
+ * Database creation
15
+
16
+ * Database initialization
17
+
18
+ * How to run the test suite
19
+
20
+ * Services (job queues, cache servers, search engines, etc.)
21
+
22
+ * Deployment instructions
23
+
24
+ * ...
25
+
26
+
27
+ Please feel free to use a different markup language if you do not plan to run
28
+ <tt>rake doc:app</tt>.
@@ -0,0 +1,6 @@
1
+ # Add your own tasks in files placed in lib/tasks ending in .rake,
2
+ # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3
+
4
+ require File.expand_path('../config/application', __FILE__)
5
+
6
+ Rails.application.load_tasks
@@ -0,0 +1,13 @@
1
+ // This is a manifest file that'll be compiled into application.js, which will include all the files
2
+ // listed below.
3
+ //
4
+ // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
5
+ // or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
6
+ //
7
+ // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8
+ // compiled file.
9
+ //
10
+ // Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
11
+ // about supported directives.
12
+ //
13
+ //= require_tree .
@@ -0,0 +1,15 @@
1
+ /*
2
+ * This is a manifest file that'll be compiled into application.css, which will include all the files
3
+ * listed below.
4
+ *
5
+ * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6
+ * or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
7
+ *
8
+ * You're free to add application-wide styles to this file and they'll appear at the bottom of the
9
+ * compiled file so the styles you add here take precedence over styles defined in any styles
10
+ * defined in the other CSS/SCSS files in this directory. It is generally better to create a new
11
+ * file per style scope.
12
+ *
13
+ *= require_tree .
14
+ *= require_self
15
+ */
@@ -0,0 +1,5 @@
1
+ class ApplicationController < ActionController::Base
2
+ # Prevent CSRF attacks by raising an exception.
3
+ # For APIs, you may want to use :null_session instead.
4
+ protect_from_forgery with: :exception
5
+ end
@@ -0,0 +1,2 @@
1
+ module ApplicationHelper
2
+ end
@@ -0,0 +1,14 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Dummy</title>
5
+ <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
6
+ <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
7
+ <%= csrf_meta_tags %>
8
+ </head>
9
+ <body>
10
+
11
+ <%= yield %>
12
+
13
+ </body>
14
+ </html>
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
3
+ load Gem.bin_path('bundler', 'bundle')
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ APP_PATH = File.expand_path('../../config/application', __FILE__)
3
+ require_relative '../config/boot'
4
+ require 'rails/commands'
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ require_relative '../config/boot'
3
+ require 'rake'
4
+ Rake.application.run
@@ -0,0 +1,29 @@
1
+ #!/usr/bin/env ruby
2
+ require 'pathname'
3
+
4
+ # path to your application root.
5
+ APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
6
+
7
+ Dir.chdir APP_ROOT do
8
+ # This script is a starting point to setup your application.
9
+ # Add necessary setup steps to this file:
10
+
11
+ puts "== Installing dependencies =="
12
+ system "gem install bundler --conservative"
13
+ system "bundle check || bundle install"
14
+
15
+ # puts "\n== Copying sample files =="
16
+ # unless File.exist?("config/database.yml")
17
+ # system "cp config/database.yml.sample config/database.yml"
18
+ # end
19
+
20
+ puts "\n== Preparing database =="
21
+ system "bin/rake db:setup"
22
+
23
+ puts "\n== Removing old logs and tempfiles =="
24
+ system "rm -f log/*"
25
+ system "rm -rf tmp/cache"
26
+
27
+ puts "\n== Restarting application server =="
28
+ system "touch tmp/restart.txt"
29
+ end
@@ -0,0 +1,26 @@
1
+ require File.expand_path('../boot', __FILE__)
2
+
3
+ require 'rails/all'
4
+
5
+ Bundler.require(*Rails.groups)
6
+ require "rails_pivot_table_js"
7
+
8
+ module Dummy
9
+ class Application < Rails::Application
10
+ # Settings in config/environments/* take precedence over those specified here.
11
+ # Application configuration should go into files in config/initializers
12
+ # -- all .rb files in that directory are automatically loaded.
13
+
14
+ # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
15
+ # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
16
+ # config.time_zone = 'Central Time (US & Canada)'
17
+
18
+ # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
19
+ # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
20
+ # config.i18n.default_locale = :de
21
+
22
+ # Do not swallow errors in after_commit/after_rollback callbacks.
23
+ config.active_record.raise_in_transactional_callbacks = true
24
+ end
25
+ end
26
+
@@ -0,0 +1,5 @@
1
+ # Set up gems listed in the Gemfile.
2
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../../../Gemfile', __FILE__)
3
+
4
+ require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
5
+ $LOAD_PATH.unshift File.expand_path('../../../../lib', __FILE__)
@@ -0,0 +1,25 @@
1
+ # SQLite version 3.x
2
+ # gem install sqlite3
3
+ #
4
+ # Ensure the SQLite 3 gem is defined in your Gemfile
5
+ # gem 'sqlite3'
6
+ #
7
+ default: &default
8
+ adapter: sqlite3
9
+ pool: 5
10
+ timeout: 5000
11
+
12
+ development:
13
+ <<: *default
14
+ database: db/development.sqlite3
15
+
16
+ # Warning: The database defined as "test" will be erased and
17
+ # re-generated from your development database when you run "rake".
18
+ # Do not set this db to the same as development or production.
19
+ test:
20
+ <<: *default
21
+ database: db/test.sqlite3
22
+
23
+ production:
24
+ <<: *default
25
+ database: db/production.sqlite3
@@ -0,0 +1,5 @@
1
+ # Load the Rails application.
2
+ require File.expand_path('../application', __FILE__)
3
+
4
+ # Initialize the Rails application.
5
+ Rails.application.initialize!