tkh_content 0.10.3 → 0.10.4

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dd7bc55b0d8bb4d7f10dffc54da9c7faf6be9ee4
4
- data.tar.gz: 19a5f636495315ef82a0a20600d9dcc1321a4ac8
3
+ metadata.gz: 7c8668b344e4cf0d8c448d884e7a9d2d4c32ac89
4
+ data.tar.gz: babab662e689ff46d44bb8528e5d51695567795b
5
5
  SHA512:
6
- metadata.gz: ed228f74e5ebc4fd9f7d3ce1713a7425d4ec75a0adc1b6d1f5accab8beb39b69de72971975b893d43f0df248a2abc62bd14000986e8953e96b750ad90c8c8967
7
- data.tar.gz: f53acd8c17e22e8fa959ccf1a5230f104fb350bbe6940307009c719c0a980209e59fe9dc6bc10a10dc641f5f5728b8609b0a133b59d217ef5cbb828465f949f1
6
+ metadata.gz: 4df7228acc84cc82e5c467fb44e5d61ea8a82af26284cf99056fc8bc3fc35ee3e348382d9d914ed2b35f987176cfe4a99c769248c0ffb1e4bf66458960d0ac03
7
+ data.tar.gz: 54daaf9f771ec5dff5695892da94b6a8bc1ba20eb91f19bf5b4fd313075b6466f3ed59c5afbd7e19c5b4ab17b5d274e821d795cb7c7398e68954426a610b81bc
data/CHANGELOG.md CHANGED
@@ -2,6 +2,11 @@
2
2
 
3
3
 
4
4
 
5
+ ## 0.10.4
6
+
7
+ * Deleted the contact form resource. Exported it to the tkh_mailing_list gem.
8
+
9
+
5
10
  ## 0.10.3
6
11
 
7
12
  * Debugged page_parent_id attribute in page model
data/config/routes.rb CHANGED
@@ -12,8 +12,6 @@ Rails.application.routes.draw do
12
12
  end
13
13
  end
14
14
 
15
- resources :contacts
16
-
17
15
  resources :comments do
18
16
  collection do
19
17
  get :pending
@@ -4,8 +4,6 @@ de:
4
4
  models:
5
5
  comment: 'Kommentar'
6
6
  comments: 'Kommentare'
7
- contact: 'Kontakt'
8
- contacts: 'Kontakte'
9
7
  page: 'Seite'
10
8
  pages: 'Seiten'
11
9
  tag: 'Tag'
@@ -23,11 +21,6 @@ de:
23
21
  tags:
24
22
  name: "name"
25
23
 
26
- contacts:
27
- sender_name: "Absender-Name"
28
- sender_email: 'Absender-Email'
29
- body: 'Nachricht'
30
-
31
24
  comments:
32
25
  author: 'Verfasser'
33
26
  body: "Haupttext"
@@ -73,20 +66,6 @@ de:
73
66
  hint:
74
67
  name: 'Lower case only. Multiple words should be joined by a dash (-) and NOT spaces'
75
68
 
76
- contacts:
77
- messages_from_forms: 'Nachrichten vom Kontaktformular'
78
- send_message: 'Nachricht senden'
79
- sent: 'Gesendet am'
80
- create:
81
- did_not_reach: 'Etwas ist schief gegangen. Deine Nachricht hat den gewünschten Adressaten nicht erreicht.'
82
- invalid_email: 'Deine Emai-Adresse scheint ungültig zu sein!'
83
- notice: 'Die Nachricht wurde gesendet.'
84
- warning: 'Beim Versenden der Nachricht gab es ein Problem.'
85
- mailer:
86
- intro: 'Hier ist die Nachricht vom Kontaktformular der Webseite:'
87
- sender_name: "Absendername:"
88
- sender_email: "Absender-Email:"
89
- message: 'Nachricht'
90
69
 
91
70
  comments:
92
71
  login_needed: 'Du must angemeldet sein, um einen Kommentar zu verfassen'
@@ -4,8 +4,6 @@ en:
4
4
  models:
5
5
  comment: 'comment'
6
6
  comments: 'comments'
7
- contact: 'contact'
8
- contacts: 'contacts'
9
7
  page: 'page'
10
8
  pages: 'pages'
11
9
  tag: 'tag'
@@ -23,11 +21,6 @@ en:
23
21
  tags:
24
22
  name: "name"
25
23
 
26
- contacts:
27
- sender_name: "sender name"
28
- sender_email: 'sender email'
29
- body: 'message'
30
-
31
24
  comments:
32
25
  author: 'author'
33
26
  body: "body text"
@@ -73,21 +66,6 @@ en:
73
66
  hint:
74
67
  name: 'Lower case only. Multiple words should be joined by a dash (-) and NOT spaces'
75
68
 
76
- contacts:
77
- messages_from_forms: 'messages from contact form'
78
- send_message: 'send message'
79
- sent: 'Sent at'
80
- create:
81
- did_not_reach: 'Something went wrong. Your message did not reach the intended recipient.'
82
- invalid_email: 'Your email address does not seem to be valid!'
83
- notice: 'Thank you. We have received your message.'
84
- warning: 'There was a problem sending your message.'
85
- mailer:
86
- intro: 'Here is the message sent via the contact form on the web site:'
87
- sender_name: "Sender's name:"
88
- sender_email: "Sender's email:"
89
- message: 'Message:'
90
-
91
69
  comments:
92
70
  login_needed: 'You need to be logged in to leave a comment'
93
71
  sorted_by_oldest: 'This section is sorted by oldest comment first so that they can be moderated from top to bottom.'
@@ -4,8 +4,6 @@ es:
4
4
  models:
5
5
  comment: 'comment'
6
6
  comments: 'comments'
7
- contact: 'contact'
8
- contacts: 'contacts'
9
7
  page: 'page'
10
8
  pages: 'pages'
11
9
  tag: 'tag'
@@ -23,11 +21,6 @@ es:
23
21
  tags:
24
22
  name: "name"
25
23
 
26
- contacts:
27
- sender_name: "nombre del remitente"
28
- sender_email: 'correo electrónico del remitente'
29
- body: 'mensaje'
30
-
31
24
  comments:
32
25
  author: 'author'
33
26
  body: "body text"
@@ -73,21 +66,6 @@ es:
73
66
  hint:
74
67
  name: 'Lower case only. Multiple words should be joined by a dash (-) and NOT spaces'
75
68
 
76
- contacts:
77
- messages_from_forms: 'mensajes del formulario de contacto'
78
- send_message: 'enviar el mensaje'
79
- sent: 'Enviado a las'
80
- create:
81
- did_not_reach: 'Something went wrong. Your message did not reach the intended recipient.'
82
- invalid_email: 'Your email address does not seem to be valid!'
83
- notice: 'Tu mensaje ha sido enviado.'
84
- warning: 'Hubo un problema al enviar su mensaje.'
85
- mailer:
86
- intro: 'Here is the message sent via the contact form on the web site:'
87
- sender_name: "Sender's name:"
88
- sender_email: "Sender's email:"
89
- message: 'Message:'
90
-
91
69
  comments:
92
70
  login_needed: 'You need to be logged in to leave a comment'
93
71
  sorted_by_oldest: 'This section is sorted by oldest comment first so that they can be moderated from top to bottom.'
@@ -4,8 +4,6 @@ fr:
4
4
  models:
5
5
  comment: 'commentaire'
6
6
  comments: 'commentaires'
7
- contact: 'contact'
8
- contacts: 'les contacts'
9
7
  page: 'page'
10
8
  pages: 'les pages'
11
9
  tag: 'étiquette'
@@ -23,11 +21,6 @@ fr:
23
21
  tags:
24
22
  name: "nom"
25
23
 
26
- contacts:
27
- sender_name: "votre nom"
28
- sender_email: "votre adresse email"
29
- body: 'contenu du message'
30
-
31
24
  comments:
32
25
  author: 'auteur'
33
26
  body: "texte"
@@ -73,20 +66,6 @@ fr:
73
66
  hint:
74
67
  name: 'Pas de majuscules, que des minuscules. Entre les mots multiples, utilisez un tiret ( - ), pas avec un espace.'
75
68
 
76
- contacts:
77
- messages_from_forms: 'messages du formulaire de contact'
78
- send_message: 'envoyez le message'
79
- sent: 'Envoyé le'
80
- create:
81
- did_not_reach: "Il y a eu un problem. Le message n'a pas été acheminé a sa destination."
82
- invalid_email: 'Votre adresse courriel ne semble pas bonne !'
83
- notice: 'Merci. Nous avons bien reçu votre message.'
84
- warning: "Il y'a eu un probleme en envoyant votre message."
85
- mailer:
86
- intro: 'Voici le message envoyé par un visiteur avec le formulaire de contact sur le site web :'
87
- sender_name: "Nom de l'auteur :"
88
- sender_email: "Adresse courriel de l'auteur :"
89
- message: 'Message :'
90
69
 
91
70
  comments:
92
71
  login_needed: 'Vous devez être identifié pour fournir un commentaire'
@@ -23,7 +23,6 @@ module TkhContent
23
23
  migration_template "add_parent_id_to_pages.rb", "db/migrate/add_parent_id_to_pages.rb"
24
24
  migration_template "create_tags.rb", "db/migrate/create_tags.rb"
25
25
  migration_template "create_taggings.rb", "db/migrate/create_taggings.rb"
26
- migration_template "create_contacts.rb", "db/migrate/create_contacts.rb"
27
26
  migration_template "add_various_indices_to_pages.rb", "db/migrate/add_various_indices_to_pages.rb"
28
27
  migration_template "create_comments.rb", "db/migrate/create_comments.rb"
29
28
  migration_template "make_comments_polymorphic.rb", "db/migrate/make_comments_polymorphic.rb"
@@ -1,3 +1,3 @@
1
1
  module TkhContent
2
- VERSION = "0.10.3"
2
+ VERSION = "0.10.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tkh_content
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.3
4
+ version: 0.10.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Swami Atma
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-13 00:00:00.000000000 Z
11
+ date: 2015-02-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -164,14 +164,11 @@ files:
164
164
  - app/assets/javascripts/ckeditor/config.js.coffee
165
165
  - app/controllers/blog_controller.rb
166
166
  - app/controllers/comments_controller.rb
167
- - app/controllers/contacts_controller.rb
168
167
  - app/controllers/pages_controller.rb
169
168
  - app/controllers/tags_controller.rb
170
169
  - app/helpers/blog_helper.rb
171
170
  - app/helpers/pages_helper.rb
172
- - app/mailers/contact_mailer.rb
173
171
  - app/models/comment.rb
174
- - app/models/contact.rb
175
172
  - app/models/page.rb
176
173
  - app/models/tag.rb
177
174
  - app/models/tagging.rb
@@ -195,11 +192,6 @@ files:
195
192
  - app/views/comments/for_feed.atom.builder
196
193
  - app/views/comments/index.html.erb
197
194
  - app/views/comments/pending.html.erb
198
- - app/views/contact_mailer/message_from_contact_form.text.erb
199
- - app/views/contacts/_form.html.erb
200
- - app/views/contacts/_tab_admin_menu.html.erb
201
- - app/views/contacts/index.html.erb
202
- - app/views/contacts/show.html.erb
203
195
  - app/views/pages/_admin_context_menu.html.erb
204
196
  - app/views/pages/_blog_post_meta.html.erb
205
197
  - app/views/pages/_draft_notice.html.erb
@@ -230,7 +222,6 @@ files:
230
222
  - lib/generators/tkh_content/create_or_update_migrations/templates/add_short_title_to_pages.rb
231
223
  - lib/generators/tkh_content/create_or_update_migrations/templates/add_various_indices_to_pages.rb
232
224
  - lib/generators/tkh_content/create_or_update_migrations/templates/create_comments.rb
233
- - lib/generators/tkh_content/create_or_update_migrations/templates/create_contacts.rb
234
225
  - lib/generators/tkh_content/create_or_update_migrations/templates/create_pages.rb
235
226
  - lib/generators/tkh_content/create_or_update_migrations/templates/create_taggings.rb
236
227
  - lib/generators/tkh_content/create_or_update_migrations/templates/create_tags.rb
@@ -287,7 +278,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
287
278
  version: '0'
288
279
  requirements: []
289
280
  rubyforge_project:
290
- rubygems_version: 2.4.4
281
+ rubygems_version: 2.2.2
291
282
  signing_key:
292
283
  specification_version: 4
293
284
  summary: Rails engine running pages and blog posts.
@@ -1,65 +0,0 @@
1
- class ContactsController < ApplicationController
2
-
3
- before_filter :authenticate, :except => 'create'
4
- before_filter :authenticate_with_admin, :except => 'create'
5
-
6
- def index
7
- @contacts = Contact.by_recent.paginate(:page => params[:page], :per_page => 35)
8
- switch_to_admin_layout
9
- end
10
-
11
- def show
12
- @contact = Contact.find(params[:id])
13
- switch_to_admin_layout
14
- end
15
-
16
- def create
17
- @contact = Contact.new(contact_params)
18
- saved = @contact.save
19
- sent_email = send_message_to_admin(@contact)
20
-
21
- if saved && sent_email == 'success'
22
- redirect_to root_path, notice: t("contacts.create.notice")
23
- elsif saved && sent_email == 'exception'
24
- flash[:error] = t("contacts.create.warning")
25
- redirect_to :back
26
- elsif saved && sent_email == 'invalid'
27
- flash[:error] = "#{t("contacts.create.warning")} #{t('contacts.create.invalid_email')}"
28
- redirect_to :back
29
- else
30
- flash[:error] = t('contacts.create.did_not_reach')
31
- redirect_to :back
32
- end
33
- end
34
-
35
- def valid_email?(string)
36
- (!string.blank? && string =~ /^([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})$/i) ? true : false
37
- end
38
- # helper_method :valid_email?
39
-
40
- private
41
-
42
- def send_message_to_admin(contact)
43
- # check email validity
44
- if valid_email?(contact.sender_email)
45
- # Actually send the email to the student
46
- begin
47
- ContactMailer.message_from_contact_form(contact).deliver
48
- return 'success'
49
- rescue Exception => e
50
- AdminMailer.rescued_exceptions(e, "Some exception occurred while trying to send to site admin a message from contact form").deliver
51
- @exception = e
52
- return 'exception'
53
- end
54
- else # for invalid or blank emails
55
- return 'invalid'
56
- end
57
- end
58
-
59
- # Never trust parameters from the scary internet, only allow the white list through.
60
- def contact_params
61
- params.require(:contact).permit(:sender_name, :sender_email, :body)
62
- end
63
-
64
-
65
- end
@@ -1,21 +0,0 @@
1
- class ContactMailer < ActionMailer::Base
2
-
3
- # default :from => "info@yoga.lu"
4
-
5
- # Subject can be set in your I18n file at config/locales/en.yml
6
- # with the following lookup:
7
- #
8
- # en.user_mailer.password_reset.subject
9
- #
10
- def message_from_contact_form(contact)
11
- @contact = contact
12
- # FIXME - only the email addresses show up. not the names :-(
13
- # TODO - what do to if contact_email is not set?
14
- recipient = "#{Setting.first.try(:company_name)} <#{Setting.first.try(:contact_email)}>"
15
- reply_to = "#{@contact.sender_name} <#{@contact.sender_email}>"
16
- mail to: recipient,
17
- from: "#{Setting.first.site_name} <deploy@mailcenter.tenthousandhours.eu>",
18
- reply_to: reply_to,
19
- subject: "Message from #{@contact.sender_name} via #{Setting.first.try(:site_name)} web site"
20
- end
21
- end
@@ -1,15 +0,0 @@
1
- # this is needed for now to make mass assignment security compatible with the translation of globalize3
2
- # Globalize::ActiveRecord::Translation.class_eval do
3
- # attr_accessible :locale
4
- # end
5
-
6
- class Contact < ActiveRecord::Base
7
-
8
- validates_presence_of :sender_name
9
- validates_presence_of :sender_email
10
- # validates :sender_email, :presence => true, :format => { :with => /\A([\A@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\z/i, :on => :create }
11
- validates_presence_of :body
12
-
13
- scope :by_recent, -> { order('updated_at desc') }
14
-
15
- end
@@ -1,12 +0,0 @@
1
- <%= t('contacts.mailer.intro') %>
2
-
3
- - <%= t('contacts.mailer.sender_name') %> <%= @contact.sender_name %>
4
- - <%= t('contacts.mailer.sender_email') %> <%= @contact.sender_email %>
5
-
6
- <%= t('contacts.mailer.message') %>
7
-
8
- -----------------------------------
9
-
10
- <%= @contact.body %>
11
-
12
- -----------------------------------
@@ -1,9 +0,0 @@
1
- <%= simple_form_for Contact.new do |f| %>
2
- <%= f.error_notification %>
3
-
4
- <%= f.input :sender_name, label: t('activerecord.attributes.contacts.sender_name') %>
5
- <%= f.input :sender_email, label: t('activerecord.attributes.contacts.sender_email') %>
6
- <%= f.input :body, label: t('activerecord.attributes.contacts.body'), :input_html => { :rows => 10 } %>
7
-
8
- <%= f.button :submit, t('contacts.send_message'), :class => 'btn btn-primary' %>
9
- <% end %>
@@ -1,4 +0,0 @@
1
- <ul class="nav nav-tabs" id="admin-menu-tab">
2
- <%= content_tag :li, link_to(t('list'), contacts_path), ({ class: 'active' } if controller.action_name.to_s == 'index' ) %>
3
- <%= content_tag :li, link_to(t('view'), contacts_path), ({ class: 'active' }) if controller.action_name.to_s == 'show' %>
4
- </ul>
@@ -1,31 +0,0 @@
1
- <h1><%= t 'activerecord.models.contacts' %></h1>
2
-
3
- <%= render 'tab_admin_menu' %>
4
-
5
- <table class='table table-striped'>
6
- <thead>
7
- <tr>
8
- <th><%= t 'activerecord.attributes.contacts.sender_name' %></th>
9
- <th><%= t 'activerecord.attributes.contacts.sender_email' %></th>
10
- <th><%= t 'activerecord.attributes.contacts.body' %></th>
11
- <th><%= t 'contacts.sent' %></th>
12
- <th><%= t('actions') %></th>
13
- </tr>
14
- </thead>
15
-
16
- <tbody>
17
- <% @contacts.each do |contact| %>
18
- <tr>
19
- <td><%= contact.sender_name %></td>
20
- <td><%= link_to contact.sender_email, "mailto:#{contact.sender_email}" %></td>
21
- <td><%= truncate contact.body, length: 85, separator: ' ...' %></td>
22
- <td><%= l contact.created_at, :format => :tkh_default %></td>
23
- <td><%= link_to t('view'), contact %></td>
24
- </tr>
25
- <% end %>
26
- </tbody>
27
- </table>
28
-
29
- <%= will_paginate @contacts %>
30
-
31
- <%= render 'shared/admin_sidebar' %>
@@ -1,18 +0,0 @@
1
- <h1><%= t('activerecord.models.contacts') %></h1>
2
-
3
- <%= render 'tab_admin_menu' %>
4
-
5
- <h2><%= "#{t('contacts.sent')}#{t('colon')} #{ l(@contact.created_at, :format => :tkh_default) }" %></h2>
6
-
7
- <p>
8
- <%= "#{t('activerecord.attributes.contacts.sender_name').capitalize}#{t('colon')} #{@contact.sender_name}" %><br />
9
- <%= "#{t('activerecord.attributes.contacts.sender_email')}#{t('colon')} #{link_to(@contact.sender_email, "mailto:#{@contact.sender_email}")}".capitalize.html_safe %>
10
- </p>
11
- <h3><%= t('activerecord.attributes.contacts.body').capitalize %></h3>
12
- <p><%= sanitize @contact.body.gsub(/\r\n?/, "<br>"), :tags => %w(br), :attributes => %w() %></p>
13
-
14
- <hr>
15
-
16
- <p><%= link_to t('list'), contacts_path, class: 'btn' %></p>
17
-
18
- <%= render 'shared/admin_sidebar' %>
@@ -1,19 +0,0 @@
1
- class CreateContacts < ActiveRecord::Migration
2
-
3
- def self.up
4
- create_table :contacts do |t|
5
- t.string :sender_name
6
- t.string :sender_email
7
- t.text :body
8
-
9
- t.timestamps
10
- end
11
- add_index :contacts, :updated_at
12
- end
13
-
14
- def self.down
15
- drop_table :contacts
16
- remove_index :contacts, :updated_at
17
- end
18
-
19
- end