refinerycms-quotes 1.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.
- data/app/controllers/admin/quotes_controller.rb +12 -0
- data/app/controllers/quotes_controller.rb +29 -0
- data/app/controllers/quotes_controller.rb~ +21 -0
- data/app/mailers/quote_mailer.rb +11 -0
- data/app/models/quote.rb +16 -0
- data/app/views/admin/quotes/_quote.html.erb +18 -0
- data/app/views/admin/quotes/index.html.erb +16 -0
- data/app/views/admin/quotes/show.html.erb +86 -0
- data/app/views/quote_mailer/notification.html.erb +5 -0
- data/app/views/quotes/new.html.erb +45 -0
- data/app/views/quotes/new.html.erb~ +43 -0
- data/app/views/quotes/thank_you.html.erb +1 -0
- data/config/locales/en.yml +25 -0
- data/config/locales/fr.yml +64 -0
- data/config/locales/fr.yml~ +64 -0
- data/config/locales/lolcat.yml +25 -0
- data/config/locales/nb.yml +21 -0
- data/config/locales/nl.yml +21 -0
- data/config/routes.rb +11 -0
- data/db/migrate/create_quotes.rb +33 -0
- data/db/seeds/quotes.rb +33 -0
- data/db/seeds/quotes.rb~ +33 -0
- data/lib/generators/refinerycms_quotes_generator.rb +6 -0
- data/lib/refinerycms-quotes.rb +29 -0
- data/lib/tasks/quotes.rake +13 -0
- data/public/quotes.css~ +27 -0
- data/public/refinery/quotes.css +27 -0
- metadata +71 -0
@@ -0,0 +1,29 @@
|
|
1
|
+
class QuotesController < ApplicationController
|
2
|
+
|
3
|
+
before_filter :find_page, :only => [:create, :new]
|
4
|
+
|
5
|
+
def thank_you
|
6
|
+
@page = Page.find_by_link_url("/quotes/thank_you", :include => [:parts, :slugs])
|
7
|
+
end
|
8
|
+
|
9
|
+
|
10
|
+
def new
|
11
|
+
@quote = Quote.new
|
12
|
+
end
|
13
|
+
|
14
|
+
def create
|
15
|
+
@quote = Quote.new params[:quote]
|
16
|
+
if @quote.save
|
17
|
+
QuoteMailer.notification(@quote, request).deliver
|
18
|
+
redirect_to thank_you_quotes_url
|
19
|
+
else
|
20
|
+
render :new
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
protected
|
25
|
+
|
26
|
+
def find_page
|
27
|
+
@page = Page.find_by_link_url('/quotes', :include => [:parts, :slugs])
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
class QuotesController < ApplicationController
|
2
|
+
|
3
|
+
def thank_you
|
4
|
+
@page = Page.find_by_link_url("/quotes/thank_you", :include => [:parts, :slugs])
|
5
|
+
end
|
6
|
+
|
7
|
+
|
8
|
+
def new
|
9
|
+
@quote = Quote.new
|
10
|
+
end
|
11
|
+
|
12
|
+
def create
|
13
|
+
@quote = Quote.new params[:quote]
|
14
|
+
if @quote.save
|
15
|
+
QuoteMailer.notification(@quote, request).deliver
|
16
|
+
redirect_to thank_you_quotes_url
|
17
|
+
else
|
18
|
+
render :new
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
class QuoteMailer < ActionMailer::Base
|
2
|
+
|
3
|
+
def notification(quote, request)
|
4
|
+
subject t('.subject', :scope => 'quote_mailer.notification')
|
5
|
+
recipients 'guirec.corbel@gmail.com'
|
6
|
+
from "\"#{RefinerySetting[:site_name]}\" <no-reply@#{request.domain(RefinerySetting.find_or_set(:tld_length, 1))}>"
|
7
|
+
sent_on Time.now
|
8
|
+
@quote = quote
|
9
|
+
end
|
10
|
+
|
11
|
+
end
|
data/app/models/quote.rb
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
class Quote < ActiveRecord::Base
|
2
|
+
|
3
|
+
validate :have_phone_or_email
|
4
|
+
validates :description, :presence => true
|
5
|
+
|
6
|
+
private
|
7
|
+
def have_phone_or_email
|
8
|
+
reg = /^([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})$/i
|
9
|
+
if self.phone.blank? and self.email.blank?
|
10
|
+
errors.add(:base, I18n.t('.empty_mail_and_phone', :scope => 'quotes.errors'))
|
11
|
+
elsif !self.email.blank? && !reg.match(self.email)
|
12
|
+
errors.add(:email, I18n.t(".invalid_format", :scope => 'quotes.errors'))
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<li class='clearfix record <%= cycle("on", "on-hover") %>'>
|
2
|
+
<span class='title'>
|
3
|
+
<%= link_to "#{quote.first_name} #{quote.name}", admin_quote_url(quote) %><br/>
|
4
|
+
<span class="preview"><%= truncate(strip_tags(quote.description), :length => 60) -%></span>
|
5
|
+
</span>
|
6
|
+
<span class='actions'>
|
7
|
+
<%= link_to refinery_icon_tag('delete.png'), admin_quote_url(quote),
|
8
|
+
{ :method => :delete,
|
9
|
+
:confirm => t('shared.admin.delete.message', :title => quote.name) },
|
10
|
+
:class => "cancel confirm-delete",
|
11
|
+
:title => t('admin.quotes.delete') -%>
|
12
|
+
|
13
|
+
<%= link_to refinery_icon_tag('zoom.png'), admin_quote_url(quote),
|
14
|
+
:title => t('.show_quote') -%>
|
15
|
+
</span>
|
16
|
+
</li>
|
17
|
+
|
18
|
+
|
@@ -0,0 +1,16 @@
|
|
1
|
+
<div id='records'>
|
2
|
+
<% if @quotes.any? -%>
|
3
|
+
<%= will_paginate @quotes %>
|
4
|
+
<% group_by_date(@quotes).each do |container| %>
|
5
|
+
<h3><%= l((quote_group = container.last).first.created_at, :format => :short) %></h3>
|
6
|
+
<ul>
|
7
|
+
<%= render :partial => 'quote', :collection => quote_group %>
|
8
|
+
</ul>
|
9
|
+
<% end %>
|
10
|
+
<%= will_paginate @quotes %>
|
11
|
+
<% else -%>
|
12
|
+
<p>
|
13
|
+
<strong><%= t("no_quotes", :scope => 'admin.quotes.records') %></strong>
|
14
|
+
</p>
|
15
|
+
<% end -%>
|
16
|
+
</div>
|
@@ -0,0 +1,86 @@
|
|
1
|
+
<div id='actions'>
|
2
|
+
<h2><%= t('.details')%></h2>
|
3
|
+
<p>
|
4
|
+
<strong><%= t('.age') %>:</strong> <%= time_ago_in_words(@quote.created_at) %>
|
5
|
+
</p>
|
6
|
+
<h2><%= t('.actions') %></h2>
|
7
|
+
<ul>
|
8
|
+
<li>
|
9
|
+
<%= link_to t('.back_to_all_quotes'), {:action => 'index'}, :class => "back_icon" %>
|
10
|
+
</li>
|
11
|
+
<li>
|
12
|
+
<%= link_to t('admin.quotes.delete'),
|
13
|
+
admin_quote_url(@quote),
|
14
|
+
:class => 'delete_icon no-tooltip confirm-delete',
|
15
|
+
:title => t('admin.quotes.delete'),
|
16
|
+
:confirm => t('.delete_message', :name => @quote.name, :first_name => @quote.first_name),
|
17
|
+
:method => :delete %>
|
18
|
+
</li>
|
19
|
+
</ul>
|
20
|
+
</div>
|
21
|
+
<div id='records'>
|
22
|
+
<h2><%= t('.quote') %></h2>
|
23
|
+
<table id='quote'>
|
24
|
+
<tr>
|
25
|
+
<td>
|
26
|
+
<strong><%= t('.to') %></strong>
|
27
|
+
</td>
|
28
|
+
<td>
|
29
|
+
<%= RefinerySetting[:site_name] %>
|
30
|
+
</td>
|
31
|
+
</tr>
|
32
|
+
<tr>
|
33
|
+
<td>
|
34
|
+
<strong><%= t('.from') %></strong>
|
35
|
+
</td>
|
36
|
+
<td>
|
37
|
+
<%= "#{@quote.first_name} #{@quote.name}" %>
|
38
|
+
<% unless @quote.email.blank? %>
|
39
|
+
[<%= mail_to @quote.email, @quote.email, {:title => t('.click_to_email')} %>]
|
40
|
+
<% end %>
|
41
|
+
</td>
|
42
|
+
</tr>
|
43
|
+
<% unless @quote.phone.blank? %>
|
44
|
+
<tr>
|
45
|
+
<td>
|
46
|
+
<strong><%= t('.phone') %></strong>
|
47
|
+
</td>
|
48
|
+
<td>
|
49
|
+
<%= @quote.phone %>
|
50
|
+
</td>
|
51
|
+
</tr>
|
52
|
+
<% end %>
|
53
|
+
<tr>
|
54
|
+
<td>
|
55
|
+
<strong><%= t('.date') %></strong>
|
56
|
+
</td>
|
57
|
+
<td>
|
58
|
+
<%= l(Date.parse(@quote.created_at.to_s), :format => :long) %>
|
59
|
+
</td>
|
60
|
+
</tr>
|
61
|
+
<tr>
|
62
|
+
<td valign='top'>
|
63
|
+
<strong><%= t('.description') %></strong>
|
64
|
+
</td>
|
65
|
+
<td>
|
66
|
+
<%= simple_format strip_tags(@quote.description), :style => 'margin-top: 0' %>
|
67
|
+
</td>
|
68
|
+
</tr>
|
69
|
+
<tr>
|
70
|
+
<td valign='top'>
|
71
|
+
<strong><%= t('.references') %></strong>
|
72
|
+
</td>
|
73
|
+
<td>
|
74
|
+
<%= simple_format strip_tags(@quote.references), :style => 'margin-top: 0' %>
|
75
|
+
</td>
|
76
|
+
</tr>
|
77
|
+
<tr>
|
78
|
+
<td valign='top'>
|
79
|
+
<strong><%= t('.comments') %></strong>
|
80
|
+
</td>
|
81
|
+
<td>
|
82
|
+
<%= simple_format strip_tags(@quote.comments), :style => 'margin-top: 0' %>
|
83
|
+
</td>
|
84
|
+
</tr>
|
85
|
+
</table>
|
86
|
+
</div>
|
@@ -0,0 +1,5 @@
|
|
1
|
+
<%=raw t('.you_recieved_new_quote', :url => url_for(:controller => "admin/quotes", :action => :index, :only_path => false)) %>
|
2
|
+
|
3
|
+
<%=raw t('.from') %>: <%= @quote.first_name %> <%= @quote.name %>
|
4
|
+
<%=raw t('.email') %>: <%= @quote.email %>
|
5
|
+
<%=raw t('.phone') %>: <%= @quote.phone %>
|
@@ -0,0 +1,45 @@
|
|
1
|
+
<% content_for :body_content_title do %>
|
2
|
+
Demander un devis
|
3
|
+
<% end %>
|
4
|
+
<% content_for :body_content_left do %>
|
5
|
+
<div class='quotes'>
|
6
|
+
<%=raw @page[Page.default_parts.first.to_sym] %>
|
7
|
+
<%= render :partial => '/shared/admin/error_messages',
|
8
|
+
:locals => {
|
9
|
+
:object => @quote,
|
10
|
+
:include_object_name => true
|
11
|
+
} %>
|
12
|
+
<%= form_for @quote do |f| %>
|
13
|
+
<div class="field">
|
14
|
+
<%= f.label :name %> <%= f.text_field :name %>
|
15
|
+
</div>
|
16
|
+
<div class="field">
|
17
|
+
<%= f.label :first_name %> <%= f.text_field :first_name %>
|
18
|
+
</div>
|
19
|
+
<div class="field">
|
20
|
+
<%= f.label :email %> <%= f.text_field :email %>
|
21
|
+
</div>
|
22
|
+
<div class="field">
|
23
|
+
<%= f.label :phone %> <%= f.text_field :phone %>
|
24
|
+
</div>
|
25
|
+
<div class="field">
|
26
|
+
<%= f.label :description %><br/>
|
27
|
+
<%= f.text_area :description, :cols => 65 %>
|
28
|
+
</div>
|
29
|
+
<div class="field">
|
30
|
+
<%= f.label :references %><br/>
|
31
|
+
(Projets similaires que vous trouvez intéressant)<br/>
|
32
|
+
<%= f.text_area :references, :cols => 65 %>
|
33
|
+
</div>
|
34
|
+
<div class="field">
|
35
|
+
<%= f.label :comments %><br/>
|
36
|
+
<%= f.text_area :comments, :cols => 65 %>
|
37
|
+
</div>
|
38
|
+
|
39
|
+
<div class="actions">
|
40
|
+
<%= f.submit t('.send') %>
|
41
|
+
</div>
|
42
|
+
<% end %>
|
43
|
+
</div>
|
44
|
+
<% end %>
|
45
|
+
<%= render :partial => "/shared/content_page" %>
|
@@ -0,0 +1,43 @@
|
|
1
|
+
<% content_for :body_content_title do %>
|
2
|
+
Demander un devis
|
3
|
+
<% end %>
|
4
|
+
<% content_for :body_content_left do %>
|
5
|
+
<div class='quotes'>
|
6
|
+
<%=raw @page[Page.default_parts.first.to_sym] %>
|
7
|
+
<%= render :partial => '/shared/admin/error_messages',
|
8
|
+
:locals => {
|
9
|
+
:object => @quote,
|
10
|
+
:include_object_name => true
|
11
|
+
} %>
|
12
|
+
<%= form_for @quote do |f| %>
|
13
|
+
<div class="field">
|
14
|
+
<%= f.label :name %> <%= f.text_field :name %>
|
15
|
+
</div>
|
16
|
+
<div class="field">
|
17
|
+
<%= f.label :first_name %> <%= f.text_field :first_name %>
|
18
|
+
</div>
|
19
|
+
<div class="field">
|
20
|
+
<%= f.label :email %> <%= f.text_field :email %>
|
21
|
+
</div>
|
22
|
+
<div class="field">
|
23
|
+
<%= f.label :phone %> <%= f.text_field :phone %>
|
24
|
+
</div>
|
25
|
+
<div class="field">
|
26
|
+
<%= f.label :description %><br/>
|
27
|
+
(Projets similaires que vous trouvez intéressant)<br/>
|
28
|
+
<%= f.text_area :description, :cols => 65 %>
|
29
|
+
</div>
|
30
|
+
<div class="field">
|
31
|
+
<%= f.label :references %><br/><%= f.text_area :references, :cols => 65 %>
|
32
|
+
</div>
|
33
|
+
<div class="field">
|
34
|
+
<%= f.label :comments %><br/><%= f.text_area :comments, :cols => 65 %>
|
35
|
+
</div>
|
36
|
+
|
37
|
+
<div class="actions">
|
38
|
+
<%= f.submit t('.send') %>
|
39
|
+
</div>
|
40
|
+
<% end %>
|
41
|
+
</div>
|
42
|
+
<% end %>
|
43
|
+
<%= render :partial => "/shared/content_page" %>
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= render :partial => "/shared/content_page" %>
|
@@ -0,0 +1,25 @@
|
|
1
|
+
en:
|
2
|
+
shared:
|
3
|
+
admin:
|
4
|
+
image_picker:
|
5
|
+
image: image
|
6
|
+
plugins:
|
7
|
+
quotes:
|
8
|
+
title: Quotes
|
9
|
+
admin:
|
10
|
+
quotes:
|
11
|
+
actions:
|
12
|
+
create_new: Add New Quote
|
13
|
+
reorder: Reorder Quotes
|
14
|
+
reorder_done: Done Reordering Quotes
|
15
|
+
records:
|
16
|
+
title: Quotes
|
17
|
+
sorry_no_results: Sorry! There are no results found.
|
18
|
+
no_items_yet: There are no Quotes yet. Click "Add New Quote" to add your first quote.
|
19
|
+
quote:
|
20
|
+
view_live_html: View this quote live <br/><em>(opens in a new window)</em>
|
21
|
+
edit: Edit this quote
|
22
|
+
delete: Remove this quote forever
|
23
|
+
quotes:
|
24
|
+
show:
|
25
|
+
other: Other Quotes
|
@@ -0,0 +1,64 @@
|
|
1
|
+
fr:
|
2
|
+
plugins:
|
3
|
+
quotes:
|
4
|
+
title: Devis
|
5
|
+
admin:
|
6
|
+
quotes:
|
7
|
+
delete: Supprimer
|
8
|
+
records:
|
9
|
+
title: Devis
|
10
|
+
no_quotes: 'Il n''y a actuellement aucun devis.'
|
11
|
+
quote:
|
12
|
+
view_live_html: Voir ce devis <br/><em>(Ouvre une nouvelle fenêtre)</em>
|
13
|
+
delete: Supprimer définitivement ce devis
|
14
|
+
description: Description
|
15
|
+
show:
|
16
|
+
quote: Devis
|
17
|
+
show_quote: Voir le devis
|
18
|
+
click_to_email: Envoyer un courriel
|
19
|
+
details: Details
|
20
|
+
age: Depuis
|
21
|
+
actions: Actions
|
22
|
+
back_to_all_quotes: Retour vers tous les devis
|
23
|
+
delete: Supprimer
|
24
|
+
to: À
|
25
|
+
from: De
|
26
|
+
phone: Téléphone
|
27
|
+
date: Date
|
28
|
+
description: Description
|
29
|
+
references: References
|
30
|
+
comments: Commentaires
|
31
|
+
delete_message: Êts vous sûre de vouloir supprimer le devis de %{first_name} %{name}
|
32
|
+
quotes:
|
33
|
+
new:
|
34
|
+
send: Envoyer
|
35
|
+
errors:
|
36
|
+
empty_mail_and_phone: Votre adresse de courriel ou votre numéro de téléphone doit être remplie
|
37
|
+
invalid_format: doit être un format valide.
|
38
|
+
quote_mailer:
|
39
|
+
notification:
|
40
|
+
subject: 'Vous avez reçu une nouvelle demande de devis'
|
41
|
+
you_recieved_new_quote: 'Une nouvelle nouvelle demande de devis a été ajoutée. Vous pouvez la consulter à cette adresse : %{url}'
|
42
|
+
from: de
|
43
|
+
email: Courriel
|
44
|
+
phone: Téléphone
|
45
|
+
activerecord:
|
46
|
+
models:
|
47
|
+
quote: devis
|
48
|
+
attributes:
|
49
|
+
quote:
|
50
|
+
name: Nom
|
51
|
+
first_name: Prénom
|
52
|
+
email: Courriel
|
53
|
+
phone: Téléphone
|
54
|
+
description: Description du projet
|
55
|
+
comments: Commentaires
|
56
|
+
references_html: Références
|
57
|
+
errors:
|
58
|
+
models:
|
59
|
+
quote:
|
60
|
+
attributes:
|
61
|
+
description:
|
62
|
+
blank: doit être remplie
|
63
|
+
|
64
|
+
|
@@ -0,0 +1,64 @@
|
|
1
|
+
fr:
|
2
|
+
plugins:
|
3
|
+
quotes:
|
4
|
+
title: Devis
|
5
|
+
admin:
|
6
|
+
quotes:
|
7
|
+
delete: Supprimer
|
8
|
+
records:
|
9
|
+
title: Devis
|
10
|
+
no_quotes: 'Il n''y a actuellement aucun devis.'
|
11
|
+
quote:
|
12
|
+
view_live_html: Voir ce devis <br/><em>(Ouvre une nouvelle fenêtre)</em>
|
13
|
+
delete: Supprimer définitivement ce devis
|
14
|
+
description: Description
|
15
|
+
show:
|
16
|
+
quote: Devis
|
17
|
+
show_quote: Voir le devis
|
18
|
+
click_to_email: Envoyer un courriel
|
19
|
+
details: Details
|
20
|
+
age: Depuis
|
21
|
+
actions: Actions
|
22
|
+
back_to_all_quotes: Retour vers tous les devis
|
23
|
+
delete: Supprimer
|
24
|
+
to: À
|
25
|
+
from: De
|
26
|
+
phone: Téléphone
|
27
|
+
date: Date
|
28
|
+
description: Description
|
29
|
+
references: References
|
30
|
+
comments: Commentaires
|
31
|
+
delete_message: Êts vous sûre de vouloir supprimer le devis de %{first_name} %{name}
|
32
|
+
quotes:
|
33
|
+
new:
|
34
|
+
send: Envoyer
|
35
|
+
errors:
|
36
|
+
empty_mail_and_phone: Votre adresse de courriel ou votre numéro de téléphone doit être remplie
|
37
|
+
invalid_format: doit être un format valide.
|
38
|
+
quote_mailer:
|
39
|
+
notification:
|
40
|
+
subject: 'Vous avez reçu une nouvelle demande de devis'
|
41
|
+
you_recieved_new_quote: 'Une nouvelle nouvelle demande de devis a été ajoutée. Vous pouvez la consulter à cette adresse : %{url}'
|
42
|
+
from: de
|
43
|
+
email: Courriel
|
44
|
+
phone: Téléphone
|
45
|
+
activerecord:
|
46
|
+
models:
|
47
|
+
quote: devis
|
48
|
+
attributes:
|
49
|
+
quote:
|
50
|
+
name: Nom
|
51
|
+
first_name: Prénom
|
52
|
+
email: Courriel
|
53
|
+
phone: Téléphone
|
54
|
+
description: Description du projet
|
55
|
+
comments: Commentaires
|
56
|
+
references_html: Références (Projets similaires que vous trouvez intéressant)
|
57
|
+
errors:
|
58
|
+
models:
|
59
|
+
quote:
|
60
|
+
attributes:
|
61
|
+
description:
|
62
|
+
blank: doit être remplie
|
63
|
+
|
64
|
+
|
@@ -0,0 +1,25 @@
|
|
1
|
+
lolcat:
|
2
|
+
shared:
|
3
|
+
admin:
|
4
|
+
image_picker:
|
5
|
+
image: IMAGE
|
6
|
+
plugins:
|
7
|
+
quotes:
|
8
|
+
title: Quotes
|
9
|
+
admin:
|
10
|
+
quotes:
|
11
|
+
actions:
|
12
|
+
create_new: CREATE NEW Quote
|
13
|
+
reorder: REORDR Quotes
|
14
|
+
reorder_done: DUN REORDERIN Quotes
|
15
|
+
records:
|
16
|
+
title: Quotes
|
17
|
+
sorry_no_results: SRY! THAR R NO RESULTS FINDZ.
|
18
|
+
no_items_yet: THAR R NO Quotes YET. CLICK "CREATE NEW Quote" 2 ADD UR FURST quote.
|
19
|
+
quote:
|
20
|
+
view_live_html: VIEW DIS quote LIV <BR/><EM>(OPENS IN NEW WINDOW)</EM>
|
21
|
+
edit: EDIT DIS quote
|
22
|
+
delete: REMOOV DIS quote FOREVR
|
23
|
+
quotes:
|
24
|
+
show:
|
25
|
+
other: OTHR Quotes
|
@@ -0,0 +1,21 @@
|
|
1
|
+
nb:
|
2
|
+
plugins:
|
3
|
+
quotes:
|
4
|
+
title: Quotes
|
5
|
+
admin:
|
6
|
+
quotes:
|
7
|
+
actions:
|
8
|
+
create_new: Lag en ny Quote
|
9
|
+
reorder: Endre rekkefølgen på Quotes
|
10
|
+
reorder_done: Ferdig å endre rekkefølgen Quotes
|
11
|
+
records:
|
12
|
+
title: Quotes
|
13
|
+
sorry_no_results: Beklager! Vi fant ikke noen resultater.
|
14
|
+
no_items_yet: Det er ingen Quotes enda. Klikk på "Lag en ny Quote" for å legge til din første quote.
|
15
|
+
quote:
|
16
|
+
view_live_html: Vis hvordan denne quote ser ut offentlig <br/><em>(åpner i et nytt vindu)</em>
|
17
|
+
edit: Rediger denne quote
|
18
|
+
delete: Fjern denne quote permanent
|
19
|
+
quotes:
|
20
|
+
show:
|
21
|
+
other: Andre Quotes
|
@@ -0,0 +1,21 @@
|
|
1
|
+
nl:
|
2
|
+
plugins:
|
3
|
+
quotes:
|
4
|
+
title: Quotes
|
5
|
+
admin:
|
6
|
+
quotes:
|
7
|
+
actions:
|
8
|
+
create_new: Maak een nieuwe Quote
|
9
|
+
reorder: Wijzig de volgorde van de Quotes
|
10
|
+
reorder_done: Klaar met het wijzingen van de volgorde van de Quotes
|
11
|
+
records:
|
12
|
+
title: Quotes
|
13
|
+
sorry_no_results: Helaas! Er zijn geen resultaten gevonden.
|
14
|
+
no_items_yet: Er zijn nog geen Quotes. Druk op 'Maak een nieuwe Quote' om de eerste aan te maken.
|
15
|
+
quote:
|
16
|
+
view_live_html: Bekijk deze quote op de website <br/><em>(opent een nieuw venster)</em>
|
17
|
+
edit: Bewerk deze quote
|
18
|
+
delete: Verwijder deze quote voor eeuwig
|
19
|
+
quotes:
|
20
|
+
show:
|
21
|
+
other: Andere Quotes
|
data/config/routes.rb
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
class CreateQuotes < ActiveRecord::Migration
|
2
|
+
|
3
|
+
def self.up
|
4
|
+
create_table :quotes do |t|
|
5
|
+
t.string :name
|
6
|
+
t.string :first_name
|
7
|
+
t.string :email
|
8
|
+
t.string :phone
|
9
|
+
t.text :description
|
10
|
+
t.text :references
|
11
|
+
t.text :comments
|
12
|
+
|
13
|
+
t.timestamps
|
14
|
+
end
|
15
|
+
|
16
|
+
add_index :quotes, :id
|
17
|
+
|
18
|
+
load(Rails.root.join('db', 'seeds', 'quotes.rb'))
|
19
|
+
end
|
20
|
+
|
21
|
+
def self.down
|
22
|
+
if defined?(UserPlugin)
|
23
|
+
UserPlugin.destroy_all({:name => "quotes"})
|
24
|
+
end
|
25
|
+
|
26
|
+
if defined?(Page)
|
27
|
+
Page.delete_all({:link_url => "/quotes"})
|
28
|
+
end
|
29
|
+
|
30
|
+
drop_table :quotes
|
31
|
+
end
|
32
|
+
|
33
|
+
end
|
data/db/seeds/quotes.rb
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
if defined?(User)
|
2
|
+
User.all.each do |user|
|
3
|
+
if user.plugins.where(:name => 'quotes').blank?
|
4
|
+
user.plugins.create(:name => 'quotes',
|
5
|
+
:position => (user.plugins.maximum(:position) || -1) +1)
|
6
|
+
end
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
10
|
+
if defined?(Page)
|
11
|
+
page = Page.create(
|
12
|
+
:title => 'Quotes',
|
13
|
+
:link_url => '/quotes',
|
14
|
+
:deletable => false,
|
15
|
+
:position => ((Page.maximum(:position, :conditions => {:parent_id => nil}) || -1)+1),
|
16
|
+
:menu_match => '^/quotes(\/|\/.+?|)$'
|
17
|
+
)
|
18
|
+
Page.default_parts.each do |default_page_part|
|
19
|
+
page.parts.create(:title => default_page_part, :body => nil)
|
20
|
+
end
|
21
|
+
|
22
|
+
thank_you = page.children.create(
|
23
|
+
:title => 'Thank you',
|
24
|
+
:link_url => '/quotes/thank_you',
|
25
|
+
:deletable => false,
|
26
|
+
:show_in_menu => false,
|
27
|
+
:position => 0,
|
28
|
+
:menu_match => '^/quotes(\/|\/.+?|)$'
|
29
|
+
)
|
30
|
+
Page.default_parts.each do |default_page_part|
|
31
|
+
thank_you.parts.create(:title => default_page_part, :body => nil)
|
32
|
+
end
|
33
|
+
end
|
data/db/seeds/quotes.rb~
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
if defined?(User)
|
2
|
+
User.all.each do |user|
|
3
|
+
if user.plugins.where(:name => 'quotes').blank?
|
4
|
+
user.plugins.create(:name => 'quotes',
|
5
|
+
:position => (user.plugins.maximum(:position) || -1) +1)
|
6
|
+
end
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
10
|
+
if defined?(Page)
|
11
|
+
page = Page.create(
|
12
|
+
:title => 'Quotes',
|
13
|
+
:link_url => '/quotes',
|
14
|
+
:deletable => false,
|
15
|
+
:position => ((Page.maximum(:position, :conditions => {:parent_id => nil}) || -1)+1),
|
16
|
+
:menu_match => '^/quotes(\/|\/.+?|)$'
|
17
|
+
)
|
18
|
+
Page.default_parts.each do |default_page_part|
|
19
|
+
page.parts.create(:title => default_page_part, :body => nil)
|
20
|
+
end
|
21
|
+
|
22
|
+
thank_you = Page.create(
|
23
|
+
:title => 'Thank you',
|
24
|
+
:link_url => '/quotes/thank_you',
|
25
|
+
:deletable => false,
|
26
|
+
:show_in_menu => false,
|
27
|
+
:position => 0,
|
28
|
+
:menu_match => '^/quotes(\/|\/.+?|)$'
|
29
|
+
)
|
30
|
+
Page.default_parts.each do |default_page_part|
|
31
|
+
thank_you.parts.create(:title => default_page_part, :body => nil)
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
require 'refinerycms-base'
|
2
|
+
|
3
|
+
module Refinery
|
4
|
+
module Quotes
|
5
|
+
|
6
|
+
class << self
|
7
|
+
attr_accessor :root
|
8
|
+
def root
|
9
|
+
@root ||= Pathname.new(File.expand_path('../../', __FILE__))
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
class Engine < Rails::Engine
|
14
|
+
initializer "static assets" do |app|
|
15
|
+
app.middleware.insert_after ::ActionDispatch::Static, ::ActionDispatch::Static, "#{root}/public"
|
16
|
+
end
|
17
|
+
|
18
|
+
config.after_initialize do
|
19
|
+
Refinery::Plugin.register do |plugin|
|
20
|
+
plugin.name = "quotes"
|
21
|
+
plugin.pathname = root
|
22
|
+
plugin.activity = {
|
23
|
+
:class => Quote
|
24
|
+
}
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
data/public/quotes.css~
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
.quotes form label {
|
2
|
+
width: 150px;
|
3
|
+
float: left;
|
4
|
+
}
|
5
|
+
.inquiries form input {
|
6
|
+
|
7
|
+
}
|
8
|
+
.inquiries form input, .inquiries form textarea {
|
9
|
+
|
10
|
+
}
|
11
|
+
.inquiries form textarea {
|
12
|
+
|
13
|
+
}
|
14
|
+
.inquiries form .actions {
|
15
|
+
margin-left: 150px;
|
16
|
+
}
|
17
|
+
|
18
|
+
.inquiries form .actions input {
|
19
|
+
}
|
20
|
+
|
21
|
+
.inquiries .field {
|
22
|
+
margin: 12px 0px;
|
23
|
+
}
|
24
|
+
|
25
|
+
.inquiries form {
|
26
|
+
padding-top: 12px;
|
27
|
+
}
|
@@ -0,0 +1,27 @@
|
|
1
|
+
.quotes form label {
|
2
|
+
width: 150px;
|
3
|
+
float: left;
|
4
|
+
}
|
5
|
+
.quotes form input {
|
6
|
+
|
7
|
+
}
|
8
|
+
.quotes form input, .quotes form textarea {
|
9
|
+
|
10
|
+
}
|
11
|
+
.quotes form textarea {
|
12
|
+
|
13
|
+
}
|
14
|
+
.quotes form .actions {
|
15
|
+
margin-left: 150px;
|
16
|
+
}
|
17
|
+
|
18
|
+
.quotes form .actions input {
|
19
|
+
}
|
20
|
+
|
21
|
+
.quotes .field {
|
22
|
+
margin: 12px 0px;
|
23
|
+
}
|
24
|
+
|
25
|
+
.quotes form {
|
26
|
+
padding-top: 12px;
|
27
|
+
}
|
metadata
ADDED
@@ -0,0 +1,71 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: refinerycms-quotes
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: '1.0'
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Guirec CORBEL
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2011-10-05 00:00:00.000000000Z
|
13
|
+
dependencies: []
|
14
|
+
description: Ruby on Rails Quotes engine for Refinery CMS
|
15
|
+
email:
|
16
|
+
executables: []
|
17
|
+
extensions: []
|
18
|
+
extra_rdoc_files: []
|
19
|
+
files:
|
20
|
+
- lib/generators/refinerycms_quotes_generator.rb
|
21
|
+
- lib/refinerycms-quotes.rb
|
22
|
+
- lib/tasks/quotes.rake
|
23
|
+
- config/locales/en.yml
|
24
|
+
- config/locales/fr.yml
|
25
|
+
- config/locales/fr.yml~
|
26
|
+
- config/locales/lolcat.yml
|
27
|
+
- config/locales/nb.yml
|
28
|
+
- config/locales/nl.yml
|
29
|
+
- config/routes.rb
|
30
|
+
- app/controllers/admin/quotes_controller.rb
|
31
|
+
- app/controllers/quotes_controller.rb
|
32
|
+
- app/controllers/quotes_controller.rb~
|
33
|
+
- app/mailers/quote_mailer.rb
|
34
|
+
- app/models/quote.rb
|
35
|
+
- app/views/admin/quotes/index.html.erb
|
36
|
+
- app/views/admin/quotes/show.html.erb
|
37
|
+
- app/views/admin/quotes/_quote.html.erb
|
38
|
+
- app/views/quotes/new.html.erb
|
39
|
+
- app/views/quotes/new.html.erb~
|
40
|
+
- app/views/quotes/thank_you.html.erb
|
41
|
+
- app/views/quote_mailer/notification.html.erb
|
42
|
+
- db/migrate/create_quotes.rb
|
43
|
+
- db/seeds/quotes.rb
|
44
|
+
- db/seeds/quotes.rb~
|
45
|
+
- public/quotes.css~
|
46
|
+
- public/refinery/quotes.css
|
47
|
+
homepage:
|
48
|
+
licenses: []
|
49
|
+
post_install_message:
|
50
|
+
rdoc_options: []
|
51
|
+
require_paths:
|
52
|
+
- lib
|
53
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
54
|
+
none: false
|
55
|
+
requirements:
|
56
|
+
- - ! '>='
|
57
|
+
- !ruby/object:Gem::Version
|
58
|
+
version: '0'
|
59
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
60
|
+
none: false
|
61
|
+
requirements:
|
62
|
+
- - ! '>='
|
63
|
+
- !ruby/object:Gem::Version
|
64
|
+
version: '0'
|
65
|
+
requirements: []
|
66
|
+
rubyforge_project:
|
67
|
+
rubygems_version: 1.8.6
|
68
|
+
signing_key:
|
69
|
+
specification_version: 3
|
70
|
+
summary: Quotes engine for Refinery CMS
|
71
|
+
test_files: []
|