clark_kent 0.9.9 → 0.10.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (34) hide show
  1. checksums.yaml +5 -5
  2. data/app/controllers/clark_kent/reports_controller.rb +2 -2
  3. data/app/models/clark_kent/report.rb +15 -4
  4. data/app/models/clark_kent/sharing_scope_kind.rb +6 -2
  5. data/app/views/clark_kent/report_columns/_form.html.erb +8 -8
  6. data/app/views/clark_kent/report_columns/_index.html.erb +3 -3
  7. data/app/views/clark_kent/report_columns/_show.html.erb +6 -6
  8. data/app/views/clark_kent/report_emails/_edit.html.erb +3 -3
  9. data/app/views/clark_kent/report_emails/_form.html.erb +3 -3
  10. data/app/views/clark_kent/report_emails/_index.html.erb +3 -3
  11. data/app/views/clark_kent/report_emails/_show.html.erb +5 -5
  12. data/app/views/clark_kent/report_filters/_form.html.erb +7 -7
  13. data/app/views/clark_kent/report_filters/_index.html.erb +3 -3
  14. data/app/views/clark_kent/report_filters/_show.html.erb +5 -5
  15. data/app/views/clark_kent/reports/_date_filter.html.erb +10 -12
  16. data/app/views/clark_kent/reports/_download_link.html.erb +1 -6
  17. data/app/views/clark_kent/reports/_edit.html.erb +31 -26
  18. data/app/views/clark_kent/reports/_number_filter.html.erb +6 -6
  19. data/app/views/clark_kent/reports/_object_filter.html.erb +4 -4
  20. data/app/views/clark_kent/reports/_print_report.html.erb +1 -1
  21. data/app/views/clark_kent/reports/_show.html.erb +4 -4
  22. data/app/views/clark_kent/reports/_string_filter.html.erb +4 -4
  23. data/app/views/clark_kent/reports/edit.html.erb +4 -4
  24. data/app/views/clark_kent/reports/new.html.erb +1 -1
  25. data/app/views/clark_kent/reports/show.html.erb +4 -4
  26. data/app/views/clark_kent/user_report_emails/_form.html.erb +4 -4
  27. data/app/views/clark_kent/user_report_emails/_index.html.erb +3 -3
  28. data/app/views/clark_kent/user_report_emails/_show.html.erb +3 -3
  29. data/lib/clark_kent/version.rb +1 -1
  30. data/test/dummy/db/development.sqlite3 +0 -0
  31. data/test/dummy/db/test.sqlite3 +0 -0
  32. data/test/dummy/log/development.log +1 -0
  33. data/test/dummy/log/test.log +519 -23772
  34. metadata +51 -49
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 891318c6af29ae0c9bdb151d429053a54576e557
4
- data.tar.gz: b6d05cb1bf8a5e1c1c551cc27ddda83dd000f85b
2
+ SHA256:
3
+ metadata.gz: 9e552df82e37d03aacc458fdcbfcccb935f8e3910506ba5efac88b0a8559465d
4
+ data.tar.gz: 2c4d34bac0e68e8418f771b4dd2932c1cfd3ef29cc0b0462e3032e393721437c
5
5
  SHA512:
6
- metadata.gz: 296f80f982ccc0948cb679ce630d42474c74e007ac3b84f39239e6d94b10760dda476d3386559275efa372ec6088caed44ea6279143c39ae4c0b0b20b3074cfd
7
- data.tar.gz: dcc55a7d3b67db0463a16ef2dfe5739a08182147b3cfaedc6abe262de8c903c12a53c9d3dab850e62ed1d9b924e1019f9f372ddce05f9929a666e5e4fdc2f937
6
+ metadata.gz: 6ad6cb7c1c77e05a15ec52c2e95abfbcdf6f0d4e2ee2c3091127a0a50b48fb02329ffb2b099b3103b7092ae5721cdab733226743a2049fb6d82b146d57e8996d
7
+ data.tar.gz: 01c76efd10ad930849078e2e319036e4e27b64e4e88b14708a1609eb111745ca92c5f33ac7455bd64cf1459cdc9a9d8d53ad48632dc0f5b7253f8fc8573ad022
@@ -52,11 +52,11 @@ class ClarkKent::ReportsController < ClarkKent::ApplicationController
52
52
  @report_result_name = "report-#{@report.id}-#{Time.now.to_formatted_s(:number)}"
53
53
  parse_date_filters if params[:run_report].present?
54
54
  @these_params[:report_result_name] = @report_result_name
55
+ @these_params[:browser_tab_id] = @browser_tab_id
55
56
  ConeyIsland.submit(ClarkKent::Report,
56
57
  :send_report_to_s3,
57
58
  args: [@report.id, @these_params],
58
- timeout: 300,
59
- work_queue: 'boardwalk')
59
+ timeout: 300)
60
60
  render partial: 'download_link'
61
61
  end
62
62
 
@@ -4,10 +4,14 @@ require 'aws-sdk-v1'
4
4
  Dir.glob(Rails.root.join('app/models/reporting/*.rb')) { |file| load file }
5
5
  class Report < ActiveRecord::Base
6
6
  include ClarkKent::Cloneable
7
+ include ForeignOffice::Broadcaster
8
+
9
+ require_channel_presence
10
+
7
11
 
8
12
  SortDirections = {'ascending' => 'asc', 'descending' => 'desc'}
9
13
 
10
- attr_accessor :summary_row_storage
14
+ attr_accessor :summary_row_storage, :report_result_url, :browser_tab_id
11
15
 
12
16
  belongs_to :sharing_scope, polymorphic: true
13
17
  has_many :report_filters, as: :filterable, dependent: :destroy
@@ -58,17 +62,19 @@ require 'aws-sdk-v1'
58
62
  buffer << chunk
59
63
  end
60
64
  end
61
- report_result_url = report_destination.url_for(
65
+ report.report_result_url = report_destination.url_for(
62
66
  :read,
63
67
  secure: true,
64
68
  response_content_type: 'text/csv',
65
69
  response_content_encoding: 'binary',
70
+ response_content_disposition: 'attachment',
66
71
  expires: 60*60*24*30 #good for 30 days
67
72
  )
68
73
  if 'ClarkKent::Report' == report_class.name
69
- ForeignOffice.publish(channel: params[:report_result_name], object: {report_result_url: report_result_url.to_s} )
74
+ report.browser_tab_id = params[:browser_tab_id]
75
+ report.broadcast_change
70
76
  end
71
- report_result_url.to_s
77
+ report.report_result_url.to_s
72
78
  end
73
79
 
74
80
  def viable_report_columns
@@ -315,6 +321,11 @@ require 'aws-sdk-v1'
315
321
  end
316
322
  end
317
323
 
324
+ def serialize
325
+ { report_result_url: self.report_result_url,
326
+ browser_tab_id: self.browser_tab_id
327
+ }
328
+ end
318
329
  end
319
330
 
320
331
  class ReportSort
@@ -4,8 +4,12 @@ module ClarkKent
4
4
 
5
5
  def self.all
6
6
  return @ss_types if @ss_types
7
- user_ss = self.new(ClarkKent.user_class_name)
8
- @ss_types = [user_ss]
7
+ if ClarkKent.user_class_name
8
+ user_ss = self.new(ClarkKent.user_class_name)
9
+ @ss_types = [user_ss]
10
+ else
11
+ @ss_types = []
12
+ end
9
13
  ClarkKent.other_sharing_scopes.each do |ss_type|
10
14
  @ss_types << self.new(*ss_type)
11
15
  end
@@ -1,4 +1,4 @@
1
- <div class="ih-row editing">
1
+ <div class="srow editing">
2
2
  <%= simple_form_for report_column,
3
3
  defaults: {
4
4
  wrapper_html: { class: 'span2'},
@@ -13,31 +13,31 @@
13
13
  insert_method: report_column.new_record? ? 'append' : 'html',
14
14
  container: '#new_report_column_container',
15
15
  ajax_flash: true } } do |f| %>
16
- <div class="ih-span one-fifth">
16
+ <div class="scol one-fifth">
17
17
  <%= f.input :report_id, as: :hidden %>
18
18
  <% if report_column.new_record? %>
19
19
  <%= f.input :column_name, collection: @report.available_columns, prompt: 'select column' %>
20
20
  <% else %>
21
- <div class="ih-row quiet">Column Name</div>
22
- <div class="ih-row"><%= report_column.column_name %></div>
21
+ <div class="srow quiet">Column Name</div>
22
+ <div class="srow"><%= report_column.column_name %></div>
23
23
  <% end %>
24
24
  </div>
25
- <div class="ih-span one-fifth">
25
+ <div class="scol one-fifth">
26
26
  <%= f.input :column_order %>
27
27
  </div>
28
- <div class="ih-span one-fifth">
28
+ <div class="scol one-fifth">
29
29
  <% if !report_column.new_record? and report_column.summarizable? %>
30
30
  <%= f.input :summary_method, collection: ClarkKent::ReportColumn::SummaryMethods %>
31
31
  <% else %>
32
32
  &nbsp;
33
33
  <% end %>
34
34
  </div>
35
- <div class="ih-span one-fifth">
35
+ <div class="scol one-fifth">
36
36
  <% if report_column.report.sort_column.blank? || report_column.report.sort_column == report_column %>
37
37
  <%= f.input :report_sort, collection: [['A->Z','ascending'],['Z->A','descending']], include_blank: true %>
38
38
  <% end %>
39
39
  </div>
40
- <div class="ih-span right margin-top">
40
+ <div class="scol right margin-top">
41
41
  <%= f.button :submit %>
42
42
  <% unless report_column.new_record? %>
43
43
  &nbsp; <%= link_to 'cancel', report_column_url(report_column),
@@ -1,16 +1,16 @@
1
1
  <div id="report_column_container">
2
2
  <h3>Report Columns</h3>
3
- <div id="report_column_list" class="ih-row">
3
+ <div id="report_column_list" class="srow">
4
4
  <% @report.viable_report_columns.each do |report_column| %>
5
5
  <%= render partial: '/clark_kent/report_columns/show_wrapper', locals: {report_column: report_column} %>
6
6
  <% end %>
7
7
  </div>
8
8
 
9
- <div class="ih-row margin-top">
9
+ <div class="srow margin-top">
10
10
  <%= link_to 'Add a Column', new_report_column_url(report_id: @report.id), class: 'btn btn-primary', data: {ajax_link: "true", ajax_target: '#new_report_column_container'} %>
11
11
  </div>
12
12
 
13
- <div id="new_report_column_container" class="ih-row margin-top">
13
+ <div id="new_report_column_container" class="srow margin-top">
14
14
 
15
15
  </div>
16
16
  </div>
@@ -1,17 +1,17 @@
1
- <div class="ih-row read-only">
2
- <div class="ih-span one-fifth">
1
+ <div class="srow read-only report-element">
2
+ <div class="scol one-fifth">
3
3
  <%= report_column.column_name %>
4
4
  </div>
5
- <div class="ih-span one-fifth">
5
+ <div class="scol one-fifth">
6
6
  <%= report_column.column_order %>
7
7
  </div>
8
- <div class="ih-span one-fifth">
8
+ <div class="scol one-fifth">
9
9
  <%= report_column.summary_method.present? ? "summarize: #{report_column.summary_method}" : '' %>
10
10
  </div>
11
- <div class="ih-span one-fifth">
11
+ <div class="scol one-fifth">
12
12
  <%= report_column.report_sort_pretty %>
13
13
  </div>
14
- <div class="ih-span right">
14
+ <div class="scol right">
15
15
  <%= link_to 'edit', edit_report_column_url(report_column),
16
16
  data: {
17
17
  ajax_link: true,
@@ -1,10 +1,10 @@
1
- <div class="ih-row editing">
1
+ <div class="srow editing">
2
2
  <%= render partial: '/clark_kent/report_emails/form', locals: {report_email: report_email} %>
3
3
  <% unless report_email.new_record? %>
4
- <div class="well margin-top ih-row">
4
+ <div class="well margin-top srow">
5
5
  <%= render partial: '/clark_kent/report_filters/index', locals: {filterable: report_email} %>
6
6
  </div>
7
- <div class="well margin-top ih-row">
7
+ <div class="well margin-top srow">
8
8
  <%= render partial: '/clark_kent/user_report_emails/index', locals: {report_email: report_email} %>
9
9
  </div>
10
10
  <% end %>
@@ -15,14 +15,14 @@
15
15
  insert_method: report_email.new_record? ? 'append' : 'html',
16
16
  container: "new_report_email_container_#{report_email.report_id}",
17
17
  ajax_flash: true }} do |f| %>
18
- <div class="ih-span one-third">
18
+ <div class="scol one-third">
19
19
  <%= f.input :name %>
20
20
  </div>
21
- <div class="ih-span one-third">
21
+ <div class="scol one-third">
22
22
  <%= f.input :report_id, as: :hidden %>
23
23
  <%= f.input :when_to_send, collection: ClarkKent::ReportEmail::SEND_TIMES, include_blank: false %>
24
24
  </div>
25
- <div class="ih-span one-third right margin-top">
25
+ <div class="scol one-third right margin-top">
26
26
  <%= f.button :submit %>
27
27
  <% unless report_email.new_record? %>
28
28
  &nbsp; <%= link_to 'cancel', report_email_url(report_email),
@@ -1,16 +1,16 @@
1
1
  <div id="report_email_container">
2
2
  <h3>Timed Emails</h3>
3
- <div id="report_email_list" class="ih-row">
3
+ <div id="report_email_list" class="srow">
4
4
  <% for report_email in @report.report_emails %>
5
5
  <%= render partial: '/clark_kent/report_emails/show_wrapper', locals: {report_email: report_email} %>
6
6
  <% end %>
7
7
  </div>
8
8
 
9
- <div class="ih-row margin-top">
9
+ <div class="srow margin-top">
10
10
  <%= link_to 'Add a timed email', new_report_email_url(report_id: @report.id), class: 'btn btn-primary', data: {ajax_link: "true", ajax_target: "#new_report_email_container_#{@report.id}" } %>
11
11
  </div>
12
12
 
13
- <div id="new_report_email_container_<%= @report.id %>" class="ih-row margin-top">
13
+ <div id="new_report_email_container_<%= @report.id %>" class="srow margin-top">
14
14
 
15
15
  </div>
16
16
  </div>
@@ -1,17 +1,17 @@
1
- <div class="ih-row read-only">
2
- <div class="ih-span one-quarter">
1
+ <div class="srow read-only report-element">
2
+ <div class="scol one-quarter">
3
3
  <%= report_email.name %> <span class="quiet">send</span> <%= report_email.when_to_send %>
4
4
  </div>
5
- <div class="ih-span one-quarter">
5
+ <div class="scol one-quarter">
6
6
  <%= link_to 'edit', edit_report_email_url(report_email),
7
7
  data: {
8
8
  ajax_link: true,
9
9
  ajax_target: "#report_email_#{report_email.id}" } %>
10
10
  </div>
11
- <div class="ih-span one-quarter">
11
+ <div class="scol one-quarter">
12
12
  <%= report_email.period_pretty %>
13
13
  </div>
14
- <div class="ih-span one-quarter">
14
+ <div class="scol one-quarter">
15
15
  <%= display_for_value(report_email.emails) %>
16
16
  </div>
17
17
  </div>
@@ -1,4 +1,4 @@
1
- <div class="ih-row editing">
1
+ <div class="srow editing">
2
2
  <%= simple_form_for report_filter,
3
3
  as: report_filter,
4
4
  url: report_filter.new_record? ? report_filters_url : report_filter_url(report_filter),
@@ -16,7 +16,7 @@
16
16
  insert_method: report_filter.new_record? ? 'append' : 'html',
17
17
  container: dom_target(report_filter.filterable, :new_report_filter_container),
18
18
  ajax_flash: true } } do |f| %>
19
- <div class="ih-span one-third">
19
+ <div class="scol one-third">
20
20
  <%= f.input :filterable_id, as: :hidden %>
21
21
  <%= f.input :filterable_type, as: :hidden %>
22
22
  <% if report_filter.new_record? %>
@@ -26,12 +26,12 @@
26
26
  id: "report_filter_filter_name_#{report_filter.object_id}"),
27
27
  include_blank: false %>
28
28
  <% else %>
29
- <div class="ih-row quiet">Filter Name</div>
30
- <div class="ih-row"><%= report_filter.filter_name %></div>
29
+ <div class="srow quiet">Filter Name</div>
30
+ <div class="srow"><%= report_filter.filter_name %></div>
31
31
  <% end %>
32
32
  </div>
33
33
  <% if report_filter.new_record? %>
34
- <div class="ih-span one-third" <%= revealer_target_attrs("filter_value_options_#{report_filter.object_id}") %>>
34
+ <div class="scol one-third" <%= revealer_target_attrs("filter_value_options_#{report_filter.object_id}") %>>
35
35
  <% report_filter.filterable.available_filters.each do |name,label| %>
36
36
  <div <%= revealer_option_attrs("filter_value_options_#{report_filter.object_id}", trigger: name) %> id="filter_value_options_<%= name %>">
37
37
  <%= render partial: report_filter.filterable.filter_kind(name) + '_edit', locals: {f: f, report_filter: report_filter, name: name} %>
@@ -39,11 +39,11 @@
39
39
  <% end %>
40
40
  </div>
41
41
  <% else %>
42
- <div class="ih-span one-third">
42
+ <div class="scol one-third">
43
43
  <%= render partial: report_filter.filterable.filter_kind(report_filter.filter_name) + '_edit', locals: {f: f, report_filter: report_filter, name: report_filter.filter_name} %>
44
44
  </div>
45
45
  <% end %>
46
- <div class="ih-span right margin-top">
46
+ <div class="scol right margin-top">
47
47
  <%= f.button :submit %>
48
48
  <% if report_filter.new_record? %>
49
49
  &nbsp; <a <%= emptier dom_target(report_filter.filterable, :new_report_filter_container) %>> cancel </a>
@@ -1,16 +1,16 @@
1
1
  <div id="report_filter_container_<%= dom_id(filterable) %>">
2
2
  <h3><%= filterable.class.name.sub('ClarkKent::','').underscore.humanize %> Filters</h3>
3
- <div id="report_filter_list_<%= dom_id(filterable) %>" class="ih-row">
3
+ <div id="report_filter_list_<%= dom_id(filterable) %>" class="srow">
4
4
  <% for report_filter in filterable.viable_report_filters %>
5
5
  <%= render partial: '/clark_kent/report_filters/show_wrapper', locals: {report_filter: report_filter} %>
6
6
  <% end %>
7
7
  </div>
8
8
 
9
- <div class="ih-row margin-top">
9
+ <div class="srow margin-top">
10
10
  <%= link_to 'Add a Filter', new_report_filter_url(filterable_id: filterable.id, filterable_type: filterable.class.name), class: 'btn btn-primary', data: {ajax_link: "true", ajax_target: "#new_report_filter_container_#{dom_id(filterable)}" } %>
11
11
  </div>
12
12
 
13
- <div id="<%= dom_id filterable, :new_report_filter_container %>" class="ih-row margin-top">
13
+ <div id="<%= dom_id filterable, :new_report_filter_container %>" class="srow margin-top">
14
14
 
15
15
  </div>
16
16
  </div>
@@ -1,11 +1,11 @@
1
- <div class="ih-row read-only">
2
- <div class="ih-span one-third">
3
- <%= report_filter.display_name %>
1
+ <div class="srow read-only report-element">
2
+ <div class="scol one-third">
3
+ <%= report_filter.display_name %> ->
4
4
  </div>
5
- <div class="ih-span one-third">
5
+ <div class="scol one-third">
6
6
  <%= render partial: '/clark_kent/report_filters/' + report_filter.filterable.filter_kind(report_filter.filter_name) + '_show', locals: {report_filter: report_filter} %>
7
7
  </div>
8
- <div class="ih-span right">
8
+ <div class="scol right">
9
9
  <%= link_to 'edit', edit_report_filter_url(report_filter),
10
10
  data: {
11
11
  ajax_link: true,
@@ -1,24 +1,22 @@
1
- <div class="ih-span one-quarter">
2
- <div class="ih-row">
3
- <%= filter.label.humanize %>
1
+ <div class="scol one-quarter report-filter">
2
+ <div class="srow">
3
+ <b><%= filter.label.humanize %></b>
4
4
  </div>
5
- <div class="ih-row">
6
- <div class="ih-span">
5
+ <div class="srow">
6
+ <div class="scol">
7
7
  from<br>
8
- <%= text_field_tag "#{filter.param}_from",
8
+ <%= date_field_tag "#{filter.param}_from",
9
9
  params["#{filter.param}_from"],
10
- data: {date_picker: 'true', sub_type: 'DatePickerLoader'},
10
+ data: {date_picker: 'true'},
11
11
  class: 'string input-small',
12
- readonly: true,
13
12
  id: "#{filter.param}_start_date" %>
14
13
  </div>
15
- <div class="ih-span">
14
+ <div class="scol">
16
15
  to<br>
17
- <%= text_field_tag "#{filter.param}_until",
16
+ <%= date_field_tag "#{filter.param}_until",
18
17
  params["#{filter.param}_until"],
19
- data: {date_picker: 'true', sub_type: 'DatePickerLoader'},
18
+ data: {date_picker: 'true'},
20
19
  class: 'string input-small',
21
- readonly: true,
22
20
  id: "#{filter.param}_end_date" %>
23
21
  </div>
24
22
  </div>
@@ -1,11 +1,6 @@
1
1
  <% if @report_result_name %>
2
2
  <%= link_to 're-download full csv', '',
3
- data: {
4
- listener: true,
5
- channel: @report_result_name,
6
- key: 'report_result_url',
7
- progress_indicator: true,
8
- trigger_on_message: true } %>
3
+ data: listener_hash(@report, :report_result_url, browser_tab_id: @browser_tab_id, trigger: true ) %>
9
4
  <% else %>
10
5
  <%= link_to 'download full csv', (download_link_report_url(@report.id) + '?' + request.query_parameters.to_param),
11
6
  data: {
@@ -1,44 +1,49 @@
1
- <div class="ih-row">
1
+ <div class="srow">
2
2
  <%= simple_form_for @report, html: @report.persisted? ? ajax_form_hash( '#report_info_container' ) : {} do |f| %>
3
- <div class="ih-span one-quarter">
3
+ <div class="scol one-quarter">
4
4
  <%= f.input :name, minlength: false %>
5
5
  </div>
6
- <div class="ih-span one-quarter">
6
+ <div class="scol one-quarter">
7
7
  <%= f.input :resource_type,
8
8
  collection: ClarkKent.resource_options,
9
9
  label: 'A row for every:',
10
10
  prompt: 'Please Choose' %>
11
11
 
12
12
  </div>
13
- <div class="ih-span one-quarter">
14
- <div class="ih-row">sharing</div>
15
- <div class="ih-row">
16
- <%= f.input :sharing_scope_type, collection: ClarkKent::SharingScopeKind.select_options_for_user(clark_kent_user),
17
- input_html: revealer("sharing_options", highlander: true),
18
- label: false, include_blank: false %>
19
- </div>
20
- <div class="ih-row" <%= revealer_target_attrs("sharing_options") %>>
21
- <%= f.input :sharing_scope_id, as: :hidden, input_html: {value: clark_kent_user.id, data: {foo: ClarkKent.user_class_name}}, wrapper_html: revealer_option("sharing_options", trigger: ClarkKent.user_class_name).merge(id: "sharing_options_#{ClarkKent.user_class_name}") %>
22
- <% ClarkKent::SharingScopeKind.custom_for_user(clark_kent_user).each do |sharing_scope_kind| %>
23
- <% if sharing_scope_kind.associated_containers_for(clark_kent_user).respond_to? :each %>
24
- <%= f.input :sharing_scope_id, collection: sharing_scope_kind.associated_containers_for(clark_kent_user), label: false, include_blank: false,
25
- wrapper_html: revealer_option("sharing_options", trigger: sharing_scope_kind.class_name).merge(id: "sharing_options_#{sharing_scope_kind.class_name}") %>
26
- <% else %>
27
- <%= f.input :sharing_scope_id, as: :hidden, input_html: {value: sharing_scope_kind.associated_containers_for(clark_kent_user).id}, wrapper_html: revealer_option("sharing_options", trigger: sharing_scope_kind.associated_containers_for(clark_kent_user).class.name).merge(id: "sharing_options_#{sharing_scope_kind.associated_containers_for(clark_kent_user).class.name}") %>
13
+ <% if ClarkKent.user_class_name %>
14
+ <div class="scol one-quarter">
15
+ <div class="srow">sharing</div>
16
+ <div class="srow">
17
+ <%= f.input :sharing_scope_type, collection: ClarkKent::SharingScopeKind.select_options_for_user(clark_kent_user),
18
+ input_html: revealer("sharing_options", highlander: true),
19
+ label: false, include_blank: false %>
20
+ </div>
21
+ <div class="srow" <%= revealer_target_attrs("sharing_options") %>>
22
+ <%= f.input :sharing_scope_id, as: :hidden, input_html: {value: clark_kent_user.id, data: {foo: ClarkKent.user_class_name}}, wrapper_html: revealer_option("sharing_options", trigger: ClarkKent.user_class_name).merge(id: "sharing_options_#{ClarkKent.user_class_name}") %>
23
+ <% ClarkKent::SharingScopeKind.custom_for_user(clark_kent_user).each do |sharing_scope_kind| %>
24
+ <% if sharing_scope_kind.associated_containers_for(clark_kent_user).respond_to? :each %>
25
+ <%= f.input :sharing_scope_id, collection: sharing_scope_kind.associated_containers_for(clark_kent_user), label: false, include_blank: false,
26
+ wrapper_html: revealer_option("sharing_options", trigger: sharing_scope_kind.class_name).merge(id: "sharing_options_#{sharing_scope_kind.class_name}") %>
27
+ <% else %>
28
+ <%= f.input :sharing_scope_id, as: :hidden, input_html: {value: sharing_scope_kind.associated_containers_for(clark_kent_user).id}, wrapper_html: revealer_option("sharing_options", trigger: sharing_scope_kind.associated_containers_for(clark_kent_user).class.name).merge(id: "sharing_options_#{sharing_scope_kind.associated_containers_for(clark_kent_user).class.name}") %>
29
+ <% end %>
28
30
  <% end %>
29
- <% end %>
30
- <%= f.input :sharing_scope_id, as: :hidden, input_html: {value: ''},
31
- wrapper_html: revealer_option("sharing_options", trigger: "").merge(id: "sharing_options_") %>
31
+ <%= f.input :sharing_scope_id, as: :hidden, input_html: {value: ''},
32
+ wrapper_html: revealer_option("sharing_options", trigger: "").merge(id: "sharing_options_") %>
33
+ </div>
32
34
  </div>
33
- </div>
34
- <div class="ih-span one-quarter margin-top right">
35
- <div class="ih-row">
35
+ <% else %>
36
+ <%= f.input :sharing_scope_type, as: :hidden, value: 'Everyone' %>
37
+ <%= f.input :sharing_scope_id, as: :hidden, value: 'Everyone' %>
38
+ <% end %>
39
+ <div class="scol one-quarter margin-top right">
40
+ <div class="srow">
36
41
  <%= f.button :submit %>
37
42
  <% unless @report.new_record? %>
38
43
  &nbsp; <%= ajax_link 'cancel', report_url(@report), {class: 'right'}, "#report_info_container" %>
39
44
  </div>
40
- <div class="ih-row right">or</div>
41
- <div class="ih-row">
45
+ <div class="srow right">or</div>
46
+ <div class="srow">
42
47
  <%= link_to "Delete Report", @report, class: 'right', :method=>:delete, :data => { delete_link: true, :confirm => "Are you sure you want to delete this report?" } %>
43
48
  <% end %>
44
49
  </div>
@@ -1,16 +1,16 @@
1
- <div class="ih-span one-quarter">
2
- <div class="ih-row">
3
- <%= filter.label.humanize %>
1
+ <div class="scol one-quarter report-filter">
2
+ <div class="srow">
3
+ <b><%= filter.label.humanize %></b>
4
4
  </div>
5
- <div class="ih-row">
6
- <div class="ih-span">
5
+ <div class="srow">
6
+ <div class="scol">
7
7
  min<br>
8
8
  <%= text_field_tag "#{filter.param}_min",
9
9
  params["#{filter.param}_min"],
10
10
  class: 'string input-small',
11
11
  id: "#{filter.param}_min" %>
12
12
  </div>
13
- <div class="ih-span">
13
+ <div class="scol">
14
14
  max<br>
15
15
  <%= text_field_tag "#{filter.param}_max",
16
16
  params["#{filter.param}_max"],
@@ -1,8 +1,8 @@
1
- <div class="ih-span one-quarter">
2
- <div class="ih-row">
3
- <%= filter.param.humanize %>
1
+ <div class="scol one-quarter report-filter">
2
+ <div class="srow">
3
+ <b><%= filter.param.humanize %></b>
4
4
  </div>
5
- <div class="ih-row">
5
+ <div class="srow">
6
6
  <% options = case filter.collection.class.name
7
7
  when 'String', 'Symbol'
8
8
  clark_kent_user.send(filter.collection)
@@ -11,7 +11,7 @@
11
11
  &nbsp;
12
12
  </div>
13
13
  <div class="modal-body">
14
- <p> You will only be printing the current page of results (50 of <%= @rows.total_count %> total results).
14
+ <p> You will only be printing the current page of results (<%= @report.resource_class.default_per_page %> of <%= @rows.total_count %> total results).
15
15
  To print all results click the <strong>download full csv</strong> link at the bottom of the page.</p>
16
16
  <div class="row-fluid" >
17
17
  <div class="span8"></div>
@@ -1,13 +1,13 @@
1
- <div class="ih-span one-quarter">
1
+ <div class="scol one-quarter">
2
2
  <%= @report.name %>
3
3
  </div>
4
- <div class="ih-span one-quarter">
4
+ <div class="scol one-quarter">
5
5
  <span class="quiet">a row for every</span> <%= @report.resource_type_pretty.singularize %>
6
6
  </div>
7
- <div class="ih-span one-quarter">
7
+ <div class="scol one-quarter">
8
8
  <span class="quite">shared with</span> <%= @report.sharing_scope_pretty %>
9
9
  </div>
10
- <div class="ih-span one-quarter right">
10
+ <div class="scol one-quarter right">
11
11
  <%= link_to 'clone', clone_report_url(@report),
12
12
  method: :post,
13
13
  style: 'margin-left: 10px',
@@ -1,8 +1,8 @@
1
- <div class="ih-span one-quarter">
2
- <div class="ih-row">
3
- <%= filter.param.humanize %>
1
+ <div class="scol one-quarter report-filter">
2
+ <div class="srow">
3
+ <b><%= filter.param.humanize %></b>
4
4
  </div>
5
- <div class="ih-row">
5
+ <div class="srow">
6
6
  <%= text_field_tag filter.param, params[filter.param] %>
7
7
 
8
8
  </div>
@@ -2,20 +2,20 @@
2
2
  <%= link_to "&larr; back to report index".html_safe, reports_url %>
3
3
 
4
4
 
5
- <div class="ih-row margin-top">
5
+ <div class="srow margin-top">
6
6
  <div id="report_info_container">
7
7
  <%= render partial: 'show' %>
8
8
  </div>
9
9
  </div>
10
10
 
11
11
  <% unless @report.new_record? %>
12
- <div class="well margin-top ih-row">
12
+ <div class="well srow">
13
13
  <%= render partial: '/clark_kent/report_filters/index', locals: {filterable: @report} %>
14
14
  </div>
15
- <div class="well margin-top ih-row">
15
+ <div class="well srow">
16
16
  <%= render partial: '/clark_kent/report_columns/index' %>
17
17
  </div>
18
- <div class="well margin-top ih-row">
18
+ <div class="well srow">
19
19
  <%= render partial: '/clark_kent/report_emails/index' %>
20
20
  </div>
21
21
  <% end %>
@@ -2,7 +2,7 @@
2
2
  <%= link_to "&larr; back to report index".html_safe, reports_url %>
3
3
 
4
4
 
5
- <div class="ih-row margin-top">
5
+ <div class="srow margin-top">
6
6
  <div id="report_info_container">
7
7
  <%= render partial: 'edit' %>
8
8
  </div>
@@ -6,7 +6,7 @@
6
6
  <%= @errors %>
7
7
  </div>
8
8
  <% end %>
9
- <div class="ih-row margin-top">
9
+ <div class="srow margin-top">
10
10
  <form action="<%= report_url(@report) %>" method="get">
11
11
  <% @report.custom_filters.each do |filter| %>
12
12
  <%= render partial: filter.kind, locals: {filter: filter} %>
@@ -17,7 +17,7 @@
17
17
  </form>
18
18
  </div>
19
19
  <% if @rows %>
20
- <div class="ih-row margin-top">
20
+ <div class="srow margin-top">
21
21
  <table class="stripey-table">
22
22
  <tr>
23
23
  <% @report.report_columns.sorted.each do |column| %>
@@ -39,10 +39,10 @@
39
39
  <% end %>
40
40
  </table>
41
41
  </div>
42
- <div class="ih-row margin-top">
42
+ <div class="srow margin-top">
43
43
  <%= paginate @rows %>
44
44
  <div id="download_link"><%= render partial: 'download_link' %></div>
45
45
  </div>
46
46
  <% end %>
47
- <div class="ih-span">&nbsp;</div>
47
+ <div class="scol">&nbsp;</div>
48
48