refinerycms-inquiries 0.9.9.7 → 0.9.9.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,19 +1,20 @@
1
1
  class Admin::InquiriesController < Admin::BaseController
2
2
 
3
3
  crudify :inquiry, :title_attribute => "name", :order => "created_at DESC"
4
+ helper_method :group_by_date
4
5
 
6
+ before_filter :find_all_ham, :only => [:ham]
7
+ before_filter :find_all_spam, :only => [:spam]
5
8
  before_filter :get_spam_count, :only => [:index, :spam]
6
9
 
7
10
  def index
8
- @inquiries = Inquiry.ham.with_query(params[:search]) if searching?
9
-
10
- @grouped_inquiries = group_by_date(Inquiry.ham)
11
+ @inquiries = @inquiries.with_query(params[:search]) if searching?
12
+ @inquiries = @inquiries.paginate({:page => params[:page]})
11
13
  end
12
14
 
13
15
  def spam
14
- @inquiries = Inquiry.spam.with_query(params[:search]) if searching?
15
-
16
- @grouped_inquiries = group_by_date(Inquiry.spam)
16
+ self.index
17
+ render :action => 'index'
17
18
  end
18
19
 
19
20
  def toggle_spam
@@ -25,6 +26,14 @@ class Admin::InquiriesController < Admin::BaseController
25
26
 
26
27
  protected
27
28
 
29
+ def find_all_ham
30
+ @inquiries = Inquiry.ham
31
+ end
32
+
33
+ def find_all_spam
34
+ @inquiries = Inquiry.spam
35
+ end
36
+
28
37
  def get_spam_count
29
38
  @spam_count = Inquiry.count(:conditions => {:spam => true})
30
39
  end
@@ -3,23 +3,27 @@
3
3
  <% if searching? %>
4
4
  <h2><%= t('shared.admin.search.results_for', :query => params[:search]) %></h2>
5
5
  <% if @inquiries.any? %>
6
+ <%= will_paginate @inquiries %>
6
7
  <ul>
7
8
  <%= render :partial => "inquiry", :collection => @inquiries %>
8
9
  </ul>
10
+ <%= will_paginate @inquiries %>
9
11
  <% else %>
10
12
  <p><%= t('shared.admin.search.no_results') %></p>
11
13
  <% end %>
12
14
  <% else %>
13
- <% if @grouped_inquiries.any? -%>
14
- <% @grouped_inquiries.each do |container| %>
15
+ <% if @inquiries.any? -%>
16
+ <%= will_paginate @inquiries %>
17
+ <% group_by_date(@inquiries).each do |container| %>
15
18
  <h3><%= l((inquiry_group = container.last).first.created_at, :format => :short) %></h3>
16
19
  <ul>
17
20
  <%= render :partial => 'inquiry', :collection => inquiry_group %>
18
21
  </ul>
19
22
  <% end %>
23
+ <%= will_paginate @inquiries %>
20
24
  <% else -%>
21
25
  <p>
22
- <strong><%= t('.no_inquiries') %></strong>
26
+ <strong><%= t(".no_#{action_name == 'index' ? 'inquiries' : 'spam'}") %></strong>
23
27
  </p>
24
28
  <% end -%>
25
29
  <% end %>
@@ -22,7 +22,6 @@ de:
22
22
  edit_confirmation_email: Bestätigungs-E-Mail bearbeiten
23
23
  index:
24
24
  no_inquiries: Sie haben noch keine Kontaktanfragen erhalten.
25
- spam:
26
25
  no_spam: Juhu! Sie haben keinen Spam.
27
26
  show:
28
27
  details: Details
@@ -22,7 +22,6 @@ en:
22
22
  edit_confirmation_email: Edit confirmation email
23
23
  index:
24
24
  no_inquiries: You have not received any inquiries yet.
25
- spam:
26
25
  no_spam: Hooray! You don't have any spam.
27
26
  show:
28
27
  details: Details
@@ -22,7 +22,6 @@ fr:
22
22
  edit_confirmation_email: Modifier l'e-mail de confirmation
23
23
  index:
24
24
  no_inquiries: Vous n'avez reçu aucune requête.
25
- spam:
26
25
  no_spam: Vous n'avez aucun spam.
27
26
  show:
28
27
  details: Détails
@@ -24,7 +24,6 @@ it:
24
24
  edit_confirmation_email: Modifica la mail di conferma
25
25
  index:
26
26
  no_inquiries: Non hai ancora ricevuto alcuna richiesta.
27
- spam:
28
27
  no_spam: Evviva! Non hai alcuno spam
29
28
  show:
30
29
  details: Dettagli
@@ -22,7 +22,6 @@ lolcat:
22
22
  edit_confirmation_email: EDIT CONFIRMASHUN EMAIL
23
23
  index:
24
24
  no_inquiries: U HAS NOT RECEIVD ANY INQUIRIEZ YET.
25
- spam:
26
25
  no_spam: HOORAH! U DOAN HAS ANY SPAM.
27
26
  show:
28
27
  details: DETAILS
@@ -22,7 +22,6 @@ lt:
22
22
  edit_confirmation_email: Redaguoti patvirtinimo laišką
23
23
  index:
24
24
  no_inquiries: Kol kas nėra jokių užklausų.
25
- spam:
26
25
  no_spam: Valio! Jūs neturite jokio spamo.
27
26
  show:
28
27
  details: Smulkesnė informacija
@@ -22,7 +22,6 @@ lv:
22
22
  edit_confirmation_email: Labot apstiprinājuma epastu
23
23
  index:
24
24
  no_inquiries: Nav saņemts neviens pieprasījums.
25
- spam:
26
25
  no_spam: Urā! Jums nav neviens pieprasījums, kas būtu spams.
27
26
  show:
28
27
  details: Detaļas
@@ -40,7 +40,6 @@ nb:
40
40
  index:
41
41
  search_results_for: Søkeresultater for %{query}
42
42
  no_inquiries: Du har ikke mottatt noen forespørsler enda.
43
- spam:
44
43
  no_spam: Hurra! Du har ikke noen søppelpost.
45
44
  show:
46
45
  details: Detaljer
@@ -21,7 +21,6 @@ nl:
21
21
  edit_confirmation_email: Bewerk bevestigings email
22
22
  index:
23
23
  no_inquiries: Je hebt nog geen vragen ontvangen.
24
- spam:
25
24
  no_spam: Jeej! Je hebt geen spam.
26
25
  show:
27
26
  details: Details
@@ -23,7 +23,6 @@ pl:
23
23
  edit_confirmation_email: Zmień email z potwierdzeniem
24
24
  index:
25
25
  no_inquiries: Nie ma jeszcze żadnych zapytań.
26
- spam:
27
26
  no_spam: Hurra! Nie masz żadnego spamu.
28
27
  show:
29
28
  details: Szczegóły
@@ -22,7 +22,6 @@ pt-BR:
22
22
  edit_confirmation_email: Editar email de confirmação
23
23
  index:
24
24
  no_inquiries: "Não exitem mensagens."
25
- spam:
26
25
  no_spam: Não existem mensagens de spam.
27
26
  show:
28
27
  details: Detalhes
@@ -22,7 +22,6 @@ ru:
22
22
  edit_confirmation_email: Редактировать письмо-подтверждение
23
23
  index:
24
24
  no_inquiries: "Вы еще не получили ни одного запроса."
25
- spam:
26
25
  no_spam: "Ура, спама нет!"
27
26
  show:
28
27
  details: Подробности
@@ -22,7 +22,6 @@ sv:
22
22
  edit_confirmation_email: Redigera bekräftelse
23
23
  index:
24
24
  no_inquiries: Du har inte fått några förfrågningar ännu.
25
- spam:
26
25
  no_spam: Hurra! Du har ingen skräppost.
27
26
  show:
28
27
  details: Detaljer
@@ -0,0 +1,37 @@
1
+ class CreateInquiries < ActiveRecord::Migration
2
+ def self.up
3
+ unless ::Inquiry.table_exists?
4
+ create_table ::Inquiry.table_name, :force => true do |t|
5
+ t.string "name"
6
+ t.string "email"
7
+ t.string "phone"
8
+ t.text "message"
9
+ t.integer "position"
10
+ t.boolean "open", :default => true
11
+ t.datetime "created_at"
12
+ t.datetime "updated_at"
13
+ t.boolean "spam", :default => false
14
+ end
15
+
16
+ add_index ::Inquiry.table_name, :id
17
+ end
18
+
19
+ # todo: remove at 1.0
20
+ create_table ::InquirySetting.table_name, :force => true do |t|
21
+ t.string "name"
22
+ t.text "value"
23
+ t.boolean "destroyable"
24
+ t.datetime "created_at"
25
+ t.datetime "updated_at"
26
+ end unless ::InquirySetting.table_exists?
27
+
28
+ load(Rails.root.join('db', 'seeds', 'pages_for_inquiries.rb').to_s)
29
+ end
30
+
31
+ def self.down
32
+ drop_table ::Inquiry.table_name
33
+ # todo: remove at 1.0
34
+ drop_table ::InquirySetting.table_name
35
+ Page.delete_all({:link_url => ("/contact" || "/contact/thank_you")})
36
+ end
37
+ end
@@ -0,0 +1,11 @@
1
+ class RemovePositionAndOpenFromInquiries < ActiveRecord::Migration
2
+ def self.up
3
+ remove_column :inquiries, :position
4
+ remove_column :inquiries, :open
5
+ end
6
+
7
+ def self.down
8
+ add_column :inquiries, :position, :integer
9
+ add_column :inquiries, :open, :boolean, :default => true
10
+ end
11
+ end
@@ -1,3 +1,5 @@
1
+ page_position = (Page.maximum(:position, :conditions => {:parent_id => nil}) || -1)
2
+
1
3
  contact_us_page = Page.create({
2
4
  :title => "Contact",
3
5
  :link_url => "/contact",
data/lib/gemspec.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
- version = '0.9.9.7'
2
+ version = '0.9.9.8'
3
3
  raise "Could not get version so gemspec can not be built" if version.nil?
4
4
  files = Dir.glob("**/*").flatten.reject do |file|
5
5
  file =~ /\.gem$/
data/readme.md CHANGED
@@ -6,14 +6,24 @@
6
6
 
7
7
  Include the latest [gem](http://rubygems.org/gems/refinerycms-inquiries) into your Refinery CMS application's Gemfile:
8
8
 
9
- gem "refinerycms-inquiries", '~> 0.9.9.7'
9
+ gem 'refinerycms-inquiries', '~> 0.9.9.8'
10
10
 
11
11
  Then type the following at command line inside your Refinery CMS application's root directory:
12
12
 
13
13
  bundle install
14
14
 
15
15
  You don't currently have to do any migrations because Refinery CMS never removed the inquiries tables by default.
16
- This may change in a future version.
16
+ This will change in a future version - follow the instructions below if you are running the currently unreleased Refinery 0.9.9.
17
+
18
+ #### Installation on Refinery 0.9.9
19
+
20
+ The inquiries table has been removed from the base install of Refinery 0.9.9. To install the migrations, run:
21
+
22
+ rails generate refinerycms_inquiries
23
+
24
+ Next migrate your database and you're done:
25
+
26
+ rake db:migrate
17
27
 
18
28
  ## About
19
29
 
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = %q{refinerycms-inquiries}
3
- s.version = %q{0.9.9.7}
4
- s.date = %q{2010-12-02}
3
+ s.version = %q{0.9.9.8}
4
+ s.date = %q{2010-12-29}
5
5
  s.summary = %q{Inquiry handling functionality for the Refinery CMS project.}
6
6
  s.description = %q{Inquiry handling functionality extracted from Refinery CMS to allow you to have a contact form and manage inquiries in the Refinery backend.}
7
7
  s.homepage = %q{http://refinerycms.com}
@@ -30,7 +30,6 @@ Gem::Specification.new do |s|
30
30
  'app/views/admin/inquiries/_submenu.html.erb',
31
31
  'app/views/admin/inquiries/index.html.erb',
32
32
  'app/views/admin/inquiries/show.html.erb',
33
- 'app/views/admin/inquiries/spam.html.erb',
34
33
  'app/views/admin/inquiry_settings',
35
34
  'app/views/admin/inquiry_settings/_confirmation_email_form.html.erb',
36
35
  'app/views/admin/inquiry_settings/_notification_recipients_form.html.erb',
@@ -59,13 +58,13 @@ Gem::Specification.new do |s|
59
58
  'config/locales/ru.yml',
60
59
  'config/locales/sl.yml',
61
60
  'config/locales/sv.yml',
62
- 'config/locales/zh-CN.yml',
63
61
  'config/routes.rb',
64
62
  'db',
65
63
  'db/migrate',
66
- 'db/migrate/create_inquiries.rb',
64
+ 'db/migrate/20101208082840_create_inquiries.rb',
65
+ 'db/migrate/20101208082841_remove_position_and_open_from_inquiries.rb',
67
66
  'db/seeds',
68
- 'db/seeds/inquiries.rb',
67
+ 'db/seeds/pages_for_inquiries.rb',
69
68
  'features',
70
69
  'features/create_inquiries.feature',
71
70
  'features/manage_inquiries.feature',
metadata CHANGED
@@ -6,8 +6,8 @@ version: !ruby/object:Gem::Version
6
6
  - 0
7
7
  - 9
8
8
  - 9
9
- - 7
10
- version: 0.9.9.7
9
+ - 8
10
+ version: 0.9.9.8
11
11
  platform: ruby
12
12
  authors:
13
13
  - Resolve Digital
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-12-02 00:00:00 +13:00
18
+ date: 2010-12-29 00:00:00 +13:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -52,7 +52,6 @@ files:
52
52
  - app/views/admin/inquiries/_submenu.html.erb
53
53
  - app/views/admin/inquiries/index.html.erb
54
54
  - app/views/admin/inquiries/show.html.erb
55
- - app/views/admin/inquiries/spam.html.erb
56
55
  - app/views/admin/inquiry_settings/_confirmation_email_form.html.erb
57
56
  - app/views/admin/inquiry_settings/_notification_recipients_form.html.erb
58
57
  - app/views/admin/inquiry_settings/edit.html.erb
@@ -76,10 +75,10 @@ files:
76
75
  - config/locales/ru.yml
77
76
  - config/locales/sl.yml
78
77
  - config/locales/sv.yml
79
- - config/locales/zh-CN.yml
80
78
  - config/routes.rb
81
- - db/migrate/create_inquiries.rb
82
- - db/seeds/inquiries.rb
79
+ - db/migrate/20101208082840_create_inquiries.rb
80
+ - db/migrate/20101208082841_remove_position_and_open_from_inquiries.rb
81
+ - db/seeds/pages_for_inquiries.rb
83
82
  - features/create_inquiries.feature
84
83
  - features/manage_inquiries.feature
85
84
  - features/step_definitions/inquiry_steps.rb
@@ -1,26 +0,0 @@
1
- <%= render :partial => "submenu" %>
2
- <div id='records'>
3
- <% if searching? %>
4
- <h2><%= t('shared.admin.search.results_for', :query => params[:search]) %></h2>
5
- <% if @inquiries.any? %>
6
- <ul>
7
- <%= render :partial => "inquiry", :collection => @inquiries %>
8
- </ul>
9
- <% else %>
10
- <p><%= t('shared.admin.search.no_results') %></p>
11
- <% end %>
12
- <% else %>
13
- <% if @grouped_inquiries.any? -%>
14
- <% @grouped_inquiries.each do |container| %>
15
- <h3><%= l((inquiry_group = container.last).first.created_at, :format => :short) %></h3>
16
- <ul>
17
- <%= render :partial => 'inquiry', :collection => inquiry_group %>
18
- </ul>
19
- <% end %>
20
- <% else -%>
21
- <p>
22
- <strong><%= t('.no_spam') %></strong>
23
- </p>
24
- <% end -%>
25
- <% end %>
26
- </div>
@@ -1,73 +0,0 @@
1
- zh-CN:
2
- plugins:
3
- refinery_inquiries:
4
- title: Inquiries
5
- inquiries:
6
- new:
7
- header_message: Whoops there was a small problem
8
- message: "The following problems need to be corrected:"
9
- send: Send message
10
- privacy_policy: We value your privacy
11
- admin:
12
- inquiries:
13
- inquiry:
14
- read_inquiry: Read the inquiry
15
- said: said
16
- mark_as_spam: Mark as spam
17
- mark_as_ham: Move to inbox
18
- submenu:
19
- inbox: Inbox
20
- spam: Spam
21
- update_notified: Update who gets notified
22
- edit_confirmation_email: Edit confirmation email
23
- index:
24
- no_inquiries: You have not received any inquiries yet.
25
- spam:
26
- no_spam: Hooray! You don't have any spam.
27
- show:
28
- details: Details
29
- age: Age
30
- actions: Actions
31
- back_to_all_inquiries: Back to all Inquiries
32
- spam: Spam
33
- spam_yes: 'yes'
34
- inquiry: Inquiry
35
- to: To
36
- from: From
37
- click_to_email: Click to email this address
38
- phone: Phone
39
- date: Date
40
- message: Message
41
- inquiry_settings:
42
- update:
43
- updated: "'%{setting}' was successfully updated."
44
- notification_recipients_form:
45
- inquiry_settings_value_name: Send notifications to
46
- explanation: Every time someone contacts you on your website, Refinery sends out an email to say there is a new inquiry.
47
- hint: When a new inquiry is submitted, Refinery will send an email notification to you.
48
- example: "Enter your email address(es) like: jack@work.com, jill@office.com"
49
- confirmation_email_form:
50
- to: To
51
- from: From
52
- subject: Subject
53
- click_to_edit_subject: Click here to edit the subject
54
- explanation: Every time someone contacts you on your website, Refinery sends out an email to confirm the inquiry with the person who made it.
55
- below_edit_email_sent: Below you can edit the email that is sent out.
56
- the_customer_making_inquiry: The customer making the inquiry
57
- message: Message
58
- note: "Note: place the text %name% where you'd like the customer's name to appear in the email"
59
- inquiry_mailer:
60
- notification:
61
- greeting: Hi there
62
- you_recieved_new_inquiry: You just received a new inquiry on your website.
63
- inquiry_starts: --- inquiry starts ---
64
- inquiry_ends: --- inquiry ends ---
65
- from: From
66
- email: Email
67
- phone: Phone
68
- message: Message
69
- closing_line: Kind Regards
70
- ps: P.S. All your inquiries are stored in the "Inquiries" section of Refinery should you ever want to view it later there.
71
- activerecord:
72
- models:
73
- inquiry: inquiry
@@ -1,32 +0,0 @@
1
- class CreateInquiries < ActiveRecord::Migration
2
- def self.up
3
- create_table ::Inquiry.table_name, :force => true do |t|
4
- t.string "name"
5
- t.string "email"
6
- t.string "phone"
7
- t.text "message"
8
- t.integer "position"
9
- t.boolean "open", :default => true
10
- t.datetime "created_at"
11
- t.datetime "updated_at"
12
- t.boolean "spam", :default => false
13
- end
14
-
15
- # todo: remove at 1.0
16
- create_table ::InquirySetting.table_name, :force => true do |t|
17
- t.string "name"
18
- t.text "value"
19
- t.boolean "destroyable"
20
- t.datetime "created_at"
21
- t.datetime "updated_at"
22
- end
23
-
24
- add_index ::Inquiry.table_name, :id
25
- end
26
-
27
- def self.down
28
- remove_table ::Inquiry.table_name
29
- # todo: remove at 1.0
30
- remove_table ::InquirySetting.table_name
31
- end
32
- end