Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@ use the following command in your rails console : `Decidim::User.find_each { |us

**Added**:

- **decidim-core**: banner uploader has been changed in [\#150](https://github.com/OpenSourcePolitics/decidim/pull/150)
- **decidim-debates**: Allow debates to be reported [#199](https://github.com/OpenSourcePolitics/decidim/pull/199)
- **decidim-core**: Banner uploader has been changed in [\#150](https://github.com/OpenSourcePolitics/decidim/pull/150)
- **decidim-core**: Avater uploader has been changed in [\#147](https://github.com/OpenSourcePolitics/decidim/pull/147)
- **decidim-core**: Now have a quality setting which can be used by adding `process quality:%%` where %% is your desired percentage of quality
- **decidim-core** : Add an initializer otion to skip first login authorization [\#176](https://github.com/OpenSourcePolitics/decidim/pull/176)
- **decidim-admin**:Add link to user profile and link to conversation from admin space. [\#208](https://github.com/OpenSourcePolitics/decidim/pull/208)
- **decidim-admin**: Add link to user profile and link to conversation from admin space. [\#208](https://github.com/OpenSourcePolitics/decidim/pull/208)


**Changed**:

Expand Down
6 changes: 5 additions & 1 deletion decidim-core/app/cells/decidim/author_cell.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def withdrawable?

def flagable?
return unless from_context
return unless proposals_controller?
return unless proposals_controller? || debates_controller?
return if index_action?
return if from_context.official?
true
Expand Down Expand Up @@ -86,6 +86,10 @@ def proposals_controller?
context[:controller].class.to_s == "Decidim::Proposals::ProposalsController"
end

def debates_controller?
context[:controller].class.to_s == "Decidim::Debates::DebatesController"
end

def posts_controller?
context[:controller].class.to_s == "Decidim::Blogs::PostsController"
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@
</div>
</div>
</div>
</section>
</div>
</section>
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ class DebatesController < Decidim::Debates::ApplicationController

helper_method :debates, :debate, :paginated_debates, :report_form

def show
debate
end

def new
enforce_permission_to :create, :debate

Expand Down Expand Up @@ -44,7 +48,7 @@ def paginated_debates
end

def debates
@debates ||= search.results
@debates ||= search.results.not_hidden
end

def debate
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<%== translated_attribute debate.title %>
</h2>

<%= cell "decidim/author", Decidim::Debates::DebatePresenter.new(debate).author, context: {extra_classes: ["author-data--small"]} %>
<%= cell "decidim/author", present(@debate).author, from: @debate, context: {extra_classes: ["author-data--small"]} %>

</div>
<div class="row">
Expand Down
21 changes: 21 additions & 0 deletions decidim-debates/spec/system/report_debate.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# frozen_string_literal: true

require "spec_helper"

describe "Report Debate", type: :system do
include_context "with a component"

let(:manifest_name) { "debates" }
let!(:debates) { create_list(:debate, 3, :with_author, component: component) }
let(:reportable) { debates.first }
let(:reportable_path) { resource_locator(reportable).path }
let!(:user) { create :user, :confirmed, organization: organization }

let!(:component) do
create(:debates_component,
manifest: manifest,
participatory_space: participatory_process)
end

include_examples "reports"
end