e9_polls 1.0.3 → 1.0.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -88,6 +88,7 @@ module E9Polls::PollsHelper
88
88
  retv = <<-RETV
89
89
  TEMPLATES = window.TEMPLATES || {};
90
90
  TEMPLATES['#{association_name}'] = {
91
+ rx: new RegExp(#{options[:index]}, 'g'),
91
92
  index: #{options[:index]},
92
93
  template: "#{template}"
93
94
  };
data/app/models/poll.rb CHANGED
@@ -44,6 +44,6 @@ class Poll < ::Renderable
44
44
  protected
45
45
 
46
46
  def reject_answer?(attributes)
47
- attributes.keys.member?(:value) && attributes[:value].blank?
47
+ !attributes.keys.member?('value') || attributes['value'].blank?
48
48
  end
49
49
  end
@@ -29,6 +29,14 @@ en:
29
29
 
30
30
  # AR record translations
31
31
  activerecord:
32
+ models:
33
+ poll: Poll
34
+ poll_answer: Poll Answer
35
+
36
+ attributes:
37
+ poll:
38
+ template: Question
39
+
32
40
  errors:
33
41
  models:
34
42
  poll:
@@ -1,3 +1,3 @@
1
1
  module E9Polls
2
- VERSION = "1.0.3"
2
+ VERSION = "1.0.4"
3
3
  end
@@ -78,19 +78,13 @@
78
78
 
79
79
  var $this = $(this),
80
80
  $fields = $this.closest('.nested-associations').find('.fields'),
81
- obj,
82
- template,
83
- index;
81
+ obj;
84
82
 
85
83
  try {
86
84
  obj = TEMPLATES[this.getAttribute('data-association')];
87
- } catch(e) { return }
88
-
89
- template = obj.template.replace(new RegExp(obj.index++, 'g'), obj.index);
90
-
91
- $(template).appendTo($fields);
92
-
93
- try { $.colorbox.resize() } catch(e) {}
85
+ $(obj.template.replace(obj.rx, obj.index++)).appendTo($fields);
86
+ $.colorbox.resize();
87
+ } catch(e) { }
94
88
  });
95
89
 
96
90
  /**
@@ -7,7 +7,9 @@
7
7
  .poll-answer { margin: 1em 0; clear: both; }
8
8
  .poll-answer textarea { height: 3em; margin-bottom: 0; }
9
9
  .poll-answer .field { margin-bottom: 0; }
10
+
10
11
  form.edit_poll .actions { padding: 0.5em 0; }
12
+ .e9-poll h1 { line-height: 1.333em; }
11
13
 
12
14
  /* Poll answers or poll percentage. */
13
15
  .poll-answer-votes { display: none; }
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: e9_polls
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 1.0.3
5
+ version: 1.0.4
6
6
  platform: ruby
7
7
  authors:
8
8
  - Travis Cox