decidim-feeds 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE-AGPLv3.txt +661 -0
- data/README.md +39 -0
- data/Rakefile +9 -0
- data/app/cells/decidim/feeds/content_blocks/feeds_settings_form/show.erb +3 -0
- data/app/cells/decidim/feeds/content_blocks/feeds_settings_form_cell.rb +23 -0
- data/app/cells/decidim/feeds/feed_cell.rb +24 -0
- data/app/cells/decidim/feeds/feed_dropdown_metadata_cell.rb +19 -0
- data/app/cells/decidim/feeds/feed_g_cell.rb +33 -0
- data/app/cells/decidim/feeds/feed_metadata_g_cell.rb +25 -0
- data/app/cells/decidim/feeds/feed_s_cell.rb +13 -0
- data/app/commands/decidim/feeds/admin/create_feed.rb +90 -0
- data/app/commands/decidim/feeds/admin/update_feed.rb +85 -0
- data/app/commands/decidim/feeds/create_feed.rb +90 -0
- data/app/commands/decidim/feeds/update_feed.rb +73 -0
- data/app/constraints/decidim/feeds/current_component.rb +28 -0
- data/app/constraints/decidim/feeds/current_feed.rb +43 -0
- data/app/controllers/concerns/decidim/feeds/feed_breadcrumb.rb +36 -0
- data/app/controllers/decidim/feeds/admin/application_controller.rb +26 -0
- data/app/controllers/decidim/feeds/admin/components_controller.rb +14 -0
- data/app/controllers/decidim/feeds/admin/concerns/feed_admin.rb +51 -0
- data/app/controllers/decidim/feeds/admin/feeds_controller.rb +92 -0
- data/app/controllers/decidim/feeds/application_controller.rb +37 -0
- data/app/controllers/decidim/feeds/feeds_controller.rb +137 -0
- data/app/forms/decidim/feeds/admin/feed_form.rb +102 -0
- data/app/forms/decidim/feeds/feed_form.rb +70 -0
- data/app/helpers/decidim/feeds/admin/feeds_admin_menu_helper.rb +10 -0
- data/app/helpers/decidim/feeds/application_helper.rb +16 -0
- data/app/helpers/decidim/feeds/feeds_helper.rb +38 -0
- data/app/models/decidim/feeds/application_record.rb +10 -0
- data/app/models/decidim/feeds/feed.rb +113 -0
- data/app/packs/entrypoints/decidim_feeds.js +5 -0
- data/app/packs/entrypoints/decidim_feeds.scss +1 -0
- data/app/packs/images/decidim/feeds/decidim_feeds.svg +1 -0
- data/app/packs/images/decidim/feeds/icon.svg +1 -0
- data/app/packs/src/decidim/feeds/feeds.js +0 -0
- data/app/packs/stylesheets/decidim/feeds/_variables.scss +10 -0
- data/app/packs/stylesheets/decidim/feeds/feeds.scss +3 -0
- data/app/permissions/decidim/feeds/permissions.rb +53 -0
- data/app/presenters/decidim/feeds/admin_log/feed_presenter.rb +46 -0
- data/app/queries/decidim/feeds/admin/admin_users.rb +60 -0
- data/app/queries/decidim/feeds/organization_feeds.rb +16 -0
- data/app/views/decidim/feeds/admin/feeds/_form.html.erb +66 -0
- data/app/views/decidim/feeds/admin/feeds/edit.html.erb +20 -0
- data/app/views/decidim/feeds/admin/feeds/index.html.erb +65 -0
- data/app/views/decidim/feeds/admin/feeds/new.html.erb +20 -0
- data/app/views/decidim/feeds/feeds/_form.html.erb +18 -0
- data/app/views/decidim/feeds/feeds/edit.html.erb +10 -0
- data/app/views/decidim/feeds/feeds/index.html.erb +5 -0
- data/app/views/decidim/feeds/feeds/new.html.erb +20 -0
- data/app/views/decidim/feeds/feeds/show.html.erb +33 -0
- data/app/views/layouts/decidim/admin/_manage_feeds.html.erb +11 -0
- data/app/views/layouts/decidim/admin/feed.html.erb +17 -0
- data/app/views/layouts/decidim/admin/feeds.html.erb +17 -0
- data/app/views/layouts/decidim/feed.html.erb +18 -0
- data/config/assets.rb +9 -0
- data/config/i18n-tasks.yml +10 -0
- data/config/locales/bs.yml +75 -0
- data/config/locales/de.yml +77 -0
- data/config/locales/en.yml +75 -0
- data/config/locales/hr.yml +75 -0
- data/config/locales/it.yml +75 -0
- data/config/locales/sr.yml +75 -0
- data/config/locales/tr.yml +75 -0
- data/lib/decidim/api/feed_type.rb +30 -0
- data/lib/decidim/feeds/admin.rb +10 -0
- data/lib/decidim/feeds/admin_engine.rb +81 -0
- data/lib/decidim/feeds/api.rb +9 -0
- data/lib/decidim/feeds/content_blocks/content_blocks_homepage.rb +19 -0
- data/lib/decidim/feeds/engine.rb +83 -0
- data/lib/decidim/feeds/menu.rb +106 -0
- data/lib/decidim/feeds/participatory_space.rb +52 -0
- data/lib/decidim/feeds/seeds.rb +47 -0
- data/lib/decidim/feeds/test/factories.rb +17 -0
- data/lib/decidim/feeds/version.rb +9 -0
- data/lib/decidim/feeds.rb +13 -0
- metadata +142 -0
File without changes
|
@@ -0,0 +1,10 @@
|
|
1
|
+
:root {
|
2
|
+
--dg-color-white: 255 255 255;
|
3
|
+
--dg-color-black: 60 57 52;
|
4
|
+
--dg-color-post: 229 57 144;
|
5
|
+
--dg-color-help: 1 114 187;
|
6
|
+
--dg-color-sharecare: 36 166 32;
|
7
|
+
--dg-color-host: 219 15 16;
|
8
|
+
--dg-color-survey: 50 49 143;
|
9
|
+
--dg-color-calendar: 253 182 32;
|
10
|
+
}
|
@@ -0,0 +1,53 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module Feeds
|
5
|
+
class Permissions < Decidim::DefaultPermissions
|
6
|
+
def permissions
|
7
|
+
return permission_action unless user
|
8
|
+
|
9
|
+
case permission_action.subject
|
10
|
+
when :feed
|
11
|
+
case permission_action.action
|
12
|
+
when :read
|
13
|
+
allow! if user.present?
|
14
|
+
when :create
|
15
|
+
allow! if user.present? # TODO: maybe add a max number of feeds per user
|
16
|
+
when :update
|
17
|
+
allow! if can_update?
|
18
|
+
when :list
|
19
|
+
allow! if user.present?
|
20
|
+
end
|
21
|
+
when :feed_list
|
22
|
+
case permission_action.action
|
23
|
+
when :read
|
24
|
+
allow! if user.admin?
|
25
|
+
end
|
26
|
+
when :participatory_space
|
27
|
+
case permission_action.action
|
28
|
+
when :read
|
29
|
+
allow! if user.present?
|
30
|
+
end
|
31
|
+
when :component
|
32
|
+
case permission_action.action
|
33
|
+
when :read
|
34
|
+
allow! if user.present?
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
permission_action
|
39
|
+
end
|
40
|
+
|
41
|
+
private
|
42
|
+
|
43
|
+
def can_access?
|
44
|
+
user.present?
|
45
|
+
end
|
46
|
+
|
47
|
+
def can_update?
|
48
|
+
# TODO: allow feed admins to update
|
49
|
+
user.admin? || user == resource.created_by
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
@@ -0,0 +1,46 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module Feeds
|
5
|
+
module AdminLog
|
6
|
+
# This class holds the logic to present a `Decidim::Feeds::Feed`
|
7
|
+
# for the `AdminLog` log.
|
8
|
+
#
|
9
|
+
# Usage should be automatic and you should not need to call this class
|
10
|
+
# directly, but here is an example:
|
11
|
+
#
|
12
|
+
# action_log = Decidim::ActionLog.last
|
13
|
+
# view_helpers # => this comes from the views
|
14
|
+
# FeedPresenter.new(action_log, view_helpers).present
|
15
|
+
class FeedPresenter < Decidim::Log::BasePresenter
|
16
|
+
private
|
17
|
+
|
18
|
+
def diff_fields_mapping
|
19
|
+
{
|
20
|
+
published_at: :date,
|
21
|
+
slug: :default,
|
22
|
+
title: :i18n,
|
23
|
+
created_by: :string
|
24
|
+
}
|
25
|
+
end
|
26
|
+
|
27
|
+
def i18n_labels_scope
|
28
|
+
"activemodel.attributes.feed"
|
29
|
+
end
|
30
|
+
|
31
|
+
def action_string
|
32
|
+
case action
|
33
|
+
when "create", "update"
|
34
|
+
"decidim.admin_log.feed.#{action}"
|
35
|
+
else
|
36
|
+
super
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
def diff_actions
|
41
|
+
super
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
@@ -0,0 +1,60 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module Feeds
|
5
|
+
module Admin
|
6
|
+
# A class used to find the admins for an feed or an organization feeds.
|
7
|
+
class AdminUsers < Decidim::Query
|
8
|
+
# Syntactic sugar to initialize the class and return the queried objects.
|
9
|
+
#
|
10
|
+
# feed - an feed that needs to find its feed admins
|
11
|
+
def self.for(feed)
|
12
|
+
new(feed).query
|
13
|
+
end
|
14
|
+
|
15
|
+
# Syntactic sugar to initialize the class and return the queried objects.
|
16
|
+
#
|
17
|
+
# organization - an organization that needs to find its feed admins
|
18
|
+
def self.for_organization(organization)
|
19
|
+
new(nil, organization).query
|
20
|
+
end
|
21
|
+
|
22
|
+
# Initializes the class.
|
23
|
+
#
|
24
|
+
# feed - an feed that needs to find its feed admins
|
25
|
+
# organization - an organization that needs to find its feed admins
|
26
|
+
def initialize(feed, organization = nil)
|
27
|
+
@feed = feed
|
28
|
+
@organization = feed&.organization || organization
|
29
|
+
end
|
30
|
+
|
31
|
+
# Finds organization admins and the users with role admin for the given feed.
|
32
|
+
#
|
33
|
+
# Returns an ActiveRecord::Relation.
|
34
|
+
def query
|
35
|
+
organization.admins.or(feeds_user_admins)
|
36
|
+
end
|
37
|
+
|
38
|
+
private
|
39
|
+
|
40
|
+
attr_reader :feed, :organization
|
41
|
+
|
42
|
+
def feeds_user_admins
|
43
|
+
# Decidim::User.where(
|
44
|
+
# id: Decidim::FeedUserRole.where(feed: feeds, role: :admin)
|
45
|
+
# .select(:decidim_user_id)
|
46
|
+
# )
|
47
|
+
Decidim::User.where(admin: true)
|
48
|
+
end
|
49
|
+
|
50
|
+
def feeds
|
51
|
+
if feed
|
52
|
+
[feed]
|
53
|
+
else
|
54
|
+
Decidim::Feed.where(organization:)
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module Feeds
|
5
|
+
# This query class filters all feeds given an organization.
|
6
|
+
class OrganizationFeeds < Decidim::Query
|
7
|
+
def initialize(organization)
|
8
|
+
@organization = organization
|
9
|
+
end
|
10
|
+
|
11
|
+
def query
|
12
|
+
Decidim::Feeds::Feed.where(organization: @organization)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,66 @@
|
|
1
|
+
<div class="form__wrapper">
|
2
|
+
<div class="card" data-component="accordion" id="accordion-title">
|
3
|
+
<div class="card-divider">
|
4
|
+
<button class="card-divider-button" data-open="true" data-controls="panel-title" type="button">
|
5
|
+
<%= icon "arrow-right-s-line" %>
|
6
|
+
<h2 class="card-title" id="title">
|
7
|
+
<%= t("title", scope: "decidim.feeds.admin.feeds.form") %>
|
8
|
+
</h2>
|
9
|
+
</button>
|
10
|
+
</div>
|
11
|
+
|
12
|
+
<div id="panel-title" class="card-section">
|
13
|
+
<div class="row column">
|
14
|
+
<%= form.translated :text_field, :title, autofocus: true, aria: { label: :title } %>
|
15
|
+
</div>
|
16
|
+
|
17
|
+
<div class="row">
|
18
|
+
<div class="columns slug">
|
19
|
+
<%= form.text_field :slug, help_text: t(".slug_help_html", url: decidim_form_slug_url(:feeds, form.object.slug)) %>
|
20
|
+
</div>
|
21
|
+
</div>
|
22
|
+
</div>
|
23
|
+
</div>
|
24
|
+
|
25
|
+
<div class="card" data-component="accordion" id="accordion-sponsor_logos">
|
26
|
+
<div class="card-divider">
|
27
|
+
<button class="card-divider-button" data-open="true" data-controls="panel-sponsor_logos" type="button">
|
28
|
+
<%= icon "arrow-right-s-line" %>
|
29
|
+
<h2 class="card-title" id="sponsor_logos">
|
30
|
+
<%= t("sponsor_logos", scope: "decidim.feeds.admin.feeds.form") %>
|
31
|
+
</h2>
|
32
|
+
</button>
|
33
|
+
</div>
|
34
|
+
|
35
|
+
<div id="panel-sponsor_logos" class="card-section">
|
36
|
+
<div class="row column">
|
37
|
+
<div class="">
|
38
|
+
<%= form.upload :documents,
|
39
|
+
titled: true,
|
40
|
+
label: false,
|
41
|
+
button_label: t("add_sponsor_logo", scope: "decidim.feeds.admin.feeds.form"),
|
42
|
+
button_edit_label: I18n.t("replace_sponsor_logo", scope: "decidim.feeds.admin.feeds.form"),
|
43
|
+
multiple: true,
|
44
|
+
# modal_only: false,
|
45
|
+
# show_current: true,
|
46
|
+
#label: false,
|
47
|
+
# id: field_id,
|
48
|
+
# disabled:,
|
49
|
+
# attribute:,
|
50
|
+
# resource_name: @object_name,
|
51
|
+
# resource_class: options[:resource_class]&.to_s || resource_class(attribute),
|
52
|
+
# show_current: true,
|
53
|
+
# max_file_size:,
|
54
|
+
# help: help_messages,
|
55
|
+
# label: label_for(attribute),
|
56
|
+
# button_label:,
|
57
|
+
# button_edit_label: I18n.t("decidim.forms.upload.labels.replace"),
|
58
|
+
button_class: "button button__sm button__transparent-primary w-full",
|
59
|
+
required: false %>
|
60
|
+
</div>
|
61
|
+
</div>
|
62
|
+
</div>
|
63
|
+
</div>
|
64
|
+
</div>
|
65
|
+
|
66
|
+
<%#= append_javascript_pack_tag "decidim_feeds_admin" %>
|
@@ -0,0 +1,20 @@
|
|
1
|
+
<% add_decidim_page_title(t("info", scope: "decidim.admin.menu.feeds_submenu")) %>
|
2
|
+
<div class="item_show__header">
|
3
|
+
<h1 class="item_show__header-title">
|
4
|
+
<%= t("info", scope: "decidim.admin.menu.feeds_submenu") %>
|
5
|
+
</h1>
|
6
|
+
</div>
|
7
|
+
|
8
|
+
<div class="item__edit item__edit-1col">
|
9
|
+
<div class="item__edit-form">
|
10
|
+
<%= decidim_form_for(@form, html: { class: "form form-defaults edit_feed feed_form_admin" }) do |f| %>
|
11
|
+
<%= render partial: "form", object: f %>
|
12
|
+
<div class="item__edit-sticky">
|
13
|
+
<div class="item__edit-sticky-container">
|
14
|
+
<%= f.submit t("feeds.edit.update", scope: "decidim.admin"), class: "button button__sm button__secondary" %>
|
15
|
+
</div>
|
16
|
+
</div>
|
17
|
+
<% end %>
|
18
|
+
|
19
|
+
</div>
|
20
|
+
</div>
|
@@ -0,0 +1,65 @@
|
|
1
|
+
<% add_decidim_page_title(t("feeds", scope: "decidim.admin.titles")) %>
|
2
|
+
|
3
|
+
<% if defined?(Decidim::FeedsUi) && Decidim::StaticPage.find_by(slug: "info").blank? %>
|
4
|
+
<%= cell("decidim/announcement", t(".new_info_page_info"), callout_class: "warning") %>
|
5
|
+
<div class="mb-8">
|
6
|
+
<%= link_to t(".new_info_page_button"), decidim_admin.new_static_page_path, class: "text-xl button button__sm button__text-secondary" %>
|
7
|
+
</div>
|
8
|
+
<% end %>
|
9
|
+
|
10
|
+
<div class="card" id="feeds">
|
11
|
+
<div class="table-scroll">
|
12
|
+
<table class="table-list">
|
13
|
+
<thead>
|
14
|
+
<tr>
|
15
|
+
<th>
|
16
|
+
<%= t("models.feed.fields.title", scope: "decidim.admin") %>
|
17
|
+
</th>
|
18
|
+
<th>
|
19
|
+
<%= t("models.feed.fields.created_at", scope: "decidim.admin") %>
|
20
|
+
</th>
|
21
|
+
<th>
|
22
|
+
<%= t("models.feed.fields.actions", scope: "decidim.admin") %>
|
23
|
+
</th>
|
24
|
+
</tr>
|
25
|
+
</thead>
|
26
|
+
<tbody>
|
27
|
+
<% @feeds.each do |feed| %>
|
28
|
+
<% next unless allowed_to? :list, :feed, feed: feed %>
|
29
|
+
<tr>
|
30
|
+
<td>
|
31
|
+
<% if allowed_to? :update, :feed, feed: feed %>
|
32
|
+
<%= link_to translated_attribute(feed.title), edit_feed_path(feed) %>
|
33
|
+
<% else %>
|
34
|
+
<%= translated_attribute(feed.title) %>
|
35
|
+
<% end %>
|
36
|
+
</td>
|
37
|
+
<td class="table-list__date">
|
38
|
+
<%= l(feed.created_at, format: :short) %>
|
39
|
+
</td>
|
40
|
+
<td class="table-list__actions">
|
41
|
+
<% if allowed_to? :update, :feed, feed: feed %>
|
42
|
+
<%= icon_link_to "pencil-line", edit_feed_path(feed), t("actions.configure", scope: "decidim.admin"), class: "action-icon--new" %>
|
43
|
+
<% else %>
|
44
|
+
<span class="action-space icon"></span>
|
45
|
+
<% end %>
|
46
|
+
<span class="action-space icon"></span>
|
47
|
+
<% if allowed_to? :preview, :feed, feed: feed %>
|
48
|
+
<%= icon_link_to "eye-line", decidim_feeds.feed_path(feed), t("actions.preview", scope: "decidim.admin"), class: "action-icon--preview", target: "_blank", data: { "external-link": false } %>
|
49
|
+
<% else %>
|
50
|
+
<span class="action-space icon"></span>
|
51
|
+
<% end %>
|
52
|
+
|
53
|
+
<% if allowed_to? :read, :moderation, feed: feed %>
|
54
|
+
<%= icon_link_to "flag-line", moderations_path(feed), t("actions.moderate", scope: "decidim.admin"), class: "action-icon--moderate" %>
|
55
|
+
<% else %>
|
56
|
+
<span class="action-space icon"></span>
|
57
|
+
<% end %>
|
58
|
+
</td>
|
59
|
+
</tr>
|
60
|
+
<% end %>
|
61
|
+
</tbody>
|
62
|
+
</table>
|
63
|
+
</div>
|
64
|
+
<%#= decidim_paginate @feeds %>
|
65
|
+
</div>
|
@@ -0,0 +1,20 @@
|
|
1
|
+
<% add_decidim_page_title(t("feeds.new.title", scope: "decidim.admin")) %>
|
2
|
+
|
3
|
+
<div class="item_show__header">
|
4
|
+
<h1 class="item_show__header-title">
|
5
|
+
<%= t "feeds.new.title", scope: "decidim.admin" %>
|
6
|
+
</h1>
|
7
|
+
</div>
|
8
|
+
|
9
|
+
<div class="item__edit item__edit-1col">
|
10
|
+
<div class="item__edit-form">
|
11
|
+
<%= decidim_form_for(@form, html: { class: "form-defaults form new_feed feed_form_admin" }) do |f| %>
|
12
|
+
<%= render partial: "form", object: f %>
|
13
|
+
<div class="item__edit-sticky">
|
14
|
+
<div class="item__edit-sticky-container">
|
15
|
+
<%= f.submit t("feeds.new.create", scope: "decidim.admin"), class: "button button__sm button__secondary" %>
|
16
|
+
</div>
|
17
|
+
</div>
|
18
|
+
<% end %>
|
19
|
+
</div>
|
20
|
+
</div>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<div class="form__wrapper">
|
2
|
+
<div class="card" data-component="accordion" id="accordion-title">
|
3
|
+
<div class="card-divider">
|
4
|
+
<button class="card-divider-button" data-open="true" data-controls="panel-title" type="button">
|
5
|
+
<%= icon "arrow-right-s-line" %>
|
6
|
+
<h2 class="card-title" id="title">
|
7
|
+
<%= t("title", scope: "decidim.feeds.feeds.form") %>
|
8
|
+
</h2>
|
9
|
+
</button>
|
10
|
+
</div>
|
11
|
+
|
12
|
+
<div id="panel-title" class="card-section">
|
13
|
+
<div class="row column">
|
14
|
+
<%= form.text_field :title, autofocus: true, aria: { label: :title } %>
|
15
|
+
</div>
|
16
|
+
</div>
|
17
|
+
</div>
|
18
|
+
</div>
|
@@ -0,0 +1,10 @@
|
|
1
|
+
<div>
|
2
|
+
<%= decidim_form_for(@form, html: { class: "form form-defaults edit_feed feed_form_admin" }) do |f| %>
|
3
|
+
<%= render partial: "form", object: f %>
|
4
|
+
<div class="item__edit-sticky">
|
5
|
+
<div class="item__edit-sticky-container">
|
6
|
+
<%= f.submit t("feeds.edit.update", scope: "decidim.feeds"), class: "button button__sm button__secondary" %>
|
7
|
+
</div>
|
8
|
+
</div>
|
9
|
+
<% end %>
|
10
|
+
</div>
|
@@ -0,0 +1,20 @@
|
|
1
|
+
<% add_decidim_page_title(t("feeds.new.title", scope: "decidim.feeds")) %>
|
2
|
+
|
3
|
+
<div class="item_show__header">
|
4
|
+
<h1 class="item_show__header-title">
|
5
|
+
<%= t "feeds.new.title", scope: "decidim.feeds" %>
|
6
|
+
</h1>
|
7
|
+
</div>
|
8
|
+
|
9
|
+
<div class="item__edit item__edit-1col">
|
10
|
+
<div class="item__edit-form">
|
11
|
+
<%= decidim_form_for(@form, html: { class: "form-defaults form new_feed feed_form" }) do |f| %>
|
12
|
+
<%= render partial: "form", object: f %>
|
13
|
+
<div class="item__edit-sticky">
|
14
|
+
<div class="item__edit-sticky-container">
|
15
|
+
<%= f.submit t("feeds.new.create", scope: "decidim.feeds"), class: "button button__sm button__secondary" %>
|
16
|
+
</div>
|
17
|
+
</div>
|
18
|
+
<% end %>
|
19
|
+
</div>
|
20
|
+
</div>
|
@@ -0,0 +1,33 @@
|
|
1
|
+
<%# add_decidim_meta_tags({
|
2
|
+
image_url: current_participatory_space.attached_uploader(:hero_image).path,
|
3
|
+
description: translated_attribute(current_participatory_space.short_description),
|
4
|
+
url: feed_url(current_participatory_space),
|
5
|
+
twitter_handler: current_organization.twitter_handler
|
6
|
+
}) %>
|
7
|
+
|
8
|
+
<%
|
9
|
+
edit_link(
|
10
|
+
resource_locator(current_participatory_space).edit,
|
11
|
+
:update,
|
12
|
+
:feed,
|
13
|
+
feed: current_participatory_space
|
14
|
+
)
|
15
|
+
%>
|
16
|
+
|
17
|
+
<%= link_to t(".show_posts"), decidim_feed_posts_path(current_participatory_space, @posts_component) %>
|
18
|
+
<%= link_to t(".edit"), edit_feed_path(@current_feed) %>
|
19
|
+
|
20
|
+
<div class="participatory-space__container">
|
21
|
+
|
22
|
+
<%= participatory_space_floating_help %>
|
23
|
+
|
24
|
+
<% active_content_blocks.each do |content_block| %>
|
25
|
+
<% next unless content_block.manifest %>
|
26
|
+
<%= cell content_block.manifest.cell, content_block %>
|
27
|
+
<% end %>
|
28
|
+
|
29
|
+
</div>
|
30
|
+
|
31
|
+
<section class="participatory-space__block-reference">
|
32
|
+
<%= resource_reference(current_participatory_space) %>
|
33
|
+
</section>
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<div class="inline-block relative">
|
2
|
+
<%= button_tag data: { component: "dropdown", target: "feeds-dropdown-menu-settings" }, class: "dropdown__trigger button button__transparent" do %>
|
3
|
+
<span>
|
4
|
+
<%= t("menu.manage", scope: "decidim.admin") %>
|
5
|
+
</span>
|
6
|
+
<%= icon "arrow-down-s-line" %>
|
7
|
+
<% end %>
|
8
|
+
<div id="feeds-dropdown-menu-settings" class="process-title-content-dropdown" aria-hidden="true">
|
9
|
+
<%= dropdown_menu(:admin_feeds_menu).render %>
|
10
|
+
</div>
|
11
|
+
</div>
|
@@ -0,0 +1,17 @@
|
|
1
|
+
<% add_secondary_root_menu(:admin_feed_menu) %>
|
2
|
+
|
3
|
+
<% add_decidim_page_title(translated_attribute(current_participatory_space.title)) %>
|
4
|
+
<% content_for :breadcrumb_context_menu do %>
|
5
|
+
<div class="process-title-content-breadcrumb-container-right">
|
6
|
+
<%= link_to decidim_feeds.feed_path(current_participatory_space), class: "button button__sm button__transparent process-title-content-breadcrumb-container-right-link", target: "_blank", data: { "external-link": false } do %>
|
7
|
+
<%= icon "eye-line" %>
|
8
|
+
<span>
|
9
|
+
<%= t("see_feed", scope: "decidim.admin.menu.feeds_submenu") %>
|
10
|
+
</span>
|
11
|
+
<% end %>
|
12
|
+
</div>
|
13
|
+
<% end %>
|
14
|
+
|
15
|
+
<%= render "layouts/decidim/admin/application" do %>
|
16
|
+
<%= yield %>
|
17
|
+
<% end %>
|
@@ -0,0 +1,17 @@
|
|
1
|
+
<% content_for :breadcrumb_context_menu do %>
|
2
|
+
<div class="process-title-content-breadcrumb-container-right">
|
3
|
+
<% if allowed_to? :create, :feed %>
|
4
|
+
<%= link_to new_feed_path, class: "button button__sm button__transparent process-title-content-breadcrumb-container-right-link" do %>
|
5
|
+
<%= icon "add-line", class: "w-4 h-4" %>
|
6
|
+
<span>
|
7
|
+
<%= t("actions.new_feed", scope: "decidim.admin") %>
|
8
|
+
</span>
|
9
|
+
<% end %>
|
10
|
+
<% end %>
|
11
|
+
<%= render partial: "layouts/decidim/admin/manage_feeds" %>
|
12
|
+
</div>
|
13
|
+
<% end %>
|
14
|
+
|
15
|
+
<%= render "layouts/decidim/admin/application" do %>
|
16
|
+
<%= yield %>
|
17
|
+
<% end %>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<% add_decidim_page_title(translated_attribute(current_component.name)) if try(:current_component) %>
|
2
|
+
<% add_decidim_page_title(translated_attribute(current_participatory_space.title)) %>
|
3
|
+
<%# add_decidim_meta_tags(
|
4
|
+
image_url: current_participatory_space.attached_uploader(:banner_image).path,
|
5
|
+
description: translated_attribute(current_participatory_space.short_description)
|
6
|
+
) %>
|
7
|
+
|
8
|
+
<%#= append_javascript_pack_tag "decidim_feeds" %>
|
9
|
+
|
10
|
+
<%= render partial: "layouts/decidim/header/follow_space_menu_bar_button", locals: { participatory_space: current_participatory_space } %>
|
11
|
+
|
12
|
+
<%= render "layouts/decidim/application" do %>
|
13
|
+
<main>
|
14
|
+
<%= yield %>
|
15
|
+
</main>
|
16
|
+
<% end %>
|
17
|
+
|
18
|
+
<%# provide :meta_image_url, current_participatory_space.attached_uploader(:banner_image).path %>
|
data/config/assets.rb
ADDED
@@ -0,0 +1,9 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
base_path = File.expand_path("..", __dir__)
|
4
|
+
|
5
|
+
Decidim::Webpacker.register_path("#{base_path}/app/packs")
|
6
|
+
Decidim::Webpacker.register_entrypoints(
|
7
|
+
decidim_feeds: "#{base_path}/app/packs/entrypoints/decidim_feeds.js"
|
8
|
+
)
|
9
|
+
Decidim::Webpacker.register_stylesheet_import("stylesheets/decidim/feeds/feeds")
|
@@ -0,0 +1,75 @@
|
|
1
|
+
---
|
2
|
+
bs:
|
3
|
+
decidim:
|
4
|
+
feeds:
|
5
|
+
feeds:
|
6
|
+
index:
|
7
|
+
new_feed: Novi Feed
|
8
|
+
show:
|
9
|
+
show_posts: Prikazi postove
|
10
|
+
edit: Uredi
|
11
|
+
posts_component_not_found: Postovi nisu pronađeni
|
12
|
+
new:
|
13
|
+
title: Novi Feed
|
14
|
+
create: Kreiraj Feed
|
15
|
+
edit:
|
16
|
+
update: Ažuriraj Feed
|
17
|
+
form:
|
18
|
+
title: Naslov
|
19
|
+
create:
|
20
|
+
error: Kreiranje feeda nije uspjelo
|
21
|
+
success: Feed uspješno kreiran
|
22
|
+
update:
|
23
|
+
success: Feed uspješno ažuriran
|
24
|
+
error: Ažuriranje feeda nije uspjelo
|
25
|
+
admin:
|
26
|
+
feeds:
|
27
|
+
index:
|
28
|
+
new_info_page_info: "Za Feeds UI, potrebna vam je stranica s URL slugom \"info\""
|
29
|
+
new_info_page_button: Kreiraj novu info stranicu
|
30
|
+
form:
|
31
|
+
title: Naslov
|
32
|
+
slug_help_html: 'URL slugovi se koriste za generisanje URL-ova koji upućuju na ovaj feed. Prihvata samo slova, brojeve i crtice, i mora početi slovom. Primjer: %{url}'
|
33
|
+
sponsor_logos: Sponsor Logos
|
34
|
+
add_sponsor_logo: Dodaj Sponsor Logo
|
35
|
+
replace_sponsor_logo: Zamijeni Sponsor Logo
|
36
|
+
content_blocks:
|
37
|
+
feeds:
|
38
|
+
name: Feed
|
39
|
+
survey:
|
40
|
+
participated: "%{count} odgovora"
|
41
|
+
shared:
|
42
|
+
flag_modal:
|
43
|
+
report: Prijavi
|
44
|
+
admin:
|
45
|
+
feeds:
|
46
|
+
new:
|
47
|
+
title: Novi Feed
|
48
|
+
create: Kreiraj Feed
|
49
|
+
create:
|
50
|
+
success: Feed uspješno kreiran
|
51
|
+
invalid: Kreiranje feeda nije uspjelo
|
52
|
+
error: Kreiranje feeda nije uspjelo
|
53
|
+
edit:
|
54
|
+
title: Uredi Feed
|
55
|
+
update: Ažuriraj Feed
|
56
|
+
update:
|
57
|
+
success: Feed uspješno ažuriran
|
58
|
+
invalid: Ažuriranje feeda nije uspjelo
|
59
|
+
menu:
|
60
|
+
feeds: Feedovi
|
61
|
+
feeds_submenu:
|
62
|
+
components: Komponente
|
63
|
+
info: O ovom feedu
|
64
|
+
moderations: Moderacije
|
65
|
+
see_feed: Pogledaj feed
|
66
|
+
titles:
|
67
|
+
feeds: Feedovi
|
68
|
+
actions:
|
69
|
+
new_feed: Novi Feed
|
70
|
+
models:
|
71
|
+
feed:
|
72
|
+
fields:
|
73
|
+
title: Naslov
|
74
|
+
created_at: Kreirano
|
75
|
+
actions: Akcije
|