simple_discussion 1.0.1 → 1.2.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
2
  SHA256:
3
- metadata.gz: 3f2f5e88baaa6845d27866a70baa5facf3c48e13798cb4889b83b7e6aa7cc5c3
4
- data.tar.gz: 2bb6cf3b10096223a6c06cf48aab740c1ead7f9cd6515d0bef25f0151555d028
3
+ metadata.gz: 20ef7fd5da8bb052ef36f73fbbd24661032fe5e14453e611a208a6f0f405e80a
4
+ data.tar.gz: 1e4c484430c87b3122358dce54c744c7c5611710d3175b27c24dad9c58f39257
5
5
  SHA512:
6
- metadata.gz: bcd1f320d3ea9c3d7015315e8a924700e7f6648545e2297184c3e5eb575f7fb77fc6c7f4d8c3ad99220b638f868100a9cce51b0fe89a5e74c9512dd387c9efbe
7
- data.tar.gz: 2423d0d19d3495edb17d3789b8372770a98739f19f15df2555cb7d4945624c6f34c9070ca7ec4826fe727361c93ee1e9c46763c12bbf0667742656cabe171c1a
6
+ metadata.gz: 29755f4463b66a8420840b4639c520441b9c9820e2759e351d4d4e8056f2c0f867cf635f771b5f13f5393bd2ce86bb340307cb9367635eec0ab60d67a86e80ee
7
+ data.tar.gz: d7a0af8b494062a347310281a22a7f41b79ba10a060a82130586160f584a007c1166ff294b6881da3b05c5f9ee4ab2f9ae5d14110e6461e6b10d4b2bfa93d786
@@ -0,0 +1,3 @@
1
+ ### 1.2.0
2
+
3
+ * Update to require Font Awesome 5.x+
@@ -1,8 +1,8 @@
1
1
  class SimpleDiscussion::ForumPostsController < SimpleDiscussion::ApplicationController
2
2
  before_action :authenticate_user!
3
3
  before_action :set_forum_thread
4
- before_action :set_forum_post, only: [:edit, :update]
5
- before_action :require_mod_or_author_for_post!, only: [:edit, :update]
4
+ before_action :set_forum_post, only: [:edit, :update, :destroy]
5
+ before_action :require_mod_or_author_for_post!, only: [:edit, :update, :destroy]
6
6
  before_action :require_mod_or_author_for_thread!, only: [:solved, :unsolved]
7
7
 
8
8
  def create
@@ -28,6 +28,11 @@ class SimpleDiscussion::ForumPostsController < SimpleDiscussion::ApplicationCont
28
28
  end
29
29
  end
30
30
 
31
+ def destroy
32
+ @forum_post.destroy!
33
+ redirect_to simple_discussion.forum_thread_path(@forum_thread)
34
+ end
35
+
31
36
  def solved
32
37
  @forum_post = @forum_thread.forum_posts.find(params[:id])
33
38
 
@@ -19,32 +19,32 @@
19
19
  </h5>
20
20
  <div>
21
21
  <%= forum_link_to simple_discussion.forum_threads_path, exact: true do %>
22
- <%= icon "bars" %>
22
+ <%= icon "fa-fw fas", "bars" %>
23
23
  <%= t('.all_threads') %>
24
24
  <% end %>
25
25
  </div>
26
26
  <% if user_signed_in? %>
27
27
  <div>
28
- <%= forum_link_to simple_discussion.mine_forum_threads_path do %><%= icon "user-circle-o" %>
28
+ <%= forum_link_to simple_discussion.mine_forum_threads_path do %><%= icon "fa-fw far", "user-circle" %>
29
29
  <%= t('.my_questions') %>
30
30
  <% end %>
31
31
  </div>
32
32
  <div>
33
33
  <%= forum_link_to simple_discussion.participating_forum_threads_path do %>
34
- <%= icon "comments-o" %>
34
+ <%= icon "fa-fw far", "comments" %>
35
35
  <%= t('.participating') %>
36
36
  <% end %>
37
37
  </div>
38
38
  <% end %>
39
39
  <div>
40
40
  <%= forum_link_to simple_discussion.answered_forum_threads_path do %>
41
- <%= icon "check" %>
41
+ <%= icon "fa-fw fas", "check" %>
42
42
  <%= t('.answered') %>
43
43
  <% end %>
44
44
  </div>
45
45
  <div>
46
46
  <%= forum_link_to simple_discussion.unanswered_forum_threads_path do %>
47
- <%= icon "question" %>
47
+ <%= icon "fa-fw fas", "question" %>
48
48
  <%= t('.unanswered') %>
49
49
  <% end %>
50
50
  </div>
@@ -58,11 +58,11 @@
58
58
  <%= t('.by_category') %>
59
59
  </strong>
60
60
  </h6>
61
- <div><%= forum_link_to simple_discussion.forum_threads_path, exact: true do %><%= icon "circle" %> All<% end %></div>
61
+ <div><%= forum_link_to simple_discussion.forum_threads_path, exact: true do %><%= icon "fa-fw fas", "circle" %> All<% end %></div>
62
62
  <% ForumCategory.sorted.each do |category| %>
63
63
  <div>
64
64
  <%= forum_link_to simple_discussion.forum_category_forum_threads_path(category) do %>
65
- <%= icon "circle", style: "color: #{category.color}" %>
65
+ <%= icon "fa-fw fas", "circle", style: "color: #{category.color}" %>
66
66
  <%= category.name %>
67
67
  <% end %>
68
68
  </div>
@@ -77,9 +77,9 @@
77
77
 
78
78
  <%= link_to simple_discussion.forum_thread_notifications_path(@forum_thread), method: :post, class: "btn btn-secondary btn-sm btn-block mb-2" do %>
79
79
  <% if @forum_thread.subscribed? current_user %>
80
- <%= icon "bell-slash" %> t('.unsubscribe')
80
+ <%= icon "fa-fw fas", "bell-slash" %> <%= t('.unsubscribe') %>
81
81
  <% else %>
82
- <%= icon "bell" %>
82
+ <%= icon "fa-fw fas", "bell" %>
83
83
  <%= t('.suscribe') %>
84
84
  <% end %>
85
85
  <% end %>
@@ -4,12 +4,19 @@
4
4
  <div class="card-header">
5
5
 
6
6
  <% if is_moderator_or_owner?(forum_post) %>
7
- <div class="pull-right">
8
- <%= link_to icon("pencil"), simple_discussion.edit_forum_thread_forum_post_path(@forum_thread, forum_post),
7
+ <div class="float-right">
8
+ <%= link_to icon("fas","edit"), 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
11
  title: t('edit_this_post')
12
12
  %>
13
+ &nbsp;
14
+ <%= link_to icon("fas","trash"), simple_discussion.forum_thread_forum_post_path(@forum_thread, forum_post),
15
+ class: "text-muted",
16
+ method: :delete,
17
+ data: { toggle: "tooltip", placement: "left", confirm: "Are you sure you want to delete this post?" },
18
+ title: t('edit_this_post')
19
+ %>
13
20
  </div>
14
21
  <% end %>
15
22
 
@@ -33,7 +40,7 @@
33
40
  <% if @forum_thread.solved? && forum_post.solved? %>
34
41
  <div class="card-footer">
35
42
  <div class="pull-right">
36
- <strong class="text-success"><%= icon("check") %> <%= t('solved') %></strong>
43
+ <strong class="text-success"><%= icon("fas","check") %> <%= t('solved') %></strong>
37
44
 
38
45
  <% if is_moderator_or_owner?(@forum_thread) %>
39
46
  <small>
@@ -48,7 +55,7 @@
48
55
  <div class="pull-right">
49
56
  <small>
50
57
  <%= link_to simple_discussion.solved_forum_thread_forum_post_path(@forum_thread, forum_post), method: :put do %>
51
- <%= icon("check") %>
58
+ <%= icon("fas","fas","check") %>
52
59
  <%= t('this_solved_my_question') %>
53
60
  <% end %>
54
61
  </small>
@@ -9,11 +9,11 @@
9
9
  <div class="col">
10
10
  <h4>
11
11
  <% if forum_thread.solved? %>
12
- <span class="text-success"><%= icon "check-circle" %></span>
12
+ <span class="text-success"><%= icon "fas", "check-circle" %></span>
13
13
  <% end %>
14
14
 
15
15
  <%= link_to simple_discussion.forum_thread_path(forum_thread) do %>
16
- <%= icon "thumb-tack", class: "text-muted" if forum_thread.pinned? %> <%= forum_thread.title %>
16
+ <%= icon "fas", "thumb-tack", class: "text-muted" if forum_thread.pinned? %> <%= forum_thread.title %>
17
17
  <% end %>
18
18
  </h4>
19
19
 
@@ -1,11 +1,11 @@
1
1
  <div class="row">
2
2
  <div class="col-md-11">
3
- <h1><%= icon "thumb-tack", class: "text-muted" if @forum_thread.pinned? %> <%= @forum_thread.title %></h1>
3
+ <h1><%= icon "fas", "thumb-tack", class: "text-muted" if @forum_thread.pinned? %> <%= @forum_thread.title %></h1>
4
4
  </div>
5
5
 
6
6
  <% if is_moderator_or_owner?(@forum_thread) %>
7
7
  <div class="col-md-1">
8
- <%= link_to icon("pencil"), simple_discussion.edit_forum_thread_path(@forum_thread),
8
+ <%= link_to icon("fas","pencil"), simple_discussion.edit_forum_thread_path(@forum_thread),
9
9
  class: "text-muted",
10
10
  data: { toggle: "tooltip", placement: "left" },
11
11
  title: t('edit_this_thread') %>
@@ -4,7 +4,7 @@ en:
4
4
  ask_a_question: Ask A Question
5
5
  asked_time_ago: "Asked %{time} ago by %{author}"
6
6
  choose_a_category: Choose a Category
7
- comment: comment
7
+ comment: Comment
8
8
  commented_on: Commented on
9
9
  community: Community
10
10
  edit_this_post: Edit this post
@@ -1,3 +1,3 @@
1
1
  module SimpleDiscussion
2
- VERSION = "1.0.1"
2
+ VERSION = "1.2.0"
3
3
  end
@@ -21,7 +21,7 @@ Gem::Specification.new do |spec|
21
21
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
22
22
  spec.require_paths = ["lib"]
23
23
 
24
- spec.add_dependency 'font-awesome-sass', '>= 4.7.0'
24
+ spec.add_dependency 'font-awesome-sass', '~> 5.13.0'
25
25
  spec.add_dependency 'friendly_id', '>= 5.2.0'
26
26
  spec.add_dependency 'gravatar_image_tag'
27
27
  spec.add_dependency 'rails', '>= 4.2'
metadata CHANGED
@@ -1,29 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple_discussion
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.2.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: 2020-06-14 00:00:00.000000000 Z
11
+ date: 2020-06-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: font-awesome-sass
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 4.7.0
19
+ version: 5.13.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ">="
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 4.7.0
26
+ version: 5.13.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: friendly_id
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -90,6 +90,7 @@ files:
90
90
  - ".github/FUNDING.yml"
91
91
  - ".gitignore"
92
92
  - ".travis.yml"
93
+ - CHANGELOG.md
93
94
  - CODE_OF_CONDUCT.md
94
95
  - Gemfile
95
96
  - LICENSE.txt