thredded 0.0.12 → 0.0.13

Sign up to get free protection for your applications and to get access to all the features.
Files changed (112) hide show
  1. checksums.yaml +4 -4
  2. metadata +7 -114
  3. data/MIT-LICENSE +0 -20
  4. data/README.mkdn +0 -72
  5. data/Rakefile +0 -31
  6. data/app/assets/javascripts/thredded/application.js +0 -15
  7. data/app/assets/stylesheets/thredded/application.css +0 -13
  8. data/app/controllers/thredded/application_controller.rb +0 -60
  9. data/app/controllers/thredded/emails_controller.rb +0 -4
  10. data/app/controllers/thredded/messageboards_controller.rb +0 -7
  11. data/app/controllers/thredded/posts_controller.rb +0 -85
  12. data/app/controllers/thredded/preferences_controller.rb +0 -28
  13. data/app/controllers/thredded/private_topics_controller.rb +0 -58
  14. data/app/controllers/thredded/setups_controller.rb +0 -44
  15. data/app/controllers/thredded/topics_controller.rb +0 -99
  16. data/app/decorators/thredded/messageboard_decorator.rb +0 -74
  17. data/app/decorators/thredded/post_decorator.rb +0 -61
  18. data/app/decorators/thredded/topic_decorator.rb +0 -94
  19. data/app/decorators/thredded/user_topic_decorator.rb +0 -88
  20. data/app/helpers/thredded/application_helper.rb +0 -4
  21. data/app/helpers/thredded/posts_helper.rb +0 -7
  22. data/app/helpers/thredded/topics_helper.rb +0 -4
  23. data/app/mailers/thredded/post_mailer.rb +0 -28
  24. data/app/mailers/thredded/topic_mailer.rb +0 -29
  25. data/app/models/thredded/ability.rb +0 -66
  26. data/app/models/thredded/attachment.rb +0 -23
  27. data/app/models/thredded/category.rb +0 -9
  28. data/app/models/thredded/image.rb +0 -26
  29. data/app/models/thredded/messageboard.rb +0 -117
  30. data/app/models/thredded/messageboard_preference.rb +0 -14
  31. data/app/models/thredded/null_preference.rb +0 -11
  32. data/app/models/thredded/null_topic.rb +0 -16
  33. data/app/models/thredded/null_topic_read.rb +0 -19
  34. data/app/models/thredded/null_user.rb +0 -35
  35. data/app/models/thredded/post.rb +0 -120
  36. data/app/models/thredded/post_notification.rb +0 -5
  37. data/app/models/thredded/private_topic.rb +0 -42
  38. data/app/models/thredded/private_user.rb +0 -6
  39. data/app/models/thredded/role.rb +0 -16
  40. data/app/models/thredded/topic.rb +0 -154
  41. data/app/models/thredded/topic_category.rb +0 -6
  42. data/app/models/thredded/user_detail.rb +0 -6
  43. data/app/models/thredded/user_extender.rb +0 -21
  44. data/app/models/thredded/user_preference.rb +0 -6
  45. data/app/models/thredded/user_topic_read.rb +0 -9
  46. data/app/uploaders/thredded/attachment_uploader.rb +0 -30
  47. data/app/uploaders/thredded/image_uploader.rb +0 -16
  48. data/app/views/thredded/attachments/_attachment.html.erb +0 -7
  49. data/app/views/thredded/messageboards/_messageboard.html.erb +0 -20
  50. data/app/views/thredded/messageboards/index.html.erb +0 -18
  51. data/app/views/thredded/post_mailer/at_notification.html.erb +0 -17
  52. data/app/views/thredded/post_mailer/at_notification.text.erb +0 -13
  53. data/app/views/thredded/posts/_form.html.erb +0 -17
  54. data/app/views/thredded/posts/_null_user.html.erb +0 -0
  55. data/app/views/thredded/posts/_post.html.erb +0 -29
  56. data/app/views/thredded/posts/_user.html.erb +0 -7
  57. data/app/views/thredded/posts/edit.html.erb +0 -31
  58. data/app/views/thredded/posts/index.html.erb +0 -64
  59. data/app/views/thredded/preferences/edit.html.erb +0 -22
  60. data/app/views/thredded/private_topics/_form.html.erb +0 -15
  61. data/app/views/thredded/private_topics/index.html.erb +0 -34
  62. data/app/views/thredded/private_topics/new.html.erb +0 -28
  63. data/app/views/thredded/search/_form.html.erb +0 -9
  64. data/app/views/thredded/setups/_form.html.erb +0 -35
  65. data/app/views/thredded/setups/new.html.erb +0 -6
  66. data/app/views/thredded/shared/_currently_online.html.erb +0 -10
  67. data/app/views/thredded/shared/_error_msgs.html.erb +0 -7
  68. data/app/views/thredded/shared/_google_analytics.html.erb +0 -10
  69. data/app/views/thredded/shared/_topic_nav.html.erb +0 -21
  70. data/app/views/thredded/topic_mailer/message_notification.html.erb +0 -17
  71. data/app/views/thredded/topic_mailer/message_notification.text.erb +0 -13
  72. data/app/views/thredded/topics/_form.html.erb +0 -6
  73. data/app/views/thredded/topics/_recent_topics_by_user.html.erb +0 -8
  74. data/app/views/thredded/topics/_topic_condensed.html.erb +0 -24
  75. data/app/views/thredded/topics/_topic_form.html.erb +0 -27
  76. data/app/views/thredded/topics/by_category.html.erb +0 -54
  77. data/app/views/thredded/topics/edit.html.erb +0 -28
  78. data/app/views/thredded/topics/index.html.erb +0 -34
  79. data/app/views/thredded/topics/menu/_new_topic.html.erb +0 -3
  80. data/app/views/thredded/topics/new.html.erb +0 -21
  81. data/app/views/thredded/topics/search.html.erb +0 -34
  82. data/config/initializers/griddler.rb +0 -4
  83. data/config/routes.rb +0 -29
  84. data/db/migrate/20130425230852_create_thredded_tables.rb +0 -143
  85. data/db/migrate/20131005032727_prevent_null_sticky_and_locked.rb +0 -15
  86. data/db/migrate/20131014014258_uniqs_on_user_topic_read.rb +0 -9
  87. data/db/migrate/20131019014258_index_necessary_columns.rb +0 -24
  88. data/db/migrate/20131026202621_move_filter_to_messageboards.rb +0 -11
  89. data/db/migrate/20131029034507_convert_textile_to_markdown.rb +0 -7
  90. data/lib/html/pipeline/at_mention_filter.rb +0 -19
  91. data/lib/html/pipeline/attached_image_filter.rb +0 -59
  92. data/lib/html/pipeline/bbcode_filter.rb +0 -19
  93. data/lib/tasks/thredded_tasks.rake +0 -4
  94. data/lib/thredded.rb +0 -58
  95. data/lib/thredded/at_notification_extractor.rb +0 -15
  96. data/lib/thredded/at_notifier.rb +0 -67
  97. data/lib/thredded/at_users.rb +0 -19
  98. data/lib/thredded/email_processor.rb +0 -76
  99. data/lib/thredded/engine.rb +0 -17
  100. data/lib/thredded/errors.rb +0 -40
  101. data/lib/thredded/messageboard_user_permissions.rb +0 -27
  102. data/lib/thredded/post_sql_builder.rb +0 -34
  103. data/lib/thredded/post_user_permissions.rb +0 -41
  104. data/lib/thredded/private_topic_notifier.rb +0 -56
  105. data/lib/thredded/private_topic_user_permissions.rb +0 -38
  106. data/lib/thredded/search_parser.rb +0 -45
  107. data/lib/thredded/search_sql_builder.rb +0 -25
  108. data/lib/thredded/setup_thredded.rb +0 -7
  109. data/lib/thredded/table_sql_builder.rb +0 -105
  110. data/lib/thredded/topic_sql_builder.rb +0 -32
  111. data/lib/thredded/topic_user_permissions.rb +0 -55
  112. data/lib/thredded/version.rb +0 -3
@@ -1,9 +0,0 @@
1
- module Thredded
2
- class UserTopicRead < ActiveRecord::Base
3
- belongs_to :topic
4
- belongs_to :user, class_name: Thredded.user_class
5
- belongs_to :farthest_post,
6
- class_name: 'Thredded::Post', foreign_key: 'post_id'
7
- validates :user_id, uniqueness: { scope: :topic }
8
- end
9
- end
@@ -1,30 +0,0 @@
1
- require 'carrierwave/processing/mini_magick'
2
-
3
- module Thredded
4
- class AttachmentUploader < CarrierWave::Uploader::Base
5
- include CarrierWave::MiniMagick
6
- storage Thredded.file_storage
7
-
8
- def store_dir
9
- "uploads/#{mounted_as}/#{model.id}"
10
- end
11
-
12
- version :thumb, if: :image? do
13
- process :resize_to_fit => [90, 90]
14
- end
15
-
16
- version :mobile, if: :image? do
17
- process :resize_to_limit => [480, 2000]
18
- end
19
-
20
- def extension_white_list
21
- %w(jpg jpeg gif png pdf zip tgz txt)
22
- end
23
-
24
- protected
25
-
26
- def image?(new_file)
27
- new_file.content_type.include? 'image'
28
- end
29
- end
30
- end
@@ -1,16 +0,0 @@
1
- require 'carrierwave/processing/mini_magick'
2
-
3
- module Thredded
4
- class ImageUploader < CarrierWave::Uploader::Base
5
- include CarrierWave::MiniMagick
6
- storage Thredded.file_storage
7
-
8
- def store_dir
9
- "uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
10
- end
11
-
12
- def extension_white_list
13
- %w(jpg jpeg gif png)
14
- end
15
- end
16
- end
@@ -1,7 +0,0 @@
1
- <li>
2
- <% if attachment.attachment %>
3
- <%= link_to attachment.filename,
4
- attachment.attachment.to_s,
5
- data: { type: attachment.content_type } %>
6
- <% end %>
7
- </li>
@@ -1,20 +0,0 @@
1
- <% if can? :read, messageboard.original %>
2
- <div class="messageboard">
3
- <header>
4
- <h2>
5
- <%= link_to messageboard.name, messageboard_topics_path(messageboard) %>
6
- </h2>
7
-
8
- <div class="meta"><%= messageboard.meta %></div>
9
- </header>
10
-
11
- <%= messageboard.description %>
12
-
13
- <footer>
14
- <p>
15
- <%= messageboard.latest_topic_timeago %>
16
- <cite>by <%= messageboard.latest_user %></cite>
17
- </p>
18
- </footer>
19
- </div>
20
- <% end %>
@@ -1,18 +0,0 @@
1
- <% content_for :thredded_page_title, 'Messageboards' %>
2
- <% content_for :thredded_page_id, 'thredded_messageboards_index' %>
3
-
4
- <header>
5
- <nav>
6
- <ul class="breadcrumbs">
7
- <li><span>Forums</span></li>
8
- </ul>
9
- </nav>
10
- <h2>
11
- <%= number_to_human(Thredded::Messageboard.all.count) %> messageboards,
12
- <%= number_to_human(Thredded::Messageboard.all.map(&:topics_count).sum, precision: 4) %> topics,
13
- and <%= number_to_human(Thredded::Messageboard.all.map(&:posts_count).sum, precision: 5) %> posts</h2>
14
- </header>
15
-
16
- <section id="messageboards">
17
- <%= render @messageboards %>
18
- </section>
@@ -1,17 +0,0 @@
1
- <p><span style="font-size:11px; color: gray;">- write above this line to post a reply -</span></p>
2
-
3
- <%== @post.filtered_content %>
4
-
5
- <hr />
6
-
7
- <p>
8
- This email was sent to you because <%= @post.user %> mentioned you in
9
- "<%= link_to @post.topic.title, messageboard_topic_posts_url(@post.messageboard, @post.topic, anchor: "post_#{@post.id}") %>"
10
- Feel free to reply above or <%= link_to 'head to the thread', messageboard_topic_posts_url(@post.messageboard, @post.topic) %>
11
- to view the conversation.
12
- </p>
13
-
14
- <p>
15
- To unsubscribe from these emails, update your
16
- <%= link_to 'preferences', edit_messageboard_preferences_url(@post.messageboard) %>.
17
- </p>
@@ -1,13 +0,0 @@
1
- - write above this line to post a reply -
2
-
3
- <%= @post.content %>
4
-
5
- ---
6
-
7
- This email was sent to you because <%= @post.user %> mentioned you in
8
- "<%= @post.topic.title %>". Feel free to reply above or head to the following
9
- to view the conversation:
10
- <%= messageboard_topic_posts_url @post.messageboard, @post.topic, anchor: "post_#{@post.id}" %>
11
-
12
- To unsubscribe from these emails, update your preferences here:
13
- <%= edit_messageboard_preferences_url @post.messageboard %>
@@ -1,17 +0,0 @@
1
- <li class="content">
2
- <%= f.label :content %>
3
- <%= f.text_area :content, { rows: 5 } %>
4
- </li>
5
-
6
- <%= f.fields_for :attachments do |attachment_form| %>
7
- <li class="attachment">
8
- <%= attachment_form.file_field :attachment %>
9
- <%= attachment_form.link_to_remove 'Remove this attachment',
10
- { class: 'remove_attachment' } %>
11
- </li>
12
- <% end %>
13
-
14
- <li>
15
- <%= f.link_to_add 'Add an attachment', :attachments,
16
- { class: :add_attachment } %>
17
- </li>
@@ -1,29 +0,0 @@
1
- <% cache [current_user, 'post', post] do %>
2
- <% post = Thredded::PostDecorator.new(post) %>
3
-
4
- <%= content_tag_for(:article, post) do %>
5
- <header>
6
- <%= image_tag post.gravatar_url, class: 'avatar' %>
7
- <cite>
8
- <%= post.user_name %>
9
- <%= post.created_at_timeago %>
10
- </cite>
11
- </header>
12
-
13
- <div class="content">
14
- <%== post.filtered_content %>
15
- <ul class="attachments"><%= render post.attachments %></ul>
16
- </div>
17
-
18
- <footer>
19
- <% if can? :edit, post.original %>
20
- <%= link_to 'edit post', edit_messageboard_topic_post_path(
21
- messageboard,
22
- topic,
23
- post
24
- ),
25
- class: 'edit' %>
26
- <% end %>
27
- </footer>
28
- <% end %>
29
- <% end %>
@@ -1,7 +0,0 @@
1
- <span class="roles">
2
- <%= post.user_roles %>
3
- </span>
4
-
5
- <span class="posts_count">
6
- <%= post.user_posts_count %> posts
7
- </span>
@@ -1,31 +0,0 @@
1
- <% content_for :thredded_page_title, 'Edit Post' %>
2
- <% content_for :thredded_page_id, 'thredded_edit_post' %>
3
-
4
- <header>
5
- <nav>
6
- <ul class="breadcrumbs">
7
- <li><%= link_to 'Forums', thredded.root_path %></li>
8
- <li><%= link_to messageboard.name,
9
- messageboard_topic_posts_path(messageboard, topic) %></li>
10
- <li>
11
- <span>
12
- Editing Post - <%= link_to "##{@post.id}",
13
- messageboard_topic_posts_path(messageboard, topic) + "#post_#{@post.id}" %>
14
- </span>
15
- </li>
16
- </ul>
17
- </nav>
18
- </header>
19
-
20
- <div class="forms">
21
- <%= nested_form_for([messageboard, topic, @post], url: { action: 'update' },
22
- html: { method: :put, class: :topic_form }) do |f| %>
23
- <ul>
24
- <%= render 'form', f: f %>
25
-
26
- <li class="submit">
27
- <%= f.submit 'Update Post', { tabindex: 2 } %>
28
- </li>
29
- </ul>
30
- <% end %>
31
- </div>
@@ -1,64 +0,0 @@
1
- <% content_for :thredded_page_title, topic.title %>
2
- <% content_for :thredded_page_id, 'thredded_posts' %>
3
-
4
- <% content_for :breadcrumbs do %>
5
- <ul class="breadcrumbs">
6
- <li><%= link_to 'Forums', thredded.root_path %></li>
7
- <li><%= link_to messageboard.name, messageboard_topics_path(messageboard) %></li>
8
- <li>
9
- <span>
10
- <%= topic.title %>
11
-
12
- <% if can? :edit, topic %>
13
- <%= link_to 'edit',
14
- edit_messageboard_topic_path(messageboard, topic) %>
15
- <% end %>
16
- </span>
17
- </li>
18
- </ul>
19
- <% end %>
20
-
21
- <header>
22
- <nav>
23
- <%= yield :breadcrumbs %>
24
- </nav>
25
-
26
- <% if topic.users_to_sentence.present? %>
27
- <cite><%= topic.users_to_sentence %></cite>
28
- <% end %>
29
-
30
- <%= render 'thredded/shared/currently_online' %>
31
- <%= render 'thredded/shared/topic_nav' %>
32
- </header>
33
-
34
- <%= content_tag_for :section, topic,
35
- class: user_topic.css_class,
36
- data: { 'latest-read' => user_topic.farthest_post.id } do %>
37
-
38
- <header><h1><%= topic.title %></h1></header>
39
-
40
- <section class="posts" id="topics_posts">
41
- <%= render @posts %>
42
- </section>
43
- <% end %>
44
-
45
- <footer>
46
- <%= paginate @posts %>
47
-
48
- <% if can? :create, @post %>
49
- <div class="forms">
50
- <%= nested_form_for [messageboard, topic, @post], html: { multipart: true } do |f| %>
51
- <ul>
52
- <%= render 'form', f: f %>
53
- <li class="submit">
54
- <%= f.submit 'Submit reply' %>
55
- </li>
56
- </ul>
57
- <% end %>
58
- </div>
59
- <% end %>
60
-
61
- <nav>
62
- <%= yield :breadcrumbs %>
63
- </nav>
64
- </footer>
@@ -1,22 +0,0 @@
1
- <% content_for :thredded_page_title, 'Messageboard Preferences' %>
2
- <% content_for :thredded_page_id, 'thredded_preferences' %>
3
-
4
- <fieldset>
5
- <legend>Update Preferences For <%= messageboard.name %></legend>
6
-
7
- <%= form_for [messageboard, preference], url: messageboard_preferences_path(messageboard) do |f| %>
8
- <%= render 'thredded/shared/error_msgs' %>
9
-
10
- <ul>
11
- <li>
12
- <%= f.label :notify_on_mention, "Notify me when I am @'ed" %>
13
- <%= f.check_box :notify_on_mention %>
14
- </li>
15
- <li>
16
- <%= f.label :notify_on_message, 'Notify me when I am included in a private topic' %>
17
- <%= f.check_box :notify_on_message %>
18
- </li>
19
- <li class="submit"><%= f.submit 'Update Preferences' %></li>
20
- </ul>
21
- <% end %>
22
- </fieldset>
@@ -1,15 +0,0 @@
1
- <li class="title">
2
- <%= form.label :title %>
3
- <%= form.text_field :title, { placeholder: 'Title', autofocus: 'autofocus' } %>
4
- </li>
5
-
6
- <li class="private_users">
7
- <%= form.select :user_id, messageboard.users_options,
8
- { selected: form.object.users.map(&:id) },
9
- {
10
- multiple: true,
11
- 'data-placeholder' => 'select users to participate in this topic',
12
- } %>
13
- </li>
14
-
15
- <%= render 'thredded/topics/topic_form', form: form, messageboard: messageboard %>
@@ -1,34 +0,0 @@
1
- <% content_for :thredded_page_title, 'Private Topics' %>
2
- <% content_for :thredded_page_id, 'thredded_private_topics_index' %>
3
-
4
- <% content_for :breadcrumbs do %>
5
- <ul class="breadcrumbs">
6
- <li><%= link_to 'Forums', thredded.root_path %></li>
7
- <li><span><%= messageboard.name %></span></li>
8
- </ul>
9
- <% end %>
10
-
11
- <header>
12
- <nav>
13
- <%= yield :breadcrumbs %>
14
- </nav>
15
-
16
- <%= render 'thredded/shared/currently_online' %>
17
- <%= render 'thredded/shared/topic_nav' %>
18
- </header>
19
-
20
- <section class="topics" id="topics_listing">
21
- <div class="currently">
22
- <%= render partial: 'thredded/topics/topic_condensed',
23
- collection: Thredded::UserTopicDecorator.decorate_all(current_user, @private_topics),
24
- as: :topic %>
25
- </div>
26
- </section>
27
-
28
- <footer>
29
- <%= paginate @private_topics %>
30
-
31
- <nav>
32
- <%= yield :breadcrumbs %>
33
- </nav>
34
- </footer>
@@ -1,28 +0,0 @@
1
- <% content_for :thredded_page_title, 'Create a New Private Topic' %>
2
- <% content_for :thredded_page_id, 'thredded_new_private_topic' %>
3
-
4
- <header>
5
- <nav>
6
- <ul class="breadcrumbs">
7
- <li><%= link_to 'Forums', thredded.root_path %></li>
8
- <li><%= link_to messageboard.name, [messageboard, @private_topic] %></li>
9
- <li><span>Create New Topic</span></li>
10
- </ul>
11
- </nav>
12
- </header>
13
-
14
-
15
- <div class="topics forms">
16
- <%= nested_form_for([messageboard, @private_topic],
17
- url: messageboard_private_topics_path(messageboard, @private_topic),
18
- html: { multipart: true, class: :topic_form }) do |form| %>
19
-
20
- <ul>
21
- <%= render 'form', form: form, messageboard: messageboard.decorate %>
22
-
23
- <li class="submit">
24
- <%= form.submit 'Create New Private Topic' %>
25
- </li>
26
- </ul>
27
- <% end %>
28
- </div>
@@ -1,9 +0,0 @@
1
- <li class="search_form">
2
- <%= form_tag messageboard_topics_path(messageboard), method: 'get' do %>
3
- <%= label :q, :search, 'Search', for: 'q', class: 'show-for-small',
4
- data: {toggle: '#q'} %>
5
- <%= text_field_tag(:q, params[:q],
6
- { placeholder: 'Search Topics and Posts', type: 'search', class: 'input-search' }) %>
7
- <%= submit_tag('Search', name: '') %>
8
- <% end %>
9
- </li>
@@ -1,35 +0,0 @@
1
- <%= form_for @messageboard do |f| %>
2
- <div id="setup-container">
3
- <p class="setup-overview-text">
4
- These will be the settings and permissions for your first thredded
5
- messageboard.
6
- </p>
7
-
8
- <dl>
9
- <dt><%= f.label :name %></dt>
10
- <dd><%= f.text_field :name %></dd>
11
-
12
- <dt><%= f.label :description %></dt>
13
- <dd><%= f.text_field :description %></dd>
14
-
15
- <dt><%= f.label :security %></dt>
16
- <dd>
17
- <%= f.select :security, [:private, :public, :logged_in] %>
18
- <p class="setup-explanation-text">
19
- This will set the visibility of your messageboard to the public
20
- members.
21
- </p>
22
- </dd>
23
-
24
- <dt><%= f.label :posting_permission %></dt>
25
- <dd>
26
- <%= f.select :posting_permission, [:members, :logged_in, :anonymous] %>
27
- <p class="setup-explanation-text">
28
- The required minimum permissions to post in your messageboard.
29
- </p>
30
- </dd>
31
- </dl>
32
-
33
- <%= f.submit 'Continue' %>
34
- </div>
35
- <% end %>