noodall-form-builder 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -6,3 +6,4 @@ spec/dummy/db/*.sqlite3
6
6
  spec/dummy/log/*.log
7
7
  spec/dummy/tmp/
8
8
  Gemfile.lock
9
+ .rvmrc
@@ -59,12 +59,13 @@ module Noodall
59
59
 
60
60
  def mark_as_spam
61
61
  @response = @form.responses.find(params[:id])
62
-
63
- @response.mark_as_spam!
64
-
65
- @form.responses = @form.responses.reject{|r| r == @response }
66
- @form.save
67
-
62
+ @response.mark_as_spam!
63
+ redirect_to(noodall_admin_form_form_responses_url(@form))
64
+ end
65
+
66
+ def mark_as_not_spam
67
+ @response = @form.responses.find(params[:id])
68
+ @response.approve!
68
69
  redirect_to(noodall_admin_form_form_responses_url(@form))
69
70
  end
70
71
 
@@ -33,7 +33,7 @@ module Noodall
33
33
  self.save!
34
34
  self.class.defensio.put_document(defensio_signature, { :allow => false })
35
35
  end
36
-
36
+
37
37
  def is_spam?
38
38
  self.approved == false
39
39
  end
@@ -13,6 +13,7 @@
13
13
  <th>Name</th>
14
14
  <th>Fields</th>
15
15
  <th width="100">Date</th>
16
+ <th width="150">Spam</th>
16
17
  <th width="45">Delete</th>
17
18
  </tr>
18
19
  </thead>
@@ -22,8 +23,15 @@
22
23
  <td class="edit"><%= mail_to response.email, h(response.name) %></td>
23
24
  <td><%= @form.fields.collect{|f| "<strong>#{f.name}:</strong> #{response.string_value(f.underscored_name)}" }.join(",&nbsp;").html_safe %></td>
24
25
  <td><%= h response.created_at.to_formatted_s(:long_dot) %></td>
26
+ <td class="spam <%= 'flagged' unless response.approved %>">
27
+ <% if response.approved %>
28
+ <%= link_to "Spam?", mark_as_spam_noodall_admin_form_form_response_path(@form, response), :method => :put %>
29
+ <% else %>
30
+ <%= link_to "Not Spam?", mark_as_not_spam_noodall_admin_form_form_response_path(@form, response), :method => :put %>
31
+ <% end %>
32
+ </td>
25
33
  <td><%= link_to 'Delete', noodall_admin_form_form_response_path(@form, response), :confirm => 'Are you sure?', :method => :delete, :class => 'delete', :title => 'Delete this response' %>
26
- <%= link_to('Mark as Spam', mark_as_spam_noodall_admin_form_form_response_path(@form, response), :class => 'spam', :title => 'Mark this response as spam and delete', :confirm => 'Are you sure?') unless response.approved == false %></td>
34
+ </td>
27
35
  </tr>
28
36
  <% end %>
29
37
  </tbody>
@@ -32,6 +40,7 @@
32
40
  <th>Name</th>
33
41
  <th>Fields</th>
34
42
  <th width="100">Date</th>
43
+ <th width="150">Spam</th>
35
44
  <th width="45">Delete</th>
36
45
  </tr>
37
46
  </tfoot>
@@ -15,7 +15,8 @@ module Noodall
15
15
  resources :forms do
16
16
  resources :form_responses do
17
17
  member do
18
- get :mark_as_spam
18
+ put :mark_as_spam
19
+ put :mark_as_not_spam
19
20
  end
20
21
  end
21
22
  end
@@ -1,5 +1,5 @@
1
1
  module Noodall
2
2
  module FormBuilder
3
- VERSION = "0.2.1"
3
+ VERSION = "0.2.2"
4
4
  end
5
5
  end
Binary file
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: noodall-form-builder
3
3
  version: !ruby/object:Gem::Version
4
- hash: 21
4
+ hash: 19
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 1
10
- version: 0.2.1
9
+ - 2
10
+ version: 0.2.2
11
11
  platform: ruby
12
12
  authors: []
13
13
 
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-04-20 00:00:00 +01:00
18
+ date: 2011-05-09 00:00:00 +01:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -124,7 +124,7 @@ files:
124
124
  - lib/noodall/form_builder/routes.rb
125
125
  - lib/noodall/form_builder/version.rb
126
126
  - noodall-form-builder.gemspec
127
- - public/images/admin/spam.png
127
+ - public/images/admin/spam-flag.png
128
128
  - public/javascripts/admin/formbuilder.js
129
129
  - spec/dummy/Rakefile
130
130
  - spec/dummy/app/controllers/application_controller.rb
Binary file