thredded 0.3.2 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (64) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.mkdn +22 -2
  3. data/README.mkdn +17 -5
  4. data/app/assets/stylesheets/thredded/base/_typography.scss +9 -0
  5. data/app/assets/stylesheets/thredded/base/_variables.scss +4 -0
  6. data/app/assets/stylesheets/thredded/components/_messageboard.scss +13 -1
  7. data/app/assets/stylesheets/thredded/components/_post.scss +15 -1
  8. data/app/assets/stylesheets/thredded/layout/_search-navigation.scss +1 -1
  9. data/app/controllers/thredded/application_controller.rb +1 -1
  10. data/app/controllers/thredded/messageboard_groups_controller.rb +29 -0
  11. data/app/controllers/thredded/messageboards_controller.rb +24 -10
  12. data/app/controllers/thredded/post_permalinks_controller.rb +10 -0
  13. data/app/controllers/thredded/private_post_permalinks_controller.rb +11 -0
  14. data/app/controllers/thredded/private_topics_controller.rb +2 -1
  15. data/app/controllers/thredded/theme_previews_controller.rb +3 -2
  16. data/app/controllers/thredded/topics_controller.rb +14 -7
  17. data/app/forms/thredded/private_topic_form.rb +4 -2
  18. data/app/helpers/thredded/application_helper.rb +1 -1
  19. data/app/helpers/thredded/urls_helper.rb +5 -3
  20. data/app/mailer_previews/thredded/base_mailer_preview.rb +12 -6
  21. data/app/mailer_previews/thredded/post_mailer_preview.rb +2 -1
  22. data/app/mailer_previews/thredded/private_post_mailer_preview.rb +2 -1
  23. data/app/mailer_previews/thredded/private_topic_mailer_preview.rb +2 -1
  24. data/app/models/concerns/thredded/post_common.rb +6 -5
  25. data/app/models/thredded/messageboard.rb +18 -1
  26. data/app/models/thredded/messageboard_group.rb +11 -0
  27. data/app/models/thredded/null_user.rb +2 -6
  28. data/app/policies/thredded/messageboard_group_policy.rb +15 -0
  29. data/app/policies/thredded/messageboard_policy.rb +4 -0
  30. data/app/policies/thredded/post_policy.rb +5 -0
  31. data/app/policies/thredded/private_post_policy.rb +5 -0
  32. data/app/view_models/thredded/messageboard_group_view.rb +14 -0
  33. data/app/views/thredded/messageboard_groups/new.html.erb +20 -0
  34. data/app/views/thredded/messageboards/_form.html.erb +19 -0
  35. data/app/views/thredded/messageboards/edit.html.erb +11 -0
  36. data/app/views/thredded/messageboards/index.html.erb +14 -6
  37. data/app/views/thredded/messageboards/new.html.erb +3 -16
  38. data/app/views/thredded/post_mailer/at_notification.html.erb +1 -1
  39. data/app/views/thredded/post_mailer/at_notification.text.erb +1 -1
  40. data/app/views/thredded/posts_common/_form.html.erb +1 -1
  41. data/app/views/thredded/posts_common/form/_after_content.html.erb +0 -0
  42. data/app/views/thredded/posts_common/form/_before_content.html.erb +0 -0
  43. data/app/views/thredded/posts_common/form/_content_field.html.erb +6 -0
  44. data/app/views/thredded/private_post_mailer/at_notification.html.erb +1 -1
  45. data/app/views/thredded/private_topics/_form.html.erb +1 -1
  46. data/app/views/thredded/topics/_form.html.erb +1 -1
  47. data/app/views/thredded/topics/index.html.erb +8 -0
  48. data/app/views/thredded/users/_link.html.erb +1 -1
  49. data/config/locales/en.yml +11 -0
  50. data/config/locales/pt-BR.yml +15 -3
  51. data/config/routes.rb +12 -1
  52. data/db/migrate/20160329231848_create_thredded.rb +8 -0
  53. data/db/seeds.rb +10 -5
  54. data/db/upgrade_migrations/20160429222452_upgrade_v0_3_to_v0_4.rb +14 -0
  55. data/heroku.gemfile +1 -1
  56. data/heroku.gemfile.lock +43 -43
  57. data/lib/generators/thredded/install/USAGE +1 -6
  58. data/lib/generators/thredded/install/install_generator.rb +0 -5
  59. data/lib/thredded/engine.rb +8 -0
  60. data/lib/thredded/version.rb +1 -1
  61. data/thredded.gemspec +1 -1
  62. metadata +17 -6
  63. data/app/controllers/thredded/setups_controller.rb +0 -54
  64. data/app/views/thredded/posts/_content_field.html.erb +0 -4
@@ -2,11 +2,6 @@
2
2
  module Thredded
3
3
  module Generators
4
4
  class InstallGenerator < Rails::Generators::Base
5
- class_option :theme,
6
- type: :boolean,
7
- default: false,
8
- desc: 'Copy all thredded layout, views, and assets to parent application.'
9
-
10
5
  def set_source_paths
11
6
  @source_paths = [
12
7
  File.expand_path('../templates', __FILE__),
@@ -36,6 +36,14 @@ module Thredded
36
36
  tag :img, match: %r{^https?://.*(png|bmp|jpe?g|gif)$}, singular: false do
37
37
  %(<img src="#{singular? ? meta : content}" />)
38
38
  end
39
+
40
+ tag :spoilers do
41
+ %(<span class="thredded--post--content--spoiler">#{content}</span>)
42
+ end
43
+
44
+ tag :spoiler do
45
+ %(<span class="thredded--post--content--spoiler">#{content}</span>)
46
+ end
39
47
  end
40
48
  end
41
49
  end
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Thredded
3
- VERSION = '0.3.2'
3
+ VERSION = '0.4.0'
4
4
  end
data/thredded.gemspec CHANGED
@@ -65,7 +65,7 @@ Gem::Specification.new do |s|
65
65
  s.add_development_dependency 'pg'
66
66
  s.add_development_dependency 'sqlite3'
67
67
  s.add_development_dependency 'puma'
68
- s.add_development_dependency 'rails_email_preview', '>= 1.0.3'
68
+ s.add_development_dependency 'rails_email_preview', '>= 2.0.1'
69
69
  s.add_development_dependency 'i18n-tasks'
70
70
 
71
71
  # dummy app frontend
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: thredded
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joel Oliveira
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-05-04 00:00:00.000000000 Z
12
+ date: 2016-05-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bbcoder
@@ -563,14 +563,14 @@ dependencies:
563
563
  requirements:
564
564
  - - ">="
565
565
  - !ruby/object:Gem::Version
566
- version: 1.0.3
566
+ version: 2.0.1
567
567
  type: :development
568
568
  prerelease: false
569
569
  version_requirements: !ruby/object:Gem::Requirement
570
570
  requirements:
571
571
  - - ">="
572
572
  - !ruby/object:Gem::Version
573
- version: 1.0.3
573
+ version: 2.0.1
574
574
  - !ruby/object:Gem::Dependency
575
575
  name: i18n-tasks
576
576
  requirement: !ruby/object:Gem::Requirement
@@ -682,11 +682,13 @@ files:
682
682
  - app/commands/thredded/notify_private_topic_users.rb
683
683
  - app/controllers/thredded/application_controller.rb
684
684
  - app/controllers/thredded/autocomplete_users_controller.rb
685
+ - app/controllers/thredded/messageboard_groups_controller.rb
685
686
  - app/controllers/thredded/messageboards_controller.rb
687
+ - app/controllers/thredded/post_permalinks_controller.rb
686
688
  - app/controllers/thredded/posts_controller.rb
687
689
  - app/controllers/thredded/preferences_controller.rb
690
+ - app/controllers/thredded/private_post_permalinks_controller.rb
688
691
  - app/controllers/thredded/private_topics_controller.rb
689
- - app/controllers/thredded/setups_controller.rb
690
692
  - app/controllers/thredded/theme_previews_controller.rb
691
693
  - app/controllers/thredded/topics_controller.rb
692
694
  - app/forms/thredded/private_topic_form.rb
@@ -711,6 +713,7 @@ files:
711
713
  - app/models/concerns/thredded/user_topic_read_state_common.rb
712
714
  - app/models/thredded/category.rb
713
715
  - app/models/thredded/messageboard.rb
716
+ - app/models/thredded/messageboard_group.rb
714
717
  - app/models/thredded/messageboard_user.rb
715
718
  - app/models/thredded/null_preference.rb
716
719
  - app/models/thredded/null_user.rb
@@ -737,12 +740,14 @@ files:
737
740
  - app/models/thredded/user_preference.rb
738
741
  - app/models/thredded/user_private_topic_read_state.rb
739
742
  - app/models/thredded/user_topic_read_state.rb
743
+ - app/policies/thredded/messageboard_group_policy.rb
740
744
  - app/policies/thredded/messageboard_policy.rb
741
745
  - app/policies/thredded/post_policy.rb
742
746
  - app/policies/thredded/private_post_policy.rb
743
747
  - app/policies/thredded/private_topic_policy.rb
744
748
  - app/policies/thredded/topic_policy.rb
745
749
  - app/view_models/thredded/base_topic_view.rb
750
+ - app/view_models/thredded/messageboard_group_view.rb
746
751
  - app/view_models/thredded/post_view.rb
747
752
  - app/view_models/thredded/posts_page_view.rb
748
753
  - app/view_models/thredded/private_topic_view.rb
@@ -760,18 +765,23 @@ files:
760
765
  - app/views/thredded/kaminari/_page.html.erb
761
766
  - app/views/thredded/kaminari/_paginator.html.erb
762
767
  - app/views/thredded/kaminari/_prev_page.html.erb
768
+ - app/views/thredded/messageboard_groups/new.html.erb
769
+ - app/views/thredded/messageboards/_form.html.erb
763
770
  - app/views/thredded/messageboards/_messageboard.html.erb
771
+ - app/views/thredded/messageboards/edit.html.erb
764
772
  - app/views/thredded/messageboards/index.html.erb
765
773
  - app/views/thredded/messageboards/new.html.erb
766
774
  - app/views/thredded/post_mailer/at_notification.html.erb
767
775
  - app/views/thredded/post_mailer/at_notification.text.erb
768
- - app/views/thredded/posts/_content_field.html.erb
769
776
  - app/views/thredded/posts/_form.html.erb
770
777
  - app/views/thredded/posts/_post.html.erb
771
778
  - app/views/thredded/posts/_user.html.erb
772
779
  - app/views/thredded/posts/edit.html.erb
773
780
  - app/views/thredded/posts_common/_form.html.erb
774
781
  - app/views/thredded/posts_common/_post.html.erb
782
+ - app/views/thredded/posts_common/form/_after_content.html.erb
783
+ - app/views/thredded/posts_common/form/_before_content.html.erb
784
+ - app/views/thredded/posts_common/form/_content_field.html.erb
775
785
  - app/views/thredded/preferences/_form.html.erb
776
786
  - app/views/thredded/preferences/_header.html.erb
777
787
  - app/views/thredded/preferences/edit.html.erb
@@ -821,6 +831,7 @@ files:
821
831
  - db/migrate/20160329231848_create_thredded.rb
822
832
  - db/seeds.rb
823
833
  - db/upgrade_migrations/20160410111522_upgrade_v0_2_to_v0_3.rb
834
+ - db/upgrade_migrations/20160429222452_upgrade_v0_3_to_v0_4.rb
824
835
  - heroku.gemfile
825
836
  - heroku.gemfile.lock
826
837
  - lib/generators/thredded/install/USAGE
@@ -1,54 +0,0 @@
1
- # frozen_string_literal: true
2
- module Thredded
3
- class SetupsController < Thredded::ApplicationController
4
- def new
5
- show_sign_in_error unless signed_in?
6
- @messageboard = Messageboard.new
7
- end
8
-
9
- def create
10
- @messageboard = Messageboard.new(messageboard_params)
11
-
12
- if signed_in? && @messageboard.save
13
- @topic = Topic.create!(topic_params)
14
- @post = Post.create!(post_params)
15
-
16
- redirect_to root_path
17
- else
18
- show_sign_in_error unless signed_in?
19
- render action: :new
20
- end
21
- end
22
-
23
- private
24
-
25
- def show_sign_in_error
26
- flash.now[:error] = 'You are not signed in. Sign in or create an account before creating your messageboard.'
27
- end
28
-
29
- def messageboard_params
30
- params
31
- .require(:messageboard)
32
- .permit(:description, :name, :posting_permission, :security)
33
- end
34
-
35
- def topic_params
36
- {
37
- messageboard: @messageboard,
38
- user: thredded_current_user,
39
- last_user: thredded_current_user,
40
- title: "Welcome to your messageboard's very first thread",
41
- }
42
- end
43
-
44
- def post_params
45
- {
46
- messageboard: @messageboard,
47
- postable: @topic,
48
- content: "There's not a whole lot here for now.",
49
- ip: request.ip,
50
- user: thredded_current_user,
51
- }
52
- end
53
- end
54
- end
@@ -1,4 +0,0 @@
1
- <li>
2
- <%= form.label :content, content_label %>
3
- <%= form.text_area :content, { rows: 5, required: true } %>
4
- </li>