thredded 0.9.3 → 0.9.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (67) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +5 -4
  3. data/app/assets/javascripts/thredded/components/post_form.es6 +5 -0
  4. data/app/assets/javascripts/thredded/components/preview_area.es6 +52 -0
  5. data/app/assets/javascripts/thredded/components/topic_form.es6 +3 -0
  6. data/app/assets/javascripts/thredded/core/debounce.es6 +32 -0
  7. data/app/assets/javascripts/thredded/core/hide_soft_keyboard.es6 +2 -1
  8. data/app/assets/javascripts/thredded/core/mention_autocompletion.es6 +2 -2
  9. data/app/assets/javascripts/thredded/core/on_page_load.es6 +2 -2
  10. data/app/assets/javascripts/thredded/core/thredded.es6 +1 -0
  11. data/app/assets/stylesheets/thredded/_thredded.scss +1 -0
  12. data/app/assets/stylesheets/thredded/components/_pagination.scss +10 -1
  13. data/app/assets/stylesheets/thredded/components/_preview_area.scss +11 -0
  14. data/app/controllers/concerns/thredded/new_private_topic_params.rb +24 -0
  15. data/app/controllers/concerns/thredded/new_topic_params.rb +18 -0
  16. data/app/controllers/concerns/thredded/render_preview.rb +15 -0
  17. data/app/controllers/thredded/post_previews_controller.rb +28 -0
  18. data/app/controllers/thredded/posts_controller.rb +2 -0
  19. data/app/controllers/thredded/private_post_previews_controller.rb +28 -0
  20. data/app/controllers/thredded/private_topic_previews_controller.rb +14 -0
  21. data/app/controllers/thredded/private_topics_controller.rb +2 -15
  22. data/app/controllers/thredded/topic_previews_controller.rb +14 -0
  23. data/app/controllers/thredded/topics_controller.rb +2 -13
  24. data/app/mailer_previews/thredded/private_topic_mailer_preview.rb +3 -1
  25. data/app/mailers/thredded/private_topic_mailer.rb +2 -1
  26. data/app/models/concerns/thredded/post_common.rb +12 -0
  27. data/app/models/thredded/post.rb +3 -5
  28. data/app/models/thredded/private_post.rb +8 -5
  29. data/app/notifiers/thredded/email_notifier.rb +1 -1
  30. data/app/view_hooks/thredded/all_view_hooks.rb +20 -0
  31. data/app/view_models/thredded/private_topic_view.rb +4 -0
  32. data/app/view_models/thredded/topic_view.rb +4 -0
  33. data/app/views/thredded/post_previews/preview.html.erb +1 -0
  34. data/app/views/thredded/post_previews/update.html.erb +1 -0
  35. data/app/views/thredded/posts/_form.html.erb +1 -0
  36. data/app/views/thredded/posts/edit.html.erb +2 -0
  37. data/app/views/thredded/posts_common/_form.html.erb +3 -2
  38. data/app/views/thredded/posts_common/form/_content.html.erb +7 -0
  39. data/app/views/thredded/posts_common/form/_preview_area.html.erb +16 -0
  40. data/app/views/thredded/private_post_previews/preview.html.erb +1 -0
  41. data/app/views/thredded/private_post_previews/update.html.erb +1 -0
  42. data/app/views/thredded/private_posts/_form.html.erb +2 -0
  43. data/app/views/thredded/private_topic_mailer/message_notification.html.erb +9 -5
  44. data/app/views/thredded/private_topic_mailer/message_notification.text.erb +4 -3
  45. data/app/views/thredded/private_topic_previews/preview.html.erb +1 -0
  46. data/app/views/thredded/private_topics/_form.html.erb +15 -8
  47. data/app/views/thredded/private_topics/index.html.erb +5 -4
  48. data/app/views/thredded/private_topics/new.html.erb +1 -0
  49. data/app/views/thredded/private_topics/show.html.erb +8 -2
  50. data/app/views/thredded/shared/preview.html.erb +10 -0
  51. data/app/views/thredded/theme_previews/show.html.erb +7 -0
  52. data/app/views/thredded/topic_previews/preview.html.erb +1 -0
  53. data/app/views/thredded/topics/_form.html.erb +4 -3
  54. data/app/views/thredded/topics/edit.html.erb +1 -1
  55. data/app/views/thredded/topics/index.html.erb +5 -4
  56. data/app/views/thredded/topics/new.html.erb +4 -3
  57. data/app/views/thredded/topics/search.html.erb +1 -1
  58. data/app/views/thredded/topics/show.html.erb +8 -1
  59. data/config/locales/en.yml +1 -0
  60. data/config/locales/es.yml +1 -0
  61. data/config/locales/pl.yml +187 -0
  62. data/config/locales/pt-BR.yml +1 -0
  63. data/config/routes.rb +14 -4
  64. data/lib/thredded/html_pipeline/at_mention_filter.rb +2 -2
  65. data/lib/thredded/version.rb +1 -1
  66. metadata +66 -4
  67. data/app/views/thredded/topics/menu/_new_topic.html.erb +0 -3
@@ -1,4 +1,4 @@
1
- <%# locals: messageboard, topic, post, content_label, button_text, button_submitting_text. %>
1
+ <%# locals: messageboard, topic, post, preview_url, content_label, button_text, button_submitting_text. %>
2
2
  <%= form_for (post.private_topic_post? ? [topic, post] : [messageboard, topic, post]), as: :post,
3
3
  html: {
4
4
  class: 'thredded--form thredded--post-form',
@@ -7,7 +7,8 @@
7
7
  'data-autocomplete-min-length' => Thredded.autocomplete_min_length,
8
8
  } do |form| %>
9
9
  <ul class="thredded--form-list">
10
- <%= render 'thredded/posts_common/form/content_field', form: form, content_label: content_label %>
10
+ <%= render 'thredded/posts_common/form/content',
11
+ form: form, content_label: content_label, preview_url: preview_url %>
11
12
  <li>
12
13
  <% button_submitting_text ||=
13
14
  post.persisted? ? t('thredded.form.update_btn_submitting') : t('thredded.form.create_btn_submitting') %>
@@ -0,0 +1,7 @@
1
+ <%= render 'thredded/posts_common/form/content_field',
2
+ form: form,
3
+ content_label: content_label %>
4
+
5
+ <%= render 'thredded/posts_common/form/preview_area',
6
+ form: form,
7
+ preview_url: preview_url %>
@@ -0,0 +1,16 @@
1
+ <%= view_hooks.post_form.preview_area.render self, form: form, preview_url: preview_url do %>
2
+ <li>
3
+ <noscript>
4
+ <button type="submit" class="thredded--button thredded--post--preview-btn"
5
+ formtarget="_blank" formaction="<%= preview_url %>">
6
+ <%= t 'thredded.form.preview' %>
7
+ </button>
8
+ </noscript>
9
+
10
+ <div class="thredded--preview-area"
11
+ data-thredded-preview-area data-thredded-preview-url="<%= preview_url %>">
12
+ <h4 class="thredded--preview-area--title"><%= t 'thredded.form.preview' %></h4>
13
+ <div class="thredded--preview-area--post thredded--post--content" data-thredded-preview-area-post></div>
14
+ </div>
15
+ </li>
16
+ <% end %>
@@ -0,0 +1 @@
1
+ <%= @private_post.filtered_content(self) %>
@@ -0,0 +1 @@
1
+ <%= @private_post.filtered_content(self) %>
@@ -1,6 +1,8 @@
1
+ <%# TODO: For private topics, only autocomplete users in this private topic %>
1
2
  <%= render 'thredded/posts_common/form',
2
3
  topic: topic,
3
4
  post: post,
5
+ preview_url: preview_url,
4
6
  button_text: t('thredded.private_posts.form.create_btn'),
5
7
  button_submitting_text: t('thredded.private_posts.form.create_btn_submitting'),
6
8
  content_label: t('thredded.private_posts.form.content_label') %>
@@ -1,11 +1,15 @@
1
- <blockquote><%= @topic.posts.first.filtered_content(self) %></blockquote>
2
- <% # as this is only sent on first post, doesn't need to define order %>
1
+ <figure>
2
+ <figcaption>
3
+ <%= @post.user.thredded_display_name %> <%= link_to 'said', private_post_permalink_url(@post) %>:
4
+ </figcaption>
5
+ <blockquote>
6
+ <%= @post.filtered_content(self) %>
7
+ </blockquote>
8
+ </figure>
3
9
  <hr />
4
-
5
10
  <p>
6
11
  This email was sent to you because <%= @topic.user.thredded_display_name %> included you in a
7
- private topic, "<%= link_to @topic.title, @topic %>".
8
- <%= link_to 'Go here', @topic %> to view the conversation.
12
+ private topic, "<%= link_to @topic.title, private_topic_url(@topic) %>".
9
13
  </p>
10
14
 
11
15
  <p>
@@ -1,11 +1,12 @@
1
- <%= @topic.posts.first.content %>
2
- <% # as this is only sent on first post, doesn't need to define order %>
1
+ <%= @post.user.thredded_display_name %> said:
2
+ <%= @post.content %>
3
3
  ---
4
4
 
5
5
  This email was sent to you because <%= @topic.user.thredded_display_name %>
6
6
  included you in the private topic "<%= @topic.title %>".
7
+
7
8
  Go here to view the conversation:
8
- <%= url_for @topic %>
9
+ <%= private_post_permalink_url(@post) %>
9
10
 
10
11
  To unsubscribe from these emails, update your preferences here:
11
12
  <%= edit_preferences_url %>
@@ -0,0 +1 @@
1
+ <%= @private_post.filtered_content(self) %>
@@ -1,6 +1,12 @@
1
1
  <%= form_for private_topic,
2
- url: private_topics_path(@private_topic),
3
- html: { class: "thredded--form thredded--new-private-topic-form #{local_assigns[:css_class]}", 'data-thredded-topic-form' => true } do |form| %>
2
+ url: private_topics_path(@private_topic),
3
+ html: {
4
+ class: "thredded--form thredded--new-private-topic-form #{local_assigns[:css_class]}",
5
+ 'data-thredded-topic-form' => true,
6
+ # TODO: only autocomplete users in this private topic
7
+ 'data-autocomplete-url' => autocomplete_users_path,
8
+ 'data-autocomplete-min-length' => Thredded.autocomplete_min_length,
9
+ } do |form| %>
4
10
 
5
11
  <ul class="thredded--form-list on-top">
6
12
  <li class="title">
@@ -10,15 +16,16 @@
10
16
  <li>
11
17
  <%= form.label :user_ids, t('thredded.private_topics.form.users_label') %>
12
18
  <%= form.text_field :user_ids,
13
- placeholder: t('thredded.private_topics.form.users_placeholder'),
14
- 'data-thredded-users-select' => true,
15
- 'data-autocomplete-url' => autocomplete_users_path,
19
+ placeholder: t('thredded.private_topics.form.users_placeholder'),
20
+ 'data-thredded-users-select' => true,
21
+ 'data-autocomplete-url' => autocomplete_users_path,
16
22
  'data-autocomplete-min-length' => Thredded.autocomplete_min_length %>
17
23
  </li>
18
24
 
19
- <%= render 'thredded/posts_common/form/content_field',
20
- form: form,
21
- content_label: t('thredded.private_topics.form.content_label') %>
25
+ <%= render 'thredded/posts_common/form/content',
26
+ form: form,
27
+ content_label: t('thredded.private_topics.form.content_label'),
28
+ preview_url: preview_url %>
22
29
 
23
30
  <li>
24
31
  <button type="submit" class="thredded--form--submit"
@@ -11,9 +11,10 @@
11
11
  <%= render 'thredded/private_topics/no_private_topics' %>
12
12
  <% else -%>
13
13
  <%= render 'thredded/private_topics/form',
14
- private_topic: @new_private_topic,
15
- css_class: 'thredded--is-compact',
16
- placeholder: t('thredded.private_topics.form.title_placeholder_start') %>
14
+ private_topic: @new_private_topic,
15
+ preview_url: preview_new_private_topic_path,
16
+ css_class: 'thredded--is-compact',
17
+ placeholder: t('thredded.private_topics.form.title_placeholder_start') %>
17
18
 
18
19
  <%= render @private_topics %>
19
20
 
@@ -26,7 +27,7 @@
26
27
  <% end -%>
27
28
  <% end %>
28
29
 
29
- <footer>
30
+ <footer class="thredded--pagination-bottom">
30
31
  <%= paginate @private_topics %>
31
32
  </footer>
32
33
  <% end %>
@@ -6,6 +6,7 @@
6
6
  <section class="thredded--main-section">
7
7
  <%= render 'thredded/private_topics/form',
8
8
  private_topic: @private_topic,
9
+ preview_url: preview_new_private_topic_path,
9
10
  placeholder: t('thredded.private_topics.form.title_placeholder_new') if @private_topic %>
10
11
  </section>
11
12
  <% end %>
@@ -8,10 +8,16 @@
8
8
  id: dom_id(private_topic),
9
9
  class: ['thredded--main-section', 'thredded--topic', *topic_css_classes(private_topic)] do %>
10
10
  <%= render 'thredded/private_topics/header', topic: private_topic %>
11
+ <%= view_hooks.posts_common.pagination_top.render(self, posts: @posts) do %>
12
+ <footer class="thredded--pagination-top"><%= paginate @posts %></footer>
13
+ <% end %>
11
14
  <%= render partial: 'thredded/private_posts/private_post', collection: @posts, cached: true %>
12
- <%= paginate @posts %>
15
+ <%= view_hooks.posts_common.pagination_bottom.render(self, posts: @posts) do %>
16
+ <footer class="thredded--pagination-bottom"><%= paginate @posts %></footer>
17
+ <% end %>
13
18
  <%= render 'thredded/private_posts/form',
14
19
  topic: private_topic,
15
- post: @post %>
20
+ post: @post,
21
+ preview_url: private_topic.new_post_preview_path %>
16
22
  <% end %>
17
23
  <% end %>
@@ -0,0 +1,10 @@
1
+ <% content_for :thredded_page_title, t('thredded.form.preview') %>
2
+ <% content_for :thredded_page_id, 'thredded--post-preview' %>
3
+
4
+ <%# The noscript version of a post preview %>
5
+ <%= thredded_page do %>
6
+ <h1><%= t 'thredded.form.preview' %></h1>
7
+ <div class="thredded--preview-area--post thredded--post--content">
8
+ <%= @preview_content %>
9
+ </div>
10
+ <% end %>
@@ -21,6 +21,7 @@
21
21
  <%= render 'thredded/topics/form',
22
22
  messageboard: @messageboard,
23
23
  topic: @new_topic,
24
+ preview_url: preview_new_messageboard_topic_path(@messageboard),
24
25
  css_class: 'thredded--is-compact',
25
26
  placeholder: 'Start a New Topic' %>
26
27
  <%= render @topics %>
@@ -39,6 +40,7 @@
39
40
  messageboard: @messageboard,
40
41
  topic: @topic,
41
42
  post: @new_post,
43
+ preview_url: @topic.new_post_preview_path,
42
44
  button_text: t('thredded.posts.form.create_btn')
43
45
  %>
44
46
  <% end %>
@@ -47,6 +49,7 @@
47
49
  <%= render 'thredded/topics/form',
48
50
  messageboard: @messageboard,
49
51
  topic: @new_topic,
52
+ preview_url: preview_new_messageboard_topic_path(@messageboard),
50
53
  placeholder: 'Start a New Topic' %>
51
54
 
52
55
  <%= render 'section_title', label: 'posts#edit', href: edit_messageboard_topic_post_path(@messageboard, @post.postable, @post) %>
@@ -57,6 +60,7 @@
57
60
  messageboard: @messageboard,
58
61
  topic: @topic,
59
62
  post: @post,
63
+ preview_url: @topic.new_post_preview_path,
60
64
  button_text: t('thredded.posts.form.update_btn')
61
65
  %>
62
66
  <% end %>
@@ -72,6 +76,7 @@
72
76
  <%= render 'thredded/private_topics/form',
73
77
  private_topic: @new_private_topic,
74
78
  css_class: 'thredded--is-compact',
79
+ preview_url: preview_new_private_topic_path,
75
80
  placeholder: t('thredded.private_topics.form.title_placeholder_start') %>
76
81
  <%= render @private_topics %>
77
82
  <% end %>
@@ -80,6 +85,7 @@
80
85
  <section class="thredded--thredded--main-section">
81
86
  <%= render 'thredded/private_topics/form',
82
87
  private_topic: @new_private_topic,
88
+ preview_url: preview_new_private_topic_path,
83
89
  placeholder: t('thredded.private_topics.form.title_placeholder_new') %>
84
90
  </section>
85
91
 
@@ -90,6 +96,7 @@
90
96
  <%= render 'thredded/private_posts/form',
91
97
  topic: @private_topic,
92
98
  post: @private_post,
99
+ preview_url: @private_topic.new_post_preview_path,
93
100
  button_text: t('thredded.private_posts.form.create_btn')
94
101
  %>
95
102
  </section>
@@ -0,0 +1 @@
1
+ <%= @post.filtered_content(self) %>
@@ -20,9 +20,10 @@
20
20
  </li>
21
21
  <% end %>
22
22
 
23
- <%= render 'thredded/posts_common/form/content_field',
24
- form: form,
25
- content_label: t('thredded.topics.form.content_label') %>
23
+ <%= render 'thredded/posts_common/form/content',
24
+ form: form,
25
+ content_label: t('thredded.topics.form.content_label'),
26
+ preview_url: preview_url %>
26
27
  <%= render 'thredded/topics/topic_form_admin_options', form: form %>
27
28
 
28
29
  <li><%= form.submit t('thredded.topics.form.create_btn'), class: 'thredded--form--submit' %></li>
@@ -3,7 +3,7 @@
3
3
  <% content_for :thredded_breadcrumbs do %>
4
4
  <ul class="thredded--navigation-breadcrumbs">
5
5
  <li><%= link_to t('thredded.nav.all_messageboards'), messageboards_path %></li>
6
- <li><%= link_to messageboard.name, messageboard_topics_path(@topic.messageboard, @topic) %></li>
6
+ <li><%= link_to messageboard.name, messageboard_topics_path(@topic.messageboard) %></li>
7
7
  <li><%= link_to @topic.title, topic_path(@topic) %></li>
8
8
  <li><%= link_to t('thredded.nav.edit_topic'), edit_messageboard_topic_path(@topic.messageboard, @topic) %></li>
9
9
  </ul>
@@ -11,13 +11,14 @@
11
11
  <%= content_tag :section, class: 'thredded--main-section thredded--topics', 'data-thredded-topics' => true do %>
12
12
  <%= render 'thredded/topics/form',
13
13
  messageboard: messageboard,
14
- topic: @new_topic,
15
- css_class: 'thredded--is-compact',
16
- placeholder: t('thredded.topics.form.title_placeholder_start') if @new_topic %>
14
+ topic: @new_topic,
15
+ css_class: 'thredded--is-compact',
16
+ preview_url: preview_new_messageboard_topic_path(messageboard),
17
+ placeholder: t('thredded.topics.form.title_placeholder_start') if @new_topic %>
17
18
  <%= render @topics %>
18
19
  <% end %>
19
20
 
20
- <footer>
21
+ <footer class="thredded--pagination-bottom">
21
22
  <%= paginate @topics %>
22
23
  </footer>
23
24
 
@@ -5,7 +5,8 @@
5
5
  <%= thredded_page do %>
6
6
  <%= render 'thredded/topics/form',
7
7
  messageboard: messageboard,
8
- topic: @new_topic,
9
- css_class: 'thredded--is-expanded',
10
- placeholder: t('thredded.topics.form.title_placeholder_start') %>
8
+ topic: @new_topic,
9
+ css_class: 'thredded--is-expanded',
10
+ preview_url: preview_new_messageboard_topic_path(messageboard),
11
+ placeholder: t('thredded.topics.form.title_placeholder_start') %>
11
12
  <% end %>
@@ -10,7 +10,7 @@
10
10
  <section class="thredded--main-section thredded--topics">
11
11
  <%= render @topics %>
12
12
  </section>
13
- <footer>
13
+ <footer class="thredded--pagination-bottom">
14
14
  <%= paginate @topics %>
15
15
  </footer>
16
16
  <% else %>
@@ -7,9 +7,15 @@
7
7
  <%= content_tag :section,
8
8
  id: dom_id(topic),
9
9
  class: ['thredded--main-section', 'thredded--topic', *topic_css_classes(topic)] do %>
10
+
10
11
  <%= render 'thredded/topics/header', topic: topic %>
12
+ <%= view_hooks.posts_common.pagination_top.render(self, posts: @posts) do %>
13
+ <footer class="thredded--pagination-top"><%= paginate @posts %></footer>
14
+ <% end %>
11
15
  <%= render partial: 'thredded/posts/post', collection: @posts, cached: true %>
12
- <%= paginate @posts %>
16
+ <%= view_hooks.posts_common.pagination_bottom.render(self, posts: @posts) do %>
17
+ <footer class="thredded--pagination-bottom"><%= paginate @posts %></footer>
18
+ <% end %>
13
19
 
14
20
  <% if policy(@new_post).create? %>
15
21
  <div class="thredded--post-form--wrapper">
@@ -17,6 +23,7 @@
17
23
  <%= render 'thredded/posts/form',
18
24
  topic: topic,
19
25
  post: @new_post,
26
+ preview_url: topic.new_post_preview_path,
20
27
  button_text: t('thredded.posts.form.create_btn'),
21
28
  button_submitting_text: t('thredded.posts.form.create_btn_submitting') %>
22
29
  </div>
@@ -15,6 +15,7 @@ en:
15
15
  create_btn_submitting: Creating...
16
16
  update: Update
17
17
  update_btn_submitting: Updating...
18
+ preview: Preview
18
19
  messageboard:
19
20
  create: Create a New Messageboard
20
21
  form:
@@ -13,6 +13,7 @@ es:
13
13
  private_topic_not_found: Este tema privado no existe.
14
14
  form:
15
15
  create_btn_submitting: Creando...
16
+ preview: Vista previa
16
17
  update: Actualizar
17
18
  update_btn_submitting: Actualizando...
18
19
  messageboard:
@@ -0,0 +1,187 @@
1
+ ---
2
+ pl:
3
+ thredded:
4
+ content_moderation_states:
5
+ content_blocked_notice: Zablokowany
6
+ content_blocked_notice_with_record_html: Zablokowany przez %{moderator} %{time_ago}
7
+ email_notifier:
8
+ by_email: przez e-mail
9
+ errors:
10
+ login_required: Proszę się najpierw zalogować.
11
+ not_authorized: Nie masz uprawnień aby zobaczyć tę stronę.
12
+ private_topic_create_denied: Nie masz uprawnień do tworzenia prywatnych tematów.
13
+ private_topic_not_found: Ten prywatny temat nie istnieje.
14
+ form:
15
+ create_btn_submitting: Tworzenie...
16
+ preview: Zapowiedź
17
+ update: Zaktualizuj
18
+ update_btn_submitting: Aktualizowanie...
19
+ messageboard:
20
+ create: Stwórz nową tablicę
21
+ form:
22
+ create_btn_submitting: :thredded.form.create_btn_submitting
23
+ no_group: Brak grupy
24
+ update_btn_submitting: :thredded.form.update_btn_submitting
25
+ index:
26
+ page_title: Tablice
27
+ last_updated_by_html: Zaktualizowano %{time_ago} <cite>przez %{user}</cite>
28
+ topics_and_posts_counts: "%{topics_count} tematów / %{posts_count} postów"
29
+ update: :thredded.form.update
30
+ updated_notice: Tablica została zaktualizowana
31
+ messageboard_group:
32
+ create: Stwórz nową Grupę
33
+ form:
34
+ create_btn_submitting: :thredded.form.create_btn_submitting
35
+ saved: Grupa %{name} została utworzona
36
+ moderation:
37
+ approve_btn: Zaakceptuj
38
+ block_btn: Zablokuj
39
+ pending:
40
+ empty:
41
+ content: Wszystkie posty zostały zweryfikowane.
42
+ title: Dobra robota!
43
+ post_approved_html: Post zaakceptowany przez %{moderator} %{time_ago}.
44
+ post_blocked_html: Post zablokowany przez %{moderator} %{time_ago}.
45
+ post_deleted_notice: Ten post został usunięty.
46
+ posts_content_changed_since_moderation_html: >-
47
+ Zawartość <a href="%{post_url}">postu</a> zmieniła się od czasu moderacji. Poniżej znajduje się jego treść
48
+ z okresu moderacji.
49
+ search_users:
50
+ form_label: Wyszukaj użytkowników
51
+ form_placeholder: :thredded.moderation.search_users.form_label
52
+ no_results_message: 'Brak użytkowników zaczynających się od: %{query}'
53
+ results_message: 'Użytkownicy zaczynający się od: %{query}'
54
+ nav:
55
+ all_messageboards: Wszystkie tablice
56
+ edit_messageboard: Edytuj tablicę
57
+ edit_post: Edytuj post
58
+ edit_private_topic: :thredded.nav.edit_topic
59
+ edit_topic: Edytuj
60
+ mark_all_read: Oznacz jako przeczytane
61
+ moderation: Moderacja
62
+ moderation_activity: Aktywność
63
+ moderation_history: Historia
64
+ moderation_pending: Oczekujące
65
+ moderation_users: Użytkownicy
66
+ private_topics: Prywatne wiadomości
67
+ settings: Ustawienia powiadomień
68
+ null_user_name: Usunięci użytkownicy
69
+ posts:
70
+ delete: Usuń post
71
+ delete_confirm: Jesteś pewny, że chcesz usunąć ten post?
72
+ deleted_notice: Twój post został usunięty.
73
+ edit: :thredded.nav.edit_post
74
+ form:
75
+ content_label: Treść
76
+ create_btn: Wyślij odpowiedź
77
+ create_btn_submitting: Wysyłanie...
78
+ update_btn: Zaktualizuj post
79
+ update_btn_submitting: :thredded.form.update_btn_submitting
80
+ pending_moderation_notice: Twój post zostanie zamieszczony po zweryfikowaniu go przez moderatora.
81
+ preferences:
82
+ edit:
83
+ page_title: :thredded.nav.settings
84
+ form:
85
+ follow_topics_on_mention:
86
+ hint: 'Gdy ktoś w temacie wspomni o Tobie (np.: @sam) zaczniesz obserwować ten temat.'
87
+ label: Obserwuj tematy, w których zostałeś wspomiany
88
+ global_preferences_label: Ustawienia powiadomień
89
+ messageboard_follow_topics_on_mention:
90
+ hint: 'Gdy ktoś w temacie wspomni o Tobie (np.: @sam) zaczniesz obserwować ten temat.'
91
+ label: :thredded.preferences.form.follow_topics_on_mention.label
92
+ messageboard_notifications_for_followed_topics:
93
+ label: :thredded.preferences.form.notifications_for_followed_topics.label
94
+ messageboard_preferences_label_html: Notification Settings for <em>%{messageboard}</em>
95
+ notifications_for_followed_topics:
96
+ label: Powiadomienia z obserwowanych tematów
97
+ notifications_for_private_topics:
98
+ label: Powiadomienia z prywatnych wiadomości
99
+ submit_btn: Zaktualizuj ustawienia
100
+ title: Ustawienia
101
+ update_btn_submitting: :thredded.form.update_btn_submitting
102
+ updated_notice: Twoje ustawienia zostały zaktualizowane.
103
+ private_posts:
104
+ form:
105
+ content_label: Wiadomość
106
+ create_btn: Wyślij wiadomość
107
+ create_btn_submitting: Wysyłanie
108
+ update_btn_submitting: :thredded.form.update_btn_submitting
109
+ private_topics:
110
+ edit: Edytuj
111
+ errors:
112
+ user_ids_length: Proszę dodać przynajmniej jednego innego użytkownika.
113
+ form:
114
+ content_label: :thredded.private_posts.form.content_label
115
+ create_btn: :thredded.private_posts.form.create_btn
116
+ create_btn_submitting: :thredded.private_posts.form.create_btn_submitting
117
+ title_label: :thredded.topics.form.title_label
118
+ title_placeholder_new: Wpisz temat konwersacji
119
+ title_placeholder_start: Rozpocznij konwersację
120
+ update_btn: Zaktualizuj
121
+ update_btn_submitting: :thredded.private_posts.form.update_btn_submitting
122
+ users_label: Uczestnicy
123
+ users_placeholder: Zaproś użytkowników do udziału w tej konwersacji
124
+ no_private_topics:
125
+ create_btn: Rozpocznij swoją pierwszą prywatną konwersację
126
+ title: Nie masz żadnych prywatnych wiadomości.
127
+ updated_notice: Tytuł zaktualizowany.
128
+ recent_activity: Ostatnia aktywność.
129
+ search:
130
+ form:
131
+ btn_submit: :thredded.search.form.label
132
+ label: Wyszukaj
133
+ placeholder: Wyszukaj tematy i posty.
134
+ time_ago: "%{time} ago"
135
+ topics:
136
+ delete_confirm: Jesteś pewien, że chcesz usunąć ten temat? Tej operacji nie można cofnąć.
137
+ delete_topic: Usuń temat
138
+ deleted_notice: Temat usunięty.
139
+ edit: Edytuj temat
140
+ follow: Obserwuj temat
141
+ followed_by: 'Obserwowany przez:'
142
+ followed_by_noone: Nikt nie obserwuje tego tematu
143
+ followed_notice: Obserwujesz ten temat
144
+ following:
145
+ manual: Obserwujesz ten temat.
146
+ mentioned: Obserwujesz ten temat, ponieważ ktoś wspomniał w nim o tobie.
147
+ posted: Obserwujesz ten temat, ponieważ w nim napisałeś.
148
+ form:
149
+ categories_placeholder: Kategorie
150
+ content_label: :thredded.posts.form.content_label
151
+ create_btn: Stwórz nowy temat
152
+ title_label: Tytuł
153
+ title_placeholder: :thredded.topics.form.title_label
154
+ title_placeholder_start: Rozpocznij nowy temat
155
+ update_btn: Zaktualizuj temat
156
+ locked:
157
+ label: Zablokowany
158
+ not_following: Nie obserwujesz tego tematu.
159
+ search:
160
+ no_results_message: 'Nie odnaleziono żadnych wyników dla frazy: %{query}'
161
+ page_title: Wyniki wyszukiwania
162
+ results_message: 'Wyniki wyszukiwania dla: %{query}'
163
+ started_by_html: Rozpoczęty %{time_ago} przez %{user}
164
+ sticky:
165
+ label: Przyklejony
166
+ unfollow: Przestań obserwować
167
+ unfollowed_notice: Przestałeś obserwować ten temat
168
+ updated_notice: Temat zaktualizowany
169
+ users:
170
+ currently_online: Aktualnie online
171
+ last_active_html: Ostatnio aktywny %{time_ago}
172
+ posted_in_topic_html: Napisał w temacie %{topic_link}
173
+ posts_count:
174
+ few: Napisał %{count} postów
175
+ many: Napisał %{count} postów
176
+ one: Napisał 1 post
177
+ other: Napisał %{count} postów
178
+ recent_activity: :thredded.recent_activity
179
+ started_topic_html: Rozpoczął %{topic_link}
180
+ started_topics_count:
181
+ few: Rozpoczął %{count} tematy
182
+ many: Rozpoczął %{count} tematów
183
+ one: Rozpoczął 1 temat
184
+ other: Rozpoczął %{count} tematów
185
+ user_posted_in_topic_html: "%{user_link} napisał w %{topic_link}"
186
+ user_since_html: Zarejestrowany od %{time_ago}
187
+ user_started_topic_html: "%{user_link} rozpoczął %{topic_link}"
@@ -13,6 +13,7 @@ pt-BR:
13
13
  private_topic_not_found: Este tópico privado não existe.
14
14
  form:
15
15
  create_btn_submitting: Criando...
16
+ preview: Pré-visualização
16
17
  update: Atualizar
17
18
  update_btn_submitting: Atualizando...
18
19
  messageboard:
data/config/routes.rb CHANGED
@@ -7,12 +7,17 @@ Thredded::Engine.routes.draw do # rubocop:disable Metrics/BlockLength
7
7
 
8
8
  scope path: 'private-topics' do
9
9
  resource :read_state, only: [:update], as: :mark_all_private_topics_read
10
- resource :private_topic, only: [:new], path: ''
10
+ resource :private_topic, only: [:new], path: '' do
11
+ post :preview, on: :new, controller: 'private_topic_previews'
12
+ end
11
13
  resources :private_topics, except: [:new, :show], path: '' do
12
14
  member do
13
15
  get '(page-:page)', action: :show, as: '', constraints: page_constraint
14
16
  end
15
- resources :private_posts, path: '', except: [:index, :show], controller: 'posts'
17
+ resources :private_posts, path: '', except: [:index, :show], controller: 'posts' do
18
+ post :preview, on: :new, controller: 'private_post_previews'
19
+ resource :preview, only: [:update], controller: 'private_post_previews'
20
+ end
16
21
  end
17
22
  end
18
23
 
@@ -48,7 +53,9 @@ Thredded::Engine.routes.draw do # rubocop:disable Metrics/BlockLength
48
53
  resources :messageboards, only: [:edit, :update]
49
54
  resources :messageboards, only: [:index, :create], path: '' do
50
55
  resource :preferences, only: [:edit, :update]
51
- resource :topic, path: 'topics', only: [:new]
56
+ resource :topic, path: 'topics', only: [:new] do
57
+ post :preview, on: :new, controller: 'topic_previews'
58
+ end
52
59
  resources :topics, path: '', except: [:index, :new, :show] do
53
60
  collection do
54
61
  get '(page-:page)', action: :index, as: '', constraints: page_constraint
@@ -61,7 +68,10 @@ Thredded::Engine.routes.draw do # rubocop:disable Metrics/BlockLength
61
68
  match 'follow', via: [:post, :get]
62
69
  match 'unfollow', via: [:post, :get]
63
70
  end
64
- resources :posts, except: [:index, :show], path: ''
71
+ resources :posts, except: [:index, :show], path: '' do
72
+ post :preview, on: :new, controller: 'post_previews'
73
+ resource :preview, only: [:update], controller: 'post_previews'
74
+ end
65
75
  end
66
76
  end
67
77
 
@@ -34,7 +34,7 @@ module Thredded
34
34
 
35
35
  private
36
36
 
37
- MATCH_NAME_RE = /(?:^|[\s>])@([\w]+|"[\w ]+")(?=\W|$)/
37
+ MATCH_NAME_RE = /(?:^|[\s>])@(\w+|"[\w. ]+")(?=\W|$)/
38
38
 
39
39
  def mentioned_names(text_node_html)
40
40
  text_node_html.scan(MATCH_NAME_RE).map(&:first).map { |m| m.start_with?('"') ? m[1..-2] : m }
@@ -45,7 +45,7 @@ module Thredded
45
45
  return unless names.present?
46
46
  @users_provider.call(names).each do |user|
47
47
  name = user.thredded_display_name
48
- maybe_quoted_name = name.include?(' ') ? %("#{name}") : name
48
+ maybe_quoted_name = name =~ /[. ]/ ? %("#{name}") : name
49
49
  url = Thredded.user_path(@view_context, user)
50
50
  text_node_html.gsub!(
51
51
  /(^|[\s>])(@#{Regexp.escape maybe_quoted_name})([^a-z\d]|$)/i,
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Thredded
3
- VERSION = '0.9.3'
3
+ VERSION = '0.9.4'
4
4
  end