4 |
--------------------------------------------------------------------------------
/decidim-comments/app/frontend/entry_test.ts:
--------------------------------------------------------------------------------
1 | import { configure } from "enzyme";
2 | import * as Adapter from "enzyme-adapter-react-16";
3 |
4 | configure({ adapter: new Adapter() });
5 |
--------------------------------------------------------------------------------
/decidim-core/app/assets/stylesheets/decidim/modules/_reference.scss:
--------------------------------------------------------------------------------
1 | .reference{
2 | color: $muted;
3 | font-size: .9rem;
4 | text-align: center;
5 | margin-bottom: 1rem;
6 | }
7 |
--------------------------------------------------------------------------------
/decidim-dev/lib/decidim/dev/test/rspec_support/webmock.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | require "webmock/rspec"
4 |
5 | WebMock.disable_net_connect!(allow_localhost: true)
6 |
--------------------------------------------------------------------------------
/decidim-dev/lib/decidim/dev/test/rspec_support/factory_bot.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | RSpec.configure do |config|
4 | config.include FactoryBot::Syntax::Methods
5 | end
6 |
--------------------------------------------------------------------------------
/decidim-comments/app/frontend/fragments/add_comment_form_session.fragment.graphql:
--------------------------------------------------------------------------------
1 | fragment AddCommentFormSession on Session {
2 | verifiedUserGroups {
3 | id
4 | name
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/decidim-accountability/app/views/decidim/accountability/result_widgets/show.html.erb:
--------------------------------------------------------------------------------
1 | <% content_for(:title, translated_attribute(model.title)) %>
2 | <%== translated_attribute model.description %>
3 |
--------------------------------------------------------------------------------
/decidim-core/app/assets/stylesheets/decidim/utils/_toggle-expand.scss:
--------------------------------------------------------------------------------
1 | //Generic toggle expand
2 |
3 | .toggle-show{
4 | display: none;
5 | &.is-expanded{
6 | display: block;
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | root = true
2 |
3 | [*]
4 | indent_style = space
5 | indent_size = 2
6 | end_of_line = lf
7 | charset = utf-8
8 | trim_trailing_whitespace = true
9 | insert_final_newline = true
10 |
--------------------------------------------------------------------------------
/decidim-admin/app/assets/stylesheets/decidim/admin/utils/_toggle-expand.scss:
--------------------------------------------------------------------------------
1 | //Generic toggle expand
2 |
3 | .toggle-show{
4 | display: none;
5 | &.is-expanded{
6 | display: block;
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/decidim-admin/app/views/decidim/admin/devise/mailers/password_change.html.erb:
--------------------------------------------------------------------------------
1 |
Hello <%= @resource.email %>!
2 |
3 |
We're contacting you to notify you that your password has been changed.
4 |
--------------------------------------------------------------------------------
/decidim-core/app/assets/stylesheets/decidim/modules/_flag.scss:
--------------------------------------------------------------------------------
1 | .flag{
2 | ul{
3 | list-style: none;
4 | margin-left: 0;
5 | }
6 | li a{
7 | color: $anchor-color;
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/decidim-core/lib/decidim/attributes.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Decidim
4 | module Attributes
5 | autoload :TimeWithZone, "decidim/attributes/time_with_zone"
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/decidim-system/app/assets/stylesheets/decidim/system/_actions.scss:
--------------------------------------------------------------------------------
1 | .actions{
2 | text-align: right;
3 |
4 | &.title{
5 | margin-bottom: $global-margin;
6 | font-size: 1.2em;
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/decidim-system/app/views/decidim/system/devise/mailers/password_change.html.erb:
--------------------------------------------------------------------------------
1 |
Hello <%= @resource.email %>!
2 |
3 |
We're contacting you to notify you that your password has been changed.
4 |
--------------------------------------------------------------------------------
/decidim-comments/app/frontend/fragments/comment_thread.fragment.graphql:
--------------------------------------------------------------------------------
1 | #import "../fragments/comment.fragment.graphql"
2 |
3 | fragment CommentThread on Comment {
4 | hasComments
5 | ...Comment
6 | }
7 |
--------------------------------------------------------------------------------
/decidim-core/app/assets/stylesheets/decidim/extras/_proposal_form.scss:
--------------------------------------------------------------------------------
1 | form.new_proposal {
2 | fieldset {
3 | border: 1px solid #e8e8e8;
4 | padding: 0.5em;
5 | margin-bottom: 1em;
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/decidim-proposals/config/initializers/social_share_button.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | SocialShareButton.configure do |config|
4 | config.allow_sites = %w(twitter facebook google_plus)
5 | end
6 |
--------------------------------------------------------------------------------
/lib/decidim/version.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | # This holds the decidim version and the faker version it uses.
4 | module Decidim
5 | def self.version
6 | "0.8.0-pre"
7 | end
8 | end
9 |
--------------------------------------------------------------------------------
/decidim-admin/app/views/decidim/admin/dashboard/show.html.erb:
--------------------------------------------------------------------------------
1 |
2 | <%= t "decidim.admin.titles.dashboard" %>
3 |
4 |
5 |
<%= t ".welcome" %>
6 |
7 |
--------------------------------------------------------------------------------
/decidim-api/lib/decidim/api/graphiql-initial-query.txt:
--------------------------------------------------------------------------------
1 | {
2 | processes {
3 | id
4 | title {
5 | translations {
6 | locale
7 | text
8 | }
9 | }
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/decidim-api/spec/factories.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | require "decidim/core/test/factories"
4 | require "decidim/participatory_processes/test/factories"
5 | require "decidim/comments/test/factories"
6 |
--------------------------------------------------------------------------------
/decidim-assemblies/spec/factories.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | require "decidim/core/test/factories"
4 | require "decidim/proposals/test/factories"
5 |
6 | require "decidim/assemblies/test/factories"
7 |
--------------------------------------------------------------------------------
/decidim-participatory_processes/app/assets/config/decidim_participatory_processes_manifest.js:
--------------------------------------------------------------------------------
1 | //= link_directory ../images/decidim/participatory_processes
2 | //= link decidim/participatory_processes/filters.js
3 |
--------------------------------------------------------------------------------
/decidim-budgets/app/views/decidim/budgets/projects/_order_total_budget.html.erb:
--------------------------------------------------------------------------------
1 |
2 | <%= budget_to_currency current_order&.total_budget.to_f %>
3 |
4 |
--------------------------------------------------------------------------------
/decidim-core/app/assets/stylesheets/decidim/extras/_quill.scss:
--------------------------------------------------------------------------------
1 | .ql-video {
2 | max-width: 600px;
3 | width: 100%;
4 | height: 450px;
5 | max-height: 70vh;
6 | margin: 40px auto;
7 | display: block;
8 | }
9 |
--------------------------------------------------------------------------------
/decidim-core/config/initializers/mail_previews.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | Rails.application.configure do
4 | config.action_mailer.preview_path = Decidim::Core::Engine.root.join("spec/mailers")
5 | end
6 |
--------------------------------------------------------------------------------
/decidim-core/lib/tasks/decidim_tasks.rake:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | namespace :decidim do
4 | desc "Install migrations from Decidim to the app."
5 | task upgrade: ["railties:install:migrations"]
6 | end
7 |
--------------------------------------------------------------------------------
/decidim-dev/lib/decidim/dev/test/rspec_support/html_matchers.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | require "rspec-html-matchers"
4 |
5 | RSpec.configure do |config|
6 | config.include RSpecHtmlMatchers
7 | end
8 |
--------------------------------------------------------------------------------
/decidim-proposals/app/views/decidim/proposals/proposals/_remaining_votes_count.html.erb:
--------------------------------------------------------------------------------
1 |
2 | <%= remaining_votes_count_for(current_user) %>
3 |
4 |
--------------------------------------------------------------------------------
/decidim-admin/app/assets/stylesheets/decidim/admin/vendor/mathsass/_constants.scss:
--------------------------------------------------------------------------------
1 | // Constants
2 | $E: 2.718281828459045;
3 | $PI: 3.141592653589793;
4 | $LN2: 0.6931471805599453;
5 | $SQRT2: 1.4142135623730951;
6 |
--------------------------------------------------------------------------------
/decidim-comments/spec/factories.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | require "decidim/core/test/factories"
4 | require "decidim/participatory_processes/test/factories"
5 |
6 | require "decidim/comments/test/factories"
7 |
--------------------------------------------------------------------------------
/decidim-meetings/app/views/decidim/meetings/admin/invites/_form.html.erb:
--------------------------------------------------------------------------------
1 |
2 | <%= form.text_field :name %>
3 |
4 |
5 |
6 | <%= form.text_field :email %>
7 |
8 |
--------------------------------------------------------------------------------
/decidim-meetings/app/views/decidim/meetings/registration_mailer/confirmation.html.erb:
--------------------------------------------------------------------------------
1 |
<%= t(".confirmed_html", title: translated_attribute(@meeting.title), url: @locator.url) %>
2 |
3 |
<%= t(".details") %>
4 |
--------------------------------------------------------------------------------
/decidim-surveys/spec/factories.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | require "decidim/core/test/factories"
4 | require "decidim/participatory_processes/test/factories"
5 |
6 | require "decidim/surveys/test/factories"
7 |
--------------------------------------------------------------------------------
/decidim-verifications/spec/factories.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | require "decidim/core/test/factories"
4 | require "decidim/participatory_processes/test/factories"
5 | require "decidim/proposals/test/factories"
6 |
--------------------------------------------------------------------------------
/decidim-core/app/views/decidim/shared/_announcement.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 | <%= decidim_sanitize translated_attribute announcement %>
4 |
5 |
6 |
--------------------------------------------------------------------------------
/decidim-dev/lib/decidim/dev/test/rspec_support/active_job.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | RSpec.configure do |config|
4 | config.include ActiveJob::TestHelper
5 | end
6 |
7 | ActiveJob::Base.queue_adapter = :test
8 |
--------------------------------------------------------------------------------
/decidim-dev/lib/decidim/dev/test/rspec_support/wisper.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | require "wisper/rspec/matchers"
4 |
5 | RSpec.configure do |config|
6 | config.include Wisper::RSpec::BroadcastMatcher
7 | end
8 |
--------------------------------------------------------------------------------
/decidim-admin/app/assets/stylesheets/decidim/admin/vendor/mathsass/helpers/_deg-to-rad.scss:
--------------------------------------------------------------------------------
1 | // Convert deg to rad
2 | @function deg-to-rad ($deg, $unit: true) {
3 | @return strip-unit($deg) * $PI / 180 * if($unit, 1rad, 1);
4 | }
5 |
--------------------------------------------------------------------------------
/decidim-admin/app/assets/stylesheets/decidim/admin/vendor/mathsass/helpers/_rad-to-deg.scss:
--------------------------------------------------------------------------------
1 | // Convert rad to deg
2 | @function rad-to-deg ($rad, $unit: true) {
3 | @return strip-unit($rad) * 180 / $PI * if($unit, 1deg, 1);
4 | }
5 |
--------------------------------------------------------------------------------
/decidim-dev/lib/decidim/dev/test/rspec_support/route_helpers.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | RSpec.configure do |config|
4 | config.include Decidim::FeaturePathHelper
5 | config.include Decidim::ResourceHelper
6 | end
7 |
--------------------------------------------------------------------------------
/decidim-core/lib/decidim/abilities.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Decidim
4 | module Abilities
5 | autoload :ParticipatoryProcessRoleAbility, "decidim/abilities/participatory_process_role_ability"
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/decidim-participatory_processes/spec/factories.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | require "decidim/core/test/factories"
4 | require "decidim/proposals/test/factories"
5 |
6 | require "decidim/participatory_processes/test/factories"
7 |
--------------------------------------------------------------------------------
/decidim-admin/app/assets/stylesheets/decidim/admin/extra/_action-icon.scss:
--------------------------------------------------------------------------------
1 | .table-list__actions {
2 | .action-icon {
3 | &.action-icon--disabled {
4 | color: rgba($muted, .3);
5 | vertical-align: bottom
6 | }
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/decidim-admin/app/views/decidim/admin/scope_types/_form.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 | <%= form.translated :text_field, :name %>
4 |
5 |
6 | <%= form.translated :text_field, :plural %>
7 |
8 |
--------------------------------------------------------------------------------
/decidim-api/lib/decidim/api/version.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Decidim
4 | # This holds the decidim-api version.
5 | module Api
6 | def self.version
7 | "0.8.0-pre"
8 | end
9 | end
10 | end
11 |
--------------------------------------------------------------------------------
/decidim-core/app/assets/stylesheets/decidim/application.scss.erb:
--------------------------------------------------------------------------------
1 | @import "decidim";
2 | @import "editor";
3 |
4 | <% Decidim.feature_manifests.map(&:stylesheet).compact.each do |stylesheet| %>
5 | @import "<%= stylesheet %>";
6 | <% end %>
7 |
--------------------------------------------------------------------------------
/decidim-core/db/migrate/20161010131544_add_locale_to_users.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddLocaleToUsers < ActiveRecord::Migration[5.0]
4 | def change
5 | add_column :decidim_users, :locale, :string
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/decidim-core/db/migrate/20161213094244_add_avatar_to_users.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddAvatarToUsers < ActiveRecord::Migration[5.0]
4 | def change
5 | add_column :decidim_users, :avatar, :string
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/decidim-dev/config/locales/nl.yml:
--------------------------------------------------------------------------------
1 | nl:
2 | decidim:
3 | dummy:
4 | admin:
5 | exports:
6 | dummies: Dummies
7 | resource_links:
8 | test_link:
9 | dummy_resource_dummy: Gerelateerde dummy
10 |
--------------------------------------------------------------------------------
/decidim-dev/config/locales/pl.yml:
--------------------------------------------------------------------------------
1 | pl:
2 | decidim:
3 | dummy:
4 | admin:
5 | exports:
6 | dummies: Manekiny
7 | resource_links:
8 | test_link:
9 | dummy_resource_dummy: Podobne manekina
10 |
--------------------------------------------------------------------------------
/decidim-dev/config/locales/pt.yml:
--------------------------------------------------------------------------------
1 | pt:
2 | decidim:
3 | dummy:
4 | admin:
5 | exports:
6 | dummies: Bobos
7 | resource_links:
8 | test_link:
9 | dummy_resource_dummy: Manequim relacionado
10 |
--------------------------------------------------------------------------------
/decidim-dev/lib/decidim/dev/version.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Decidim
4 | # This holds the decidim-dev version.
5 | module Dev
6 | def self.version
7 | "0.8.0-pre"
8 | end
9 | end
10 | end
11 |
--------------------------------------------------------------------------------
/lib/generators/decidim/templates/cable.yml.erb:
--------------------------------------------------------------------------------
1 | development:
2 | adapter: async
3 |
4 | test:
5 | adapter: async
6 |
7 | production:
8 | adapter: redis
9 | url: <%%= ENV.fetch("REDIS_URL") { "redis://localhost:6379/1" } %>
10 |
--------------------------------------------------------------------------------
/decidim-admin/lib/decidim/admin/version.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Decidim
4 | # This holds the decidim-admin version.
5 | module Admin
6 | def self.version
7 | "0.8.0-pre"
8 | end
9 | end
10 | end
11 |
--------------------------------------------------------------------------------
/decidim-comments/app/frontend/mutations/up_vote.mutation.graphql:
--------------------------------------------------------------------------------
1 | #import "../fragments/comment.fragment.graphql"
2 |
3 | mutation UpVote($id: ID!) {
4 | comment(id: $id) {
5 | upVote {
6 | ...Comment
7 | }
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/decidim-core/db/migrate/20161010085443_add_name_to_users.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddNameToUsers < ActiveRecord::Migration[5.0]
4 | def change
5 | add_column :decidim_users, :name, :string, null: false
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/decidim-core/lib/decidim/core/version.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Decidim
4 | # This holds the decidim-core version.
5 | module Core
6 | def self.version
7 | "0.8.0-pre"
8 | end
9 | end
10 | end
11 |
--------------------------------------------------------------------------------
/decidim-dev/config/locales/ca.yml:
--------------------------------------------------------------------------------
1 | ca:
2 | decidim:
3 | dummy:
4 | admin:
5 | exports:
6 | dummies: Maniquins
7 | resource_links:
8 | test_link:
9 | dummy_resource_dummy: Fictici relacionat
10 |
--------------------------------------------------------------------------------
/decidim-dev/config/locales/en.yml:
--------------------------------------------------------------------------------
1 | ---
2 | en:
3 | decidim:
4 | dummy:
5 | admin:
6 | exports:
7 | dummies: Dummies
8 | resource_links:
9 | test_link:
10 | dummy_resource_dummy: Related dummy
11 |
--------------------------------------------------------------------------------
/decidim-dev/config/locales/es.yml:
--------------------------------------------------------------------------------
1 | es:
2 | decidim:
3 | dummy:
4 | admin:
5 | exports:
6 | dummies: Maniquíes
7 | resource_links:
8 | test_link:
9 | dummy_resource_dummy: Ficticio relacionado
10 |
--------------------------------------------------------------------------------
/decidim-pages/lib/decidim/pages/version.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Decidim
4 | # This holds the decidim-pages version.
5 | module Pages
6 | def self.version
7 | "0.8.0-pre"
8 | end
9 | end
10 | end
11 |
--------------------------------------------------------------------------------
/decidim-system/app/controllers/decidim/system/dashboard_controller.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Decidim
4 | module System
5 | class DashboardController < Decidim::System::ApplicationController
6 | end
7 | end
8 | end
9 |
--------------------------------------------------------------------------------
/decidim-verifications/lib/decidim/verifications/dummy.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | Decidim::Verifications.register_workflow(:dummy_authorization_handler) do |workflow|
4 | workflow.form = "Decidim::DummyAuthorizationHandler"
5 | end
6 |
--------------------------------------------------------------------------------
/decidim-admin/app/assets/stylesheets/decidim/admin/application.scss.erb:
--------------------------------------------------------------------------------
1 | @import "decidim";
2 | @import "extra/*";
3 |
4 | <% Decidim.feature_manifests.map(&:admin_stylesheet).compact.each do |stylesheet| %>
5 | @import "<%= stylesheet %>";
6 | <% end %>
7 |
--------------------------------------------------------------------------------
/decidim-comments/app/frontend/mutations/down_vote.mutation.graphql:
--------------------------------------------------------------------------------
1 | #import "../fragments/comment.fragment.graphql"
2 |
3 | mutation DownVote($id: ID!) {
4 | comment(id: $id) {
5 | downVote {
6 | ...Comment
7 | }
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/decidim-core/app/assets/javascripts/decidim/append_elements.js.es6:
--------------------------------------------------------------------------------
1 | // = require appendAround
2 |
3 | (function() {
4 | $(() => {
5 | let $appendableElements = $('.js-append');
6 | $appendableElements.appendAround();
7 | })
8 | }(window));
9 |
--------------------------------------------------------------------------------
/decidim-core/app/views/decidim/follows/update_button.js.erb:
--------------------------------------------------------------------------------
1 | var $followResource = $("#follow-resource");
2 |
3 | morphdom($followResource[0], "<%= j(render partial: "decidim/shared/follow_button", locals: { followable: resource } ).strip.html_safe %>");
4 |
--------------------------------------------------------------------------------
/decidim-core/app/views/layouts/decidim/_feature_authorization_modals.html.erb:
--------------------------------------------------------------------------------
1 | <% if try(:current_feature) %>
2 | <% current_feature.manifest.actions.each do |action| %>
3 | <%= action_authorization_modal(action) %>
4 | <% end %>
5 | <% end %>
6 |
--------------------------------------------------------------------------------
/decidim-core/db/migrate/20170128140553_add_timestamps_to_identities.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddTimestampsToIdentities < ActiveRecord::Migration[5.0]
4 | def change
5 | add_timestamps :decidim_identities
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/decidim-dev/config/locales/eu.yml:
--------------------------------------------------------------------------------
1 | eu:
2 | decidim:
3 | dummy:
4 | admin:
5 | exports:
6 | dummies: Manikiak
7 | resource_links:
8 | test_link:
9 | dummy_resource_dummy: ' Honi buruzko adibidea '
10 |
--------------------------------------------------------------------------------
/decidim-dev/config/locales/fr.yml:
--------------------------------------------------------------------------------
1 | fr:
2 | decidim:
3 | dummy:
4 | admin:
5 | exports:
6 | dummies: Nuls
7 | resource_links:
8 | test_link:
9 | dummy_resource_dummy: Référence factice concernée
10 |
--------------------------------------------------------------------------------
/decidim-system/lib/decidim/system/version.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Decidim
4 | # This holds the decidim-system version.
5 | module System
6 | def self.version
7 | "0.8.0-pre"
8 | end
9 | end
10 | end
11 |
--------------------------------------------------------------------------------
/decidim-budgets/lib/decidim/budgets/version.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Decidim
4 | # This holds the decidim-budgets version.
5 | module Budgets
6 | def self.version
7 | "0.8.0-pre"
8 | end
9 | end
10 | end
11 |
--------------------------------------------------------------------------------
/decidim-core/db/migrate/20160920141151_user_has_roles.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class UserHasRoles < ActiveRecord::Migration[5.0]
4 | def change
5 | add_column :decidim_users, :roles, :string, array: true, default: []
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/decidim-core/db/migrate/20161214152811_add_logo_to_organizations.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddLogoToOrganizations < ActiveRecord::Migration[5.0]
4 | def change
5 | add_column :decidim_organizations, :logo, :string
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/decidim-core/db/migrate/20170123140857_add_avatar_to_user_groups.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddAvatarToUserGroups < ActiveRecord::Migration[5.0]
4 | def change
5 | add_column :decidim_user_groups, :avatar, :string
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/decidim-dev/config/locales/fi.yml:
--------------------------------------------------------------------------------
1 | fi:
2 | decidim:
3 | dummy:
4 | admin:
5 | exports:
6 | dummies: Esimerkkitiedot
7 | resource_links:
8 | test_link:
9 | dummy_resource_dummy: Liittyvät esimerkkitiedot
10 |
--------------------------------------------------------------------------------
/decidim-pages/db/migrate/20170220091402_remove_page_feature_titles.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class RemovePageFeatureTitles < ActiveRecord::Migration[5.0]
4 | def change
5 | remove_column :decidim_pages_pages, :title
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/decidim-surveys/lib/decidim/surveys/version.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Decidim
4 | # This holds the decidim-surveys version.
5 | module Surveys
6 | def self.version
7 | "0.8.0-pre"
8 | end
9 | end
10 | end
11 |
--------------------------------------------------------------------------------
/decidim-admin/app/assets/stylesheets/decidim/admin/_variables.scss:
--------------------------------------------------------------------------------
1 | // Variables
2 |
3 | $brand: #9675ce !default;
4 |
5 | $twitter: #55acee !default;
6 | $facebook: #3b5998 !default;
7 | $google: #dd4b39 !default;
8 |
9 | $secondary: #599aa6 !default;
10 |
--------------------------------------------------------------------------------
/decidim-comments/lib/decidim/comments/version.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Decidim
4 | # This holds the decidim-comments version.
5 | module Comments
6 | def self.version
7 | "0.8.0-pre"
8 | end
9 | end
10 | end
11 |
--------------------------------------------------------------------------------
/decidim-core/app/models/decidim/application_record.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Decidim
4 | # Main ActiveRecord application configuration.
5 | class ApplicationRecord < ActiveRecord::Base
6 | self.abstract_class = true
7 | end
8 | end
9 |
--------------------------------------------------------------------------------
/decidim-core/db/migrate/20170125152026_add_weight_to_features.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddWeightToFeatures < ActiveRecord::Migration[5.0]
4 | def change
5 | add_column :decidim_features, :weight, :integer, default: 0
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/decidim-core/db/migrate/20170727125445_add_roles_to_users.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddRolesToUsers < ActiveRecord::Migration[5.1]
4 | def change
5 | add_column :decidim_users, :roles, :string, array: true, default: []
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/decidim-core/db/migrate/20170906091718_add_extra_to_notifications.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddExtraToNotifications < ActiveRecord::Migration[5.1]
4 | def change
5 | add_column :decidim_notifications, :extra, :jsonb
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/decidim-dev/config/locales/it.yml:
--------------------------------------------------------------------------------
1 | it:
2 | decidim:
3 | dummy:
4 | admin:
5 | exports:
6 | dummies: Risorse Fittizie
7 | resource_links:
8 | test_link:
9 | dummy_resource_dummy: Risorse fittizie correlate
10 |
--------------------------------------------------------------------------------
/decidim-meetings/lib/decidim/meetings/version.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Decidim
4 | # This holds the decidim-meetings version.
5 | module Meetings
6 | def self.version
7 | "0.8.0-pre"
8 | end
9 | end
10 | end
11 |
--------------------------------------------------------------------------------
/decidim-proposals/lib/decidim/proposals/version.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Decidim
4 | # This holds decidim-proposals version.
5 | module Proposals
6 | def self.version
7 | "0.8.0-pre"
8 | end
9 | end
10 | end
11 |
--------------------------------------------------------------------------------
/decidim-admin/app/assets/stylesheets/decidim/admin/extra/_cards.scss:
--------------------------------------------------------------------------------
1 | .card__filter{
2 | margin-bottom: 0;
3 | @include breakpoint(mediumlarge){
4 | float: right;
5 | }
6 | }
7 |
8 | form {
9 | .card {
10 | overflow: initial;
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/decidim-assemblies/lib/decidim/assemblies/version.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Decidim
4 | # This holds the decidim-assemblies version.
5 | module Assemblies
6 | def self.version
7 | "0.8.0-pre"
8 | end
9 | end
10 | end
11 |
--------------------------------------------------------------------------------
/decidim-core/app/views/decidim/account/_password_fields.html.erb:
--------------------------------------------------------------------------------
1 | <%= form.password_field :password, value: form.object.password, autocomplete: "off" %>
2 | <%= form.password_field :password_confirmation, value: form.object.password_confirmation, autocomplete: "off" %>
3 |
--------------------------------------------------------------------------------
/decidim-core/spec/factories.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | require "decidim/core/test/factories"
4 |
5 | require "decidim/participatory_processes/test/factories"
6 | require "decidim/proposals/test/factories"
7 | require "decidim/meetings/test/factories"
8 |
--------------------------------------------------------------------------------
/decidim-surveys/app/assets/stylesheets/decidim/surveys/surveys.scss:
--------------------------------------------------------------------------------
1 | form.answer-survey {
2 | .radio-button-collection, .check-box-collection {
3 | margin: 0 0 1rem;
4 | }
5 |
6 | .tos-agreement-help-text {
7 | margin: 0.2rem 0 0;
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/decidim-system/app/assets/javascripts/decidim/system/application.js.es6:
--------------------------------------------------------------------------------
1 | // = require jquery
2 | // = require foundation
3 | // = require rails-ujs
4 | // = require decidim/editor
5 | // = require_self
6 |
7 | $(() => {
8 | $(document).foundation();
9 | });
10 |
--------------------------------------------------------------------------------
/decidim-admin/app/assets/stylesheets/decidim/admin/extra/_sort.scss:
--------------------------------------------------------------------------------
1 | .survey-questions {
2 | .question-divider {
3 | cursor: move;
4 | h2 {
5 | line-height: 32px;
6 | }
7 | }
8 | }
9 |
10 | .icon--move {
11 | vertical-align: middle;
12 | }
13 |
--------------------------------------------------------------------------------
/decidim-core/db/migrate/20170110153807_add_handler_to_organization.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddHandlerToOrganization < ActiveRecord::Migration[5.0]
4 | def change
5 | add_column :decidim_organizations, :twitter_handler, :string
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/decidim-core/db/migrate/20170529150743_add_rejected_at_to_user_groups.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddRejectedAtToUserGroups < ActiveRecord::Migration[5.0]
4 | def change
5 | add_column :decidim_user_groups, :rejected_at, :datetime
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/decidim-core/db/migrate/20170720135441_add_managed_to_users.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddManagedToUsers < ActiveRecord::Migration[5.1]
4 | def change
5 | add_column :decidim_users, :managed, :boolean, null: false, default: false
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/decidim-dev/config/locales/ru.yml:
--------------------------------------------------------------------------------
1 | ru:
2 | decidim:
3 | dummy:
4 | admin:
5 | exports:
6 | dummies: Нерабочие псевдо-части
7 | resource_links:
8 | test_link:
9 | dummy_resource_dummy: Связанный нерабочий псевдо-ресурс
10 |
--------------------------------------------------------------------------------
/decidim-pages/app/helpers/decidim/pages/application_helper.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Decidim
4 | module Pages
5 | # Custom helpers, scoped to the pages engine.
6 | #
7 | module ApplicationHelper
8 | end
9 | end
10 | end
11 |
--------------------------------------------------------------------------------
/decidim-proposals/app/views/decidim/proposals/proposal_widgets/show.html.erb:
--------------------------------------------------------------------------------
1 | <% content_for(:title, model.title) %>
2 |
3 | <%= render partial: "decidim/proposals/proposals/proposal_badge", locals: { proposal: model } %>
4 |
<%= truncate(model.body, length: 100) %>
5 |
--------------------------------------------------------------------------------
/decidim-proposals/app/views/decidim/proposals/proposals/_proposal_badge.html.erb:
--------------------------------------------------------------------------------
1 | <% if proposal.answered? %>
2 |
<%= humanize_proposal_state proposal.state %>
3 | <% end %>
4 |
--------------------------------------------------------------------------------
/decidim-core/app/assets/stylesheets/decidim/extras/_register_form.scss:
--------------------------------------------------------------------------------
1 | .lopd-text {
2 | padding: 0.5rem;
3 | border: 1px solid #e8e8e8;
4 | margin: 1rem 0;
5 | max-height: 10rem;
6 | overflow: auto;
7 | font-size: 0.8rem;
8 | font-style: italic;
9 | }
10 |
--------------------------------------------------------------------------------
/decidim-core/db/migrate/20170120120733_add_user_groups_verified.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddUserGroupsVerified < ActiveRecord::Migration[5.0]
4 | def change
5 | add_column :decidim_user_groups, :verified, :boolean, default: false
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/decidim-dev/config/locales/uk.yml:
--------------------------------------------------------------------------------
1 | uk:
2 | decidim:
3 | dummy:
4 | admin:
5 | exports:
6 | dummies: Неробочі псевдо-частини
7 | resource_links:
8 | test_link:
9 | dummy_resource_dummy: Пов'язана неробоча псевдо-частина
10 |
--------------------------------------------------------------------------------
/decidim-pages/db/migrate/20170110145040_remove_commentable_flag_from_pages.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class RemoveCommentableFlagFromPages < ActiveRecord::Migration[5.0]
4 | def change
5 | remove_column :decidim_pages_pages, :commentable
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/decidim-proposals/db/migrate/20170220152416_add_hidden_at_to_proposals.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddHiddenAtToProposals < ActiveRecord::Migration[5.0]
4 | def change
5 | add_column :decidim_proposals_proposals, :hidden_at, :datetime
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/.mdl_style.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | all
4 |
5 | exclude_rule "first-line-h1"
6 |
7 | exclude_rule "line-length"
8 |
9 | exclude_rule "no-bare-urls"
10 |
11 | exclude_rule "no-inline-html"
12 |
13 | rule "no-trailing-punctuation", punctuation: ".,;:!"
14 |
--------------------------------------------------------------------------------
/decidim-accountability/lib/decidim/accountability/version.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Decidim
4 | # This holds decidim-accountability version.
5 | module Accountability
6 | def self.version
7 | "0.8.0-pre"
8 | end
9 | end
10 | end
11 |
--------------------------------------------------------------------------------
/decidim-assemblies/app/views/decidim/assemblies/_order_by_assemblies.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
<%= t("assemblies.order_by_assemblies.assemblies", scope: "layouts.decidim", count: collection.count) %>
3 |
4 |
--------------------------------------------------------------------------------
/decidim-core/app/forms/decidim/delete_account_form.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Decidim
4 | # The form object that handles the data behind deleting users account.
5 | class DeleteAccountForm < Form
6 | attribute :delete_reason, String
7 | end
8 | end
9 |
--------------------------------------------------------------------------------
/decidim-core/app/views/decidim/newsletter_mailer/newsletter.html.erb:
--------------------------------------------------------------------------------
1 | <%= decidim_sanitize @body %>
2 |
3 | <% content_for :note do %>
4 | <%== t ".note", organization_name: h(@organization.name), link: decidim.notifications_settings_url(host: @organization.host) %>
5 | <% end %>
6 |
--------------------------------------------------------------------------------
/decidim-core/app/views/pages/home/_highlighted_processes.html.erb:
--------------------------------------------------------------------------------
1 | <% highlighted_elements = render_hook(:highlighted_elements) %>
2 |
3 | <% if !highlighted_elements.blank? %>
4 |
5 | <%= highlighted_elements %>
6 |
7 | <% end %>
8 |
--------------------------------------------------------------------------------
/decidim-core/db/migrate/20170130132833_add_favicon_to_decidim_organizations.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddFaviconToDecidimOrganizations < ActiveRecord::Migration[5.0]
4 | def change
5 | add_column :decidim_organizations, :favicon, :string
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/decidim-verifications/lib/decidim/verifications/version.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Decidim
4 | # This holds the decidim-verifications version.
5 | module Verifications
6 | def self.version
7 | "0.8.0-pre"
8 | end
9 | end
10 | end
11 |
--------------------------------------------------------------------------------
/decidim-admin/app/jobs/decidim/admin/application_job.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Decidim
4 | module Admin
5 | # Custom ApplicationJob scoped to the admin panel.
6 | #
7 | class ApplicationJob < ActiveJob::Base
8 | end
9 | end
10 | end
11 |
--------------------------------------------------------------------------------
/decidim-comments/db/migrate/20161214082645_add_depth_to_comments.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddDepthToComments < ActiveRecord::Migration[5.0]
4 | def change
5 | add_column :decidim_comments_comments, :depth, :integer, null: false, default: 0
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/decidim-core/app/assets/stylesheets/decidim/extras/_add_comments.scss:
--------------------------------------------------------------------------------
1 | .add-comment {
2 | .remaining-character-count {
3 | border: 0;
4 | color: $body-font-color;
5 | padding: 0.85em 1em;
6 | vertical-align: middle;
7 | display: inline-block;
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/decidim-core/app/models/decidim/categorization.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Decidim
4 | class Categorization < ApplicationRecord
5 | belongs_to :category, foreign_key: :decidim_category_id
6 | belongs_to :categorizable, polymorphic: true
7 | end
8 | end
9 |
--------------------------------------------------------------------------------
/decidim-core/db/migrate/20170913092351_add_header_snippets_to_organizations.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddHeaderSnippetsToOrganizations < ActiveRecord::Migration[5.1]
4 | def change
5 | add_column :decidim_organizations, :header_snippets, :text
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/decidim-dev/lib/decidim/dev/common_rake.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | require "bundler/gem_tasks"
4 | require "rspec/core/rake_task"
5 | require "decidim/dev"
6 |
7 | RSpec::Core::RakeTask.new(:spec)
8 | task default: [:spec]
9 |
10 | Decidim::Dev.install_tasks
11 |
--------------------------------------------------------------------------------
/decidim-system/app/jobs/decidim/system/application_job.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Decidim
4 | module System
5 | # Custom ApplicationJob scoped to the system panel.
6 | #
7 | class ApplicationJob < ActiveJob::Base
8 | end
9 | end
10 | end
11 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | spec/decidim_dummy_app/
2 | .byebug_history
3 | pkg/
4 | */Gemfile.lock
5 | .DS_Store
6 | node_modules/
7 | .vscode
8 | development_app/
9 | .projectile
10 | docker_development_app/
11 | npm-debug.log
12 | karma-*
13 | yarn-error.log
14 | coverage
15 | webpack.report.html
16 |
--------------------------------------------------------------------------------
/decidim-budgets/db/migrate/20170410074214_remove_not_null_reference_budgets.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class RemoveNotNullReferenceBudgets < ActiveRecord::Migration[5.0]
4 | def change
5 | change_column_null :decidim_budgets_projects, :reference, true
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/decidim-core/app/assets/stylesheets/decidim/extras/_social_icons_mini.scss:
--------------------------------------------------------------------------------
1 | .button--social--mini {
2 | padding: 0;
3 | display: inline-block;
4 | min-width: 0;
5 | .button--social__icon {
6 | border: 0;
7 | padding: 0.85em 0;
8 | margin-right: 0;
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/decidim-core/app/views/decidim/reported_mailer/hide.html.erb:
--------------------------------------------------------------------------------
1 |
<%= t(".hello", name: @user.name) %>
2 |
3 |
4 | <%= t(".report_html", { url: reported_content_url }) %>
5 |
6 |
7 |
8 | <%= link_to t(".manage_moderations"), manage_moderations_url %>
9 |
10 |
--------------------------------------------------------------------------------
/decidim-core/app/views/decidim/reported_mailer/report.html.erb:
--------------------------------------------------------------------------------
1 |
<%= t(".hello", name: @user.name) %>
2 |
3 |
4 | <%= t(".report_html", { url: reported_content_url }) %>
5 |
6 |
7 |
8 | <%= link_to t(".manage_moderations"), manage_moderations_url %>
9 |
10 |
--------------------------------------------------------------------------------
/decidim-core/db/migrate/20170131134349_add_action_permissions_to_decidim_features.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddActionPermissionsToDecidimFeatures < ActiveRecord::Migration[5.0]
4 | def change
5 | add_column :decidim_features, :permissions, :jsonb
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/decidim-meetings/db/migrate/20170410074252_remove_not_null_reference_meetings.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class RemoveNotNullReferenceMeetings < ActiveRecord::Migration[5.0]
4 | def change
5 | change_column_null :decidim_meetings_meetings, :reference, true
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/decidim-pages/db/migrate/20161214150429_add_commentable_to_pages.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddCommentableToPages < ActiveRecord::Migration[5.0]
4 | def change
5 | add_column :decidim_pages_pages, :commentable, :boolean, null: false, default: false
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/decidim-pages/lib/decidim/pages/admin.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Decidim
4 | module Pages
5 | # This module contains all the domain logic associated to Decidim's Pages
6 | # component admin panel.
7 | module Admin
8 | end
9 | end
10 | end
11 |
--------------------------------------------------------------------------------
/decidim-budgets/lib/decidim/budgets/admin.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Decidim
4 | module Budgets
5 | # This module contains all the domain logic associated to Decidim's Budgets
6 | # component admin panel.
7 | module Admin
8 | end
9 | end
10 | end
11 |
--------------------------------------------------------------------------------
/decidim-comments/db/migrate/20161216102820_add_alignment_to_comments.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddAlignmentToComments < ActiveRecord::Migration[5.0]
4 | def change
5 | add_column :decidim_comments_comments, :alignment, :integer, null: false, default: 0
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/decidim-core/db/migrate/20160920141039_user_belongs_to_organization.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class UserBelongsToOrganization < ActiveRecord::Migration[5.0]
4 | def change
5 | add_reference :decidim_users, :decidim_organization, index: true, foreign_key: true
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/decidim-meetings/db/migrate/20170129153716_remove_short_description_from_meetings.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class RemoveShortDescriptionFromMeetings < ActiveRecord::Migration[5.0]
4 | def change
5 | remove_column :decidim_meetings_meetings, :short_description
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/decidim-participatory_processes/db/migrate/20161011125616_add_hero_image_to_processes.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddHeroImageToProcesses < ActiveRecord::Migration[5.0]
4 | def change
5 | add_column :decidim_participatory_processes, :hero_image, :string
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/decidim-proposals/db/migrate/20170215131720_add_report_count_to_proposals.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddReportCountToProposals < ActiveRecord::Migration[5.0]
4 | def change
5 | add_column :decidim_proposals_proposals, :report_count, :integer, default: 0
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/decidim-proposals/db/migrate/20170410073742_remove_not_null_reference_proposals.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class RemoveNotNullReferenceProposals < ActiveRecord::Migration[5.0]
4 | def change
5 | change_column_null :decidim_proposals_proposals, :reference, true
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/decidim-surveys/db/migrate/20170522075938_add_mandatory_to_surveys_questions.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddMandatoryToSurveysQuestions < ActiveRecord::Migration[5.0]
4 | def change
5 | add_column :decidim_surveys_survey_questions, :mandatory, :boolean
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/decidim-surveys/lib/decidim/surveys/admin.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Decidim
4 | module Surveys
5 | # This module contains all the domain logic associated to Decidim's Surveys
6 | # component admin panel.
7 | module Admin
8 | end
9 | end
10 | end
11 |
--------------------------------------------------------------------------------
/decidim-system/app/views/layouts/decidim/system/_header.html.erb:
--------------------------------------------------------------------------------
1 |
2 | <%= csrf_meta_tags %>
3 | <%= stylesheet_link_tag 'decidim/system/application', media: 'all' %>
4 | <%= javascript_include_tag 'decidim/system/application' %>
5 |
--------------------------------------------------------------------------------
/lib/generators/decidim/templates/decidim_controller.rb.erb:
--------------------------------------------------------------------------------
1 | # Entry point for Decidim. It will use the `DecidimController` as
2 | # entry point, but you can change what controller it inherits from
3 | # so you can customize some methods.
4 | class DecidimController < ApplicationController
5 | end
6 |
--------------------------------------------------------------------------------
/.simplecov:
--------------------------------------------------------------------------------
1 | SimpleCov.start do
2 | add_filter "/spec/decidim_dummy_app/"
3 | add_filter "bundle.js"
4 | add_filter "/vendor/"
5 | end
6 |
7 | SimpleCov.merge_timeout 1800
8 |
9 | if ENV["CI"]
10 | require "codecov"
11 | SimpleCov.formatter = SimpleCov::Formatter::Codecov
12 | end
13 |
--------------------------------------------------------------------------------
/decidim-admin/app/assets/stylesheets/decidim/admin/vendor/mathsass/helpers/_strip-unit.scss:
--------------------------------------------------------------------------------
1 | // Strip unit from a number
2 | @function strip-unit ($number) {
3 | @if unitless($number) {
4 | @return $number;
5 | } @else {
6 | @return $number / ($number * 0 + 1);
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/decidim-admin/app/views/layouts/decidim/admin/_header.html.erb:
--------------------------------------------------------------------------------
1 |
2 | <%= csrf_meta_tags %>
3 | <%= stylesheet_link_tag 'decidim/admin/application', media: 'all' %>
4 | <%= javascript_include_tag 'decidim/admin/application' %>
5 |
6 |
--------------------------------------------------------------------------------
/decidim-api/app/views/layouts/decidim/api/documentation.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 |
<%= current_organization.name %> - API Documentation
4 | <%= javascript_include_tag 'decidim/api/docs' %>
5 |
6 |
7 | <%= yield %>
8 |
9 |
10 |
--------------------------------------------------------------------------------
/decidim-comments/db/migrate/20170123102043_add_user_group_id_to_comments.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddUserGroupIdToComments < ActiveRecord::Migration[5.0]
4 | def change
5 | add_column :decidim_comments_comments, :decidim_user_group_id, :integer, index: true
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/decidim-comments/lib/decidim/comments/admin.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Decidim
4 | module Comments
5 | # This module contains all the domain logic associated to Decidim's Comments
6 | # component admin panel.
7 | module Admin
8 | end
9 | end
10 | end
11 |
--------------------------------------------------------------------------------
/decidim-core/app/uploaders/decidim/hero_image_uploader.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Decidim
4 | # This class deals with uploading hero images to ParticipatoryProcesses.
5 | class HeroImageUploader < ImageUploader
6 | process resize_to_limit: [1000, 1000]
7 | end
8 | end
9 |
--------------------------------------------------------------------------------
/decidim-core/app/views/devise/mailer/confirmation_instructions.html.erb:
--------------------------------------------------------------------------------
1 |
<%= t('.greeting', recipient: @resource.email) %>
2 |
3 |
<%= t('.instruction') %>
4 |
<%= link_to t('.action'), confirmation_url(@resource, confirmation_token: @token, host: @resource.organization.host) %>
5 |
--------------------------------------------------------------------------------
/decidim-meetings/lib/decidim/meetings/admin.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Decidim
4 | module Meetings
5 | # This module contains all the domain logic associated to Decidim's Meetings
6 | # component admin panel.
7 | module Admin
8 | end
9 | end
10 | end
11 |
--------------------------------------------------------------------------------
/decidim-participatory_processes/db/migrate/20161011141033_add_banner_image_to_processes.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddBannerImageToProcesses < ActiveRecord::Migration[5.0]
4 | def change
5 | add_column :decidim_participatory_processes, :banner_image, :string
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/decidim-core/app/uploaders/decidim/banner_image_uploader.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Decidim
4 | # This class deals with uploading banner images to ParticipatoryProcesses.
5 | class BannerImageUploader < ImageUploader
6 | process resize_to_limit: [1000, 200]
7 | end
8 | end
9 |
--------------------------------------------------------------------------------
/decidim-core/db/migrate/20161209134715_make_organization_description_optional.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class MakeOrganizationDescriptionOptional < ActiveRecord::Migration[5.0]
4 | def change
5 | change_column :decidim_organizations, :welcome_text, :jsonb, null: true
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/decidim-core/db/migrate/20170119150649_add_show_statistics_to_organization.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddShowStatisticsToOrganization < ActiveRecord::Migration[5.0]
4 | def change
5 | add_column :decidim_organizations, :show_statistics, :boolean, default: true
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/decidim-core/db/migrate/20170405094028_add_organization_to_identities.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddOrganizationToIdentities < ActiveRecord::Migration[5.0]
4 | def change
5 | add_reference :decidim_identities, :decidim_organization, index: true, foreign_key: true
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/decidim-proposals/db/migrate/20170120151202_add_user_group_id_to_proposals.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddUserGroupIdToProposals < ActiveRecord::Migration[5.0]
4 | def change
5 | add_column :decidim_proposals_proposals, :decidim_user_group_id, :integer, index: true
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/decidim-proposals/lib/decidim/proposals/admin.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Decidim
4 | module Proposals
5 | # This module contains all the domain logic associated to Decidim's Proposal
6 | # component admin panel.
7 | module Admin
8 | end
9 | end
10 | end
11 |
--------------------------------------------------------------------------------
/decidim-surveys/db/migrate/20170518085302_add_position_to_surveys_questions.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddPositionToSurveysQuestions < ActiveRecord::Migration[5.0]
4 | def change
5 | add_column :decidim_surveys_survey_questions, :position, :integer, index: true
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/decidim-surveys/db/migrate/20170524122229_add_question_type_to_surveys_questions.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddQuestionTypeToSurveysQuestions < ActiveRecord::Migration[5.0]
4 | def change
5 | add_column :decidim_surveys_survey_questions, :question_type, :string
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/decidim-system/app/views/layouts/decidim/system/_login_items.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 | <%= current_admin.email %>
4 |
5 |
6 | <%= link_to('Logout', destroy_admin_session_path, :method => :delete) %>
7 |
8 |
9 |
--------------------------------------------------------------------------------
/decidim-assemblies/db/migrate/20170822153055_add_scopes_enabled_to_assemblies.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddScopesEnabledToAssemblies < ActiveRecord::Migration[5.1]
4 | def change
5 | add_column :decidim_assemblies, :scopes_enabled, :boolean, null: false, default: true
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/decidim-assemblies/lib/decidim/assemblies/admin.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Decidim
4 | module Assemblies
5 | # This module contains all the domain logic associated to Decidim's
6 | # Assemblies component admin panel.
7 | module Admin
8 | end
9 | end
10 | end
11 |
--------------------------------------------------------------------------------
/decidim-budgets/app/views/decidim/budgets/projects/_projects.html.erb:
--------------------------------------------------------------------------------
1 |
2 | <% projects.each do |project| %>
3 | <%= render partial: 'project', locals: { project: project } %>
4 | <% end %>
5 |
6 | <%= decidim_paginate projects, random_seed: random_seed %>
7 |
--------------------------------------------------------------------------------
/decidim-budgets/db/migrate/20170207101750_remove_short_description_from_decidim_projects.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class RemoveShortDescriptionFromDecidimProjects < ActiveRecord::Migration[5.0]
4 | def change
5 | remove_column :decidim_budgets_projects, :short_description
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/decidim-budgets/spec/factories.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | require "decidim/core/test/factories"
4 | require "decidim/participatory_processes/test/factories"
5 | require "decidim/proposals/test/factories"
6 | require "decidim/comments/test/factories"
7 |
8 | require "decidim/budgets/test/factories"
9 |
--------------------------------------------------------------------------------
/decidim-core/db/migrate/20170914075721_remove_followable_index_from_follows.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class RemoveFollowableIndexFromFollows < ActiveRecord::Migration[5.1]
4 | def change
5 | remove_index :decidim_follows, [:decidim_followable_id, :decidim_followable_type]
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/decidim-participatory_processes/db/migrate/20170804125402_attachment_description_nullable.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AttachmentDescriptionNullable < ActiveRecord::Migration[5.1]
4 | def change
5 | change_column :decidim_attachments, :description, :jsonb, null: true
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/decidim-system/app/views/layouts/decidim/system/_sidebar.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 | <%= link_to root_path do %>
4 | <%= title %>
5 | <% end %>
6 |
7 |
8 |
9 | <%= main_menu.render %>
10 |
11 | <%= render partial: 'layouts/decidim/system/login_items' %>
12 |
--------------------------------------------------------------------------------
/decidim-accountability/lib/decidim/accountability/admin.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Decidim
4 | module Accountability
5 | # This module contains all the domain logic associated to Decidim's Results
6 | # component admin panel.
7 | module Admin
8 | end
9 | end
10 | end
11 |
--------------------------------------------------------------------------------
/decidim-admin/app/assets/stylesheets/decidim/admin/modules/_process-header.scss:
--------------------------------------------------------------------------------
1 | .process-header__title{
2 | text-transform: uppercase;
3 | font-size: .8rem;
4 | margin-bottom: 1rem;
5 | color: $muted;
6 | }
7 |
8 | .process-title-summary{
9 | @extend .card-title;
10 | margin-bottom: 2rem;
11 | }
12 |
--------------------------------------------------------------------------------
/decidim-comments/app/assets/javascripts/decidim/comments/comments.js.erb:
--------------------------------------------------------------------------------
1 | // = require_self
2 | // = require ./bundle
3 |
4 | window.DecidimComments = window.DecidimComments || {};
5 |
6 | window.DecidimComments = {
7 | assets: {
8 | 'icons.svg': "<%= asset_path 'decidim/icons.svg' %>"
9 | }
10 | };
11 |
--------------------------------------------------------------------------------
/decidim-core/app/assets/stylesheets/decidim/modules/_user-form.scss:
--------------------------------------------------------------------------------
1 | .user-form{
2 | input[type="text"],
3 | input[type="email"],
4 | input[type="password"]{
5 | height: 3rem;
6 | }
7 | .button{
8 | margin: 2rem 0;
9 | }
10 | }
11 |
12 | .user-form__label{
13 | font-weight: 600;
14 | }
15 |
--------------------------------------------------------------------------------
/decidim-core/db/migrate/20161005153007_add_description_to_organizations.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddDescriptionToOrganizations < ActiveRecord::Migration[5.0]
4 | def change
5 | change_table :decidim_organizations do |t|
6 | t.jsonb :description
7 | end
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/decidim-core/db/migrate/20170110133113_add_configuration_to_features.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddConfigurationToFeatures < ActiveRecord::Migration[5.0]
4 | def change
5 | change_table :decidim_features do |t|
6 | t.jsonb :settings, default: {}
7 | end
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/decidim-core/db/migrate/20170605140421_add_deleted_fields_to_users.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddDeletedFieldsToUsers < ActiveRecord::Migration[5.0]
4 | def change
5 | add_column :decidim_users, :delete_reason, :text
6 | add_column :decidim_users, :deleted_at, :datetime
7 | end
8 | end
9 |
--------------------------------------------------------------------------------
/decidim-participatory_processes/db/migrate/20161025125300_add_published_at_to_processes.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddPublishedAtToProcesses < ActiveRecord::Migration[5.0]
4 | def change
5 | add_column :decidim_participatory_processes, :published_at, :datetime, index: true
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/decidim-accountability/db/migrate/20170623144902_add_children_counter_cache_to_results.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddChildrenCounterCacheToResults < ActiveRecord::Migration[5.0]
4 | def change
5 | add_column :decidim_accountability_results, :children_count, :integer, default: 0
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/decidim-core/app/assets/javascripts/decidim/slug_form.js.es6:
--------------------------------------------------------------------------------
1 | $(() => {
2 | const $wrapper = $(".slug");
3 | const $input = $wrapper.find("input");
4 | const $target = $wrapper.find("span.slug-url-value");
5 |
6 | $input.on("keyup", (event) => {
7 | $target.html(event.target.value);
8 | });
9 | });
10 |
--------------------------------------------------------------------------------
/decidim-core/db/migrate/20170203150545_add_newsletter_notifications_to_users.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddNewsletterNotificationsToUsers < ActiveRecord::Migration[5.0]
4 | def change
5 | add_column :decidim_users, :newsletter_notifications, :boolean, null: false, default: false
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/decidim-core/spec/factory_bot_spec.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | require "spec_helper"
4 |
5 | describe FactoryBot, processing_uploads_for: Decidim::AttachmentUploader do
6 | it "has 100% valid factories" do
7 | expect { described_class.lint(traits: true) }.not_to raise_error
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/decidim-dev/app/assets/images/decidim/dummy.svg:
--------------------------------------------------------------------------------
1 |
5 |
--------------------------------------------------------------------------------
/decidim-participatory_processes/db/migrate/20161107152228_remove_not_null_on_step_position.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class RemoveNotNullOnStepPosition < ActiveRecord::Migration[5.0]
4 | def change
5 | change_column :decidim_participatory_process_steps, :position, :integer, null: true
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/decidim-participatory_processes/lib/decidim/participatory_processes/version.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Decidim
4 | # This holds the decidim-participatory_processes version.
5 | module ParticipatoryProcesses
6 | def self.version
7 | "0.8.0-pre"
8 | end
9 | end
10 | end
11 |
--------------------------------------------------------------------------------
/decidim-surveys/db/migrate/20170525132233_add_answer_options_to_surveys_questions.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddAnswerOptionsToSurveysQuestions < ActiveRecord::Migration[5.0]
4 | def change
5 | add_column :decidim_surveys_survey_questions, :answer_options, :jsonb, default: []
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/decidim-admin/spec/spec_helper.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | require "decidim/dev"
4 |
5 | ENV["ENGINE_NAME"] = File.dirname(__dir__).split("/").last
6 |
7 | Decidim::Dev.dummy_app_path = File.expand_path(File.join("..", "spec", "decidim_dummy_app"))
8 |
9 | require "decidim/dev/test/base_spec_helper"
10 |
--------------------------------------------------------------------------------
/decidim-api/spec/spec_helper.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | require "decidim/dev"
4 |
5 | ENV["ENGINE_NAME"] = File.dirname(__dir__).split("/").last
6 |
7 | Decidim::Dev.dummy_app_path = File.expand_path(File.join("..", "spec", "decidim_dummy_app"))
8 |
9 | require "decidim/dev/test/base_spec_helper"
10 |
--------------------------------------------------------------------------------
/decidim-budgets/spec/spec_helper.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | require "decidim/dev"
4 |
5 | ENV["ENGINE_NAME"] = File.dirname(__dir__).split("/").last
6 |
7 | Decidim::Dev.dummy_app_path = File.expand_path(File.join("..", "spec", "decidim_dummy_app"))
8 |
9 | require "decidim/dev/test/base_spec_helper"
10 |
--------------------------------------------------------------------------------
/decidim-core/db/migrate/20170912082054_add_emails_on_notifications_flag_to_user.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddEmailsOnNotificationsFlagToUser < ActiveRecord::Migration[5.1]
4 | def change
5 | add_column :decidim_users, :email_on_notification, :boolean, default: false, null: false
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/decidim-core/lib/decidim/events.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Decidim
4 | module Events
5 | autoload :BaseEvent, "decidim/events/base_event"
6 | autoload :EmailEvent, "decidim/events/email_event"
7 | autoload :NotificationEvent, "decidim/events/notification_event"
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/decidim-core/spec/spec_helper.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | require "decidim/dev"
4 |
5 | ENV["ENGINE_NAME"] = File.dirname(__dir__).split("/").last
6 |
7 | Decidim::Dev.dummy_app_path = File.expand_path(File.join("..", "spec", "decidim_dummy_app"))
8 |
9 | require "decidim/dev/test/base_spec_helper"
10 |
--------------------------------------------------------------------------------
/decidim-pages/spec/spec_helper.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | require "decidim/dev"
4 |
5 | ENV["ENGINE_NAME"] = File.dirname(__dir__).split("/").last
6 |
7 | Decidim::Dev.dummy_app_path = File.expand_path(File.join("..", "spec", "decidim_dummy_app"))
8 |
9 | require "decidim/dev/test/base_spec_helper"
10 |
--------------------------------------------------------------------------------
/decidim-surveys/spec/spec_helper.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | require "decidim/dev"
4 |
5 | ENV["ENGINE_NAME"] = File.dirname(__dir__).split("/").last
6 |
7 | Decidim::Dev.dummy_app_path = File.expand_path(File.join("..", "spec", "decidim_dummy_app"))
8 |
9 | require "decidim/dev/test/base_spec_helper"
10 |
--------------------------------------------------------------------------------
/decidim-system/spec/spec_helper.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | require "decidim/dev"
4 |
5 | ENV["ENGINE_NAME"] = File.dirname(__dir__).split("/").last
6 |
7 | Decidim::Dev.dummy_app_path = File.expand_path(File.join("..", "spec", "decidim_dummy_app"))
8 |
9 | require "decidim/dev/test/base_spec_helper"
10 |
--------------------------------------------------------------------------------
/decidim-verifications/lib/decidim/verifications/id_documents.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | require "decidim/verifications/id_documents/admin"
4 | require "decidim/verifications/id_documents/engine"
5 | require "decidim/verifications/id_documents/admin_engine"
6 | require "decidim/verifications/id_documents/workflow"
7 |
--------------------------------------------------------------------------------
/.github/PULL_REQUEST_TEMPLATE.md:
--------------------------------------------------------------------------------
1 | #### :tophat: What? Why?
2 |
3 |
4 | #### :pushpin: Related Issues
5 | - Related to #?
6 | - Fixes #?
7 |
8 | #### :clipboard: Subtasks
9 | - [x] Subtask 1
10 | - [ ] Subtask 2
11 |
12 | ### :camera: Screenshots (optional)
13 | 
14 |
15 | #### :ghost: GIF
16 | ![]()
17 |
--------------------------------------------------------------------------------
/decidim-admin/app/assets/javascripts/decidim/admin/select2.js.es6:
--------------------------------------------------------------------------------
1 | // = require select2
2 | // = require select2_locale_es
3 | // = require select2_locale_eu
4 | // = require select2_locale_ca
5 | // = require select2_locale_fi
6 | // = require select2_locale_fr
7 | // = require select2_locale_it
8 | // = require select2_locale_nl
9 |
--------------------------------------------------------------------------------
/decidim-assemblies/spec/spec_helper.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | require "decidim/dev"
4 |
5 | ENV["ENGINE_NAME"] = File.dirname(__dir__).split("/").last
6 |
7 | Decidim::Dev.dummy_app_path = File.expand_path(File.join("..", "spec", "decidim_dummy_app"))
8 |
9 | require "decidim/dev/test/base_spec_helper"
10 |
--------------------------------------------------------------------------------
/decidim-comments/spec/spec_helper.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | require "decidim/dev"
4 |
5 | ENV["ENGINE_NAME"] = File.dirname(__dir__).split("/").last
6 |
7 | Decidim::Dev.dummy_app_path = File.expand_path(File.join("..", "spec", "decidim_dummy_app"))
8 |
9 | require "decidim/dev/test/base_spec_helper"
10 |
--------------------------------------------------------------------------------
/decidim-core/app/views/decidim/notification_mailer/event_received.html.erb:
--------------------------------------------------------------------------------
1 |
<%= @event_instance.email_greeting %>
2 |
3 |
<%= @event_instance.email_intro %>
4 |
5 |
6 | <%= link_to @event_instance.resource_url, @event_instance.resource_url %>
7 |
8 |
9 |
<%= @event_instance.email_outro %>
10 |
--------------------------------------------------------------------------------
/decidim-core/db/migrate/20170306144354_add_secondary_hosts_to_organizations.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddSecondaryHostsToOrganizations < ActiveRecord::Migration[5.0]
4 | def change
5 | add_column :decidim_organizations, :secondary_hosts, :string, array: true, default: [], index: true
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/decidim-meetings/app/views/decidim/meetings/admin/meetings/edit.html.erb:
--------------------------------------------------------------------------------
1 | <%= decidim_form_for(@form, html: { class: "form edit_meeting" }) do |f| %>
2 | <%= render partial: 'form', object: f %>
3 |
4 |
5 | <%= f.submit t(".update") %>
6 |
7 | <% end %>
8 |
9 |
--------------------------------------------------------------------------------
/decidim-meetings/spec/spec_helper.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | require "decidim/dev"
4 |
5 | ENV["ENGINE_NAME"] = File.dirname(__dir__).split("/").last
6 |
7 | Decidim::Dev.dummy_app_path = File.expand_path(File.join("..", "spec", "decidim_dummy_app"))
8 |
9 | require "decidim/dev/test/base_spec_helper"
10 |
--------------------------------------------------------------------------------
/decidim-participatory_processes/db/migrate/20161013134732_add_promoted_flag_to_processes.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddPromotedFlagToProcesses < ActiveRecord::Migration[5.0]
4 | def change
5 | add_column :decidim_participatory_processes, :promoted, :boolean, default: false, index: true
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/decidim-participatory_processes/db/migrate/20170808080905_add_announcement_to_participatory_processes.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddAnnouncementToParticipatoryProcesses < ActiveRecord::Migration[5.1]
4 | def change
5 | add_column :decidim_participatory_processes, :announcement, :jsonb
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/decidim-proposals/db/migrate/20170118120151_add_counter_cache_votes_to_proposals.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddCounterCacheVotesToProposals < ActiveRecord::Migration[5.0]
4 | def change
5 | add_column :decidim_proposals_proposals, :proposal_votes_count, :integer, null: false, default: 0
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/decidim-proposals/spec/spec_helper.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | require "decidim/dev"
4 |
5 | ENV["ENGINE_NAME"] = File.dirname(__dir__).split("/").last
6 |
7 | Decidim::Dev.dummy_app_path = File.expand_path(File.join("..", "spec", "decidim_dummy_app"))
8 |
9 | require "decidim/dev/test/base_spec_helper"
10 |
--------------------------------------------------------------------------------
/decidim-system/app/views/decidim/system/admins/new.html.erb:
--------------------------------------------------------------------------------
1 | <% provide :title do %>
2 |
<%= t ".title" %>
3 | <% end %>
4 |
5 | <%= decidim_form_for(@form) do |f| %>
6 | <%= render partial: 'form', object: f %>
7 |
8 |
9 | <%= f.submit t(".create") %>
10 |
11 | <% end %>
12 |
--------------------------------------------------------------------------------
/decidim-verifications/lib/decidim/verifications/postal_letter.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | require "decidim/verifications/postal_letter/admin"
4 | require "decidim/verifications/postal_letter/engine"
5 | require "decidim/verifications/postal_letter/admin_engine"
6 | require "decidim/verifications/postal_letter/workflow"
7 |
--------------------------------------------------------------------------------
/decidim-accountability/app/assets/stylesheets/decidim/accountability/accountability/_cards.scss:
--------------------------------------------------------------------------------
1 | .accountability {
2 | .card__link--block {
3 | display: block;
4 | }
5 | .card--list__data {
6 | min-width: 7rem;
7 | }
8 | .card--meta {
9 | span {
10 | margin-right: 0.5rem;
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/decidim-accountability/spec/spec_helper.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | require "decidim/dev"
4 |
5 | ENV["ENGINE_NAME"] = File.dirname(__dir__).split("/").last
6 |
7 | Decidim::Dev.dummy_app_path = File.expand_path(File.join("..", "spec", "decidim_dummy_app"))
8 |
9 | require "decidim/dev/test/base_spec_helper"
10 |
--------------------------------------------------------------------------------
/decidim-admin/app/models/decidim/admin/application_record.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Decidim
4 | module Admin
5 | # Custom ApplicationRecord scoped to the Admin panel.
6 | #
7 | class ApplicationRecord < ActiveRecord::Base
8 | self.abstract_class = true
9 | end
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/decidim-core/app/assets/stylesheets/decidim/_decidim.scss:
--------------------------------------------------------------------------------
1 | @import "variables";
2 | @import "utils/*";
3 |
4 | @import "foundation";
5 | @include foundation-everything($flex: false);
6 |
7 | @import "select2";
8 | @import "plugins/select2";
9 |
10 | @import "modules/modules";
11 | @import "layouts/*";
12 | @import "extras/*";
13 |
--------------------------------------------------------------------------------
/decidim-dev/lib/decidim/dev/railtie.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | require "rails"
4 |
5 | module Decidim
6 | module Dev
7 | class Railtie < Rails::Railtie
8 | railtie_name :decidim_dev
9 |
10 | rake_tasks do
11 | Decidim::Dev.install_tasks
12 | end
13 | end
14 | end
15 | end
16 |
--------------------------------------------------------------------------------
/decidim-pages/app/models/decidim/pages/application_record.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Decidim
4 | module Pages
5 | # Abstract class from which all models in this engine inherit.
6 | class ApplicationRecord < ActiveRecord::Base
7 | self.abstract_class = true
8 | end
9 | end
10 | end
11 |
--------------------------------------------------------------------------------
/decidim-system/app/views/decidim/system/admins/_form.html.erb:
--------------------------------------------------------------------------------
1 |
2 | <%= form.text_field :email, autofocus: true %>
3 |
4 |
5 |
6 | <%= form.password_field :password %>
7 |
8 |
9 |
10 | <%= form.password_field :password_confirmation %>
11 |
12 |
--------------------------------------------------------------------------------
/decidim-system/app/views/decidim/system/admins/edit.html.erb:
--------------------------------------------------------------------------------
1 | <% provide :title do %>
2 |
<%= t ".title" %>
3 | <% end %>
4 |
5 | <%= decidim_form_for(@form) do |f| %>
6 | <%= render partial: 'form', object: f %>
7 |
8 |
9 | <%= f.submit t(".update") %>
10 |
11 | <% end %>
12 |
--------------------------------------------------------------------------------
/decidim-verifications/lib/decidim/verifications/id_documents/workflow.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | Decidim::Verifications.register_workflow(:id_documents) do |workflow|
4 | workflow.engine = Decidim::Verifications::IdDocuments::Engine
5 | workflow.admin_engine = Decidim::Verifications::IdDocuments::AdminEngine
6 | end
7 |
--------------------------------------------------------------------------------
/decidim-verifications/spec/spec_helper.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | require "decidim/dev"
4 |
5 | ENV["ENGINE_NAME"] = File.dirname(__dir__).split("/").last
6 |
7 | Decidim::Dev.dummy_app_path = File.expand_path(File.join("..", "spec", "decidim_dummy_app"))
8 |
9 | require "decidim/dev/test/base_spec_helper"
10 |
--------------------------------------------------------------------------------
/decidim-budgets/app/models/decidim/budgets/application_record.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Decidim
4 | module Budgets
5 | # Abstract class from which all models in this engine inherit.
6 | class ApplicationRecord < ActiveRecord::Base
7 | self.abstract_class = true
8 | end
9 | end
10 | end
11 |
--------------------------------------------------------------------------------
/decidim-budgets/lib/decidim/budgets.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | require "decidim/budgets/admin"
4 | require "decidim/budgets/engine"
5 | require "decidim/budgets/admin_engine"
6 | require "decidim/budgets/feature"
7 |
8 | module Decidim
9 | # Base module for this engine.
10 | module Budgets
11 | end
12 | end
13 |
--------------------------------------------------------------------------------
/decidim-comments/app/models/decidim/comments/application_record.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Decidim
4 | module Comments
5 | # Abstract class from which all models in this engine inherit.
6 | class ApplicationRecord < ActiveRecord::Base
7 | self.abstract_class = true
8 | end
9 | end
10 | end
11 |
--------------------------------------------------------------------------------
/decidim-core/app/assets/stylesheets/decidim/extras/_meeting-registrations.scss:
--------------------------------------------------------------------------------
1 | #meeting-registration-confirm {
2 | .help-text {
3 | border: 1px solid #eee;
4 | background: #fff;
5 | padding: 0.5em;
6 | overflow-y: scroll;
7 | margin-bottom: 1em;
8 | margin-top: 0.5em;
9 | height: 20em;
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/decidim-core/app/assets/stylesheets/decidim/utils/_keyframes.scss:
--------------------------------------------------------------------------------
1 | // Keyframes
2 |
3 | @keyframes fadeIn {
4 | 0% {
5 | opacity: 0;
6 | }
7 |
8 | 100% {
9 | opacity: 1;
10 | }
11 | }
12 |
13 | @keyframes fadeOut {
14 | 0% {
15 | opacity: 1;
16 | }
17 |
18 | 100% {
19 | opacity: 0;
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/decidim-core/db/migrate/20170117142904_add_uniqueness_field_to_authorizations.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddUniquenessFieldToAuthorizations < ActiveRecord::Migration[5.0]
4 | def change
5 | change_table :decidim_authorizations do |t|
6 | t.string :unique_id, null: true
7 | end
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/decidim-meetings/app/models/decidim/meetings/application_record.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Decidim
4 | module Meetings
5 | # Abstract class from which all models in this engine inherit.
6 | class ApplicationRecord < ActiveRecord::Base
7 | self.abstract_class = true
8 | end
9 | end
10 | end
11 |
--------------------------------------------------------------------------------
/decidim-proposals/spec/forms/decidim/proposals/admin_proposal_form_spec.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | require "spec_helper"
4 |
5 | module Decidim
6 | module Proposals
7 | module Admin
8 | describe ProposalForm do
9 | it_behaves_like "a proposal form"
10 | end
11 | end
12 | end
13 | end
14 |
--------------------------------------------------------------------------------
/decidim-surveys/app/models/decidim/surveys/application_record.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Decidim
4 | module Surveys
5 | # Abstract class from which all models in this engine inherit.
6 | class ApplicationRecord < ActiveRecord::Base
7 | self.abstract_class = true
8 | end
9 | end
10 | end
11 |
--------------------------------------------------------------------------------
/decidim-system/app/models/decidim/system/application_record.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Decidim
4 | module System
5 | # Custom ApplicationRecord scoped to the system panel.
6 | #
7 | class ApplicationRecord < ActiveRecord::Base
8 | self.abstract_class = true
9 | end
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/decidim-verifications/lib/decidim/verifications/postal_letter/workflow.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | Decidim::Verifications.register_workflow(:postal_letter) do |workflow|
4 | workflow.engine = Decidim::Verifications::PostalLetter::Engine
5 | workflow.admin_engine = Decidim::Verifications::PostalLetter::AdminEngine
6 | end
7 |
--------------------------------------------------------------------------------
/decidim-admin/app/assets/stylesheets/decidim/admin/utils/_keyframes.scss:
--------------------------------------------------------------------------------
1 | // Keyframes
2 |
3 | @keyframes fadeIn {
4 | 0% {
5 | opacity: 0;
6 | }
7 |
8 | 100% {
9 | opacity: 1;
10 | }
11 | }
12 |
13 | @keyframes fadeOut {
14 | 0% {
15 | opacity: 1;
16 | }
17 |
18 | 100% {
19 | opacity: 0;
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/decidim-comments/app/frontend/support/asset_url.ts:
--------------------------------------------------------------------------------
1 | const assetUrl = (name: string): string => {
2 | const url = window.DecidimComments.assets[name];
3 |
4 | if (!url) {
5 | throw new Error(`Asset "${name}" can't be found on decidim comments manifest.`);
6 | }
7 |
8 | return url;
9 | };
10 |
11 | export default assetUrl;
12 |
--------------------------------------------------------------------------------
/decidim-core/app/uploaders/decidim/organization_logo_uploader.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Decidim
4 | # This class deals with uploading the organization's logo.
5 | class OrganizationLogoUploader < ImageUploader
6 | version :medium do
7 | process resize_to_fit: [600, 160]
8 | end
9 | end
10 | end
11 |
--------------------------------------------------------------------------------
/decidim-core/lib/decidim/core/test/shared_examples/has_scope.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | shared_examples_for "has scope" do
4 | context "when the scope is from another organization" do
5 | before do
6 | subject.scope = create(:scope)
7 | end
8 |
9 | it { is_expected.not_to be_valid }
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/decidim-meetings/lib/decidim/meetings.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | require "decidim/meetings/admin"
4 | require "decidim/meetings/engine"
5 | require "decidim/meetings/admin_engine"
6 | require "decidim/meetings/feature"
7 |
8 | module Decidim
9 | # Base module for this engine.
10 | module Meetings
11 | end
12 | end
13 |
--------------------------------------------------------------------------------
/decidim-participatory_processes/spec/spec_helper.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | require "decidim/dev"
4 |
5 | ENV["ENGINE_NAME"] = File.dirname(__dir__).split("/").last
6 |
7 | Decidim::Dev.dummy_app_path = File.expand_path(File.join("..", "spec", "decidim_dummy_app"))
8 |
9 | require "decidim/dev/test/base_spec_helper"
10 |
--------------------------------------------------------------------------------
/decidim-proposals/app/models/decidim/proposals/application_record.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Decidim
4 | module Proposals
5 | # Abstract class from which all models in this engine inherit.
6 | class ApplicationRecord < ActiveRecord::Base
7 | self.abstract_class = true
8 | end
9 | end
10 | end
11 |
--------------------------------------------------------------------------------
/decidim-admin/db/migrate/20170714083651_rename_participatory_process_user_roles_table.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class RenameParticipatoryProcessUserRolesTable < ActiveRecord::Migration[5.1]
4 | def change
5 | rename_table :decidim_admin_participatory_process_user_roles, :decidim_participatory_process_user_roles
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/decidim-api/config/routes.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | Decidim::Api::Engine.routes.draw do
4 | mount GraphiQL::Rails::Engine, at: "/graphiql", graphql_path: "/api", as: :graphiql
5 | get "/docs", to: "documentation#show", as: :documentation
6 | get "/", to: redirect("/api/docs")
7 | post "/" => "queries#create", as: :root
8 | end
9 |
--------------------------------------------------------------------------------
/decidim-api/lib/decidim/api/query_type.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Decidim
4 | module Api
5 | # This type represents the root query type of the whole API.
6 | QueryType = GraphQL::ObjectType.define do
7 | name "Query"
8 | description "The root query of this schema"
9 | end
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/decidim-budgets/app/views/decidim/budgets/admin/projects/edit.html.erb:
--------------------------------------------------------------------------------
1 | <%= decidim_form_for(@form, html: { class: "form edit_project" }) do |f| %>
2 | <%= render partial: 'form', object: f, locals: { title: t('.title') } %>
3 |
4 |
5 | <%= f.submit t(".update") %>
6 |
7 | <% end %>
8 |
--------------------------------------------------------------------------------
/decidim-budgets/app/views/decidim/budgets/admin/projects/new.html.erb:
--------------------------------------------------------------------------------
1 | <%= decidim_form_for(@form, html: { class: "form new_project" }) do |f| %>
2 | <%= render partial: 'form', object: f, locals: { title: t('.title') } %>
3 |
4 |
5 | <%= f.submit t(".create") %>
6 |
7 | <% end %>
8 |
9 |
--------------------------------------------------------------------------------
/decidim-budgets/spec/features/follow_projects_spec.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | require "spec_helper"
4 |
5 | describe "Follow projects", type: :feature do
6 | let(:manifest_name) { "budgets" }
7 |
8 | let!(:followable) do
9 | create(:project, feature: feature)
10 | end
11 |
12 | include_examples "follows"
13 | end
14 |
--------------------------------------------------------------------------------
/decidim-meetings/app/views/decidim/meetings/admin/meetings/new.html.erb:
--------------------------------------------------------------------------------
1 | <%= decidim_form_for(@form, html: { class: "form new_meeting" }) do |f| %>
2 | <%= render partial: 'form', object: f, locals: { title: t('.title') } %>
3 |
4 |
5 | <%= f.submit t(".create") %>
6 |
7 | <% end %>
8 |
--------------------------------------------------------------------------------
/.eslintignore:
--------------------------------------------------------------------------------
1 | **/*{.,-}min.js
2 | decidim-*/vendor/**/*.js
3 | spec/decidim_dummy_app/**/*.js
4 | docker_development_app
5 | development_app
6 | **/node_modules/**
7 | bundle.js
8 | karma.conf.js
9 | webpack.config.js
10 | webpack.config.babel.js
11 | entry.test.js
12 | entry.js
13 | *_manifest.js
14 | coverage
15 | decidim-dev/**/*/test/**/*.js
16 |
--------------------------------------------------------------------------------
/decidim-core/app/assets/stylesheets/decidim/modules/_help.scss:
--------------------------------------------------------------------------------
1 | .help{
2 | vertical-align: -2px;
3 | .icon{
4 | width: 14px;
5 | height: 14px;
6 | fill: $white;
7 | background: lighten($muted, 20);
8 | border-radius: 50%;
9 | padding: 2px;
10 | &:hover{
11 | background: $anchor-color;
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/decidim-core/db/migrate/20171013124505_add_verification_attachment_to_authorizations.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddVerificationAttachmentToAuthorizations < ActiveRecord::Migration[5.1]
4 | def change
5 | change_table :decidim_authorizations do |t|
6 | t.string :verification_attachment
7 | end
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/decidim-meetings/spec/features/follow_meetings_spec.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | require "spec_helper"
4 |
5 | describe "Follow meetings", type: :feature do
6 | let(:manifest_name) { "meetings" }
7 |
8 | let!(:followable) do
9 | create(:meeting, feature: feature)
10 | end
11 |
12 | include_examples "follows"
13 | end
14 |
--------------------------------------------------------------------------------
/decidim-participatory_processes/db/migrate/20170725085104_add_show_statistics_to_participatory_processes.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddShowStatisticsToParticipatoryProcesses < ActiveRecord::Migration[5.1]
4 | def change
5 | add_column :decidim_participatory_processes, :show_statistics, :boolean, default: true
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/decidim-proposals/app/views/decidim/proposals/admin/proposals/new.html.erb:
--------------------------------------------------------------------------------
1 | <%= decidim_form_for(@form, html: { class: "form new_proposal" }) do |f| %>
2 | <%= render partial: 'form', object: f, locals: { title: t('.title') } %>
3 |
4 |
5 | <%= f.submit t(".create") %>
6 |
7 | <% end %>
8 |
--------------------------------------------------------------------------------
/decidim-system/app/assets/stylesheets/decidim/system/_layout.scss:
--------------------------------------------------------------------------------
1 | .off-canvas, .sidebar, .off-canvas-wrapper{
2 | min-height: 100vh;
3 | }
4 |
5 | .off-canvas{
6 | color: #fff;
7 | }
8 |
9 | .main-content{
10 | padding: $global-padding 0;
11 | min-height: 100vh;
12 | }
13 |
14 | .page-title{
15 | margin-bottom: $global-margin;
16 | }
17 |
--------------------------------------------------------------------------------
/decidim-accountability/app/models/decidim/accountability/application_record.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Decidim
4 | module Accountability
5 | # Abstract class from which all models in this engine inherit.
6 | class ApplicationRecord < ActiveRecord::Base
7 | self.abstract_class = true
8 | end
9 | end
10 | end
11 |
--------------------------------------------------------------------------------
/decidim-admin/app/assets/stylesheets/decidim/admin/modules/_typography.scss:
--------------------------------------------------------------------------------
1 | .text-muted{
2 | color: $muted;
3 | }
4 |
5 | .text-success{
6 | color: $success-color;
7 | }
8 |
9 | .text-warning{
10 | color: $warning-color;
11 | }
12 |
13 | .text-alert{
14 | color: $alert-color;
15 | }
16 |
17 | .text-info{
18 | color: $secondary;
19 | }
20 |
--------------------------------------------------------------------------------
/decidim-admin/app/views/decidim/admin/newsletters/_form.html.erb:
--------------------------------------------------------------------------------
1 |
2 | <%= form.translated :text_field, :subject %>
3 |
4 |
5 |
6 | <%= form.translated :editor, :body, toolbar: "basic-no-video" %>
7 |
8 |
9 |
10 | <%= t('.interpolations_hint') %>
11 |
12 |
--------------------------------------------------------------------------------
/decidim-api/lib/decidim/api/mutation_type.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Decidim
4 | module Api
5 | # This type represents the root mutation type of the whole API
6 | MutationType = GraphQL::ObjectType.define do
7 | name "Mutation"
8 | description "The root mutation of this schema"
9 | end
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/decidim-comments/app/frontend/fragments/comment.fragment.graphql:
--------------------------------------------------------------------------------
1 | #import "../fragments/comment_data.fragment.graphql"
2 |
3 | fragment Comment on Comment {
4 | ...CommentData
5 | comments {
6 | ...CommentData
7 | comments {
8 | ...CommentData
9 | comments {
10 | ...CommentData
11 | }
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/decidim-core/db/migrate/20170405091801_change_decidim_user_email_index_uniqueness.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class ChangeDecidimUserEmailIndexUniqueness < ActiveRecord::Migration[5.0]
4 | def change
5 | remove_index :decidim_users, :email
6 | add_index :decidim_users, [:email, :decidim_organization_id], unique: true
7 | end
8 | end
9 |
--------------------------------------------------------------------------------
/decidim-core/lib/decidim/core/test/shared_examples/has_category.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | shared_examples_for "has category" do
4 | context "when the category is from another organization" do
5 | before do
6 | subject.category = create(:category)
7 | end
8 |
9 | it { is_expected.not_to be_valid }
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/decidim-meetings/db/migrate/20170123151650_add_latitude_and_longitude_to_meetings.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddLatitudeAndLongitudeToMeetings < ActiveRecord::Migration[5.0]
4 | def change
5 | add_column :decidim_meetings_meetings, :latitude, :float
6 | add_column :decidim_meetings_meetings, :longitude, :float
7 | end
8 | end
9 |
--------------------------------------------------------------------------------
/decidim-participatory_processes/lib/decidim/participatory_processes/admin.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Decidim
4 | module ParticipatoryProcesses
5 | # This module contains all the domain logic associated to Decidim's
6 | # Participatory processes component admin panel.
7 | module Admin
8 | end
9 | end
10 | end
11 |
--------------------------------------------------------------------------------
/decidim-proposals/spec/commands/decidim/proposals/create_proposal_spec.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | require "spec_helper"
4 |
5 | module Decidim
6 | module Proposals
7 | describe CreateProposal do
8 | let(:form_klass) { ProposalForm }
9 |
10 | it_behaves_like "create a proposal", true
11 | end
12 | end
13 | end
14 |
--------------------------------------------------------------------------------
/decidim-proposals/spec/features/follow_proposals_spec.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | require "spec_helper"
4 |
5 | describe "Follow proposals", type: :feature do
6 | let(:manifest_name) { "proposals" }
7 |
8 | let!(:followable) do
9 | create(:proposal, feature: feature)
10 | end
11 |
12 | include_examples "follows"
13 | end
14 |
--------------------------------------------------------------------------------
/decidim-system/spec/factories.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | require "decidim/core/test/factories"
4 |
5 | FactoryBot.define do
6 | factory :admin, class: "Decidim::System::Admin" do
7 | sequence(:email) { |n| "admin#{n}@citizen.corp" }
8 | password "password1234"
9 | password_confirmation "password1234"
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/lib/generators/decidim/templates/social_share_button.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | # Further information on how to configure the SocialShareButton gem can be
4 | # found here: https://github.com/huacnlee/social-share-button#configure
5 | #
6 | SocialShareButton.configure do |config|
7 | config.allow_sites = %w(twitter facebook google_plus)
8 | end
9 |
--------------------------------------------------------------------------------
/decidim-accountability/app/views/decidim/accountability/admin/statuses/edit.html.erb:
--------------------------------------------------------------------------------
1 | <%= decidim_form_for(@form, html: { class: "form edit_status" }) do |f| %>
2 | <%= render partial: 'form', object: f, locals: { title: t('.title') } %>
3 |
4 |
5 | <%= f.submit t(".update") %>
6 |
7 | <% end %>
8 |
9 |
--------------------------------------------------------------------------------
/decidim-accountability/app/views/decidim/accountability/admin/statuses/new.html.erb:
--------------------------------------------------------------------------------
1 | <%= decidim_form_for(@form, html: { class: "form new_status" }) do |f| %>
2 | <%= render partial: 'form', object: f, locals: { title: t('.title') } %>
3 |
4 |
5 | <%= f.submit t(".create") %>
6 |
7 | <% end %>
8 |
9 |
--------------------------------------------------------------------------------
/decidim-accountability/spec/factories.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | require "decidim/core/test/factories"
4 | require "decidim/comments/test/factories"
5 | require "decidim/accountability/test/factories"
6 | require "decidim/proposals/test/factories"
7 | require "decidim/meetings/test/factories"
8 | require "decidim/participatory_processes/test/factories"
9 |
--------------------------------------------------------------------------------
/decidim-admin/app/views/decidim/admin/moderations/_report.html.erb:
--------------------------------------------------------------------------------
1 | <% if report.details.blank? %>
2 | <%= t(".reasons.#{report.reason}") %>
3 | <% else %>
4 |
9 | <%= t(".reasons.#{report.reason}") %>
10 |
11 | <% end %>
12 |
--------------------------------------------------------------------------------
/decidim-core/app/uploaders/decidim/official_image_footer_uploader.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Decidim
4 | # This class deals with uploading hero images to ParticipatoryProcesses.
5 | class OfficialImageFooterUploader < ImageUploader
6 | include CarrierWave::MiniMagick
7 | process resize_to_fit: [600, 180]
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/decidim-core/app/uploaders/decidim/official_image_header_uploader.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Decidim
4 | # This class deals with uploading hero images to ParticipatoryProcesses.
5 | class OfficialImageHeaderUploader < ImageUploader
6 | include CarrierWave::MiniMagick
7 | process resize_to_fit: [160, 160]
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/decidim-core/app/views/decidim/errors/internal_server_error.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
<%= t(".title") %>
6 |
<%= t(".try_later") %>
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/decidim-core/db/migrate/20170206142116_add_published_at_to_decidim_features.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddPublishedAtToDecidimFeatures < ActiveRecord::Migration[5.0]
4 | def change
5 | add_column :decidim_features, :published_at, :datetime
6 | execute "UPDATE decidim_features SET published_at=#{quote(Time.current)}"
7 | end
8 | end
9 |
--------------------------------------------------------------------------------
/decidim-core/db/migrate/20170914092117_add_status_to_authorizations.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddStatusToAuthorizations < ActiveRecord::Migration[5.1]
4 | def change
5 | add_column :decidim_authorizations, :granted_at, :datetime
6 |
7 | execute "UPDATE decidim_authorizations SET granted_at = updated_at"
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/decidim-core/lib/decidim/features.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Decidim
4 | # This module contains all logic related to decidim's Features, the main
5 | # building block to extend functionalities in a participatory process.
6 | module Features
7 | autoload :BaseController, "decidim/features/base_controller"
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/decidim-participatory_processes/db/migrate/20170809084005_add_scopes_enabled_to_participatory_processes.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddScopesEnabledToParticipatoryProcesses < ActiveRecord::Migration[5.1]
4 | def change
5 | add_column :decidim_participatory_processes, :scopes_enabled, :boolean, null: false, default: true
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/decidim-proposals/app/assets/javascripts/decidim/proposals/utils.js.es6:
--------------------------------------------------------------------------------
1 | /* eslint-disable no-invalid-this */
2 |
3 | (() => {
4 | $("#vote_button").mouseover(function () {
5 | $(this).text($(this).data('replace'));
6 | });
7 |
8 | $("#vote_button").mouseout(function () {
9 | $(this).text($(this).data('original'));
10 | });
11 | })(this);
12 |
--------------------------------------------------------------------------------
/decidim-core/app/assets/stylesheets/decidim/modules/_margins.scss:
--------------------------------------------------------------------------------
1 | $margin-s: 1rem;
2 | $margin-sm: 2rem;
3 | $margin-m: 3rem;
4 | $margin-l: 5rem;
5 |
6 | //Sections
7 | .section{
8 | margin-bottom: $margin-sm;
9 | @include breakpoint(large){
10 | margin-bottom: $margin-m;
11 | }
12 | }
13 |
14 | .m-bottom{
15 | margin-bottom: $margin-s;
16 | }
17 |
--------------------------------------------------------------------------------
/decidim-core/db/migrate/20170914092116_remove_comment_and_replies_notifications_from_users.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class RemoveCommentAndRepliesNotificationsFromUsers < ActiveRecord::Migration[5.1]
4 | def change
5 | remove_column :decidim_users, :comments_notifications
6 | remove_column :decidim_users, :replies_notifications
7 | end
8 | end
9 |
--------------------------------------------------------------------------------
/decidim-core/db/migrate/20171017084546_add_cta_button_url_and_text_to_organization.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddCtaButtonUrlAndTextToOrganization < ActiveRecord::Migration[5.1]
4 | def change
5 | add_column :decidim_organizations, :cta_button_text, :jsonb
6 | add_column :decidim_organizations, :cta_button_path, :string
7 | end
8 | end
9 |
--------------------------------------------------------------------------------
/decidim-meetings/spec/factories.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | require "decidim/core/test/factories"
4 | require "decidim/participatory_processes/test/factories"
5 | require "decidim/assemblies/test/factories"
6 | require "decidim/proposals/test/factories"
7 | require "decidim/comments/test/factories"
8 |
9 | require "decidim/meetings/test/factories"
10 |
--------------------------------------------------------------------------------
/decidim-participatory_processes/db/migrate/20170221094835_add_scopes_to_processes.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddScopesToProcesses < ActiveRecord::Migration[5.0]
4 | def change
5 | rename_column :decidim_participatory_processes, :scope, :meta_scope
6 | add_column :decidim_participatory_processes, :decidim_scope_id, :integer
7 | end
8 | end
9 |
--------------------------------------------------------------------------------
/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "presets": [
3 | "env",
4 | "airbnb",
5 | "react",
6 | "stage-2"
7 | ],
8 | "plugins": ["transform-decorators-legacy"],
9 | "env": {
10 | "test": {
11 | "plugins": [
12 | ["__coverage__", {"ignore": "*.+(test|stub).*"}],
13 | "transform-es2015-modules-commonjs"
14 | ]
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/decidim-admin/app/controllers/decidim/admin/dashboard_controller.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Decidim
4 | module Admin
5 | # Controller that shows a simple dashboard.
6 | #
7 | class DashboardController < Decidim::Admin::ApplicationController
8 | authorize_resource :admin_dashboard, class: false
9 | end
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/decidim-assemblies/app/queries/decidim/assemblies/published_assemblies.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Decidim
4 | module Assemblies
5 | # This query filters published assemblies only.
6 | class PublishedAssemblies < Rectify::Query
7 | def query
8 | Decidim::Assembly.published
9 | end
10 | end
11 | end
12 | end
13 |
--------------------------------------------------------------------------------
/decidim-core/app/assets/stylesheets/decidim/extras/_leaflet.scss:
--------------------------------------------------------------------------------
1 | .leaflet-container {
2 | .map-info {
3 | border: 1px solid $primary;
4 |
5 | .leaflet-popup-content-wrapper {
6 | border-radius: 2px;
7 | }
8 | a.button {
9 | color: #fff;
10 | }
11 | }
12 | .leaflet-popup-tip{
13 | border: 1px solid $primary;
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/decidim-core/spec/models/decidim/feature_spec.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | require "spec_helper"
4 |
5 | module Decidim
6 | describe Feature do
7 | subject { feature }
8 |
9 | let(:feature) { build(:feature, manifest_name: "dummy") }
10 |
11 | it { is_expected.to be_valid }
12 |
13 | include_examples "publicable"
14 | end
15 | end
16 |
--------------------------------------------------------------------------------
/decidim-meetings/app/helpers/decidim/meetings/admin/application_helper.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Decidim
4 | module Meetings
5 | module Admin
6 | # Custom helpers, scoped to the meetings admin engine.
7 | #
8 | module ApplicationHelper
9 | include Decidim::MapHelper
10 | end
11 | end
12 | end
13 | end
14 |
--------------------------------------------------------------------------------
/decidim-meetings/app/views/decidim/meetings/admin/registrations/edit.html.erb:
--------------------------------------------------------------------------------
1 | <%= decidim_form_for(@form, url: meeting_registrations_path, html: { class: "form edit_meeting_registrations" }) do |f| %>
2 | <%= render partial: 'form', object: f %>
3 |
4 |
5 | <%= f.submit t(".save") %>
6 |
7 | <% end %>
8 |
9 |
--------------------------------------------------------------------------------
/decidim-pages/app/views/decidim/pages/admin/pages/edit.html.erb:
--------------------------------------------------------------------------------
1 | <%= decidim_form_for(@form, url: page_path, method: :post, html: { class: "form edit_page" }) do |form| %>
2 | <%= render partial: 'form', object: form, locals: { title: t('.title') } %>
3 |
4 |
5 | <%= form.submit t(".save") %>
6 |
7 | <% end %>
8 |
--------------------------------------------------------------------------------
/decidim-system/app/assets/stylesheets/decidim/system/application.scss:
--------------------------------------------------------------------------------
1 | @import "foundation_and_overrides";
2 | @import "layout";
3 | @import "login";
4 | @import "sidebar";
5 | @import "tables";
6 | @import "actions";
7 |
8 | @import "decidim/editor";
9 | @import "decidim/utils/fontface";
10 |
11 | body {
12 | font-family: 'Source Sans Pro', sans-serif;
13 | }
14 |
--------------------------------------------------------------------------------
/decidim-admin/app/mailers/decidim/admin/application_mailer.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Decidim
4 | module Admin
5 | # Custom application mailer, scoped to the admin mailer.
6 | #
7 | class ApplicationMailer < ActionMailer::Base
8 | default from: Decidim.config.mailer_sender
9 | layout "mailer"
10 | end
11 | end
12 | end
13 |
--------------------------------------------------------------------------------
/decidim-admin/app/views/decidim/admin/features/_settings_fields.html.erb:
--------------------------------------------------------------------------------
1 | <% form.object.manifest.attributes.each do |name, attribute| %>
2 | <%= settings_attribute_input(
3 | form,
4 | attribute,
5 | name,
6 | label: t("decidim.features.#{feature.manifest.name}.settings.#{settings_name}.#{name}"),
7 | tabs_prefix: tabs_prefix
8 | )%>
9 | <% end %>
10 |
--------------------------------------------------------------------------------
/decidim-admin/lib/decidim/admin/features.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Decidim
4 | module Admin
5 | # This module contains all logic related to Features and how they're handled
6 | # at the admin panel level.
7 | module Features
8 | autoload :BaseController, "decidim/admin/features/base_controller"
9 | end
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/decidim-assemblies/app/controllers/decidim/assemblies/admin/application_controller.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Decidim
4 | module Assemblies
5 | module Admin
6 | # The main admin application controller for assemblies
7 | class ApplicationController < Decidim::Admin::ApplicationController
8 | end
9 | end
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/decidim-assemblies/lib/decidim/assemblies.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | require "decidim/assemblies/admin"
4 | require "decidim/assemblies/engine"
5 | require "decidim/assemblies/admin_engine"
6 | require "decidim/assemblies/participatory_space"
7 |
8 | module Decidim
9 | # Base module for the assemblies engine.
10 | module Assemblies
11 | end
12 | end
13 |
--------------------------------------------------------------------------------
/decidim-core/app/controllers/decidim/devise/confirmations_controller.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Decidim
4 | module Devise
5 | # Custom Devise ConfirmationsController to avoid namespace problems.
6 | class ConfirmationsController < ::Devise::ConfirmationsController
7 | include Decidim::DeviseControllers
8 | end
9 | end
10 | end
11 |
--------------------------------------------------------------------------------
/decidim-core/spec/lib/events/base_event_spec.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | require "spec_helper"
4 |
5 | module Decidim
6 | describe Events::BaseEvent do
7 | describe ".types" do
8 | subject { described_class }
9 |
10 | it "returns an empty array" do
11 | expect(subject.types).to eq []
12 | end
13 | end
14 | end
15 | end
16 |
--------------------------------------------------------------------------------
/decidim-participatory_processes/app/views/decidim/participatory_processes/participatory_process_steps/_timeline.html.erb:
--------------------------------------------------------------------------------
1 |
2 | <% past_step = true %>
3 | <% current_participatory_process.steps.each do |step| %>
4 | <%= render step, step_status_class: step_class(step, past_step) %>
5 | <% past_step = false if step.active? %>
6 | <% end %>
7 |
8 |
--------------------------------------------------------------------------------
/tslint.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": ["tslint:recommended", "tslint-react"],
3 | "rules": {
4 | "no-unused-expression": true,
5 | "no-var-requires": false,
6 | "object-literal-sort-keys": false,
7 | "interface-name": [true, "never-prefix"],
8 | "max-line-length": [false],
9 | "jsx-no-multiline-js": false
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/decidim-accountability/app/assets/images/decidim/accountability/icon.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/decidim-accountability/db/migrate/20170508104902_add_description_and_progress_to_statuses.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddDescriptionAndProgressToStatuses < ActiveRecord::Migration[5.0]
4 | def change
5 | add_column :decidim_accountability_statuses, :description, :jsonb
6 | add_column :decidim_accountability_statuses, :progress, :integer
7 | end
8 | end
9 |
--------------------------------------------------------------------------------
/decidim-admin/app/views/decidim/admin/organization_appearance/edit.html.erb:
--------------------------------------------------------------------------------
1 | <%= decidim_form_for(@form, html: { class: "form edit_organization_appearance" }, url: organization_appearance_path, method: :put) do |f| %>
2 | <%= render partial: 'form', object: f %>
3 |
4 | <%= f.submit t(".update") %>
5 |
6 | <% end %>
7 |
8 |
--------------------------------------------------------------------------------
/decidim-api/app/views/decidim/api/documentation/show.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
<%= current_organization.name %> API documentation
3 | <%=link_to "Explore the API interactively with GraphiQL", graphiql_path %>
4 |
5 |
6 |
7 |
8 |
11 |
--------------------------------------------------------------------------------
/decidim-system/app/mailers/decidim/system/application_mailer.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Decidim
4 | module System
5 | # Custom application mailer, scoped to the system mailer.
6 | #
7 | class ApplicationMailer < ActionMailer::Base
8 | default from: Decidim.config.mailer_sender
9 | layout "mailer"
10 | end
11 | end
12 | end
13 |
--------------------------------------------------------------------------------
/decidim-accountability/app/views/decidim/accountability/admin/timeline_entries/new.html.erb:
--------------------------------------------------------------------------------
1 | <%= decidim_form_for([result, @form], html: { class: "form new_timeline_entry" }) do |f| %>
2 | <%= render partial: 'form', object: f, locals: { title: t('.title') } %>
3 |
4 |
5 | <%= f.submit t(".create") %>
6 |
7 | <% end %>
8 |
9 |
--------------------------------------------------------------------------------
/decidim-admin/app/assets/stylesheets/decidim/admin/vendor/mathsass/functions/_csc.scss:
--------------------------------------------------------------------------------
1 | // Returns the cosecant of a number.
2 | // @param {Number} $x A number in rad or deg. Assuming unitless number to be in rad.
3 | // @example
4 | // csc(1.0472) // 1.1547
5 | // csc(60deg) // 1.1547
6 | @function csc ($x) {
7 | $x: unitless-rad($x);
8 | @return 1 / sin($x);
9 | }
10 |
--------------------------------------------------------------------------------
/decidim-admin/app/assets/stylesheets/decidim/admin/vendor/mathsass/functions/_sec.scss:
--------------------------------------------------------------------------------
1 | // Returns the secant of a number.
2 | // @param {Number} $x A number in rad or deg. Assuming unitless number to be in rad.
3 | // @example
4 | // sec(0.7854) // 1.41422
5 | // sec(45deg) // 1.41422
6 | @function sec ($x) {
7 | $x: unitless-rad($x);
8 | @return 1 / cos($x);
9 | }
10 |
--------------------------------------------------------------------------------
/decidim-admin/app/views/decidim/admin/users/_form.html.erb:
--------------------------------------------------------------------------------
1 |
2 | <%= form.text_field :name, label: t('.name') %>
3 |
4 |
5 |
6 | <%= form.email_field :email, label: t('.email') %>
7 |
8 |
9 |
10 | <%= form.select :role, @form.available_roles_for_select, label: t('.role') %>
11 |
12 |
--------------------------------------------------------------------------------
/decidim-assemblies/app/queries/decidim/assemblies/promoted_assemblies.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Decidim
4 | module Assemblies
5 | # This query filters assemblies so only promoted ones are returned.
6 | class PromotedAssemblies < Rectify::Query
7 | def query
8 | Decidim::Assembly.promoted
9 | end
10 | end
11 | end
12 | end
13 |
--------------------------------------------------------------------------------
/decidim-core/app/views/decidim/application/_attachments.html.erb:
--------------------------------------------------------------------------------
1 | <% if attached_to.attachments.any? %>
2 |
3 |
4 | <%= render partial: "documents", locals: { documents: attached_to.documents } %>
5 | <%= render partial: "photos", locals: { photos: attached_to.photos } %>
6 |
7 |
8 | <% end %>
9 |
--------------------------------------------------------------------------------
/decidim-core/app/views/devise/mailer/reset_password_instructions.html.erb:
--------------------------------------------------------------------------------
1 |
<%= t('.greeting', recipient: @resource.email) %>
2 |
3 |
<%= t('.instruction') %>
4 |
5 |
<%= link_to t('.action'), edit_password_url(@resource, reset_password_token: @token, host: @resource.organization.host) %>
6 |
7 |
<%= t('.instruction_2') %>
8 |
<%= t('.instruction_3') %>
9 |
--------------------------------------------------------------------------------
/decidim-core/db/migrate/20161110105712_create_decidim_features.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class CreateDecidimFeatures < ActiveRecord::Migration[5.0]
4 | def change
5 | create_table :decidim_features do |t|
6 | t.string :manifest_name
7 | t.jsonb :name
8 | t.references :decidim_participatory_process, index: true
9 | end
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/decidim-participatory_processes/spec/features/admin/admin_manages_participatory_process_steps_spec.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | require "spec_helper"
4 |
5 | describe "Admin manages participatory process steps", type: :feature do
6 | include_context "when admin administrating a participatory process"
7 |
8 | it_behaves_like "manage process steps examples"
9 | end
10 |
--------------------------------------------------------------------------------
/decidim-system/app/helpers/decidim/system/application_helper.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Decidim
4 | module System
5 | # Custom helpers, scoped to the system panel.
6 | #
7 | module ApplicationHelper
8 | include Decidim::LocalizedLocalesHelper
9 |
10 | def title
11 | "Decidim"
12 | end
13 | end
14 | end
15 | end
16 |
--------------------------------------------------------------------------------
/decidim-verifications/lib/decidim/verifications/id_documents/admin.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Decidim
4 | module Verifications
5 | module IdDocuments
6 | # This module contains all the domain logic associated to Decidim's
7 | # identity documents authorization admin panel.
8 | module Admin
9 | end
10 | end
11 | end
12 | end
13 |
--------------------------------------------------------------------------------
/decidim-verifications/lib/decidim/verifications/postal_letter/admin.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Decidim
4 | module Verifications
5 | module PostalLetter
6 | # This module contains all the domain logic associated to Decidim's
7 | # postal letter authorization admin panel.
8 | module Admin
9 | end
10 | end
11 | end
12 | end
13 |
--------------------------------------------------------------------------------
/decidim-accountability/app/views/decidim/accountability/admin/timeline_entries/edit.html.erb:
--------------------------------------------------------------------------------
1 | <%= decidim_form_for([result, @form], html: { class: "form edit_timeline_entry" }) do |f| %>
2 | <%= render partial: 'form', object: f, locals: { title: t('.title') } %>
3 |
4 |
5 | <%= f.submit t(".update") %>
6 |
7 | <% end %>
8 |
9 |
--------------------------------------------------------------------------------
/decidim-accountability/spec/models/timeline_entry_spec.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | require "spec_helper"
4 |
5 | module Decidim
6 | module Accountability
7 | describe TimelineEntry do
8 | subject { timeline_entry }
9 |
10 | let(:timeline_entry) { build :timeline_entry }
11 |
12 | it { is_expected.to be_valid }
13 | end
14 | end
15 | end
16 |
--------------------------------------------------------------------------------
/decidim-admin/app/assets/stylesheets/decidim/admin/vendor/mathsass/functions/_cot.scss:
--------------------------------------------------------------------------------
1 | // Returns the cotangent of a number.
2 | // @param {Number} $x A number in rad or deg. Assuming unitless number to be in rad.
3 | // @example
4 | // cot(0.5236) // 1.73205
5 | // cot(30deg) // 1.73205
6 | @function cot ($x) {
7 | $x: unitless-rad($x);
8 | @return 1 / tan($x);
9 | }
10 |
--------------------------------------------------------------------------------
/decidim-admin/app/assets/stylesheets/decidim/admin/vendor/mathsass/functions/_sin.scss:
--------------------------------------------------------------------------------
1 | // Returns the sine of a number.
2 | // @param {Number} $x A number in rad or deg. Assuming unitless number to be in rad.
3 | // @example
4 | // sin(1.0472) // 0.86603
5 | // sin(60deg) // 0.86603
6 | @function sin ($x) {
7 | $x: unitless-rad($x);
8 | @return cos($x - $PI / 2);
9 | }
10 |
--------------------------------------------------------------------------------
/decidim-core/app/forms/decidim/attachment_form.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Decidim
4 | # A form object used to create attachments.
5 | #
6 | class AttachmentForm < Form
7 | attribute :title, String
8 | attribute :file
9 |
10 | mimic :attachment
11 |
12 | validates :title, presence: true, if: ->(form) { form.file.present? }
13 | end
14 | end
15 |
--------------------------------------------------------------------------------
/decidim-core/app/helpers/decidim/cookies_helper.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Decidim
4 | # This module includes helpers to verify the acceptance of the cookie policy
5 | module CookiesHelper
6 | # Public: Returns true if the cookie policy has been accepted
7 | def cookies_accepted?
8 | cookies["decidim-cc"].present?
9 | end
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/decidim-pages/db/migrate/20161116121353_create_decidim_pages.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class CreateDecidimPages < ActiveRecord::Migration[5.0]
4 | def change
5 | create_table :decidim_pages_pages do |t|
6 | t.jsonb :title
7 | t.jsonb :body
8 | t.references :decidim_feature, index: true
9 |
10 | t.timestamps
11 | end
12 | end
13 | end
14 |
--------------------------------------------------------------------------------
/decidim-participatory_processes/db/migrate/20170116135237_loosen_step_requirements.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class LoosenStepRequirements < ActiveRecord::Migration[5.0]
4 | def change
5 | change_column_null(:decidim_participatory_process_steps, :short_description, true)
6 | change_column_null(:decidim_participatory_process_steps, :description, true)
7 | end
8 | end
9 |
--------------------------------------------------------------------------------
/decidim-participatory_processes/spec/features/admin/admin_manages_participatory_process_admins_spec.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | require "spec_helper"
4 |
5 | describe "Admin manages participatory process admins", type: :feature do
6 | include_context "when admin administrating a participatory process"
7 |
8 | it_behaves_like "manage process admins examples"
9 | end
10 |
--------------------------------------------------------------------------------
/decidim-system/app/views/decidim/system/admins/show.html.erb:
--------------------------------------------------------------------------------
1 | <% provide :title do %>
2 |
<%= link_to @admin.email, @admin %>
3 | <% end %>
4 |
5 |
6 |
7 | <%= link_to "Edit", ['edit', @admin] %>
8 | <%= link_to "Destroy", @admin, method: :delete, class: "alert button", data: { confirm: "Are you sure you want to do this?" } %>
9 |
10 |
--------------------------------------------------------------------------------
/decidim-accountability/app/assets/javascripts/decidim/accountability/accountability.js.es6:
--------------------------------------------------------------------------------
1 | // = require_self
2 |
3 | $(() => {
4 | // Show category list on click when we are on a small scren
5 | if ($(window).width() < 768) {
6 | $('.category--section').click((event) => {
7 | $(event.currentTarget).next('.category--elements').toggleClass('active');
8 | });
9 | }
10 | })
11 |
--------------------------------------------------------------------------------
/decidim-accountability/spec/models/status_spec.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | require "spec_helper"
4 |
5 | module Decidim
6 | module Accountability
7 | describe Status do
8 | subject { status }
9 |
10 | let(:status) { build :status }
11 |
12 | it { is_expected.to be_valid }
13 |
14 | include_examples "has feature"
15 | end
16 | end
17 | end
18 |
--------------------------------------------------------------------------------
/decidim-admin/app/assets/stylesheets/decidim/admin/vendor/mathsass/functions/_tan.scss:
--------------------------------------------------------------------------------
1 | // Returns the tangent of a number.
2 | // @param {Number} $x A number in rad or deg. Assuming unitless number to be in rad.
3 | // @example
4 | // tan(0.5236) // 0.57735
5 | // tan(30deg) // 0.57735
6 | @function tan ($x) {
7 | $x: unitless-rad($x);
8 | @return sin($x) / cos($x);
9 | }
10 |
--------------------------------------------------------------------------------
/decidim-admin/app/forms/decidim/admin/managed_user_promotion_form.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Decidim
4 | module Admin
5 | # A form object used to promote managed users from the admin dashboard.
6 | #
7 | class ManagedUserPromotionForm < Form
8 | attribute :email, String
9 |
10 | validates :email, presence: true
11 | end
12 | end
13 | end
14 |
--------------------------------------------------------------------------------
/decidim-budgets/app/helpers/decidim/budgets/application_helper.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Decidim
4 | module Budgets
5 | # Custom helpers, scoped to the budgets engine.
6 | #
7 | module ApplicationHelper
8 | include PaginateHelper
9 | include Decidim::Comments::CommentsHelper
10 | include ProjectsHelper
11 | end
12 | end
13 | end
14 |
--------------------------------------------------------------------------------
/decidim-budgets/db/migrate/20170215132708_add_reference_to_projects.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddReferenceToProjects < ActiveRecord::Migration[5.0]
4 | def change
5 | add_column :decidim_budgets_projects, :reference, :string
6 | Decidim::Budgets::Project.find_each(&:save)
7 | change_column_null :decidim_budgets_projects, :reference, false
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/decidim-comments/app/frontend/support/generate_user_data.ts:
--------------------------------------------------------------------------------
1 | import { name } from "faker/locale/en";
2 |
3 | /**
4 | * Generate random user data to emulate a database real content
5 | * @returns {Object} - An object representing user data
6 | */
7 | const generateUserData = () => {
8 | return {
9 | name: name.findName(),
10 | };
11 | };
12 |
13 | export default generateUserData;
14 |
--------------------------------------------------------------------------------
/decidim-participatory_processes/db/migrate/20170404132616_change_steps_end_and_start_date_to_date.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class ChangeStepsEndAndStartDateToDate < ActiveRecord::Migration[5.0]
4 | def change
5 | change_column :decidim_participatory_process_steps, :start_date, :date
6 | change_column :decidim_participatory_process_steps, :end_date, :date
7 | end
8 | end
9 |
--------------------------------------------------------------------------------
/decidim-admin/app/views/decidim/admin/attachments/new.html.erb:
--------------------------------------------------------------------------------
1 | <%= decidim_form_for(@form, url: url_for([attached_to, @form]), html: { class: "form new_attachment" }) do |f| %>
2 | <%= render partial: 'decidim/admin/attachments/form', object: f, locals: { title: t(".title") } %>
3 |
4 |
5 | <%= f.submit t(".create") %>
6 |
7 | <% end %>
8 |
--------------------------------------------------------------------------------
/decidim-core/app/mailers/decidim/application_mailer.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Decidim
4 | # Main application mailer configuration. Inherit from this to create new
5 | # mailers.
6 | class ApplicationMailer < ActionMailer::Base
7 | include LocalisedMailer
8 |
9 | default from: Decidim.config.mailer_sender
10 | layout "decidim/mailer"
11 | end
12 | end
13 |
--------------------------------------------------------------------------------
/decidim-dev/lib/decidim/dev/test/rspec_support/attachments.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | RSpec.configure do |config|
4 | config.around(:each, :processing_uploads_for) do |example|
5 | uploader = example.metadata[:processing_uploads_for]
6 |
7 | uploader.enable_processing = true
8 |
9 | example.run
10 |
11 | uploader.enable_processing = false
12 | end
13 | end
14 |
--------------------------------------------------------------------------------
/decidim-participatory_processes/spec/shared/participatory_process_administration_by_admin_shared_context.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | shared_context "when admin administrating a participatory process" do
4 | let!(:user) do
5 | create(:user, :admin, :confirmed, organization: organization)
6 | end
7 |
8 | include_context "when administrating a participatory process"
9 | end
10 |
--------------------------------------------------------------------------------
/decidim-proposals/db/migrate/20170113114245_add_text_search_indexes.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddTextSearchIndexes < ActiveRecord::Migration[5.0]
4 | def change
5 | add_index :decidim_proposals_proposals, :title, name: "decidim_proposals_proposal_title_search"
6 | add_index :decidim_proposals_proposals, :body, name: "decidim_proposals_proposal_body_search"
7 | end
8 | end
9 |
--------------------------------------------------------------------------------
/decidim-surveys/app/views/decidim/surveys/admin/surveys/edit.html.erb:
--------------------------------------------------------------------------------
1 | <%= decidim_form_for(@form, url: survey_path, method: :post, html: { class: "form edit_survey" }) do |form| %>
2 | <%= render partial: 'form', object: form, locals: { title: t('.title') } %>
3 |
4 |
5 | <%= form.submit t(".save"), class: "button" %>
6 |
7 | <% end %>
8 |
--------------------------------------------------------------------------------
/decidim-surveys/db/migrate/20170515090916_create_decidim_survey_questions.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class CreateDecidimSurveyQuestions < ActiveRecord::Migration[5.0]
4 | def change
5 | create_table :decidim_surveys_survey_questions do |t|
6 | t.jsonb :body
7 | t.references :decidim_survey, index: true
8 |
9 | t.timestamps
10 | end
11 | end
12 | end
13 |
--------------------------------------------------------------------------------
/decidim-accountability/app/assets/javascripts/decidim/accountability/admin/accountability_admin.js:
--------------------------------------------------------------------------------
1 | // = require_self
2 |
3 | $("#result_decidim_accountability_status_id").change(function () {
4 | /* eslint-disable no-invalid-this */
5 | const progress = $(this).find(':selected').data('progress')
6 | if (progress || progress === 0) {
7 | $("#result_progress").val(progress);
8 | }
9 | });
10 |
--------------------------------------------------------------------------------
/decidim-comments/app/frontend/support/require_all.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Given a webpack require context it require all the files
3 | * @param {Object} requireContext - A webpack require context
4 | * @returns {Object[]} - An array of webpack modules
5 | */
6 | const requireAll = (requireContext: any) => {
7 | return requireContext.keys().map(requireContext);
8 | };
9 |
10 | export default requireAll;
11 |
--------------------------------------------------------------------------------
/decidim-comments/db/migrate/20170510091409_set_root_commentable_null_constraints.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class SetRootCommentableNullConstraints < ActiveRecord::Migration[5.0]
4 | def change
5 | change_column_null(:decidim_comments_comments, :decidim_root_commentable_id, false)
6 | change_column_null(:decidim_comments_comments, :decidim_root_commentable_type, false)
7 | end
8 | end
9 |
--------------------------------------------------------------------------------
/decidim-core/app/controllers/decidim/errors_controller.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Decidim
4 | class ErrorsController < Decidim::ApplicationController
5 | skip_authorization_check
6 |
7 | def not_found
8 | render status: :not_found
9 | end
10 |
11 | def internal_server_error
12 | render status: :internal_server_error
13 | end
14 | end
15 | end
16 |
--------------------------------------------------------------------------------
/decidim-core/app/forms/decidim/report_form.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Decidim
4 | # A form object to be used when public users want to report a reportable.
5 | class ReportForm < Decidim::Form
6 | mimic :report
7 |
8 | attribute :reason, String
9 | attribute :details, String
10 |
11 | validates :reason, inclusion: { in: Report::REASONS }
12 | end
13 | end
14 |
--------------------------------------------------------------------------------
/decidim-core/db/migrate/20170713131206_add_admin_to_users.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddAdminToUsers < ActiveRecord::Migration[5.1]
4 | def up
5 | add_column :decidim_users, :admin, :boolean, null: false, default: false
6 |
7 | execute <<~SQL
8 | UPDATE decidim_users
9 | SET admin = true
10 | WHERE roles @> '{admin}'
11 | SQL
12 | end
13 | end
14 |
--------------------------------------------------------------------------------
/decidim-meetings/app/views/decidim/meetings/admin/meeting_closes/edit.html.erb:
--------------------------------------------------------------------------------
1 | <%= decidim_form_for(@form, url: meeting_meeting_close_path(meeting, @form), html: { class: "form edit_close_meeting" }) do |f| %>
2 | <%= render partial: 'form', object: f, locals: { title: t('.title') } %>
3 |
4 |
5 | <%= f.submit t(".close") %>
6 |
7 | <% end %>
8 |
--------------------------------------------------------------------------------
/decidim-participatory_processes/db/migrate/20170830081725_add_start_date_to_processes.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddStartDateToProcesses < ActiveRecord::Migration[5.1]
4 | def change
5 | add_column :decidim_participatory_processes, :start_date, :date
6 | ActiveRecord::Base.connection.execute("UPDATE decidim_participatory_processes SET start_date = created_at")
7 | end
8 | end
9 |
--------------------------------------------------------------------------------
/decidim-participatory_processes/spec/features/admin/admin_manages_participatory_process_attachments_spec.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | require "spec_helper"
4 |
5 | describe "Admin manages participatory process attachments", type: :feature do
6 | include_context "when admin administrating a participatory process"
7 |
8 | it_behaves_like "manage process attachments examples"
9 | end
10 |
--------------------------------------------------------------------------------
/decidim-proposals/spec/commands/decidim/proposals/admin_create_proposal_spec.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | require "spec_helper"
4 |
5 | module Decidim
6 | module Proposals
7 | module Admin
8 | describe CreateProposal do
9 | let(:form_klass) { ProposalForm }
10 |
11 | it_behaves_like "create a proposal", false
12 | end
13 | end
14 | end
15 | end
16 |
--------------------------------------------------------------------------------
/codecov.yml:
--------------------------------------------------------------------------------
1 | ---
2 |
3 | coverage:
4 | precision: 2
5 | round: down
6 | range: 70...100
7 |
8 | status:
9 | project:
10 | default:
11 | threshold: 1%
12 |
13 | patch:
14 | default:
15 | target: 50%
16 |
17 | changes: false
18 |
19 | comment:
20 | layout: "header, diff"
21 | behavior: default
22 |
23 | ignore:
24 | - package-lock.json
25 | - *.md
26 |
--------------------------------------------------------------------------------
/decidim-assemblies/spec/models/abilities/admin/admin_ability_spec.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | require "spec_helper"
4 |
5 | module Decidim::Assemblies
6 | describe Abilities::Admin::AdminAbility do
7 | subject { described_class.new(user, {}) }
8 |
9 | let(:user) { build(:user, :admin) }
10 |
11 | it { is_expected.to be_able_to(:manage, Decidim::Assembly) }
12 | end
13 | end
14 |
--------------------------------------------------------------------------------
/decidim-core/db/migrate/20170119145359_create_user_groups.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class CreateUserGroups < ActiveRecord::Migration[5.0]
4 | def change
5 | create_table :decidim_user_groups do |t|
6 | t.string :name, null: false
7 | t.string :document_number, null: false
8 | t.string :phone, null: false
9 |
10 | t.timestamps
11 | end
12 | end
13 | end
14 |
--------------------------------------------------------------------------------
/decidim-dev/lib/decidim/dev/test/rspec_support/database_cleaner.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | RSpec.configure do |config|
4 | config.before(:suite) do
5 | DatabaseCleaner.strategy = :truncation
6 | DatabaseCleaner.clean_with :truncation
7 | end
8 |
9 | config.around(:each) do |example|
10 | DatabaseCleaner.cleaning do
11 | example.run
12 | end
13 | end
14 | end
15 |
--------------------------------------------------------------------------------
/decidim-proposals/db/migrate/20170215132030_add_reference_to_proposals.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddReferenceToProposals < ActiveRecord::Migration[5.0]
4 | def change
5 | add_column :decidim_proposals_proposals, :reference, :string
6 | Decidim::Proposals::Proposal.find_each(&:save)
7 | change_column_null :decidim_proposals_proposals, :reference, false
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/decidim-core/app/controllers/decidim/own_user_groups_controller.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Decidim
4 | # The controller to handle managing the current user's
5 | # UserGroups.
6 | class OwnUserGroupsController < Decidim::ApplicationController
7 | include Decidim::UserProfile
8 |
9 | def index
10 | @user_groups = current_user.user_groups
11 | end
12 | end
13 | end
14 |
--------------------------------------------------------------------------------
/decidim-core/db/migrate/20161130105257_create_decidim_scopes.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class CreateDecidimScopes < ActiveRecord::Migration[5.0]
4 | def change
5 | create_table :decidim_scopes do |t|
6 | t.string :name, null: false, index: :uniqueness
7 | t.references :decidim_organization, foreign_key: true, index: true
8 | t.timestamps
9 | end
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/decidim-proposals/spec/factories.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | require "decidim/core/test/factories"
4 | require "decidim/participatory_processes/test/factories"
5 | require "decidim/assemblies/test/factories"
6 | require "decidim/comments/test/factories"
7 | require "decidim/meetings/test/factories"
8 | require "decidim/budgets/test/factories"
9 |
10 | require "decidim/proposals/test/factories"
11 |
--------------------------------------------------------------------------------
/decidim-admin/app/views/decidim/admin/attachments/edit.html.erb:
--------------------------------------------------------------------------------
1 | <%= decidim_form_for(@form, url: url_for([@attachment.attached_to, @attachment]), html: { class: "form edit_attachment" }) do |f| %>
2 | <%= render partial: 'decidim/admin/attachments/form', object: f, locals: { title: t(".title") } %>
3 |
4 |
5 | <%= f.submit t(".update") %>
6 |
7 | <% end %>
8 |
--------------------------------------------------------------------------------
/decidim-admin/app/views/decidim/admin/scopes/_form.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 | <%= form.translated :text_field, :name %>
4 |
5 |
6 |
7 |
8 | <%= form.text_field :code %>
9 |
10 |
11 | <%= form.collection_select :scope_type_id, organization_scope_types, :id, :name %>
12 |
13 |
14 |
--------------------------------------------------------------------------------
/decidim-budgets/spec/features/comments_spec.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | require "spec_helper"
4 |
5 | describe "Comments", type: :feature do
6 | let!(:feature) { create(:budget_feature, organization: organization) }
7 | let!(:commentable) { create(:project, feature: feature) }
8 |
9 | let(:resource_path) { resource_locator(commentable).path }
10 |
11 | include_examples "comments"
12 | end
13 |
--------------------------------------------------------------------------------
/decidim-comments/db/migrate/20170504085413_add_root_commentable_to_comments.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddRootCommentableToComments < ActiveRecord::Migration[5.0]
4 | def change
5 | change_table :decidim_comments_comments do |t|
6 | t.references :decidim_root_commentable, polymorphic: true, index: { name: "decidim_comments_comment_root_commentable" }
7 | end
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/decidim-pages/app/forms/decidim/pages/admin/page_form.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Decidim
4 | module Pages
5 | module Admin
6 | # This class holds a Form to update pages from Decidim's admin panel.
7 | class PageForm < Decidim::Form
8 | include TranslatableAttributes
9 |
10 | translatable_attribute :body, String
11 | end
12 | end
13 | end
14 | end
15 |
--------------------------------------------------------------------------------
/decidim-proposals/app/assets/images/decidim/proposals/icon.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/decidim-proposals/spec/forms/decidim/proposals/proposal_form_spec.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | require "spec_helper"
4 |
5 | module Decidim
6 | module Proposals
7 | describe ProposalForm do
8 | let(:params) do
9 | super.merge(
10 | user_group_id: user_group_id
11 | )
12 | end
13 |
14 | it_behaves_like "a proposal form"
15 | end
16 | end
17 | end
18 |
--------------------------------------------------------------------------------
/decidim-api/lib/decidim/api.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | require "decidim/api/engine"
4 |
5 | module Decidim
6 | # This module holds all business logic related to exposing a Public API for
7 | # decidim.
8 | module Api
9 | autoload :MutationType, "decidim/api/mutation_type"
10 | autoload :QueryType, "decidim/api/query_type"
11 | autoload :Schema, "decidim/api/schema"
12 | end
13 | end
14 |
--------------------------------------------------------------------------------
/decidim-assemblies/spec/commands/create_category_spec.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | require "spec_helper"
4 | require "decidim/admin/test/commands/create_category_examples"
5 |
6 | module Decidim::Admin
7 | describe CreateCategory do
8 | include_examples "CreateCategory command" do
9 | let(:participatory_space) { create(:assembly, organization: organization) }
10 | end
11 | end
12 | end
13 |
--------------------------------------------------------------------------------
/decidim-assemblies/spec/commands/destroy_category_spec.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | require "spec_helper"
4 | require "decidim/admin/test/commands/destroy_category_examples"
5 |
6 | module Decidim::Admin
7 | describe DestroyCategory do
8 | include_examples "DestroyCategory command" do
9 | let(:participatory_space) { create(:assembly, organization: organization) }
10 | end
11 | end
12 | end
13 |
--------------------------------------------------------------------------------
/decidim-assemblies/spec/commands/update_category_spec.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | require "spec_helper"
4 | require "decidim/admin/test/commands/update_category_examples"
5 |
6 | module Decidim::Admin
7 | describe UpdateCategory do
8 | include_examples "UpdateCategory command" do
9 | let(:participatory_space) { create(:assembly, organization: organization) }
10 | end
11 | end
12 | end
13 |
--------------------------------------------------------------------------------
/decidim-core/app/views/kaminari/decidim/_gap.html.erb:
--------------------------------------------------------------------------------
1 | <%# Non-link tag that stands for skipped pages...
2 | - available local variables
3 | current_page: a page object for the currently displayed page
4 | total_pages: total number of pages
5 | per_page: number of items to fetch per page
6 | remote: data-remote
7 | -%>
8 |
<%= t('views.pagination.truncate').html_safe %>
9 |
--------------------------------------------------------------------------------
/decidim-core/db/migrate/20170207093048_add_organization_logo_and_url.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddOrganizationLogoAndUrl < ActiveRecord::Migration[5.0]
4 | def change
5 | add_column :decidim_organizations, :official_img_header, :string
6 | add_column :decidim_organizations, :official_img_footer, :string
7 | add_column :decidim_organizations, :official_url, :string
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/decidim-core/db/migrate/20171011194251_add_verification_metadata_to_authorizations.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddVerificationMetadataToAuthorizations < ActiveRecord::Migration[5.1]
4 | def up
5 | add_column :decidim_authorizations, :verification_metadata, :jsonb, default: {}
6 | end
7 |
8 | def down
9 | remove_column :decidim_authorizations, :verification_metadata
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/decidim-participatory_processes/app/controllers/decidim/participatory_processes/admin/application_controller.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Decidim
4 | module ParticipatoryProcesses
5 | module Admin
6 | # The main admin application controller for participatory processes
7 | class ApplicationController < Decidim::Admin::ApplicationController
8 | end
9 | end
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/decidim-system/lib/decidim/system.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | require "decidim/system/engine"
4 |
5 | module Decidim
6 | # This module contains all the logic related to a system-wide
7 | # administration panel. The scope of the domain is to be able
8 | # to manage Organizations (tenants), as well as have a bird's
9 | # eye view of the whole system.
10 | #
11 | module System
12 | end
13 | end
14 |
--------------------------------------------------------------------------------
/decidim-accountability/app/views/decidim/accountability/results/home.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 | <%= render partial: "home_header" %>
4 | <%= render partial: "scope_filters", locals: { url_method: :root_path} %>
5 | <%= render partial: "home_categories" %>
6 |
7 |
8 |
9 | <%= javascript_include_tag "decidim/accountability/accountability" %>
10 |
--------------------------------------------------------------------------------
/decidim-accountability/db/migrate/20170425154712_create_accountability_statuses.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class CreateAccountabilityStatuses < ActiveRecord::Migration[5.0]
4 | def change
5 | create_table :decidim_accountability_statuses do |t|
6 | t.string :key
7 | t.jsonb :name
8 | t.references :decidim_feature, index: true
9 |
10 | t.timestamps
11 | end
12 | end
13 | end
14 |
--------------------------------------------------------------------------------
/decidim-assemblies/app/controllers/decidim/assemblies/categories_controller.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Decidim
4 | module Assemblies
5 | module Admin
6 | # Controller that allows managing categories for assemblies.
7 | #
8 | class CategoriesController < Decidim::Admin::CategoriesController
9 | include Concerns::AssemblyAdmin
10 | end
11 | end
12 | end
13 | end
14 |
--------------------------------------------------------------------------------
/decidim-assemblies/app/queries/decidim/assemblies/prioritized_assemblies.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Decidim
4 | module Assemblies
5 | # This query orders assemblies by importance, prioritizing promoted
6 | # assemblies.
7 | class PrioritizedAssemblies < Rectify::Query
8 | def query
9 | Decidim::Assembly.order(promoted: :desc)
10 | end
11 | end
12 | end
13 | end
14 |
--------------------------------------------------------------------------------
/decidim-assemblies/spec/models/abilities/admin_ability_spec.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | require "spec_helper"
4 |
5 | module Decidim::Assemblies
6 | describe Abilities::AdminAbility do
7 | subject { described_class.new(user, context) }
8 |
9 | let(:user) { build(:user, :admin) }
10 | let(:context) { {} }
11 |
12 | it { is_expected.to be_able_to(:read, Decidim::Assembly) }
13 | end
14 | end
15 |
--------------------------------------------------------------------------------
/decidim-core/app/assets/stylesheets/decidim/modules/_video.scss:
--------------------------------------------------------------------------------
1 | .embed-container {
2 | position: relative;
3 | padding-bottom: 56.25%;
4 | height: 0;
5 | overflow: hidden;
6 | max-width: 100%;
7 | }
8 |
9 | .embed-container iframe,
10 | .embed-container object,
11 | .embed-container embed {
12 | position: absolute;
13 | top: 0;
14 | left: 0;
15 | width: 100%;
16 | height: 100%;
17 | border: none;
18 | }
19 |
--------------------------------------------------------------------------------
/decidim-core/app/models/decidim/user_group_membership.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Decidim
4 | # A UserGroupMembership associate user with user groups
5 | class UserGroupMembership < ApplicationRecord
6 | belongs_to :user, class_name: "Decidim::User", foreign_key: :decidim_user_id
7 | belongs_to :user_group, class_name: "Decidim::UserGroup", foreign_key: :decidim_user_group_id
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/decidim-core/db/migrate/20170202084913_add_comments_and_replies_notifications_to_users.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddCommentsAndRepliesNotificationsToUsers < ActiveRecord::Migration[5.0]
4 | def change
5 | add_column :decidim_users, :comments_notifications, :boolean, null: false, default: false
6 | add_column :decidim_users, :replies_notifications, :boolean, null: false, default: false
7 | end
8 | end
9 |
--------------------------------------------------------------------------------
/decidim-pages/app/views/decidim/pages/admin/pages/_form.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 |
<%= title %>
4 |
5 |
6 |
7 | <%= form.translated :editor, :body, toolbar: :full, lines: 30, label: t("models.components.body", scope: "decidim.pages.admin") %>
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/docs/testing.md:
--------------------------------------------------------------------------------
1 | # How to test Decidim engines
2 |
3 | ## Requirements
4 |
5 | You need to create a dummy application to run your tests. Run the following command in the decidim root's folder:
6 |
7 | ```bash
8 | bundle exec rake test_app
9 | ```
10 |
11 | ## Running the test suite
12 |
13 | A Decidim engine can be tested running the following command inside its folder:
14 |
15 | ```bash
16 | bundle exec rake
17 | ```
18 |
--------------------------------------------------------------------------------
/decidim-admin/app/views/decidim/admin/categories/edit.html.erb:
--------------------------------------------------------------------------------
1 | <%= decidim_form_for(@form, url: category_path(@category.participatory_space, @category), html: { class: "form edit_category" }) do |f| %>
2 | <%= render partial: 'form', object: f, locals: { title: t('.title') } %>
3 |
4 |
5 | <%= f.submit t("categories.edit.update", scope: "decidim.admin") %>
6 |
7 | <% end %>
8 |
--------------------------------------------------------------------------------
/decidim-admin/app/views/decidim/admin/static_pages/_form.html.erb:
--------------------------------------------------------------------------------
1 |
2 | <%= form.translated :text_field, :title, autofocus: true %>
3 |
4 |
5 | <% if can? :update_slug, form.object %>
6 |
7 | <%= form.text_field :slug %>
8 |
9 | <% end %>
10 |
11 |
12 | <%= form.translated :editor, :content, toolbar: :full, lines: 25 %>
13 |
14 |
--------------------------------------------------------------------------------
/decidim-assemblies/app/controllers/decidim/assemblies/admin/categories_controller.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Decidim
4 | module Assemblies
5 | module Admin
6 | # Controller that allows managing categories for assemblies.
7 | #
8 | class CategoriesController < Decidim::Admin::CategoriesController
9 | include Concerns::AssemblyAdmin
10 | end
11 | end
12 | end
13 | end
14 |
--------------------------------------------------------------------------------
/decidim-assemblies/app/controllers/decidim/assemblies/admin/moderations_controller.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Decidim
4 | module Assemblies
5 | module Admin
6 | # This controller allows admins to manage moderations in an assembly.
7 | class ModerationsController < Decidim::Admin::ModerationsController
8 | include Concerns::AssemblyAdmin
9 | end
10 | end
11 | end
12 | end
13 |
--------------------------------------------------------------------------------
/decidim-comments/lib/decidim/comments/api/add_comment_type.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Decidim
4 | module Comments
5 | # This type represents a mutation to create new comments.
6 | AddCommentType = GraphQL::ObjectType.define do
7 | name "Add comment"
8 | description "Add a new comment"
9 |
10 | field :comment, CommentType, "The new created comment"
11 | end
12 | end
13 | end
14 |
--------------------------------------------------------------------------------
/decidim-core/app/assets/javascripts/decidim/select2.js.es6:
--------------------------------------------------------------------------------
1 | // = require select2
2 | // = require select2_locale_es
3 | // = require select2_locale_eu
4 | // = require select2_locale_ca
5 | // = require select2_locale_fi
6 | // = require select2_locale_fr
7 | // = require select2_locale_it
8 | // = require select2_locale_nl
9 | // = require select2_locale_pt
10 | // = require select2_locale_uk
11 | // = require select2_locale_ru
12 |
--------------------------------------------------------------------------------
/decidim-core/app/assets/stylesheets/decidim/modules/_reveal.scss:
--------------------------------------------------------------------------------
1 | /* Reveal foundation overwrites*/
2 |
3 | @include breakpoint(small down){
4 | .reveal{
5 | width: 95%;
6 | left: 2.5%;
7 | top: 2rem;
8 | height: auto;
9 | min-height: auto;
10 | }
11 | }
12 |
13 | .reveal__header{
14 | border-bottom: $border;
15 | margin-bottom: 1rem;
16 | }
17 |
18 | .reveal__title{
19 | margin-top: -6px;
20 | }
21 |
--------------------------------------------------------------------------------
/decidim-proposals/db/migrate/20170131092413_add_answers_to_proposals.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddAnswersToProposals < ActiveRecord::Migration[5.0]
4 | def change
5 | add_column :decidim_proposals_proposals, :state, :string, index: true
6 | add_column :decidim_proposals_proposals, :answered_at, :datetime, index: true
7 | add_column :decidim_proposals_proposals, :answer, :jsonb
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/decidim-proposals/db/migrate/20170228105156_add_geolocalization_fields_to_proposals.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddGeolocalizationFieldsToProposals < ActiveRecord::Migration[5.0]
4 | def change
5 | add_column :decidim_proposals_proposals, :address, :text
6 | add_column :decidim_proposals_proposals, :latitude, :float
7 | add_column :decidim_proposals_proposals, :longitude, :float
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/decidim-system/db/seeds.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | if !Rails.env.production? || ENV["SEED"]
4 | Decidim::System::Admin.find_or_initialize_by(email: "system@example.org").update!(
5 | password: "decidim123456",
6 | password_confirmation: "decidim123456"
7 | )
8 |
9 | Decidim::Organization.find_each do |organization|
10 | Decidim::System::CreateDefaultPages.call(organization)
11 | end
12 | end
13 |
--------------------------------------------------------------------------------
/decidim-assemblies/spec/helpers/decidim/scopes_helper_spec.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | require "spec_helper"
4 |
5 | describe Decidim::ScopesHelper do
6 | let(:participatory_space) do
7 | create(
8 | :assembly,
9 | organization: organization,
10 | scopes_enabled: scopes_enabled,
11 | scope: participatory_space_scope
12 | )
13 | end
14 |
15 | include_examples "scope helpers"
16 | end
17 |
--------------------------------------------------------------------------------
/decidim-core/app/models/decidim/follow.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Decidim
4 | class Follow < ApplicationRecord
5 | belongs_to :followable, foreign_key: "decidim_followable_id", foreign_type: "decidim_followable_type", polymorphic: true
6 | belongs_to :user, foreign_key: "decidim_user_id", class_name: "Decidim::User"
7 |
8 | validates :user, uniqueness: { scope: [:followable] }
9 | end
10 | end
11 |
--------------------------------------------------------------------------------
/decidim-core/app/views/layouts/decidim/_user_menu.html.erb:
--------------------------------------------------------------------------------
1 |
<%= link_to t(".profile"), decidim.account_path %>
2 |
<%= link_to t(".notifications"), decidim.notifications_path %>
3 | <% if can? :read, :admin_dashboard %>
4 |
<%= link_to t(".admin_dashboard"), decidim_admin.root_path %>
5 | <% end %>
6 |
<%= link_to t(".sign_out"), decidim.destroy_user_session_path, method: :delete, class: "sign-out-link" %>
7 |
--------------------------------------------------------------------------------
/decidim-core/db/migrate/20161123085134_add_categories.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddCategories < ActiveRecord::Migration[5.0]
4 | def change
5 | create_table :decidim_categories do |t|
6 | t.jsonb :name, null: false
7 | t.jsonb :description, null: false
8 | t.integer :parent_id, index: true
9 | t.integer :decidim_participatory_process_id, index: true
10 | end
11 | end
12 | end
13 |
--------------------------------------------------------------------------------
/decidim-pages/lib/decidim/pages.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | require "decidim/pages/admin"
4 | require "decidim/pages/engine"
5 | require "decidim/pages/admin_engine"
6 | require "decidim/pages/feature"
7 |
8 | module Decidim
9 | # This namespace holds the logic of the `Pages` component. This component
10 | # allows the admins to create a custom page for a participatory process.
11 | module Pages
12 | end
13 | end
14 |
--------------------------------------------------------------------------------
/decidim-participatory_processes/app/queries/decidim/participatory_processes/published_participatory_processes.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Decidim
4 | module ParticipatoryProcesses
5 | # This query filters published processes only.
6 | class PublishedParticipatoryProcesses < Rectify::Query
7 | def query
8 | Decidim::ParticipatoryProcess.published
9 | end
10 | end
11 | end
12 | end
13 |
--------------------------------------------------------------------------------
/decidim-participatory_processes/spec/features/admin/participatory_process_admin_manages_participatory_process_steps_spec.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | require "spec_helper"
4 |
5 | describe "Participatory process admin manages participatory process steps", type: :feature do
6 | include_context "when process admin administrating a participatory process"
7 |
8 | it_behaves_like "manage process steps examples"
9 | end
10 |
--------------------------------------------------------------------------------
/decidim-system/app/helpers/decidim/system/menu_helper.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Decidim
4 | module System
5 | # This module includes helpers to manage menus in system layout
6 | module MenuHelper
7 | # Public: Returns the main menu presenter object
8 | def main_menu
9 | @main_menu ||= ::Decidim::MenuPresenter.new(:system_menu, self)
10 | end
11 | end
12 | end
13 | end
14 |
--------------------------------------------------------------------------------
/docs/create_followers_from_comment_authors.md:
--------------------------------------------------------------------------------
1 | # Create followers from comment authors
2 |
3 | Run the following script to make all comment authors follow the commented resource:
4 |
5 | ```ruby
6 | Decidim::Comments::Comment.includes(:author, :root_commentable).find_each do |comment|
7 | begin
8 | Decidim::Follow.create!(followable: comment.root_commentable, user: comment.author)
9 | rescue
10 | end
11 | end; p 1
12 | ```
13 |
--------------------------------------------------------------------------------
/decidim-core/lib/decidim/attributes/time_with_zone.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Decidim
4 | module Attributes
5 | # Custom Virtus value to parse a String representing a Time using
6 | # the app TimeZone.
7 | class TimeWithZone < Virtus::Attribute
8 | def coerce(value)
9 | return value unless value.is_a?(String)
10 | Time.zone.parse(value)
11 | end
12 | end
13 | end
14 | end
15 |
--------------------------------------------------------------------------------
/decidim-core/spec/helpers/decidim/widget_urls_helper_spec.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | require "spec_helper"
4 |
5 | module Decidim
6 | describe WidgetUrlsHelper do
7 | describe "#embed_modal_for" do
8 | it "returns an escaped HTML string" do
9 | expect(helper.embed_modal_for("https://example.org"))
10 | .not_to match(%r{})
11 | end
12 | end
13 | end
14 | end
15 |
--------------------------------------------------------------------------------
/decidim-meetings/app/views/decidim/meetings/meetings/_datetime.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 | <%= l meeting.start_time, format: "%d" %> <%= l meeting.start_time, format: "%B %Y" %>
4 |
5 |
6 | <%= meeting.start_time.strftime("%H:%M") %> - <%= meeting.end_time.strftime("%H:%M") %>
7 |
8 |
9 |
--------------------------------------------------------------------------------
/decidim-core/app/assets/stylesheets/decidim/layouts/_view.scss:
--------------------------------------------------------------------------------
1 | // Proposal, action, debate & meeting view
2 |
3 |
4 | //Styles
5 |
6 | .view-header{
7 | margin-bottom: 2rem;
8 | }
9 |
10 | .support-wrapper-md{
11 | @include breakpoint(medium down){
12 | margin: 1rem 0;
13 | }
14 | }
15 |
16 | .view-side{
17 | @include breakpoint(medium only){
18 | width: 50%;
19 | margin: 0 auto 2rem;
20 | float: none
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/decidim-participatory_processes/spec/commands/create_category_spec.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | require "spec_helper"
4 | require "decidim/admin/test/commands/create_category_examples"
5 |
6 | module Decidim::Admin
7 | describe CreateCategory do
8 | include_examples "CreateCategory command" do
9 | let(:participatory_space) { create(:participatory_process, organization: organization) }
10 | end
11 | end
12 | end
13 |
--------------------------------------------------------------------------------
/decidim-participatory_processes/spec/commands/update_category_spec.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | require "spec_helper"
4 | require "decidim/admin/test/commands/update_category_examples"
5 |
6 | module Decidim::Admin
7 | describe UpdateCategory do
8 | include_examples "UpdateCategory command" do
9 | let(:participatory_space) { create(:participatory_process, organization: organization) }
10 | end
11 | end
12 | end
13 |
--------------------------------------------------------------------------------
/decidim-accountability/app/views/decidim/accountability/admin/results/edit.html.erb:
--------------------------------------------------------------------------------
1 | <%= decidim_form_for(@form, html: { class: "form edit_result" }) do |f| %>
2 | <%= render partial: 'form', object: f, locals: { title: t('.title') } %>
3 |
4 |
5 | <%= f.submit t(".update") %>
6 |
7 | <% end %>
8 |
9 | <%= javascript_include_tag "decidim/accountability/admin/accountability_admin" %>
10 |
--------------------------------------------------------------------------------
/decidim-accountability/app/views/decidim/accountability/admin/results/new.html.erb:
--------------------------------------------------------------------------------
1 | <%= decidim_form_for(@form, html: { class: "form new_result" }) do |f| %>
2 | <%= render partial: 'form', object: f, locals: { title: t('.title') } %>
3 |
4 |
5 | <%= f.submit t(".create") %>
6 |
7 | <% end %>
8 |
9 | <%= javascript_include_tag "decidim/accountability/admin/accountability_admin" %>
10 |
--------------------------------------------------------------------------------
/decidim-comments/app/types/decidim/comments/commentable_type.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Decidim
4 | module Comments
5 | # This type represents a commentable object.
6 | CommentableType = GraphQL::ObjectType.define do
7 | name "Commentable"
8 | description "A commentable object"
9 |
10 | interfaces [
11 | Decidim::Comments::CommentableInterface
12 | ]
13 | end
14 | end
15 | end
16 |
--------------------------------------------------------------------------------