simple_discussion 0.9.5 → 1.0.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: a3254bbe940b1d74626469b008b0189eff8b48e6
4
- data.tar.gz: 15d14fde5ff8912b9f70c207dd42a80f66305776
2
+ SHA256:
3
+ metadata.gz: 8eb44f9da87f2a9e1cbf3ad42d69c10f4b010a3b6f09dd9dca27ce224aa1d7b3
4
+ data.tar.gz: 213e7b06dc339780bacd1cd4d079abda4efb465479d0c2fd05b966c834839cf1
5
5
  SHA512:
6
- metadata.gz: 4df44f369de7e7aced89967bc5cf9d4aba9cbcd1f02cf301c0c3a2238f43d21897153741e78e0db60c22b82410824e6d9b225d03ba803d5495479a7f972c0ed9
7
- data.tar.gz: 716f93eb02108af2ba09ad8a98fe5ab7885cb4f931d73db438eddf357be886d3c64120fa0e7ef68b07e2777e67805f49fd27ebed389cbbbeab499fce7208faf1
6
+ metadata.gz: ffe0817f1d31c617bd23aa09cd6d8e3b696321194bfacdcb897ccbe4121a3ae523e6f09dd21e0b9ff49205f753641ef9cf7fdb6ec81fe7a9c7212e0847c2d1f3
7
+ data.tar.gz: aac23697656f675a651c24a5a8c88ec09c3db39916a15fcee6fffc51e7efd3f9ead467c48423369b5c7439eb3cf4719366c04d1c81abb757fef588610580ec2f
@@ -54,7 +54,7 @@ class SimpleDiscussion::ForumThreadsController < SimpleDiscussion::ApplicationCo
54
54
 
55
55
  def update
56
56
  if @forum_thread.update(forum_thread_params)
57
- redirect_to simple_discussion.forum_thread_path(@forum_thread), notice: "Your changes were saved."
57
+ redirect_to simple_discussion.forum_thread_path(@forum_thread), notice: I18n.t('your_changes_were_saved')
58
58
  else
59
59
  render action: :edit
60
60
  end
@@ -56,20 +56,20 @@ class ForumThread < ApplicationRecord
56
56
  end
57
57
 
58
58
  def subscribed_reason(user)
59
- return "You’re not receiving notifications from this thread." if user.nil?
59
+ return I18n.t('.not_receiving_notifications') if user.nil?
60
60
 
61
61
  subscription = subscription_for(user)
62
62
 
63
63
  if subscription.present?
64
64
  if subscription.subscription_type == "optout"
65
- "You're ignoring this thread."
65
+ I18n.t('.ignoring_thread')
66
66
  elsif subscription.subscription_type == "optin"
67
- "You're receiving notifications because you've subscribed to this thread."
67
+ I18n.t('.receiving_notifications_because_subscribed')
68
68
  end
69
69
  elsif forum_posts.where(user_id: user.id).any?
70
- "You're receiving notifications because you've posted in this thread."
70
+ I18n.t('.receiving_notifications_because_posted')
71
71
  else
72
- "You're not receiving notifications from this thread."
72
+ I18n.t('.not_receiving_notifications')
73
73
  end
74
74
  end
75
75
 
@@ -1,29 +1,63 @@
1
1
  <div class="row col-md-12">
2
- <h1>Community</h1>
2
+ <h1>
3
+ <%= t('community') %>
4
+ </h1>
3
5
  </div>
4
6
 
5
7
  <div class="row simple_discussion">
6
8
  <div class="col-md-3 mb-3">
7
9
 
8
10
  <div class="card card-body">
9
- <%= link_to 'Ask A Question', simple_discussion.new_forum_thread_path, class: "btn btn-outline-primary btn-block" %>
11
+ <%= link_to t('ask_a_question'), simple_discussion.new_forum_thread_path, class: "btn btn-outline-primary btn-block" %>
10
12
  <hr />
11
13
 
12
14
  <div class="forum-thread-filters">
13
- <h5><strong>Filters</strong></h5>
14
- <div><%= forum_link_to simple_discussion.forum_threads_path, exact: true do %><%= icon "bars" %> All Threads <% end %></div>
15
+ <h5>
16
+ <strong>
17
+ <%= t('filters') %>
18
+ </strong>
19
+ </h5>
20
+ <div>
21
+ <%= forum_link_to simple_discussion.forum_threads_path, exact: true do %>
22
+ <%= icon "bars" %>
23
+ <%= t('.all_threads') %>
24
+ <% end %>
25
+ </div>
15
26
  <% if user_signed_in? %>
16
- <div><%= forum_link_to simple_discussion.mine_forum_threads_path do %><%= icon "user-circle-o" %> My Questions<% end %></div>
17
- <div><%= forum_link_to simple_discussion.participating_forum_threads_path do %><%= icon "comments-o" %> Participating<% end %></div>
27
+ <div>
28
+ <%= forum_link_to simple_discussion.mine_forum_threads_path do %><%= icon "user-circle-o" %>
29
+ <%= t('.my_questions') %>
30
+ <% end %>
31
+ </div>
32
+ <div>
33
+ <%= forum_link_to simple_discussion.participating_forum_threads_path do %>
34
+ <%= icon "comments-o" %>
35
+ <%= t('.participating') %>
36
+ <% end %>
37
+ </div>
18
38
  <% end %>
19
- <div><%= forum_link_to simple_discussion.answered_forum_threads_path do %><%= icon "check" %> Answered<% end %></div>
20
- <div><%= forum_link_to simple_discussion.unanswered_forum_threads_path do %><%= icon "question" %> Unanswered<% end %></div>
39
+ <div>
40
+ <%= forum_link_to simple_discussion.answered_forum_threads_path do %>
41
+ <%= icon "check" %>
42
+ <%= t('.answered') %>
43
+ <% end %>
44
+ </div>
45
+ <div>
46
+ <%= forum_link_to simple_discussion.unanswered_forum_threads_path do %>
47
+ <%= icon "question" %>
48
+ <%= t('.unanswered') %>
49
+ <% end %>
50
+ </div>
21
51
  </div>
22
52
 
23
53
  <hr />
24
54
 
25
55
  <div class="forum-thread-filters">
26
- <h6><strong>By Category</strong></h6>
56
+ <h6>
57
+ <strong>
58
+ <%= t('.by_category') %>
59
+ </strong>
60
+ </h6>
27
61
  <div><%= forum_link_to simple_discussion.forum_threads_path, exact: true do %><%= icon "circle" %> All<% end %></div>
28
62
  <% ForumCategory.sorted.each do |category| %>
29
63
  <div>
@@ -39,13 +73,14 @@
39
73
  <hr />
40
74
 
41
75
  <%# User has not posted in the thread or subscribed %>
42
- <h5>Notifications</h5>
76
+ <h5><%= t('.notifications') %></h5>
43
77
 
44
78
  <%= link_to simple_discussion.forum_thread_notifications_path(@forum_thread), method: :post, class: "btn btn-secondary btn-sm btn-block mb-2" do %>
45
79
  <% if @forum_thread.subscribed? current_user %>
46
80
  <%= icon "bell-slash" %> Unsubscribe
47
81
  <% else %>
48
- <%= icon "bell" %> Subscribe
82
+ <%= icon "bell" %>
83
+ <%= t('.suscribe') %>
49
84
  <% end %>
50
85
  <% end %>
51
86
 
@@ -15,7 +15,7 @@
15
15
  <% end %>
16
16
 
17
17
  <div class="form-group">
18
- <%= f.text_area :body, placeholder: "Add a comment", rows: 8, class: "form-control simplemde", data: { behavior: "comment-body" } %>
18
+ <%= f.text_area :body, placeholder: t('add_a_comment'), rows: 8, class: "form-control simplemde", data: { behavior: "comment-body" } %>
19
19
  </div>
20
20
 
21
21
  <div class="text-right">
@@ -26,7 +26,7 @@
26
26
  </small>
27
27
  </div>
28
28
 
29
- <%= f.button "#{"Update" unless f.object.new_record?} Comment", class: "btn btn-primary", data: {disable_with: "<i class='fa fa-spinner fa-spin'></i> Saving comment..."} %>
29
+ <%= f.button "#{f.object.new_record? ? t('comment') : t('update_comment') }", class: "btn btn-primary", data: {disable_with: "<i class='fa fa-spinner fa-spin'></i> #{t('saving_comment')}"} %>
30
30
  </div>
31
31
 
32
32
  <% end %>
@@ -8,7 +8,7 @@
8
8
  <%= link_to icon("pencil"), simple_discussion.edit_forum_thread_forum_post_path(@forum_thread, forum_post),
9
9
  class: "text-muted",
10
10
  data: { toggle: "tooltip", placement: "left" },
11
- title: "Edit this post"
11
+ title: t('edit_this_post')
12
12
  %>
13
13
  </div>
14
14
  <% end %>
@@ -20,7 +20,7 @@
20
20
  <%= forum_post.user.name %> <%= forum_user_badge(forum_post.user) %>
21
21
  </strong>
22
22
  <small>
23
- commented on
23
+ <%= t('commented_on') %>
24
24
  <%= link_to forum_post.created_at.strftime("%b %d, %Y"), simple_discussion.forum_thread_path(@forum_thread, anchor: "forum_post_#{forum_post.id}") %>:
25
25
  </small>
26
26
  </div>
@@ -49,7 +49,7 @@
49
49
  <small>
50
50
  <%= link_to simple_discussion.solved_forum_thread_forum_post_path(@forum_thread, forum_post), method: :put do %>
51
51
  <%= icon("check") %>
52
- This solved my question
52
+ <%= t('this_solved_my_question') %>
53
53
  <% end %>
54
54
  </small>
55
55
  </div>
@@ -4,7 +4,8 @@
4
4
 
5
5
  <p class="thread-details">
6
6
  <strong><%= category_link(@forum_thread.forum_category) %></strong>
7
- Asked <%= time_ago_in_words(@forum_thread.created_at) + ' ago' %> by <%= @forum_thread.user.name %>
7
+ • <%= t('asked_time_ago', time: time_ago_in_words(@forum_thread.created_at), author: @forum_thread.user.name) %>
8
+ </p>
8
9
  </p>
9
10
 
10
11
  <br />
@@ -14,7 +15,10 @@
14
15
  <div>
15
16
  <%= avatar_tag(@forum_post.user.email) %>
16
17
  <strong class="forum-post-user"><%= @forum_post.user.name %></strong>
17
- <small> commented on <%= link_to @forum_post.created_at.strftime("%b %d, %Y"), simple_discussion.forum_thread_url(@forum_thread, anchor: "forum_post_#{@forum_post.id}") %>:</small>
18
+ <small>
19
+ <%= t('commented_on')%>
20
+ <%= link_to @forum_post.created_at.strftime("%b %d, %Y"), simple_discussion.forum_thread_url(@forum_thread, anchor: "forum_post_#{@forum_post.id}") %>:
21
+ </small>
18
22
  </div>
19
23
  </div>
20
24
 
@@ -15,29 +15,29 @@
15
15
  <% end %>
16
16
 
17
17
  <div class="form-group">
18
- <%= f.label :forum_category_id, "Choose a Category" %>
19
- <%= f.collection_select :forum_category_id, ForumCategory.sorted, :id, :name, {include_blank: "Pick a category..."}, {autofocus: true, class: "form-control"} %>
18
+ <%= f.label :forum_category_id, t('choose_a_category') %>
19
+ <%= f.collection_select :forum_category_id, ForumCategory.sorted, :id, :name, {include_blank: t('pick_a_category')}, {autofocus: true, class: "form-control"} %>
20
20
  </div>
21
21
 
22
22
  <div class="form-group">
23
- <%= f.label :title %>
24
- <%= f.text_field :title, placeholder: "How do I...?", class: "form-control" %>
23
+ <%= f.label t('title') %>
24
+ <%= f.text_field :title, placeholder: t('how_do_i'), class: "form-control" %>
25
25
  </div>
26
26
 
27
27
  <% if local_assigns.fetch(:posts, true) %>
28
28
  <%= f.fields_for :forum_posts do |p| %>
29
29
  <div class="form-group">
30
30
  <%= p.label :body, "What do you need help with?" %>
31
- <%= p.text_area :body, placeholder: "Add a comment", rows: 10, class: "form-control simplemde", data: { behavior: "comment-body" } %>
31
+ <%= p.text_area :body, placeholder: t('add_a_comment'), rows: 10, class: "form-control simplemde", data: { behavior: "comment-body" } %>
32
32
  </div>
33
33
  <% end %>
34
34
  <% end %>
35
35
 
36
36
  <div class="form-group text-right">
37
37
  <% if f.object.new_record? %>
38
- <%= f.button "Ask Your Question", class: "btn btn-primary", data: {disable_with: "<i class='fa fa-spinner fa-spin'></i> Saving..."} %>
38
+ <%= f.button "Ask Your Question", class: "btn btn-primary", data: {disable_with: "<i class='fa fa-spinner fa-spin'></i> #{t('saving')}"} %>
39
39
  <% else %>
40
- <%= f.button "Update Thread", class: "btn btn-primary", data: {disable_with: "<i class='fa fa-spinner fa-spin'></i> Saving..."} %>
40
+ <%= f.button "Update Thread", class: "btn btn-primary", data: {disable_with: "<i class='fa fa-spinner fa-spin'></i> #{t('saving')}"} %>
41
41
  <% end %>
42
42
  </div>
43
43
 
@@ -19,16 +19,16 @@
19
19
 
20
20
  <div class="thread-details">
21
21
  <strong><%= category_link(forum_thread.forum_category) %></strong>
22
- Asked <%= time_ago_in_words(forum_thread.created_at) + ' ago' %> by <%= forum_thread.user.name %>
22
+ • <%= t('asked_time_ago', time: time_ago_in_words(forum_thread.created_at), author: forum_thread.user.name) %>
23
23
  </div>
24
24
 
25
25
  <p class="text-muted"><%= truncate(forum_thread.forum_posts.first.body, length: 200) %></p>
26
26
  </div>
27
27
 
28
- <div class="col-sm-1 text-center">
28
+ <div class="col-sm-2 text-center">
29
29
  <%= link_to simple_discussion.forum_thread_path(forum_thread), class: "thread-posts-count" do %>
30
30
  <span class="count"><%= forum_thread.forum_posts_count %></span>
31
- <small><%= "post".pluralize(forum_thread.forum_posts_count) %></small>
31
+ <small><%= t("post", count: forum_thread.forum_posts_count) %></small>
32
32
  <% end %>
33
33
  </div>
34
34
 
@@ -1,6 +1,6 @@
1
1
  <%= content_for :title, "Edit Thread" %>
2
2
 
3
- <h1>Edit Thread</h1>
3
+ <h1><%= t('edit_thread') %></h1>
4
4
 
5
5
  <div class="forum_post">
6
6
  <%= render 'form', posts: false %>
@@ -8,7 +8,7 @@
8
8
  <%= link_to icon("pencil"), simple_discussion.edit_forum_thread_path(@forum_thread),
9
9
  class: "text-muted",
10
10
  data: { toggle: "tooltip", placement: "left" },
11
- title: "Edit this thread" %>
11
+ title: t('edit_this_thread') %>
12
12
  </div>
13
13
  <% end %>
14
14
 
@@ -16,7 +16,7 @@
16
16
 
17
17
  <p class="thread-details">
18
18
  <strong><%= category_link(@forum_thread.forum_category) %></strong>
19
- Asked <%= time_ago_in_words(@forum_thread.created_at) + ' ago' %> by <%= @forum_thread.user.name %>
19
+ • <%= t('asked_time_ago', time: time_ago_in_words(@forum_thread.created_at), author: @forum_thread.user.name) %>
20
20
  </p>
21
21
 
22
22
  <%= render partial: "simple_discussion/forum_posts/forum_post", collection: @forum_thread.forum_posts.includes(:user).sorted %>
@@ -0,0 +1,37 @@
1
+ en:
2
+ add_a_comment: Add A Comment
3
+ ask_a_question: Ask A Question
4
+ asked_time_ago: "Asked %{time} ago by %{author}"
5
+ choose_a_category: Choose a Category
6
+ comment: comment
7
+ commented_on: Commented on
8
+ community: Community
9
+ edit_this_post: Edit this post
10
+ edit_this_thread: Edit this thread
11
+ edit_thread: Edit thread
12
+ filters: Filters
13
+ how_do_i: How do I...?
14
+ ignoring_thread: You're ignoring this thread.
15
+ not_receiving_notifications: You’re not receiving notifications from this thread.
16
+ layouts:
17
+ simple_discussion:
18
+ all_threads: All Threads
19
+ answered: Answered
20
+ by_category: By Category
21
+ my_questions: My Questions
22
+ notifications: Notifications
23
+ participating: Participating
24
+ suscribe: Subscribe
25
+ unanswered: Unanswered
26
+ pick_a_category: Pick a category...
27
+ post:
28
+ one: post
29
+ other: posts
30
+ receiving_notifications_because_subscribed: You're receiving notifications because you've subscribed to this thread.
31
+ receiving_notifications_because_posted: You're receiving notifications because you've posted in this thread.
32
+ saving_comment: Saving comment...
33
+ saving: Saving
34
+ this_solved_my_question: This solved my question
35
+ title: title
36
+ update_comment: Update comment
37
+ your_changes_were_saved: Your changes were saved
@@ -0,0 +1,37 @@
1
+ es:
2
+ add_a_comment: Añade un comentario
3
+ ask_a_question: HAZ UNA PREGUNTA
4
+ asked_time_ago: "Preguntado hace %{time} por %{author}"
5
+ choose_a_category: Selecciona una categoría
6
+ comment: comenta
7
+ commented_on: Comentado en
8
+ community: Comunidad
9
+ edit_this_post: Edita esta publicación
10
+ edit_this_thread: Edita este tema
11
+ edit_thread: Edita el tema
12
+ filters: Filtros
13
+ how_do_i: Cómo puedo...?
14
+ ignoring_thread: "Estás ignorando este tema"
15
+ not_receiving_notifications: "No estás recibiendo notificaciones de este tema."
16
+ layouts:
17
+ simple_discussion:
18
+ all_threads: Todos Los Temas
19
+ answered: Respondidas
20
+ by_category: Por Categoría
21
+ my_questions: Mis Preguntas
22
+ notifications: Notificaciones
23
+ participating: Participando
24
+ suscribe: Suscribirse
25
+ unanswered: Sin Responder
26
+ pick_a_category: Elige una categoría...
27
+ post:
28
+ one: publicación
29
+ other: publicaciones
30
+ receiving_notifications_because_subscribed: Estás recibiendo notificaciones porque te suscribiste a este tema.
31
+ receiving_notifications_because_posted: Estás recibiendo notificaciones porque publicaste en este tema.
32
+ saving_comment: Guardando comentario...
33
+ saving: Guardando
34
+ this_solved_my_question: Esto resolvió mi pregunta
35
+ title: Título
36
+ update_comment: Actualiza tu comentario
37
+ your_changes_were_saved: Tus cambios fueron guardados
@@ -1,3 +1,3 @@
1
1
  module SimpleDiscussion
2
- VERSION = "0.9.5"
2
+ VERSION = "1.0.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple_discussion
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.5
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Oliver
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-09-08 00:00:00.000000000 Z
11
+ date: 2019-02-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: font-awesome-sass
@@ -124,6 +124,8 @@ files:
124
124
  - app/views/simple_discussion/user_mailer/new_thread.html.erb
125
125
  - bin/console
126
126
  - bin/setup
127
+ - config/locales/en.yml
128
+ - config/locales/es.yml
127
129
  - config/routes.rb
128
130
  - db/migrate/20170417012930_create_forum_categories.rb
129
131
  - db/migrate/20170417012931_create_forum_threads.rb
@@ -158,8 +160,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
158
160
  - !ruby/object:Gem::Version
159
161
  version: '0'
160
162
  requirements: []
161
- rubyforge_project:
162
- rubygems_version: 2.6.13
163
+ rubygems_version: 3.0.1
163
164
  signing_key:
164
165
  specification_version: 4
165
166
  summary: A simple, extensible Rails forum