report_ui 0.0.1.alpha
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.bundle/config +2 -0
- data/.config/cucumber.yml +8 -0
- data/.gitignore +6 -0
- data/.gitkeep +0 -0
- data/Gemfile +28 -0
- data/Gemfile.lock +159 -0
- data/MIT-LICENSE +20 -0
- data/README +13 -0
- data/Rakefile +78 -0
- data/VERSION +1 -0
- data/features/reports.feature +45 -0
- data/features/step_definitions/bernie_steps.rb +5 -0
- data/features/step_definitions/mislav_steps.rb +13 -0
- data/features/step_definitions/web_steps.rb +226 -0
- data/features/support/blueprints.rb +13 -0
- data/features/support/env.rb +39 -0
- data/features/support/models.rb +7 -0
- data/features/support/paths.rb +41 -0
- data/fixture_rails_root/.gitignore +4 -0
- data/fixture_rails_root/Gemfile +25 -0
- data/fixture_rails_root/Gemfile.lock +177 -0
- data/fixture_rails_root/README +256 -0
- data/fixture_rails_root/Rakefile +7 -0
- data/fixture_rails_root/app/controllers/application_controller.rb +3 -0
- data/fixture_rails_root/app/helpers/application_helper.rb +2 -0
- data/fixture_rails_root/app/views/layouts/application.html.erb +14 -0
- data/fixture_rails_root/config.ru +4 -0
- data/fixture_rails_root/config/application.rb +16 -0
- data/fixture_rails_root/config/boot.rb +13 -0
- data/fixture_rails_root/config/database.yml +28 -0
- data/fixture_rails_root/config/environment.rb +5 -0
- data/fixture_rails_root/config/environments/development.rb +11 -0
- data/fixture_rails_root/config/environments/production.rb +9 -0
- data/fixture_rails_root/config/environments/test.rb +10 -0
- data/fixture_rails_root/config/initializers/backtrace_silencers.rb +7 -0
- data/fixture_rails_root/config/initializers/inflections.rb +10 -0
- data/fixture_rails_root/config/initializers/mime_types.rb +5 -0
- data/fixture_rails_root/config/initializers/report_ui.rb +1 -0
- data/fixture_rails_root/config/initializers/secret_token.rb +7 -0
- data/fixture_rails_root/config/initializers/session_store.rb +2 -0
- data/fixture_rails_root/config/locales/en.yml +5 -0
- data/fixture_rails_root/config/routes.rb +3 -0
- data/fixture_rails_root/db/schema.rb +30 -0
- data/fixture_rails_root/db/seeds.rb +7 -0
- data/fixture_rails_root/doc/README_FOR_APP +2 -0
- data/fixture_rails_root/lib/tasks/.gitkeep +0 -0
- data/fixture_rails_root/public/404.html +26 -0
- data/fixture_rails_root/public/422.html +26 -0
- data/fixture_rails_root/public/500.html +26 -0
- data/fixture_rails_root/public/favicon.ico +0 -0
- data/fixture_rails_root/public/images/rails.png +0 -0
- data/fixture_rails_root/public/index.html +239 -0
- data/fixture_rails_root/public/javascripts/application.js +2 -0
- data/fixture_rails_root/public/javascripts/controls.js +965 -0
- data/fixture_rails_root/public/javascripts/dragdrop.js +974 -0
- data/fixture_rails_root/public/javascripts/effects.js +1123 -0
- data/fixture_rails_root/public/javascripts/prototype.js +6001 -0
- data/fixture_rails_root/public/javascripts/rails.js +175 -0
- data/fixture_rails_root/public/robots.txt +5 -0
- data/fixture_rails_root/public/stylesheets/.gitkeep +0 -0
- data/fixture_rails_root/script/rails +6 -0
- data/fixture_rails_root/test/performance/browsing_test.rb +9 -0
- data/fixture_rails_root/test/test_helper.rb +13 -0
- data/generators/USAGE +8 -0
- data/generators/reporter_generator.rb +3 -0
- data/init.rb +3 -0
- data/install.rb +2 -0
- data/lib/app/controllers/reports_controller.rb +32 -0
- data/lib/app/models/report.rb +36 -0
- data/lib/app/views/layouts/reports.html.haml +11 -0
- data/lib/app/views/reports/_columns_editor.html.haml +14 -0
- data/lib/app/views/reports/_details.html.haml +5 -0
- data/lib/app/views/reports/_form.html.haml +2 -0
- data/lib/app/views/reports/_report_details_edit.html.haml +11 -0
- data/lib/app/views/reports/_reports_table.html.haml +10 -0
- data/lib/app/views/reports/edit.html.haml +2 -0
- data/lib/app/views/reports/index.html.haml +19 -0
- data/lib/app/views/reports/new.html.haml +38 -0
- data/lib/app/views/reports/show.html.haml +13 -0
- data/lib/app/views/reports/show.js.erb +1 -0
- data/lib/config/.routes.rb.swn +0 -0
- data/lib/config/routes.rb +7 -0
- data/lib/report_ui.rb +9 -0
- data/lib/report_ui/engine.rb +13 -0
- data/lib/report_ui/orm/active_record.rb +24 -0
- data/lib/report_ui/routing.rb +13 -0
- data/lib/report_ui/schema.rb +17 -0
- data/lib/tasks/report_ui_tasks.rake +4 -0
- data/public/javascripts/.gitkeep +0 -0
- data/public/javascripts/application.js +63 -0
- data/public/javascripts/jquery-ui.min.js +778 -0
- data/public/javascripts/jquery.js +154 -0
- data/public/javascripts/jrails.min.js +1 -0
- data/public/javascripts/report_ui/application.js +63 -0
- data/public/javascripts/report_ui/jquery-ui.min.js +778 -0
- data/public/javascripts/report_ui/jquery.js +154 -0
- data/public/javascripts/report_ui/jrails.min.js +1 -0
- data/public/stylesheets/.gitkeep +0 -0
- data/public/stylesheets/formtastic.css +214 -0
- data/public/stylesheets/formtastic_changes.css +8 -0
- data/public/stylesheets/ie.css +89 -0
- data/public/stylesheets/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/public/stylesheets/images/ui-bg_flat_55_fbec88_40x100.png +0 -0
- data/public/stylesheets/images/ui-bg_glass_75_d0e5f5_1x400.png +0 -0
- data/public/stylesheets/images/ui-bg_glass_85_dfeffc_1x400.png +0 -0
- data/public/stylesheets/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- data/public/stylesheets/images/ui-bg_gloss-wave_55_5c9ccc_500x100.png +0 -0
- data/public/stylesheets/images/ui-bg_inset-hard_100_f5f8f9_1x100.png +0 -0
- data/public/stylesheets/images/ui-bg_inset-hard_100_fcfdfd_1x100.png +0 -0
- data/public/stylesheets/images/ui-icons_217bc0_256x240.png +0 -0
- data/public/stylesheets/images/ui-icons_2e83ff_256x240.png +0 -0
- data/public/stylesheets/images/ui-icons_469bdd_256x240.png +0 -0
- data/public/stylesheets/images/ui-icons_6da8d5_256x240.png +0 -0
- data/public/stylesheets/images/ui-icons_cd0a0a_256x240.png +0 -0
- data/public/stylesheets/images/ui-icons_d8e7f3_256x240.png +0 -0
- data/public/stylesheets/images/ui-icons_f9bd01_256x240.png +0 -0
- data/public/stylesheets/jquery-ui.css +572 -0
- data/public/stylesheets/print.css +73 -0
- data/public/stylesheets/reporter/formtastic.css +214 -0
- data/public/stylesheets/reporter/formtastic_changes.css +8 -0
- data/public/stylesheets/reporter/ie.css +89 -0
- data/public/stylesheets/reporter/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/public/stylesheets/reporter/images/ui-bg_flat_55_fbec88_40x100.png +0 -0
- data/public/stylesheets/reporter/images/ui-bg_glass_75_d0e5f5_1x400.png +0 -0
- data/public/stylesheets/reporter/images/ui-bg_glass_85_dfeffc_1x400.png +0 -0
- data/public/stylesheets/reporter/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- data/public/stylesheets/reporter/images/ui-bg_gloss-wave_55_5c9ccc_500x100.png +0 -0
- data/public/stylesheets/reporter/images/ui-bg_inset-hard_100_f5f8f9_1x100.png +0 -0
- data/public/stylesheets/reporter/images/ui-bg_inset-hard_100_fcfdfd_1x100.png +0 -0
- data/public/stylesheets/reporter/images/ui-icons_217bc0_256x240.png +0 -0
- data/public/stylesheets/reporter/images/ui-icons_2e83ff_256x240.png +0 -0
- data/public/stylesheets/reporter/images/ui-icons_469bdd_256x240.png +0 -0
- data/public/stylesheets/reporter/images/ui-icons_6da8d5_256x240.png +0 -0
- data/public/stylesheets/reporter/images/ui-icons_cd0a0a_256x240.png +0 -0
- data/public/stylesheets/reporter/images/ui-icons_d8e7f3_256x240.png +0 -0
- data/public/stylesheets/reporter/images/ui-icons_f9bd01_256x240.png +0 -0
- data/public/stylesheets/reporter/jquery-ui.css +572 -0
- data/public/stylesheets/reporter/print.css +73 -0
- data/public/stylesheets/reporter/screen.css +1271 -0
- data/public/stylesheets/screen.css +1271 -0
- data/report_ui.gemspec +267 -0
- data/spec/controllers/reports_controller_spec.rb +4 -0
- data/spec/lib/models_spec.rb +7 -0
- data/spec/models/report_spec.rb +50 -0
- data/spec/routing/routing_spec.rb +21 -0
- data/spec/spec_helper.rb +25 -0
- data/spec/support/blueprints.rb +13 -0
- data/spec/support/models.rb +7 -0
- data/spec/views/reports/index.html.haml_spec.rb +21 -0
- data/spec/views/reports/new.html.haml_spec.rb +1 -0
- data/spec/views/reports/show.html.haml_spec.rb +10 -0
- data/tasks/reporter.rake +34 -0
- data/uninstall.rb +1 -0
- metadata +551 -0
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
(function() {
|
|
2
|
+
// Technique from Juriy Zaytsev
|
|
3
|
+
// http://thinkweb2.com/projects/prototype/detecting-event-support-without-browser-sniffing/
|
|
4
|
+
function isEventSupported(eventName) {
|
|
5
|
+
var el = document.createElement('div');
|
|
6
|
+
eventName = 'on' + eventName;
|
|
7
|
+
var isSupported = (eventName in el);
|
|
8
|
+
if (!isSupported) {
|
|
9
|
+
el.setAttribute(eventName, 'return;');
|
|
10
|
+
isSupported = typeof el[eventName] == 'function';
|
|
11
|
+
}
|
|
12
|
+
el = null;
|
|
13
|
+
return isSupported;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
function isForm(element) {
|
|
17
|
+
return Object.isElement(element) && element.nodeName.toUpperCase() == 'FORM'
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function isInput(element) {
|
|
21
|
+
if (Object.isElement(element)) {
|
|
22
|
+
var name = element.nodeName.toUpperCase()
|
|
23
|
+
return name == 'INPUT' || name == 'SELECT' || name == 'TEXTAREA'
|
|
24
|
+
}
|
|
25
|
+
else return false
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
var submitBubbles = isEventSupported('submit'),
|
|
29
|
+
changeBubbles = isEventSupported('change')
|
|
30
|
+
|
|
31
|
+
if (!submitBubbles || !changeBubbles) {
|
|
32
|
+
// augment the Event.Handler class to observe custom events when needed
|
|
33
|
+
Event.Handler.prototype.initialize = Event.Handler.prototype.initialize.wrap(
|
|
34
|
+
function(init, element, eventName, selector, callback) {
|
|
35
|
+
init(element, eventName, selector, callback)
|
|
36
|
+
// is the handler being attached to an element that doesn't support this event?
|
|
37
|
+
if ( (!submitBubbles && this.eventName == 'submit' && !isForm(this.element)) ||
|
|
38
|
+
(!changeBubbles && this.eventName == 'change' && !isInput(this.element)) ) {
|
|
39
|
+
// "submit" => "emulated:submit"
|
|
40
|
+
this.eventName = 'emulated:' + this.eventName
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
)
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
if (!submitBubbles) {
|
|
47
|
+
// discover forms on the page by observing focus events which always bubble
|
|
48
|
+
document.on('focusin', 'form', function(focusEvent, form) {
|
|
49
|
+
// special handler for the real "submit" event (one-time operation)
|
|
50
|
+
if (!form.retrieve('emulated:submit')) {
|
|
51
|
+
form.on('submit', function(submitEvent) {
|
|
52
|
+
var emulated = form.fire('emulated:submit', submitEvent, true)
|
|
53
|
+
// if custom event received preventDefault, cancel the real one too
|
|
54
|
+
if (emulated.returnValue === false) submitEvent.preventDefault()
|
|
55
|
+
})
|
|
56
|
+
form.store('emulated:submit', true)
|
|
57
|
+
}
|
|
58
|
+
})
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
if (!changeBubbles) {
|
|
62
|
+
// discover form inputs on the page
|
|
63
|
+
document.on('focusin', 'input, select, texarea', function(focusEvent, input) {
|
|
64
|
+
// special handler for real "change" events
|
|
65
|
+
if (!input.retrieve('emulated:change')) {
|
|
66
|
+
input.on('change', function(changeEvent) {
|
|
67
|
+
input.fire('emulated:change', changeEvent, true)
|
|
68
|
+
})
|
|
69
|
+
input.store('emulated:change', true)
|
|
70
|
+
}
|
|
71
|
+
})
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
function handleRemote(element) {
|
|
75
|
+
var method, url, params;
|
|
76
|
+
|
|
77
|
+
var event = element.fire("ajax:before");
|
|
78
|
+
if (event.stopped) return false;
|
|
79
|
+
|
|
80
|
+
if (element.tagName.toLowerCase() === 'form') {
|
|
81
|
+
method = element.readAttribute('method') || 'post';
|
|
82
|
+
url = element.readAttribute('action');
|
|
83
|
+
params = element.serialize();
|
|
84
|
+
} else {
|
|
85
|
+
method = element.readAttribute('data-method') || 'get';
|
|
86
|
+
url = element.readAttribute('href');
|
|
87
|
+
params = {};
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
new Ajax.Request(url, {
|
|
91
|
+
method: method,
|
|
92
|
+
parameters: params,
|
|
93
|
+
evalScripts: true,
|
|
94
|
+
|
|
95
|
+
onComplete: function(request) { element.fire("ajax:complete", request); },
|
|
96
|
+
onSuccess: function(request) { element.fire("ajax:success", request); },
|
|
97
|
+
onFailure: function(request) { element.fire("ajax:failure", request); }
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
element.fire("ajax:after");
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
function handleMethod(element) {
|
|
104
|
+
var method = element.readAttribute('data-method'),
|
|
105
|
+
url = element.readAttribute('href'),
|
|
106
|
+
csrf_param = $$('meta[name=csrf-param]')[0],
|
|
107
|
+
csrf_token = $$('meta[name=csrf-token]')[0];
|
|
108
|
+
|
|
109
|
+
var form = new Element('form', { method: "POST", action: url, style: "display: none;" });
|
|
110
|
+
element.parentNode.insert(form);
|
|
111
|
+
|
|
112
|
+
if (method !== 'post') {
|
|
113
|
+
var field = new Element('input', { type: 'hidden', name: '_method', value: method });
|
|
114
|
+
form.insert(field);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
if (csrf_param) {
|
|
118
|
+
var param = csrf_param.readAttribute('content'),
|
|
119
|
+
token = csrf_token.readAttribute('content'),
|
|
120
|
+
field = new Element('input', { type: 'hidden', name: param, value: token });
|
|
121
|
+
form.insert(field);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
form.submit();
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
document.on("click", "*[data-confirm]", function(event, element) {
|
|
129
|
+
var message = element.readAttribute('data-confirm');
|
|
130
|
+
if (!confirm(message)) event.stop();
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
document.on("click", "a[data-remote]", function(event, element) {
|
|
134
|
+
if (event.stopped) return;
|
|
135
|
+
handleRemote(element);
|
|
136
|
+
event.stop();
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
document.on("click", "a[data-method]", function(event, element) {
|
|
140
|
+
if (event.stopped) return;
|
|
141
|
+
handleMethod(element);
|
|
142
|
+
event.stop();
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
document.on("submit", function(event) {
|
|
146
|
+
var element = event.findElement(),
|
|
147
|
+
message = element.readAttribute('data-confirm');
|
|
148
|
+
if (message && !confirm(message)) {
|
|
149
|
+
event.stop();
|
|
150
|
+
return false;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
var inputs = element.select("input[type=submit][data-disable-with]");
|
|
154
|
+
inputs.each(function(input) {
|
|
155
|
+
input.disabled = true;
|
|
156
|
+
input.writeAttribute('data-original-value', input.value);
|
|
157
|
+
input.value = input.readAttribute('data-disable-with');
|
|
158
|
+
});
|
|
159
|
+
|
|
160
|
+
var element = event.findElement("form[data-remote]");
|
|
161
|
+
if (element) {
|
|
162
|
+
handleRemote(element);
|
|
163
|
+
event.stop();
|
|
164
|
+
}
|
|
165
|
+
});
|
|
166
|
+
|
|
167
|
+
document.on("ajax:after", "form", function(event, element) {
|
|
168
|
+
var inputs = element.select("input[type=submit][disabled=true][data-disable-with]");
|
|
169
|
+
inputs.each(function(input) {
|
|
170
|
+
input.value = input.readAttribute('data-original-value');
|
|
171
|
+
input.removeAttribute('data-original-value');
|
|
172
|
+
input.disabled = false;
|
|
173
|
+
});
|
|
174
|
+
});
|
|
175
|
+
})();
|
|
File without changes
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
|
|
3
|
+
|
|
4
|
+
APP_PATH = File.expand_path('../../config/application', __FILE__)
|
|
5
|
+
require File.expand_path('../../config/boot', __FILE__)
|
|
6
|
+
require 'rails/commands'
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
ENV["RAILS_ENV"] = "test"
|
|
2
|
+
require File.expand_path('../../config/environment', __FILE__)
|
|
3
|
+
require 'rails/test_help'
|
|
4
|
+
|
|
5
|
+
class ActiveSupport::TestCase
|
|
6
|
+
# Setup all fixtures in test/fixtures/*.(yml|csv) for all tests in alphabetical order.
|
|
7
|
+
#
|
|
8
|
+
# Note: You'll currently still have to declare fixtures explicitly in integration tests
|
|
9
|
+
# -- they do not yet inherit this setting
|
|
10
|
+
fixtures :all
|
|
11
|
+
|
|
12
|
+
# Add more helper methods to be used by all tests here...
|
|
13
|
+
end
|
data/generators/USAGE
ADDED
data/init.rb
ADDED
data/install.rb
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
class ReportsController < ApplicationController
|
|
2
|
+
unloadable
|
|
3
|
+
expose :report
|
|
4
|
+
|
|
5
|
+
expose(:reports) { Report.all }
|
|
6
|
+
|
|
7
|
+
expose(:custom_reports) do
|
|
8
|
+
if respond_to?(:current_user) && current_user.respond_to?(:reports)
|
|
9
|
+
current_user.reports
|
|
10
|
+
else
|
|
11
|
+
[]
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
expose(:available_columns) { report.available_columns }
|
|
16
|
+
|
|
17
|
+
#def new; end
|
|
18
|
+
#def show; end
|
|
19
|
+
#def index; end
|
|
20
|
+
#def edit; end
|
|
21
|
+
|
|
22
|
+
def create
|
|
23
|
+
report = Report.new(params[:report])
|
|
24
|
+
|
|
25
|
+
if report.save
|
|
26
|
+
flash[:notice] = 'Report was successfully created.'
|
|
27
|
+
redirect_to(report)
|
|
28
|
+
else
|
|
29
|
+
render :action => "new"
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
class Report < ActiveRecord::Base
|
|
2
|
+
serialize :used_columns
|
|
3
|
+
validates_presence_of :used_columns
|
|
4
|
+
|
|
5
|
+
def available_columns
|
|
6
|
+
::ReportUi.reportable_models.inject({}) do |result, model|
|
|
7
|
+
result.merge(model => model.columns.inject({}) do |model_attrs, attr|
|
|
8
|
+
model_attrs.merge(attr.name.to_sym => ((self.used_columns || []).include?("#{model.name}##{attr.name}")))
|
|
9
|
+
end)
|
|
10
|
+
end
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def query
|
|
14
|
+
case type
|
|
15
|
+
when 'ruby'
|
|
16
|
+
eval(code)
|
|
17
|
+
when 'sql'
|
|
18
|
+
Report.find_by_sql(code)
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def humanized_column_names
|
|
24
|
+
column_names.map(&:humanize)
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
def column_names
|
|
28
|
+
used_columns.map do |full_col|
|
|
29
|
+
full_col.scan(/#(.*)/).flatten[0]
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
def data
|
|
34
|
+
eval code
|
|
35
|
+
end
|
|
36
|
+
end
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
!!!
|
|
2
|
+
%html
|
|
3
|
+
%head
|
|
4
|
+
%title Reports
|
|
5
|
+
=stylesheet_link_tag 'reporter/formtastic', 'reporter/formtastic_changes', 'reporter/jquery-ui', 'reporter/screen', :media => 'screen, projection'
|
|
6
|
+
=stylesheet_link_tag 'reporter/print', :media => 'print'
|
|
7
|
+
= javascript_include_tag 'reporter/jquery.js','reporter/jquery-ui.min.js', 'reporter/application.js'
|
|
8
|
+
= csrf_meta_tag
|
|
9
|
+
%body.bp
|
|
10
|
+
#container
|
|
11
|
+
= yield
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
%ul#models
|
|
2
|
+
-available_columns.keys.each do |model|
|
|
3
|
+
%li
|
|
4
|
+
=link_to model.name.underscore.humanize, "#columns_for_#{model.name}"
|
|
5
|
+
-available_columns.each do |model, attrs|
|
|
6
|
+
%div(id="columns_for_#{model.name}")
|
|
7
|
+
-attrs.each do |attr_name, shown|
|
|
8
|
+
%li
|
|
9
|
+
%label(for="#{model.name}#{attr_name}")= attr_name.to_s.humanize
|
|
10
|
+
=check_box_tag("#{model.name}_#{attr_name}", "#{model.name}: #{attr_name.to_s.humanize}", shown)
|
|
11
|
+
%br
|
|
12
|
+
%button.button_button Ok
|
|
13
|
+
|
|
14
|
+
%button.button_button Cancel
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
%h1 Listing reports
|
|
2
|
+
#reports
|
|
3
|
+
%h2 Canned Reports
|
|
4
|
+
|
|
5
|
+
-if reports.present?
|
|
6
|
+
=render 'reports/reports_table', :reports => reports
|
|
7
|
+
-else
|
|
8
|
+
%p There are no canned reports
|
|
9
|
+
|
|
10
|
+
%h2 Favorite Reports
|
|
11
|
+
|
|
12
|
+
-if custom_reports.present?
|
|
13
|
+
=render 'reports/reports_table', :reports => custom_reports
|
|
14
|
+
-else
|
|
15
|
+
%p There are no custom reports.
|
|
16
|
+
=link_to 'New Report', new_report_path, :class => 'button_button'
|
|
17
|
+
#report_details
|
|
18
|
+
%h2 Report Details
|
|
19
|
+
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
-semantic_form_for report, :html => {:class => 'bp'} do |f|
|
|
2
|
+
%h1 Creating a new report
|
|
3
|
+
#sidebar.span-4
|
|
4
|
+
%h3 Selected Options
|
|
5
|
+
=f.commit_button 'Run/Save'
|
|
6
|
+
#columns
|
|
7
|
+
%h4
|
|
8
|
+
Columns
|
|
9
|
+
=link_to "Edit", '#columns_editor', :rel => 'toggle_within/#editors'
|
|
10
|
+
%ul
|
|
11
|
+
%li Click 'Edit' to add columns to the report.
|
|
12
|
+
#sorts
|
|
13
|
+
%h4
|
|
14
|
+
Sorts
|
|
15
|
+
=link_to "Edit", '#sorts_editor'
|
|
16
|
+
%ul
|
|
17
|
+
%li Click 'Edit' to sort by one or more columns.
|
|
18
|
+
#filters
|
|
19
|
+
%h4
|
|
20
|
+
Filters
|
|
21
|
+
=link_to "Edit", '#filters_editor'
|
|
22
|
+
%ul
|
|
23
|
+
%li Click 'Edit' to filter data in the report.
|
|
24
|
+
#schedule
|
|
25
|
+
%h4
|
|
26
|
+
Schedule
|
|
27
|
+
=link_to "Edit", '#schedule_editor'
|
|
28
|
+
%ul
|
|
29
|
+
%li Click 'Edit' to create a schedule for this report to run automatically.
|
|
30
|
+
=f.commit_button 'Run/Save'
|
|
31
|
+
#content.span-20.last
|
|
32
|
+
=render 'form', :f => f
|
|
33
|
+
#editors
|
|
34
|
+
#columns_editor(style='display: none')
|
|
35
|
+
=render 'columns_editor'
|
|
36
|
+
#sorts_editor(style='display: none')
|
|
37
|
+
#filters_editor(style='display: none')
|
|
38
|
+
#schedule_editor(style='display: none')
|