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.
- data/app/controllers/admin/inquiries_controller.rb +15 -6
- data/app/views/admin/inquiries/index.html.erb +7 -3
- data/config/locales/de.yml +0 -1
- data/config/locales/en.yml +0 -1
- data/config/locales/fr.yml +0 -1
- data/config/locales/it.yml +0 -1
- data/config/locales/lolcat.yml +0 -1
- data/config/locales/lt.yml +0 -1
- data/config/locales/lv.yml +0 -1
- data/config/locales/nb.yml +0 -1
- data/config/locales/nl.yml +0 -1
- data/config/locales/pl.yml +0 -1
- data/config/locales/pt-BR.yml +0 -1
- data/config/locales/ru.yml +0 -1
- data/config/locales/sv.yml +0 -1
- data/db/migrate/20101208082840_create_inquiries.rb +37 -0
- data/db/migrate/20101208082841_remove_position_and_open_from_inquiries.rb +11 -0
- data/db/seeds/{inquiries.rb → pages_for_inquiries.rb} +2 -0
- data/lib/gemspec.rb +1 -1
- data/readme.md +12 -2
- data/refinerycms-inquiries.gemspec +5 -6
- metadata +6 -7
- data/app/views/admin/inquiries/spam.html.erb +0 -26
- data/config/locales/zh-CN.yml +0 -73
- data/db/migrate/create_inquiries.rb +0 -32
@@ -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 =
|
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
|
-
|
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 @
|
14
|
-
|
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(
|
26
|
+
<strong><%= t(".no_#{action_name == 'index' ? 'inquiries' : 'spam'}") %></strong>
|
23
27
|
</p>
|
24
28
|
<% end -%>
|
25
29
|
<% end %>
|
data/config/locales/de.yml
CHANGED
data/config/locales/en.yml
CHANGED
data/config/locales/fr.yml
CHANGED
data/config/locales/it.yml
CHANGED
data/config/locales/lolcat.yml
CHANGED
data/config/locales/lt.yml
CHANGED
data/config/locales/lv.yml
CHANGED
data/config/locales/nb.yml
CHANGED
data/config/locales/nl.yml
CHANGED
data/config/locales/pl.yml
CHANGED
data/config/locales/pt-BR.yml
CHANGED
data/config/locales/ru.yml
CHANGED
data/config/locales/sv.yml
CHANGED
@@ -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
|
data/lib/gemspec.rb
CHANGED
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
|
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
|
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.
|
4
|
-
s.date = %q{2010-12-
|
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/
|
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/
|
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
|
-
-
|
10
|
-
version: 0.9.9.
|
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-
|
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/
|
82
|
-
- db/
|
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>
|
data/config/locales/zh-CN.yml
DELETED
@@ -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
|