tolaria 1.1.2 → 1.2.0

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.
Files changed (36) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +8 -1
  3. data/app/assets/fonts/admin/fontawesome.eot +0 -0
  4. data/app/assets/fonts/admin/fontawesome.svg +39 -24
  5. data/app/assets/fonts/admin/fontawesome.ttf +0 -0
  6. data/app/assets/fonts/admin/fontawesome.woff +0 -0
  7. data/app/assets/fonts/admin/fontawesome.woff2 +0 -0
  8. data/app/assets/javascripts/admin/base.js +1 -0
  9. data/app/assets/javascripts/admin/lib/autosize.js +262 -0
  10. data/app/assets/javascripts/admin/lib/backbone.js +242 -216
  11. data/app/assets/javascripts/admin/lib/jquery.chosen.js +1 -1
  12. data/app/assets/javascripts/admin/lib/jquery.js +1 -1
  13. data/app/assets/javascripts/admin/lib/jquery.selection.js +1 -1
  14. data/app/assets/javascripts/admin/lib/moment.js +301 -189
  15. data/app/assets/javascripts/admin/views/fields/attachment_field.js +1 -0
  16. data/app/assets/javascripts/admin/views/fields/textarea.js +9 -0
  17. data/app/assets/stylesheets/admin/components/_buttons.scss +7 -1
  18. data/app/assets/stylesheets/admin/components/_navigation.scss +7 -12
  19. data/app/assets/stylesheets/admin/settings/_icons.scss +81 -1
  20. data/app/controllers/tolaria/resource_controller.rb +3 -3
  21. data/app/helpers/admin/table_helper.rb +5 -5
  22. data/app/views/admin/administrators/_show.html.erb +2 -2
  23. data/app/views/admin/shared/forms/_markdown_composer.html.erb +3 -1
  24. data/app/views/admin/tolaria_resource/_form_buttons.html.erb +12 -3
  25. data/app/views/admin/tolaria_resource/_search_form.html.erb +1 -1
  26. data/app/views/admin/tolaria_resource/edit.html.erb +7 -1
  27. data/app/views/admin/tolaria_resource/index.html.erb +11 -4
  28. data/app/views/admin/tolaria_resource/show.html.erb +13 -4
  29. data/lib/tasks/admin.rake +16 -7
  30. data/lib/tolaria/default_config.rb +1 -0
  31. data/lib/tolaria/form_buildable.rb +3 -2
  32. data/lib/tolaria/version.rb +1 -1
  33. data/test/integration/{interface_test.rb → crud_test.rb} +19 -3
  34. data/test/integration/filter_preservation_test.rb +61 -0
  35. data/tolaria.gemspec +1 -0
  36. metadata +9 -6
@@ -5,6 +5,7 @@ var AttachmentFieldView = Backbone.View.extend({
5
5
  this.$label = this.$(".attachment-field-label");
6
6
  this.$icon = this.$(".icon");
7
7
  this.$preview = this.$(".attachment-field-preview");
8
+ this.refreshLabel();
8
9
  },
9
10
 
10
11
  activateFileInput: function(event) {
@@ -0,0 +1,9 @@
1
+ var TextareaView = Backbone.View.extend({
2
+
3
+ initialize: function() {
4
+ autosize(this.$el);
5
+ },
6
+
7
+ });
8
+
9
+ FormOrchestrator.register("textarea:not(.markdown-composer-textarea, .disable-autosize)", "TextareaView");
@@ -13,17 +13,23 @@
13
13
  font-weight: bold;
14
14
  height: 32px;
15
15
  line-height: 30px;
16
+ margin: 0 0 5px 0;
16
17
  padding: 0px 14px 0px 12px;
17
- vertical-align: middle;
18
18
  transition: background-color 100ms linear, border-color 100ms linear;
19
+ vertical-align: middle;
19
20
  white-space: nowrap;
20
21
 
22
+ @include min-width($bpFull) {
23
+ margin: 0;
24
+ }
25
+
21
26
  &.-small {
22
27
  transition: none;
23
28
  font-size: 12px;
24
29
  line-height: 16px;
25
30
  padding: 2px 9px 2px 9px;
26
31
  height: auto;
32
+ margin: 0;
27
33
  .icon {
28
34
  font-size: 12px;
29
35
  }
@@ -4,8 +4,8 @@
4
4
  z-index: 99999;
5
5
 
6
6
  @include max-width($bpFull - 1px) {
7
- @include clearfix;
8
7
 
8
+ @include clearfix;
9
9
  background-color: $cCoolGrey;
10
10
  border-bottom: 3px double $cGrey;
11
11
  margin-left: -20px;
@@ -17,26 +17,21 @@
17
17
  margin: 0;
18
18
  position: absolute;
19
19
  width: 100%;
20
-
21
- -webkit-transition: -webkit-transform 300ms cubic-bezier(0.215, 0.61, 0.355, 1);
22
- transition: transform 300ms cubic-bezier(0.215, 0.61, 0.355, 1);
23
-
24
- -webkit-transform: translateY(-100%);
25
- transform: translateY(-100%);
26
-
20
+ transition: transform 300ms cubic-bezier(0.215, 0.61, 0.355, 1);
21
+ transform: translateY(-100%);
27
22
  &.-open {
28
- -webkit-transform: translateY(0);
29
- transform: translateY(0);
23
+ transform: translateY(0);
30
24
  }
31
25
  }
26
+
32
27
  }
33
28
 
34
29
  @include min-width($bpFull) {
35
- width: 16%;
36
30
  border-bottom: 0;
37
- padding: 0;
38
31
  display: table-cell;
32
+ padding: 0 0 15px 0;
39
33
  vertical-align: top;
34
+ width: 16%;
40
35
  }
41
36
 
42
37
  }
@@ -22,7 +22,7 @@
22
22
 
23
23
  // ----------------------------------------------------------------------------
24
24
  // ICON CLASSES
25
- // Modified from Font Awesome 4.3.0
25
+ // Modified from Font Awesome 4.5.0
26
26
  // ----------------------------------------------------------------------------
27
27
 
28
28
  .icon-glass:before {
@@ -2453,3 +2453,83 @@
2453
2453
  .icon-fonticons:before {
2454
2454
  content: "\f280";
2455
2455
  }
2456
+
2457
+ .icon-reddit-alien:before {
2458
+ content: "\f281";
2459
+ }
2460
+
2461
+ .icon-edge:before {
2462
+ content: "\f282";
2463
+ }
2464
+
2465
+ .icon-credit-card-alt:before {
2466
+ content: "\f283";
2467
+ }
2468
+
2469
+ .icon-codiepie:before {
2470
+ content: "\f284";
2471
+ }
2472
+
2473
+ .icon-modx:before {
2474
+ content: "\f285";
2475
+ }
2476
+
2477
+ .icon-fort-awesome:before {
2478
+ content: "\f286";
2479
+ }
2480
+
2481
+ .icon-usb:before {
2482
+ content: "\f287";
2483
+ }
2484
+
2485
+ .icon-product-hunt:before {
2486
+ content: "\f288";
2487
+ }
2488
+
2489
+ .icon-mixcloud:before {
2490
+ content: "\f289";
2491
+ }
2492
+
2493
+ .icon-scribd:before {
2494
+ content: "\f28a";
2495
+ }
2496
+
2497
+ .icon-pause-circle:before {
2498
+ content: "\f28b";
2499
+ }
2500
+
2501
+ .icon-pause-circle-o:before {
2502
+ content: "\f28c";
2503
+ }
2504
+
2505
+ .icon-stop-circle:before {
2506
+ content: "\f28d";
2507
+ }
2508
+
2509
+ .icon-stop-circle-o:before {
2510
+ content: "\f28e";
2511
+ }
2512
+
2513
+ .icon-shopping-bag:before {
2514
+ content: "\f290";
2515
+ }
2516
+
2517
+ .icon-shopping-basket:before {
2518
+ content: "\f291";
2519
+ }
2520
+
2521
+ .icon-hashtag:before {
2522
+ content: "\f292";
2523
+ }
2524
+
2525
+ .icon-bluetooth:before {
2526
+ content: "\f293";
2527
+ }
2528
+
2529
+ .icon-bluetooth-b:before {
2530
+ content: "\f294";
2531
+ }
2532
+
2533
+ .icon-percent:before {
2534
+ content: "\f295";
2535
+ }
@@ -1,7 +1,7 @@
1
1
  class Tolaria::ResourceController < Tolaria::TolariaController
2
2
 
3
3
  before_filter :load_managed_class!
4
- before_filter :strip_invalid_ransack_params!, only:[:index]
4
+ before_filter :strip_invalid_ransack_params!
5
5
 
6
6
  def index
7
7
  @search = @managed_class.klass.ransack(params[:q])
@@ -92,8 +92,8 @@ class Tolaria::ResourceController < Tolaria::TolariaController
92
92
  # Returns a path we should redirect to when the form is completed successfully.
93
93
  # Handles route forbidding cases.
94
94
  def form_completion_redirect_path(managed_class, resource = nil)
95
- if managed_class.allows? :index
96
- url_for([:admin, managed_class.klass])
95
+ if managed_class.allows?(:index) && params[:save_and_review].blank?
96
+ url_for(action:"index", q:params[:q])
97
97
  elsif managed_class.allows?(:show) && resource.present?
98
98
  url_for(action:"show", id:resource.id)
99
99
  elsif managed_class.allows?(:edit) && resource.present?
@@ -137,9 +137,9 @@ module Admin::TableHelper
137
137
  end
138
138
 
139
139
  if @managed_class.allows? :edit
140
- link = url_for(action:"edit", id:resource.id)
140
+ link = url_for(action:"edit", id:resource.id, q:params[:q])
141
141
  elsif @managed_class.allows? :show
142
- link = url_for(action:"show", id:resource.id)
142
+ link = url_for(action:"show", id:resource.id, q:params[:q])
143
143
  else
144
144
  link = "#" # Guh, painted ourseves into a corner here
145
145
  end
@@ -162,15 +162,15 @@ module Admin::TableHelper
162
162
  links = []
163
163
 
164
164
  if @managed_class.allows?(:edit)
165
- links << link_to("Edit", url_for(action:"edit", id:resource.id), class:"button -small")
165
+ links << link_to("Edit", url_for(action:"edit", id:resource.id, q:params[:q]), class:"button -small")
166
166
  end
167
167
 
168
168
  if @managed_class.allows?(:show)
169
- links << link_to("Inspect", url_for(action:"show", id:resource.id), class:"button -small")
169
+ links << link_to("Inspect", url_for(action:"show", id:resource.id, q:params[:q]), class:"button -small")
170
170
  end
171
171
 
172
172
  if @managed_class.allows?(:destroy)
173
- links << link_to("Delete", url_for(action:"destroy", id:resource.id), class: "button -small", method: :delete, :'data-confirm' => deletion_warning(resource))
173
+ links << link_to("Delete", url_for(action:"destroy", id:resource.id, q:params[:q]), class: "button -small", method: :delete, :'data-confirm' => deletion_warning(resource))
174
174
  end
175
175
 
176
176
  return content_tag(:td, links.join("").html_safe, class:"actions-td")
@@ -4,11 +4,11 @@
4
4
  <%= show_thead_tr %>
5
5
  </thead>
6
6
  <tbody>
7
- <%= show_tr "Avatar", image_tag(gravatar_for(@resource.email)) %>
8
7
  <%= show_tr :name %>
9
8
  <%= show_tr :organization %>
10
9
  <%= show_tr :email, class:"monospace" %>
11
- <%= show_tr "Created At", @resource.created_at.presence.try(:strftime, "%Y-%m-%d %I:%M %p"), class:"monospace" %>
10
+ <%= show_tr "Created At", @resource.created_at.try(:strftime, "%Y-%m-%d %H:%M %Z"), class:"monospace" %>
11
+ <%= show_tr "Avatar", image_tag(gravatar_for(@resource.email)) %>
12
12
  </tbody>
13
13
 
14
14
  <% end %>
@@ -22,7 +22,9 @@
22
22
  </div>
23
23
 
24
24
  <div class="markdown-composer-workspace">
25
- <%= f.text_area method, options.reverse_merge({rows: 20}) %>
25
+ <% options[:class] = "markdown-composer-textarea #{options[:class]}" %>
26
+ <% options[:rows] = 20 %>
27
+ <%= f.text_area method, options %>
26
28
  <div class="markdown-composer-preview markdown-body" style="display:none"></div>
27
29
  </div>
28
30
 
@@ -1,12 +1,21 @@
1
1
  <% if @managed_class.allows? :index %>
2
- <%= link_to url_for([:admin, @managed_class.klass]), class:"button" do %>
2
+ <%= link_to url_for(action:"index", q:params[:q]), class:"button -cancel" do %>
3
3
  <%= fontawesome_icon :close %>
4
4
  Cancel
5
5
  <% end %>
6
6
  <% end %>
7
7
 
8
- <%= button_tag type:"submit", name:nil, class:"button -primary" do %>
8
+ <% if @managed_class.allows? :show %>
9
+ <%= button_tag type:"submit", name:"save_and_review", class:"button -primary -save-and-review", value:"Save & Review" do %>
10
+ <%= fontawesome_icon :check %>
11
+ <%= @resource.persisted?? "Save" : "Create" %>
12
+ <%= "& Review" %>
13
+ <% end %>
14
+ <% end %>
15
+
16
+ <%= button_tag type:"submit", name:"save", class:"button -primary -save", value:"Save" do %>
9
17
  <%= fontawesome_icon :check %>
10
18
  <%= @resource.persisted?? "Save" : "Create" %>
11
- <%= @managed_class.model_name.human.titleize %>
12
19
  <% end %>
20
+
21
+
@@ -23,7 +23,7 @@
23
23
  <% end %>
24
24
  <%= link_to url_for([:admin, @managed_class.klass]), class:"button" do %>
25
25
  <%= fontawesome_icon :close %>
26
- Close
26
+ Clear Search
27
27
  <% end %>
28
28
  </div>
29
29
 
@@ -6,13 +6,19 @@
6
6
 
7
7
  <%= form_for [:admin, @resource], url:contextual_form_url, builder:Admin::FormBuilder, html:{class:"resource-form"} do |form_builder| %>
8
8
 
9
+ <% if params[:q].present? %>
10
+ <% params[:q].each do |key, value| %>
11
+ <%= hidden_field_tag "q[#{key}]", value %>
12
+ <% end %>
13
+ <% end %>
14
+
9
15
  <div class="main-controls">
10
16
  <div class="main-controls-left">
11
17
  <h1>
12
18
  <span class="crumb">
13
19
  <%= fontawesome_icon @managed_class.icon %>
14
20
  <% if @managed_class.allows? :index %>
15
- <%= link_to @managed_class.model_name.human.pluralize.titleize, url_for(action:"index", controller:@managed_class.plural) %>
21
+ <%= link_to @managed_class.model_name.human.pluralize.titleize, url_for(action:"index", controller:@managed_class.plural, q:params[:q]) %>
16
22
  <% else %>
17
23
  <%= @managed_class.model_name.human.pluralize.titleize %>
18
24
  <% end %>
@@ -12,14 +12,21 @@
12
12
  <div class="main-controls-right">
13
13
 
14
14
  <% unless @managed_class.no_resources? %>
15
- <%= button_tag type:"button", class:"button search-form-toggle" do %>
16
- <%= fontawesome_icon :search %>
17
- Search
15
+ <% if currently_filtering? %>
16
+ <%= link_to url_for(action:"index"), class:"button" do %>
17
+ <%= fontawesome_icon :close %>
18
+ Clear Search
19
+ <% end %>
20
+ <% else %>
21
+ <%= button_tag type:"button", class:"button search-form-toggle" do %>
22
+ <%= fontawesome_icon :search %>
23
+ Search
24
+ <% end %>
18
25
  <% end %>
19
26
  <% end %>
20
27
 
21
28
  <% if @managed_class.allows?(:new) %>
22
- <%= link_to url_for(action:"new"), class:"button -primary" do %>
29
+ <%= link_to url_for(action:"new", q:params[:q]), class:"button -primary" do %>
23
30
  <%= fontawesome_icon :plus %>
24
31
  New <%= @managed_class.model_name.human.titleize %>
25
32
  <% end %>
@@ -7,7 +7,7 @@
7
7
  <span class="crumb">
8
8
  <%= fontawesome_icon @managed_class.icon %>
9
9
  <% if @managed_class.allows? :index %>
10
- <%= link_to @managed_class.model_name.human.pluralize.titleize, url_for(action:"index", controller:@managed_class.plural) %>
10
+ <%= link_to @managed_class.model_name.human.pluralize.titleize, url_for(action:"index", controller:@managed_class.plural, q:params[:q]) %>
11
11
  <% else %>
12
12
  <%= @managed_class.model_name.human.pluralize.titleize %>
13
13
  <% end %>
@@ -35,13 +35,22 @@
35
35
  <%= show_thead_tr %>
36
36
  </thead>
37
37
  <tbody>
38
+ <% if @resource.respond_to? :id %>
39
+ <%= show_tr "ID", @resource.id, class:"monospace" %>
40
+ <% end %>
41
+ <% if @resource.respond_to? :uuid %>
42
+ <%= show_tr "UUID", @resource.uuid, class:"monospace" %>
43
+ <% end %>
38
44
  <% if @resource.respond_to? :created_at %>
39
- <%= show_tr "Created At", @resource.created_at.try(:strftime, "%Y-%m-%d %I:%M %p"), class:"monospace" %>
45
+ <%= show_tr "Created At", @resource.created_at.try(:strftime, "%Y-%m-%d %H:%M %Z"), class:"monospace" %>
40
46
  <% end %>
41
47
  <% if @resource.respond_to? :updated_at %>
42
- <%= show_tr "Updated At", @resource.updated_at.try(:strftime, "%Y-%m-%d %I:%M %p"), class:"monospace" %>
48
+ <%= show_tr "Updated At", @resource.updated_at.try(:strftime, "%Y-%m-%d %H:%M %Z"), class:"monospace" %>
49
+ <% end %>
50
+ <% @resource.attributes.each do |attribute, value| %>
51
+ <% next if attribute.in?(%[id uuid created_at updated_at]) %>
52
+ <%= show_tr attribute.humanize, value %>
43
53
  <% end %>
44
- <%= show_tr "Label", Tolaria.display_name(@resource) %>
45
54
  </tbody>
46
55
  </table>
47
56
 
data/lib/tasks/admin.rake CHANGED
@@ -5,16 +5,25 @@ namespace :admin do
5
5
 
6
6
  @administrator = Administrator.new
7
7
 
8
- STDOUT.puts "Enter the new administrator’s credentials. All fields are required."
8
+ if ENV.has_key?("EMAIL") || ENV.has_key?("NAME") || ENV.has_key?("ORGANIZATION")
9
9
 
10
- STDOUT.print "Email address: "
11
- @administrator.email = STDIN.gets.chomp
10
+ # Get the administrator from environment variables
11
+ @administrator.email = ENV.fetch("EMAIL").chomp
12
+ @administrator.name = ENV.fetch("NAME").chomp
13
+ @administrator.organization = ENV.fetch("ORGANIZATION").chomp
12
14
 
13
- STDOUT.print "Full name: "
14
- @administrator.name = STDIN.gets.chomp
15
+ else
16
+
17
+ # Get the administrator interactively
18
+ STDOUT.puts "Enter the new administrator’s credentials. All fields are required."
19
+ STDOUT.print "Email address: "
20
+ @administrator.email = STDIN.gets.chomp
21
+ STDOUT.print "Full name: "
22
+ @administrator.name = STDIN.gets.chomp
23
+ STDOUT.print "Organization: "
24
+ @administrator.organization = STDIN.gets.chomp
15
25
 
16
- STDOUT.print "Organization: "
17
- @administrator.organization = STDIN.gets.chomp
26
+ end
18
27
 
19
28
  if @administrator.save
20
29
  STDOUT.puts %{The administrator "#{@administrator.name}" <#{@administrator.email}> was successfully created.}
@@ -41,6 +41,7 @@ Tolaria.configure do |config|
41
41
  authenticity_token
42
42
  id
43
43
  utf8
44
+ save_and_review
44
45
  ]
45
46
 
46
47
  end
@@ -3,8 +3,9 @@ module Tolaria
3
3
 
4
4
  # Returns a `p.hint` used to explain a nearby form field containing
5
5
  # the given `hint_text`.
6
- def hint(hint_text)
7
- content_tag(:p, content_tag(:span, hint_text.chomp), class:"hint")
6
+ def hint(hint_text, options = {})
7
+ css_class = "hint #{options.delete(:class)}"
8
+ content_tag(:p, content_tag(:span, hint_text.chomp), class:css_class, **options)
8
9
  end
9
10
 
10
11
  # Creates a `<select>` list that can be filtered by typing word fragments.
@@ -2,7 +2,7 @@ module Tolaria
2
2
 
3
3
  # Returns Tolaria’s version number
4
4
  def self.version
5
- Gem::Version.new("1.1.2")
5
+ Gem::Version.new("1.2.0")
6
6
  end
7
7
 
8
8
  module VERSION
@@ -1,6 +1,6 @@
1
1
  require "test_helper"
2
2
 
3
- class InterfaceTest < ActionDispatch::IntegrationTest
3
+ class CrudTest < ActionDispatch::IntegrationTest
4
4
 
5
5
  def setup
6
6
  BlogPost.destroy_all
@@ -37,7 +37,7 @@ class InterfaceTest < ActionDispatch::IntegrationTest
37
37
  assert page.has_content?("live here")
38
38
  end
39
39
 
40
- test "create a blog post, see it on the index, inspect it" do
40
+ test "create a blog post, see it on the index, and then inspect it" do
41
41
 
42
42
  sign_in_dummy_administrator!
43
43
  visit("/admin/blog_posts")
@@ -45,7 +45,7 @@ class InterfaceTest < ActionDispatch::IntegrationTest
45
45
  fill_in("blog_post[title]", with:"Neko Atsume")
46
46
  fill_in("blog_post[summary]", with:"Neko Atsume")
47
47
  fill_in("blog_post[body]", with:"Neko Atsume")
48
- first(".button.-primary").click
48
+ first(".button[name=save]").click
49
49
 
50
50
  assert page.current_path.include?(admin_blog_posts_path)
51
51
  assert page.has_content?("Neko Atsume")
@@ -58,6 +58,22 @@ class InterfaceTest < ActionDispatch::IntegrationTest
58
58
 
59
59
  end
60
60
 
61
+ test "create a blog post and review it" do
62
+
63
+ sign_in_dummy_administrator!
64
+ visit("/admin/blog_posts")
65
+ first(".button.-primary").click
66
+ fill_in("blog_post[title]", with:"Neko Atsume")
67
+ fill_in("blog_post[summary]", with:"Neko Atsume")
68
+ fill_in("blog_post[body]", with:"Neko Atsume")
69
+ first(".button[name=save_and_review]").click
70
+
71
+ assert page.current_path.include?(admin_blog_post_path(BlogPost.first.id))
72
+ assert page.has_content?("Neko Atsume")
73
+ assert page.has_content?("created the"), "should see flash message"
74
+
75
+ end
76
+
61
77
  test "blog post fails validation and sees flash message" do
62
78
 
63
79
  sign_in_dummy_administrator!
@@ -0,0 +1,61 @@
1
+ require "test_helper"
2
+
3
+ class FilterPreservationTest < ActionDispatch::IntegrationTest
4
+
5
+ def setup
6
+ BlogPost.destroy_all
7
+ end
8
+
9
+ def teardown
10
+ BlogPost.destroy_all
11
+ end
12
+
13
+ test "after filtering index, should retain filter on edit and back with crumb" do
14
+ sign_in_dummy_administrator!
15
+ visit("/admin/administrators")
16
+ find_link("Organization").click
17
+ find_link("Nintendo").click
18
+ first(".crumb a").click
19
+ assert page.current_url.include?("q[s]=organization+asc"), "filter not retained"
20
+ end
21
+
22
+ test "after filtering index, should retain filter on edit and back with button" do
23
+ sign_in_dummy_administrator!
24
+ visit("/admin/administrators")
25
+ find_link("Organization").click
26
+ find_link("Nintendo").click
27
+ first(".button.-cancel").click
28
+ assert page.current_url.include?("q[s]=organization+asc"), "filter not retained"
29
+ end
30
+
31
+ test "after filtering index, should retain filter on edit and save" do
32
+ sign_in_dummy_administrator!
33
+ visit("/admin/administrators")
34
+ find_link("Organization").click
35
+ find_link("Nintendo").click
36
+ first(".button.-save").click
37
+ assert page.current_url.include?("q[s]=organization+asc"), "filter not retained"
38
+ end
39
+
40
+ test "after filtering index, should retain filter on edit and failed validation" do
41
+ sign_in_dummy_administrator!
42
+ visit("/admin/administrators")
43
+ find_link("Organization").click
44
+ find_link("Nintendo").click
45
+ fill_in("administrator[email]", with:"")
46
+ first(".button.-save").click
47
+ first(".button.-cancel").click
48
+ assert page.current_url.include?("q[s]=organization+asc"), "filter retained"
49
+ end
50
+
51
+ test "after filtering index, should NOT retain filter on save and review" do
52
+ sign_in_dummy_administrator!
53
+ visit("/admin/administrators")
54
+ find_link("Organization").click
55
+ find_link("Nintendo").click
56
+ first(".button.-save-and-review").click
57
+ assert page.current_url.exclude?("q[s]=organization+asc"), "filter not retained"
58
+ end
59
+
60
+ end
61
+
data/tolaria.gemspec CHANGED
@@ -8,6 +8,7 @@ Gem::Specification.new do |s|
8
8
  s.platform = Gem::Platform::RUBY
9
9
  s.licenses = ["MIT"]
10
10
  s.authors = ["Corey Csuhta", "Daniel Boggs"]
11
+ s.email = "hello+tolaria@threespot.com"
11
12
  s.homepage = "https://github.com/threespot/tolaria"
12
13
  s.summary = "A Rails CMS framework for making people happy."
13
14
  s.description = "Tolaria is a content management system (CMS) framework for Ruby on Rails. It greatly speeds up the necessary—but repetitive—task of creating useful admin panels, forms, and model workflow. Includes a library of rich form components, passwordless authentication, and text search tools. Make your editors happy!"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tolaria
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.2
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Corey Csuhta
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-12-17 00:00:00.000000000 Z
12
+ date: 2016-01-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bcrypt
@@ -183,7 +183,7 @@ description: Tolaria is a content management system (CMS) framework for Ruby on
183
183
  It greatly speeds up the necessary—but repetitive—task of creating useful admin
184
184
  panels, forms, and model workflow. Includes a library of rich form components, passwordless
185
185
  authentication, and text search tools. Make your editors happy!
186
- email:
186
+ email: hello+tolaria@threespot.com
187
187
  executables: []
188
188
  extensions: []
189
189
  extra_rdoc_files: []
@@ -208,6 +208,7 @@ files:
208
208
  - app/assets/images/admin/select_arrows.svg
209
209
  - app/assets/javascripts/admin/admin.js
210
210
  - app/assets/javascripts/admin/base.js
211
+ - app/assets/javascripts/admin/lib/autosize.js
211
212
  - app/assets/javascripts/admin/lib/backbone.js
212
213
  - app/assets/javascripts/admin/lib/jquery.chosen.js
213
214
  - app/assets/javascripts/admin/lib/jquery.js
@@ -225,6 +226,7 @@ files:
225
226
  - app/assets/javascripts/admin/views/fields/searchable_select.js
226
227
  - app/assets/javascripts/admin/views/fields/slug_field.js
227
228
  - app/assets/javascripts/admin/views/fields/swatch_field.js
229
+ - app/assets/javascripts/admin/views/fields/textarea.js
228
230
  - app/assets/javascripts/admin/views/fields/timestamp_field.js
229
231
  - app/assets/javascripts/admin/views/flash_message.js
230
232
  - app/assets/javascripts/admin/views/form_orchestrator.js
@@ -395,9 +397,10 @@ files:
395
397
  - test/demo/public/422.html
396
398
  - test/demo/public/500.html
397
399
  - test/demo/public/favicon.ico
400
+ - test/integration/crud_test.rb
401
+ - test/integration/filter_preservation_test.rb
398
402
  - test/integration/forbidden_routes_test.rb
399
403
  - test/integration/help_link_test.rb
400
- - test/integration/interface_test.rb
401
404
  - test/integration/router_test.rb
402
405
  - test/integration/session_test.rb
403
406
  - test/test_helper.rb
@@ -488,9 +491,10 @@ test_files:
488
491
  - test/demo/public/422.html
489
492
  - test/demo/public/500.html
490
493
  - test/demo/public/favicon.ico
494
+ - test/integration/crud_test.rb
495
+ - test/integration/filter_preservation_test.rb
491
496
  - test/integration/forbidden_routes_test.rb
492
497
  - test/integration/help_link_test.rb
493
- - test/integration/interface_test.rb
494
498
  - test/integration/router_test.rb
495
499
  - test/integration/session_test.rb
496
500
  - test/test_helper.rb
@@ -499,4 +503,3 @@ test_files:
499
503
  - test/unit/markdown_test.rb
500
504
  - test/unit/menu_test.rb
501
505
  - test/unit/random_tokens_test.rb
502
- has_rdoc: