thredded 0.3.2 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.mkdn +22 -2
- data/README.mkdn +17 -5
- data/app/assets/stylesheets/thredded/base/_typography.scss +9 -0
- data/app/assets/stylesheets/thredded/base/_variables.scss +4 -0
- data/app/assets/stylesheets/thredded/components/_messageboard.scss +13 -1
- data/app/assets/stylesheets/thredded/components/_post.scss +15 -1
- data/app/assets/stylesheets/thredded/layout/_search-navigation.scss +1 -1
- data/app/controllers/thredded/application_controller.rb +1 -1
- data/app/controllers/thredded/messageboard_groups_controller.rb +29 -0
- data/app/controllers/thredded/messageboards_controller.rb +24 -10
- data/app/controllers/thredded/post_permalinks_controller.rb +10 -0
- data/app/controllers/thredded/private_post_permalinks_controller.rb +11 -0
- data/app/controllers/thredded/private_topics_controller.rb +2 -1
- data/app/controllers/thredded/theme_previews_controller.rb +3 -2
- data/app/controllers/thredded/topics_controller.rb +14 -7
- data/app/forms/thredded/private_topic_form.rb +4 -2
- data/app/helpers/thredded/application_helper.rb +1 -1
- data/app/helpers/thredded/urls_helper.rb +5 -3
- data/app/mailer_previews/thredded/base_mailer_preview.rb +12 -6
- data/app/mailer_previews/thredded/post_mailer_preview.rb +2 -1
- data/app/mailer_previews/thredded/private_post_mailer_preview.rb +2 -1
- data/app/mailer_previews/thredded/private_topic_mailer_preview.rb +2 -1
- data/app/models/concerns/thredded/post_common.rb +6 -5
- data/app/models/thredded/messageboard.rb +18 -1
- data/app/models/thredded/messageboard_group.rb +11 -0
- data/app/models/thredded/null_user.rb +2 -6
- data/app/policies/thredded/messageboard_group_policy.rb +15 -0
- data/app/policies/thredded/messageboard_policy.rb +4 -0
- data/app/policies/thredded/post_policy.rb +5 -0
- data/app/policies/thredded/private_post_policy.rb +5 -0
- data/app/view_models/thredded/messageboard_group_view.rb +14 -0
- data/app/views/thredded/messageboard_groups/new.html.erb +20 -0
- data/app/views/thredded/messageboards/_form.html.erb +19 -0
- data/app/views/thredded/messageboards/edit.html.erb +11 -0
- data/app/views/thredded/messageboards/index.html.erb +14 -6
- data/app/views/thredded/messageboards/new.html.erb +3 -16
- data/app/views/thredded/post_mailer/at_notification.html.erb +1 -1
- data/app/views/thredded/post_mailer/at_notification.text.erb +1 -1
- data/app/views/thredded/posts_common/_form.html.erb +1 -1
- data/app/views/thredded/posts_common/form/_after_content.html.erb +0 -0
- data/app/views/thredded/posts_common/form/_before_content.html.erb +0 -0
- data/app/views/thredded/posts_common/form/_content_field.html.erb +6 -0
- data/app/views/thredded/private_post_mailer/at_notification.html.erb +1 -1
- data/app/views/thredded/private_topics/_form.html.erb +1 -1
- data/app/views/thredded/topics/_form.html.erb +1 -1
- data/app/views/thredded/topics/index.html.erb +8 -0
- data/app/views/thredded/users/_link.html.erb +1 -1
- data/config/locales/en.yml +11 -0
- data/config/locales/pt-BR.yml +15 -3
- data/config/routes.rb +12 -1
- data/db/migrate/20160329231848_create_thredded.rb +8 -0
- data/db/seeds.rb +10 -5
- data/db/upgrade_migrations/20160429222452_upgrade_v0_3_to_v0_4.rb +14 -0
- data/heroku.gemfile +1 -1
- data/heroku.gemfile.lock +43 -43
- data/lib/generators/thredded/install/USAGE +1 -6
- data/lib/generators/thredded/install/install_generator.rb +0 -5
- data/lib/thredded/engine.rb +8 -0
- data/lib/thredded/version.rb +1 -1
- data/thredded.gemspec +1 -1
- metadata +17 -6
- data/app/controllers/thredded/setups_controller.rb +0 -54
- data/app/views/thredded/posts/_content_field.html.erb +0 -4
@@ -16,6 +16,10 @@ module Thredded
|
|
16
16
|
@user.thredded_admin? || @user.thredded_can_read_messageboards.include?(@messageboard)
|
17
17
|
end
|
18
18
|
|
19
|
+
def update?
|
20
|
+
@user.thredded_admin?
|
21
|
+
end
|
22
|
+
|
19
23
|
def post?
|
20
24
|
@user.thredded_admin? || @user.thredded_can_write_messageboards.include?(@messageboard)
|
21
25
|
end
|
@@ -1,4 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
require_dependency 'thredded/topic_policy'
|
2
3
|
module Thredded
|
3
4
|
class PostPolicy
|
4
5
|
# @param user [Thredded.user_class]
|
@@ -12,6 +13,10 @@ module Thredded
|
|
12
13
|
@user.thredded_admin? || !@post.postable.locked? && messageboard_policy.post?
|
13
14
|
end
|
14
15
|
|
16
|
+
def read?
|
17
|
+
TopicPolicy.new(@user, @post.postable).read?
|
18
|
+
end
|
19
|
+
|
15
20
|
def update?
|
16
21
|
@user.thredded_admin? || own_post? || messageboard_policy.moderate?
|
17
22
|
end
|
@@ -1,4 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
require_dependency 'thredded/private_topic_policy'
|
2
3
|
module Thredded
|
3
4
|
class PrivatePostPolicy
|
4
5
|
# @param user [Thredded.user_class]
|
@@ -12,6 +13,10 @@ module Thredded
|
|
12
13
|
@user.thredded_admin? || @post.postable.users.include?(@user)
|
13
14
|
end
|
14
15
|
|
16
|
+
def read?
|
17
|
+
PrivateTopicPolicy.new(@user, @post.postable).read?
|
18
|
+
end
|
19
|
+
|
15
20
|
def update?
|
16
21
|
@user.thredded_admin? || own_post?
|
17
22
|
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
module Thredded
|
3
|
+
# A view model for a page of MessageboardGroupViews.
|
4
|
+
class MessageboardGroupView
|
5
|
+
delegate :name, to: :@group, allow_nil: true
|
6
|
+
attr_reader :group, :messageboards
|
7
|
+
# @param group Thredded::MessageboardGroup
|
8
|
+
# @param messageboards [Thredded::TopicCommon]
|
9
|
+
def initialize(group, messageboards)
|
10
|
+
@group = group
|
11
|
+
@messageboards = messageboards
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
<% content_for :thredded_page_title, t('thredded.messageboard_group.create') %>
|
2
|
+
<% content_for :thredded_page_id, 'thredded--messageboard-groups-new' %>
|
3
|
+
<% content_for :thredded_breadcrumbs do %>
|
4
|
+
<ul class="thredded--navigation-breadcrumbs">
|
5
|
+
<li><%= t('thredded.messageboard_group.create') %></li>
|
6
|
+
</ul>
|
7
|
+
<% end %>
|
8
|
+
|
9
|
+
<%= thredded_page do %>
|
10
|
+
<%= form_for @messageboard_group, html: { class: 'thredded--form' } do |f| %>
|
11
|
+
<ul class="thredded--form-list">
|
12
|
+
<li>
|
13
|
+
<%= f.label :name %>
|
14
|
+
<%= f.text_field :name, required: true %>
|
15
|
+
</li>
|
16
|
+
|
17
|
+
<li><%= f.submit t('thredded.messageboard_group.create'), class: 'thredded--form--submit' %></li>
|
18
|
+
</ul>
|
19
|
+
<% end %>
|
20
|
+
<% end %>
|
@@ -0,0 +1,19 @@
|
|
1
|
+
<%= form_for messageboard, html: { class: 'thredded--form' } do |f| %>
|
2
|
+
<ul class="thredded--form-list">
|
3
|
+
<li>
|
4
|
+
<%= f.label :name %>
|
5
|
+
<%= f.text_field :name, required: true %>
|
6
|
+
</li>
|
7
|
+
<li>
|
8
|
+
<%= f.label :description %>
|
9
|
+
<%= f.text_field :description %>
|
10
|
+
</li>
|
11
|
+
<li>
|
12
|
+
<%= f.label :messageboard_group_id %>
|
13
|
+
<%= f.collection_select :messageboard_group_id, Thredded::MessageboardGroup.all, :id, :name,
|
14
|
+
include_blank: t('thredded.messageboard.form.no_group') %>
|
15
|
+
</li>
|
16
|
+
<li><%= f.submit @messageboard.persisted? ? t('thredded.messageboard.update') : t('thredded.messageboard.create'),
|
17
|
+
class: 'thredded--form--submit' %></li>
|
18
|
+
</ul>
|
19
|
+
<% end %>
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<% content_for :thredded_page_title, t('thredded.nav.edit_messageboard') %>
|
2
|
+
<% content_for :thredded_page_id, 'thredded--messageboard-edit' %>
|
3
|
+
<% content_for :thredded_breadcrumbs do %>
|
4
|
+
<ul class="thredded--navigation-breadcrumbs">
|
5
|
+
<li><%= t('thredded.nav.edit_messageboard') %></li>
|
6
|
+
</ul>
|
7
|
+
<% end %>
|
8
|
+
|
9
|
+
<%= thredded_page do %>
|
10
|
+
<%= render 'form', messageboard: @messageboard %>
|
11
|
+
<% end %>
|
@@ -3,12 +3,20 @@
|
|
3
3
|
<% content_for :thredded_breadcrumbs, render('thredded/shared/breadcrumbs') %>
|
4
4
|
<%= thredded_page do %>
|
5
5
|
<section class="thredded--main-section thredded--messageboards">
|
6
|
-
|
7
|
-
|
6
|
+
<% @groups.each do |group| %>
|
7
|
+
<% if group.name.present? %>
|
8
|
+
<h3><%= group.name %></h3>
|
9
|
+
<% end %>
|
10
|
+
<%= render group.messageboards %>
|
11
|
+
<% end %>
|
8
12
|
|
9
|
-
|
10
|
-
|
11
|
-
|
13
|
+
<div class="thredded--messageboards--actions">
|
14
|
+
<% if policy(Thredded::Messageboard.new).create? %>
|
15
|
+
<a class="thredded--button" href="<%= new_messageboard_path %>"><%= t('thredded.messageboard.create') %></a>
|
16
|
+
<% end %>
|
17
|
+
<% if policy(Thredded::MessageboardGroup.new).create? %>
|
18
|
+
<a class="thredded--button" href="<%= new_messageboard_group_path %>"><%= t('thredded.messageboard_group.create') %></a>
|
19
|
+
<% end %>
|
12
20
|
</div>
|
13
|
-
|
21
|
+
</section>
|
14
22
|
<% end %>
|
@@ -1,24 +1,11 @@
|
|
1
|
-
<% content_for :thredded_page_title, '
|
1
|
+
<% content_for :thredded_page_title, t('thredded.messageboard.create') %>
|
2
2
|
<% content_for :thredded_page_id, 'thredded--messageboards-new' %>
|
3
3
|
<% content_for :thredded_breadcrumbs do %>
|
4
4
|
<ul class="thredded--navigation-breadcrumbs">
|
5
|
-
<li
|
5
|
+
<li><%= t('thredded.messageboard.create') %></li>
|
6
6
|
</ul>
|
7
7
|
<% end %>
|
8
8
|
|
9
9
|
<%= thredded_page do %>
|
10
|
-
<%=
|
11
|
-
<ul class="thredded--form-list">
|
12
|
-
<li>
|
13
|
-
<%= f.label :name %>
|
14
|
-
<%= f.text_field :name, required: true %>
|
15
|
-
</li>
|
16
|
-
<li>
|
17
|
-
<%= f.label :description %>
|
18
|
-
<%= f.text_field :description %>
|
19
|
-
</li>
|
20
|
-
|
21
|
-
<li><%= f.submit 'Create New Messageboard', class: 'thredded--form--submit' %></li>
|
22
|
-
</ul>
|
23
|
-
<% end %>
|
10
|
+
<%= render 'form', messageboard: @messageboard %>
|
24
11
|
<% end %>
|
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
<p>
|
6
6
|
This email was sent to you because <%= @post.user %> mentioned you in
|
7
|
-
"<%= link_to @post.postable.title,
|
7
|
+
"<%= link_to @post.postable.title, post_permalink_url(@post.id) %>".
|
8
8
|
<%= link_to 'View the conversation here', topic_url(@post.postable) %>.
|
9
9
|
</p>
|
10
10
|
|
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
This email was sent to you because <%= @post.user %> mentioned you in
|
6
6
|
"<%= @post.postable.title %>". Go here to view the conversation:
|
7
|
-
<%=
|
7
|
+
<%= post_permalink_url @post %>
|
8
8
|
|
9
9
|
To unsubscribe from these emails, update your preferences here:
|
10
10
|
<%= edit_messageboard_preferences_url @post.messageboard %>
|
@@ -1,7 +1,7 @@
|
|
1
1
|
<%= form_for (post.private_topic_post? ? [topic, post] : [messageboard, topic, post]), as: :post,
|
2
2
|
html: { class: 'thredded--form thredded--post-form', 'data-thredded-post-form' => true } do |form| %>
|
3
3
|
<ul class="thredded--form-list">
|
4
|
-
<%= render 'thredded/
|
4
|
+
<%= render 'thredded/posts_common/form/content_field', form: form, content_label: content_label %>
|
5
5
|
|
6
6
|
<li>
|
7
7
|
<%= form.submit button_text, class: 'thredded--form--submit' %>
|
File without changes
|
File without changes
|
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
<p>
|
6
6
|
This email was sent to you because <%= @post.user %> mentioned you in
|
7
|
-
"<%= link_to @post.postable.title,
|
7
|
+
"<%= link_to @post.postable.title, private_post_permalink_url(@post.id) %>".
|
8
8
|
<%= link_to 'View the conversation here', topic_url(@post.postable) %>.
|
9
9
|
</p>
|
10
10
|
|
@@ -15,7 +15,7 @@
|
|
15
15
|
</li>
|
16
16
|
<% end %>
|
17
17
|
|
18
|
-
<%= render 'thredded/
|
18
|
+
<%= render 'thredded/posts_common/form/content_field',
|
19
19
|
form: form,
|
20
20
|
content_label: t('thredded.topics.form.content_label') %>
|
21
21
|
<%= render 'thredded/topics/topic_form_admin_options', form: form %>
|
@@ -15,4 +15,12 @@
|
|
15
15
|
<footer>
|
16
16
|
<%= paginate @topics %>
|
17
17
|
</footer>
|
18
|
+
|
19
|
+
<div class="thredded--messageboards--actions">
|
20
|
+
<% if policy(messageboard).update? %>
|
21
|
+
<a class="thredded--button" href="<%= edit_messageboard_path(messageboard) %>">
|
22
|
+
<%= t('thredded.nav.edit_messageboard') %>
|
23
|
+
</a>
|
24
|
+
<% end %>
|
25
|
+
</div>
|
18
26
|
<% end %>
|
data/config/locales/en.yml
CHANGED
@@ -1,21 +1,32 @@
|
|
1
1
|
---
|
2
2
|
en:
|
3
3
|
thredded:
|
4
|
+
form:
|
5
|
+
update: Update
|
4
6
|
errors:
|
5
7
|
login_required: Please sign in first.
|
6
8
|
not_authorized: You are not authorized to access this page.
|
7
9
|
private_topic_create_denied: You are not authorized to create private topics.
|
8
10
|
private_topic_not_found: This private topic does not exist.
|
9
11
|
messageboard:
|
12
|
+
create: Create a New Messageboard
|
13
|
+
update: :thredded.form.update
|
14
|
+
form:
|
15
|
+
no_group: No Group
|
10
16
|
last_updated_by_html: Updated %{time_ago} <cite>by %{user}</cite>
|
11
17
|
topics_and_posts_counts: "%{topics_count} topics / %{posts_count} posts"
|
18
|
+
updated_notice: Messageboard has been updated
|
19
|
+
messageboard_group:
|
20
|
+
create: Create a New Messageboard Group
|
12
21
|
nav:
|
13
22
|
all_messageboards: All Messageboards
|
23
|
+
edit_messageboard: Edit Messageboard
|
14
24
|
edit_post: Edit Post
|
15
25
|
edit_private_topic: :thredded.nav.edit_topic
|
16
26
|
edit_topic: Edit
|
17
27
|
private_topics: Private Messages
|
18
28
|
settings: Notification Settings
|
29
|
+
null_user_name: Deleted user
|
19
30
|
posts:
|
20
31
|
delete: Delete Post
|
21
32
|
delete_confirm: Are you sure you want to delete this post?
|
data/config/locales/pt-BR.yml
CHANGED
@@ -6,16 +6,27 @@ pt-BR:
|
|
6
6
|
not_authorized: Você não está autorizado a acessar esta página.
|
7
7
|
private_topic_create_denied: Você não está autorizado a criar tópicos privados.
|
8
8
|
private_topic_not_found: Este tópico privado não existe.
|
9
|
+
form:
|
10
|
+
update: Atualizar
|
9
11
|
messageboard:
|
12
|
+
create: Criar um novo Fórum de Mensagem
|
13
|
+
form:
|
14
|
+
no_group: Sem Grupo
|
10
15
|
last_updated_by_html: Atualizado %{time_ago} <cite>por %{user}</cite>
|
11
16
|
topics_and_posts_counts: "%{topics_count} tópicos / %{posts_count} posts"
|
17
|
+
update: :thredded.form.update
|
18
|
+
updated_notice: Fórum de mensagem foi atualizado
|
19
|
+
messageboard_group:
|
20
|
+
create: Criar um novo grupo de mensagens
|
12
21
|
nav:
|
13
22
|
all_messageboards: Todos os Fóruns de Mensagens
|
23
|
+
edit_messageboard: Editar Fórum de Mensagem
|
14
24
|
edit_post: Editar Post
|
15
25
|
edit_private_topic: :thredded.nav.edit_topic
|
16
26
|
edit_topic: Editar
|
17
27
|
private_topics: Mensagens Privadas
|
18
28
|
settings: Configurações de Notificação
|
29
|
+
null_user_name: Usuário deletado
|
19
30
|
posts:
|
20
31
|
delete: Remover Post
|
21
32
|
delete_confirm: Você tem certeza que deseja remover este post?
|
@@ -32,8 +43,8 @@ pt-BR:
|
|
32
43
|
global_preferences_label: Configurações Globais
|
33
44
|
messageboard_notify_on_mention:
|
34
45
|
hint: >-
|
35
|
-
Quando alguém mencionar você através do seu usuário (ex.: @sam) neste fórum de mensagens, você irá
|
36
|
-
|
46
|
+
Quando alguém mencionar você através do seu usuário (ex.: @sam) neste fórum de mensagens, você irá receber
|
47
|
+
um e-mail com o conteúdo deste post.
|
37
48
|
label: :thredded.preferences.form.notify_on_mention.label
|
38
49
|
messageboard_preferences_label_html: Configurações de Notificação para <em>%{messageboard}</em>
|
39
50
|
notify_on_mention:
|
@@ -42,7 +53,8 @@ pt-BR:
|
|
42
53
|
deste post.
|
43
54
|
label: "@ Notificações"
|
44
55
|
notify_on_message:
|
45
|
-
hint: Quando você for adicionado a uma conversa privada, você receberá um e-mail com o conteúdo desta
|
56
|
+
hint: Quando você for adicionado a uma conversa privada, você receberá um e-mail com o conteúdo desta
|
57
|
+
conversa.
|
46
58
|
label: Notificação de Mensagens Privadas
|
47
59
|
submit_btn: Atualizar Configurações
|
48
60
|
title: Configurações
|
data/config/routes.rb
CHANGED
@@ -2,7 +2,8 @@
|
|
2
2
|
Thredded::Engine.routes.draw do
|
3
3
|
resource :theme_preview, only: [:show], path: 'theme-preview' if %w(development test).include? Rails.env
|
4
4
|
|
5
|
-
|
5
|
+
positive_int = /[1-9]\d*/
|
6
|
+
page_constraint = { page: positive_int }
|
6
7
|
|
7
8
|
scope path: 'private-topics' do
|
8
9
|
resource :private_topic, only: [:new], path: ''
|
@@ -14,6 +15,11 @@ Thredded::Engine.routes.draw do
|
|
14
15
|
end
|
15
16
|
end
|
16
17
|
|
18
|
+
scope only: [:show], constraints: { id: positive_int } do
|
19
|
+
resources :private_post_permalinks, path: 'private-posts'
|
20
|
+
resources :post_permalinks, path: 'posts'
|
21
|
+
end
|
22
|
+
|
17
23
|
resources :autocomplete_users, only: [:index], path: 'autocomplete-users'
|
18
24
|
|
19
25
|
constraints(->(req) { req.env['QUERY_STRING'].include? 'q=' }) do
|
@@ -21,8 +27,13 @@ Thredded::Engine.routes.draw do
|
|
21
27
|
get '/:messageboard_id(.:format)' => 'topics#search', as: :messageboard_search
|
22
28
|
end
|
23
29
|
|
30
|
+
scope path: 'admin' do
|
31
|
+
resources :messageboard_groups, only: [:new, :create]
|
32
|
+
end
|
33
|
+
|
24
34
|
resource :preferences, only: [:edit, :update]
|
25
35
|
resource :messageboard, path: 'messageboards', only: [:new]
|
36
|
+
resources :messageboards, only: [:edit, :update]
|
26
37
|
resources :messageboards, only: [:index, :create], path: '' do
|
27
38
|
resource :preferences, only: [:edit, :update]
|
28
39
|
resource :topic, path: 'topics', only: [:new]
|
@@ -168,6 +168,14 @@ class CreateThredded < ActiveRecord::Migration
|
|
168
168
|
end
|
169
169
|
add_index table_name, [:user_id, :postable_id], name: :"#{table_name}_user_postable", unique: true
|
170
170
|
end
|
171
|
+
|
172
|
+
create_table :thredded_messageboard_groups do |t|
|
173
|
+
t.string :name
|
174
|
+
t.timestamps null: false
|
175
|
+
end
|
176
|
+
|
177
|
+
add_column :thredded_messageboards, :messageboard_group_id, :integer
|
178
|
+
add_index :thredded_messageboards, [:messageboard_group_id], name: :index_thredded_messageboards_on_messageboard_group_id
|
171
179
|
end
|
172
180
|
end
|
173
181
|
# rubocop:enable Metrics/LineLength
|
data/db/seeds.rb
CHANGED
@@ -63,13 +63,16 @@ module Thredded
|
|
63
63
|
end
|
64
64
|
|
65
65
|
def create_additional_messageboards
|
66
|
+
meta_group_id = MessageboardGroup.create!(name: 'Meta').id
|
66
67
|
additional_messageboards = [
|
67
68
|
['Off-Topic', "Talk about whatever here, it's all good."],
|
68
|
-
['
|
69
|
+
['Help, Bugs, and Suggestions',
|
70
|
+
'Need help using the forum? Want to report a bug or make a suggestion? This is the place.', meta_group_id],
|
71
|
+
['Praise', 'Want to tell us how great we are? This is the place.', meta_group_id]
|
69
72
|
]
|
70
73
|
log "Creating #{additional_messageboards.length} additional messageboards..."
|
71
|
-
additional_messageboards.each do |(name, description)|
|
72
|
-
messageboard = Messageboard.create!(name: name, description: description)
|
74
|
+
additional_messageboards.each do |(name, description, group_id)|
|
75
|
+
messageboard = Messageboard.create!(name: name, description: description, messageboard_group_id: group_id)
|
73
76
|
FactoryGirl.create_list(:topic, 1 + rand(3), messageboard: messageboard, with_posts: 1)
|
74
77
|
end
|
75
78
|
end
|
@@ -80,13 +83,15 @@ module Thredded
|
|
80
83
|
:topic, count,
|
81
84
|
messageboard: messageboard,
|
82
85
|
user: users.sample,
|
83
|
-
last_user: users.sample
|
86
|
+
last_user: users.sample
|
87
|
+
)
|
84
88
|
|
85
89
|
@private_topics = FactoryGirl.create_list(
|
86
90
|
:private_topic, count,
|
87
91
|
user: users.sample,
|
88
92
|
last_user: users.sample,
|
89
|
-
users: [user]
|
93
|
+
users: [user]
|
94
|
+
)
|
90
95
|
end
|
91
96
|
|
92
97
|
def create_posts(count: (1..30))
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class UpgradeV03ToV04 < ActiveRecord::Migration[5.0]
|
4
|
+
def up
|
5
|
+
create_table :thredded_messageboard_groups do |t|
|
6
|
+
t.string :name
|
7
|
+
t.timestamps null: false
|
8
|
+
end
|
9
|
+
|
10
|
+
add_column :thredded_messageboards, :messageboard_group_id, :integer
|
11
|
+
add_index :thredded_messageboards, [:messageboard_group_id],
|
12
|
+
name: :index_thredded_messageboards_on_messageboard_group_id
|
13
|
+
end
|
14
|
+
end
|
data/heroku.gemfile
CHANGED
@@ -5,7 +5,7 @@ ruby '2.3.1'
|
|
5
5
|
gem 'thredded', path: File.dirname(__FILE__)
|
6
6
|
|
7
7
|
# Rails 5
|
8
|
-
gem 'rails', '~> 5.0.0.
|
8
|
+
gem 'rails', '~> 5.0.0.racecar1'
|
9
9
|
gem 'kaminari', git: 'https://github.com/amatsuda/kaminari'
|
10
10
|
gem 'active_record_union', git: 'https://github.com/glebm/active_record_union', branch: 'rails-5-test-harness'
|
11
11
|
|
data/heroku.gemfile.lock
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
GIT
|
2
2
|
remote: https://github.com/amatsuda/kaminari
|
3
|
-
revision:
|
3
|
+
revision: 9c44b6461f00471886caff921feea36f29dbb06d
|
4
4
|
specs:
|
5
5
|
kaminari (1.0.0.alpha)
|
6
6
|
actionpack (>= 3.0.0)
|
@@ -17,7 +17,7 @@ GIT
|
|
17
17
|
PATH
|
18
18
|
remote: .
|
19
19
|
specs:
|
20
|
-
thredded (0.
|
20
|
+
thredded (0.4.0)
|
21
21
|
active_record_union (>= 1.1.1)
|
22
22
|
autoprefixer-rails
|
23
23
|
autosize-rails
|
@@ -47,40 +47,40 @@ PATH
|
|
47
47
|
GEM
|
48
48
|
remote: https://rubygems.org/
|
49
49
|
specs:
|
50
|
-
actioncable (5.0.0.
|
51
|
-
actionpack (= 5.0.0.
|
50
|
+
actioncable (5.0.0.rc1)
|
51
|
+
actionpack (= 5.0.0.rc1)
|
52
52
|
nio4r (~> 1.2)
|
53
53
|
websocket-driver (~> 0.6.1)
|
54
|
-
actionmailer (5.0.0.
|
55
|
-
actionpack (= 5.0.0.
|
56
|
-
actionview (= 5.0.0.
|
57
|
-
activejob (= 5.0.0.
|
54
|
+
actionmailer (5.0.0.rc1)
|
55
|
+
actionpack (= 5.0.0.rc1)
|
56
|
+
actionview (= 5.0.0.rc1)
|
57
|
+
activejob (= 5.0.0.rc1)
|
58
58
|
mail (~> 2.5, >= 2.5.4)
|
59
59
|
rails-dom-testing (~> 1.0, >= 1.0.5)
|
60
|
-
actionpack (5.0.0.
|
61
|
-
actionview (= 5.0.0.
|
62
|
-
activesupport (= 5.0.0.
|
60
|
+
actionpack (5.0.0.rc1)
|
61
|
+
actionview (= 5.0.0.rc1)
|
62
|
+
activesupport (= 5.0.0.rc1)
|
63
63
|
rack (~> 2.x)
|
64
64
|
rack-test (~> 0.6.3)
|
65
65
|
rails-dom-testing (~> 1.0, >= 1.0.5)
|
66
66
|
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
67
|
-
actionview (5.0.0.
|
68
|
-
activesupport (= 5.0.0.
|
67
|
+
actionview (5.0.0.rc1)
|
68
|
+
activesupport (= 5.0.0.rc1)
|
69
69
|
builder (~> 3.1)
|
70
70
|
erubis (~> 2.7.0)
|
71
71
|
rails-dom-testing (~> 1.0, >= 1.0.5)
|
72
72
|
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
73
|
-
activejob (5.0.0.
|
74
|
-
activesupport (= 5.0.0.
|
73
|
+
activejob (5.0.0.rc1)
|
74
|
+
activesupport (= 5.0.0.rc1)
|
75
75
|
globalid (>= 0.3.6)
|
76
|
-
activemodel (5.0.0.
|
77
|
-
activesupport (= 5.0.0.
|
78
|
-
activerecord (5.0.0.
|
79
|
-
activemodel (= 5.0.0.
|
80
|
-
activesupport (= 5.0.0.
|
76
|
+
activemodel (5.0.0.rc1)
|
77
|
+
activesupport (= 5.0.0.rc1)
|
78
|
+
activerecord (5.0.0.rc1)
|
79
|
+
activemodel (= 5.0.0.rc1)
|
80
|
+
activesupport (= 5.0.0.rc1)
|
81
81
|
arel (~> 7.0)
|
82
|
-
activesupport (5.0.0.
|
83
|
-
concurrent-ruby (~> 1.0)
|
82
|
+
activesupport (5.0.0.rc1)
|
83
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
84
84
|
i18n (~> 0.7)
|
85
85
|
minitest (~> 5.1)
|
86
86
|
tzinfo (~> 1.1)
|
@@ -123,7 +123,7 @@ GEM
|
|
123
123
|
github-markdown (0.6.9)
|
124
124
|
globalid (0.3.6)
|
125
125
|
activesupport (>= 4.1.0)
|
126
|
-
html-pipeline (2.4.
|
126
|
+
html-pipeline (2.4.1)
|
127
127
|
activesupport (>= 2, < 5)
|
128
128
|
nokogiri (>= 1.4)
|
129
129
|
html-pipeline-vimeo (0.1.1)
|
@@ -167,24 +167,24 @@ GEM
|
|
167
167
|
puma (3.4.0)
|
168
168
|
pundit (1.1.0)
|
169
169
|
activesupport (>= 3.0.0)
|
170
|
-
rack (2.0.0.
|
170
|
+
rack (2.0.0.rc1)
|
171
171
|
json
|
172
172
|
rack-canonical-host (0.2.1)
|
173
173
|
addressable (> 0, < 3)
|
174
174
|
rack (>= 1.0.0, < 3)
|
175
175
|
rack-test (0.6.3)
|
176
176
|
rack (>= 1.0)
|
177
|
-
rails (5.0.0.
|
178
|
-
actioncable (= 5.0.0.
|
179
|
-
actionmailer (= 5.0.0.
|
180
|
-
actionpack (= 5.0.0.
|
181
|
-
actionview (= 5.0.0.
|
182
|
-
activejob (= 5.0.0.
|
183
|
-
activemodel (= 5.0.0.
|
184
|
-
activerecord (= 5.0.0.
|
185
|
-
activesupport (= 5.0.0.
|
177
|
+
rails (5.0.0.rc1)
|
178
|
+
actioncable (= 5.0.0.rc1)
|
179
|
+
actionmailer (= 5.0.0.rc1)
|
180
|
+
actionpack (= 5.0.0.rc1)
|
181
|
+
actionview (= 5.0.0.rc1)
|
182
|
+
activejob (= 5.0.0.rc1)
|
183
|
+
activemodel (= 5.0.0.rc1)
|
184
|
+
activerecord (= 5.0.0.rc1)
|
185
|
+
activesupport (= 5.0.0.rc1)
|
186
186
|
bundler (>= 1.3.0, < 2.0)
|
187
|
-
railties (= 5.0.0.
|
187
|
+
railties (= 5.0.0.rc1)
|
188
188
|
sprockets-rails (>= 2.0.0)
|
189
189
|
rails-deprecated_sanitizer (1.0.3)
|
190
190
|
activesupport (>= 4.2.0.alpha)
|
@@ -200,14 +200,14 @@ GEM
|
|
200
200
|
rails-timeago (2.13.0)
|
201
201
|
actionpack (>= 3.1)
|
202
202
|
activesupport (>= 3.1)
|
203
|
-
rails_email_preview (
|
204
|
-
rails (>=
|
203
|
+
rails_email_preview (2.0.1)
|
204
|
+
rails (>= 4.2)
|
205
205
|
request_store
|
206
206
|
sass-rails
|
207
207
|
turbolinks
|
208
|
-
railties (5.0.0.
|
209
|
-
actionpack (= 5.0.0.
|
210
|
-
activesupport (= 5.0.0.
|
208
|
+
railties (5.0.0.rc1)
|
209
|
+
actionpack (= 5.0.0.rc1)
|
210
|
+
activesupport (= 5.0.0.rc1)
|
211
211
|
method_source
|
212
212
|
rake (>= 0.8.7)
|
213
213
|
thor (>= 0.18.1, < 2.0)
|
@@ -216,7 +216,7 @@ GEM
|
|
216
216
|
ref (2.0.0)
|
217
217
|
request_store (1.3.1)
|
218
218
|
rinku (1.7.3)
|
219
|
-
rollbar (2.11.
|
219
|
+
rollbar (2.11.3)
|
220
220
|
multi_json
|
221
221
|
sanitize (4.0.1)
|
222
222
|
crass (~> 1.0.2)
|
@@ -247,7 +247,7 @@ GEM
|
|
247
247
|
ref
|
248
248
|
thor (0.19.1)
|
249
249
|
thread_safe (0.3.5)
|
250
|
-
tilt (2.0.
|
250
|
+
tilt (2.0.3)
|
251
251
|
turbolinks (2.5.3)
|
252
252
|
coffee-rails
|
253
253
|
tzinfo (1.2.2)
|
@@ -271,7 +271,7 @@ DEPENDENCIES
|
|
271
271
|
pg
|
272
272
|
puma
|
273
273
|
rack-canonical-host
|
274
|
-
rails (~> 5.0.0.
|
274
|
+
rails (~> 5.0.0.racecar1)
|
275
275
|
rails-i18n
|
276
276
|
rails_email_preview (>= 1.0.3)
|
277
277
|
rollbar
|
@@ -283,4 +283,4 @@ RUBY VERSION
|
|
283
283
|
ruby 2.3.1p112
|
284
284
|
|
285
285
|
BUNDLED WITH
|
286
|
-
1.12.
|
286
|
+
1.12.3
|
@@ -1,13 +1,8 @@
|
|
1
1
|
Description:
|
2
|
-
Create an initializer with description of configuration and defaults
|
2
|
+
Create an initializer with description of configuration and defaults.
|
3
3
|
|
4
4
|
Example:
|
5
5
|
rails generate thredded:install
|
6
6
|
|
7
7
|
This will create:
|
8
8
|
config/initializers/thredded.rb
|
9
|
-
|
10
|
-
Options:
|
11
|
-
|
12
|
-
[--theme] # Will copy thredded layout, views, and assets to the parent app
|
13
|
-
|