diff --git a/Gemfile b/Gemfile index 7a00911fe..392aa2bfd 100644 --- a/Gemfile +++ b/Gemfile @@ -49,6 +49,7 @@ gem 'daemons' gem 'devise-async' gem 'newrelic_rpm', '~> 3.14' gem 'whenever', require: false +gem 'pg_search' gem 'ahoy_matey', '~> 1.2.1' gem 'groupdate' # group temporary data diff --git a/Gemfile.lock b/Gemfile.lock index 4721ee9de..6ec99b1a7 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -263,6 +263,10 @@ GEM paranoia (2.1.3) activerecord (~> 4.0) pg (0.18.3) + pg_search (1.0.5) + activerecord (>= 3.1) + activesupport (>= 3.1) + arel poltergeist (1.7.0) capybara (~> 2.1) cliver (~> 0.3.1) @@ -455,6 +459,7 @@ DEPENDENCIES omniauth-twitter paranoia pg + pg_search poltergeist quiet_assets rails (= 4.2.4) diff --git a/app/assets/images/header_print_proposals.jpg b/app/assets/images/header_print_proposals.jpg new file mode 100644 index 000000000..4d2eb18a5 Binary files /dev/null and b/app/assets/images/header_print_proposals.jpg differ diff --git a/app/assets/stylesheets/admin.scss b/app/assets/stylesheets/admin.scss index 2f6b1f0c6..66adef5de 100644 --- a/app/assets/stylesheets/admin.scss +++ b/app/assets/stylesheets/admin.scss @@ -92,6 +92,10 @@ body.admin { } } +.for-print-only { + display: none; +} + // 02. Sidebar // - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/app/assets/stylesheets/layout.scss b/app/assets/stylesheets/layout.scss index e9429a495..2a78d3cc7 100644 --- a/app/assets/stylesheets/layout.scss +++ b/app/assets/stylesheets/layout.scss @@ -687,6 +687,7 @@ header { line-height: $line-height*3; margin-left: rem-calc(12); margin-right: rem-calc(36); + margin-right: 12px\9; } &:after { @@ -898,6 +899,13 @@ form.locale-form { select { background-image: image-url("language_select.png"); + option { + background: white; + color: $text; + border: 0; + outline: none; + } + &.locale-switcher { background-color: transparent; border: 0; @@ -916,6 +924,19 @@ form { line-height: $line-height; } + input, textarea { + height: 48px\9; + line-height: 48px\9; + margin-bottom: 24px\9; + width: 100%\9; + } + + input[type="checkbox"] { + height: auto\9; + line-height: inherit\9; + width: auto\9; + } + input[type]:not([type=submit]):not([type=file]):not([type=checkbox]) { background: $input-bg; height: rem-calc(48); diff --git a/app/assets/stylesheets/print.css b/app/assets/stylesheets/print.css index 0c67035c8..ef76f607e 100644 --- a/app/assets/stylesheets/print.css +++ b/app/assets/stylesheets/print.css @@ -2,6 +2,8 @@ /* Print proposals */ +.admin-content { margin-top: 0 !important; } + .tags a { display: none !important; } .supports { display: none !important; } @@ -24,7 +26,7 @@ img.left { display: none !important; } .captcha { display: none !important; } -li.name span { display: none !important; } +li.name { display: none !important; } p.proposal-info span:nth-child(3) { display: none !important; } @@ -36,11 +38,22 @@ p.proposal-info span:nth-child(3) { display: none !important; } input[type="submit"] { display: none !important; } +.filters h2 { margin: 0 !important; font-size: 20px !important; line-height: 20px !important; width: auto !important; } + +.search-results h2 { margin: 0 !important; font-size: 20px !important; line-height: 20px !important; } + +.admin h2 { font-size: 20px !important; line-height: 20px !important; } + .select-order { - border: 0; - font-size: 24px; - font-weight: bold; - margin-left: -6px; + border: 0 !important; + font-size: 20px !important; + font-weight: bold !important; + line-height: 20px !important; + margin-left: 10px !important; + margin-top: 0 !important; + margin-bottom: 0 !important; + margin-right: 0 !important; + padding: 0 !important; } p.proposal-info { margin-left: -6px; } @@ -49,16 +62,26 @@ a { text-decoration: none !important; } a:after { content: none !important; } -.proposal .panel { min-height: auto !important; } +.proposal .panel { min-height: auto !important; margin: 0 !important; padding-bottom: 0 !important; padding-left: 0 !important; } .proposal .panel .proposal-content { min-height: auto !important; } -.proposal .panel h3 { min-height: auto !important; } +.proposal .panel h3 { min-height: auto !important; font-size: 16px !important; } -.proposal .panel .proposal-description { height: auto; } +.proposal .panel .proposal-description { height: auto !important; margin-bottom: 0 !important; } .proposal .panel { border-left: 0 !important; border-right: 0 !important; border-top: 0 !important; } + +.for-print-only { display: block !important; } + +.for-print-only p { font-size: 14px !important; line-height: 24px !important; } + +.not-print { display: none !important; } + +.date-for-print { font-size: 14px !important; line-height: 20px !important; } + +.filters { height: 48px !important;} diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index d97d59a98..ecd057d14 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -6,8 +6,6 @@ class ApplicationController < ActionController::Base include HasOrders before_action :authenticate_http_basic, if: :http_basic_auth_site? - before_action :authenticate_user!, unless: :devise_controller?, if: :beta_site? - before_action :authenticate_beta_tester!, unless: :devise_controller?, if: :beta_site? before_action :ensure_signup_complete before_action :set_locale @@ -33,21 +31,6 @@ class ApplicationController < ActionController::Base end end - def authenticate_beta_tester! - unless signed_in? && beta_testers.include?(current_user.email) - sign_out(current_user) - redirect_to new_user_session_path, alert: t('application.alert.only_beta_testers') - end - end - - def beta_testers - File.readlines('config/beta-testers.txt').map {|email| email.strip } - end - - def beta_site? - Rails.application.secrets.beta_site - end - def http_basic_auth_site? Rails.application.secrets.http_basic_auth end diff --git a/app/controllers/proposals_controller.rb b/app/controllers/proposals_controller.rb index f91e65b8a..50b436e58 100644 --- a/app/controllers/proposals_controller.rb +++ b/app/controllers/proposals_controller.rb @@ -13,7 +13,7 @@ class ProposalsController < ApplicationController respond_to :html, :js def index_customization - @featured_proposals = Proposal.all.sort_by_confidence_score.limit(3) if @search_terms.blank? + @featured_proposals = Proposal.all.sort_by_confidence_score.limit(3) if (@search_terms.blank? && @tag_filter.blank?) if @featured_proposals.present? set_featured_proposal_votes(@featured_proposals) @resources = @resources.where('proposals.id NOT IN (?)', @featured_proposals.map(&:id)) diff --git a/app/models/debate.rb b/app/models/debate.rb index 0b64b7b1e..74403139c 100644 --- a/app/models/debate.rb +++ b/app/models/debate.rb @@ -5,6 +5,7 @@ class Debate < ActiveRecord::Base include Conflictable include Measurable include Sanitizable + include PgSearch apply_simple_captcha acts_as_votable @@ -36,6 +37,22 @@ class Debate < ActiveRecord::Base # Ahoy setup visitable # Ahoy will automatically assign visit_id on create + pg_search_scope :pg_search, { + against: { + title: 'A', + description: 'B' + }, + associated_against: { + tags: :name + }, + using: { + tsearch: { dictionary: "spanish" }, + trigram: { threshold: 0.1 }, + }, + ranked_by: '(:tsearch + debates.cached_votes_up)', + order_within_rank: "debates.created_at DESC" + } + def description super.try :html_safe end diff --git a/app/models/proposal.rb b/app/models/proposal.rb index 7d5a5bb17..dd2560ba1 100644 --- a/app/models/proposal.rb +++ b/app/models/proposal.rb @@ -4,6 +4,7 @@ class Proposal < ActiveRecord::Base include Conflictable include Measurable include Sanitizable + include PgSearch apply_simple_captcha acts_as_votable @@ -38,12 +39,30 @@ class Proposal < ActiveRecord::Base scope :sort_by_random, -> { order("RANDOM()") } scope :sort_by_flags, -> { order(flags_count: :desc, updated_at: :desc) } + pg_search_scope :pg_search, { + against: { + title: 'A', + question: 'B', + summary: 'C', + description: 'D' + }, + associated_against: { + tags: :name + }, + using: { + tsearch: { dictionary: "spanish" }, + trigram: { threshold: 0.1 }, + }, + ranked_by: '(:tsearch + proposals.cached_votes_up)', + order_within_rank: "proposals.created_at DESC" + } + def description super.try :html_safe end def total_votes - cached_votes_up + cached_votes_up + physical_votes end def editable? @@ -74,14 +93,13 @@ class Proposal < ActiveRecord::Base def calculate_hot_score self.hot_score = ScoreCalculator.hot_score(created_at, - cached_votes_up, - cached_votes_up, + total_votes, + total_votes, comments_count) end def calculate_confidence_score - self.confidence_score = ScoreCalculator.confidence_score(cached_votes_up, - cached_votes_up) + self.confidence_score = ScoreCalculator.confidence_score(total_votes, total_votes) end def after_hide @@ -93,7 +111,7 @@ class Proposal < ActiveRecord::Base end def self.search(terms) - terms.present? ? where("title ILIKE ? OR description ILIKE ? OR question ILIKE ?", "%#{terms}%", "%#{terms}%", "%#{terms}%") : none + self.pg_search(terms) end def self.votes_needed_for_success diff --git a/app/views/layouts/_header.html.erb b/app/views/layouts/_header.html.erb index 2cb65d162..8ca4e1022 100644 --- a/app/views/layouts/_header.html.erb +++ b/app/views/layouts/_header.html.erb @@ -60,7 +60,6 @@ diff --git a/config/deploy.rb b/config/deploy.rb index 5d4b15960..e62d65160 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -57,7 +57,6 @@ namespace :deploy do # Custom compile and rsync of assets - works, but it is very slow #after 'deploy:symlink:shared', 'deploy:compile_assets_locally' - after :finishing, 'deploy:beta_testers' after :finishing, 'deploy:cleanup' # Restart unicorn after 'deploy:publishing', 'deploy:restart' diff --git a/config/locales/activemodel.en.yml b/config/locales/activemodel.en.yml index ad43d1516..f62fd1ec6 100644 --- a/config/locales/activemodel.en.yml +++ b/config/locales/activemodel.en.yml @@ -2,17 +2,17 @@ en: activemodel: models: verification: - residence: Residence - sms: SMS + residence: "Residence" + sms: "SMS" attributes: verification: residence: - document_type: Document type - document_number: Document number(including letter) - date_of_birth: Date of birth - postal_code: Postal code + document_type: "Document type" + document_number: "Document number (including letters)" + date_of_birth: "Date of birth" + postal_code: "Postcode" sms: - phone: 'Phone' - confirmation_code: 'Confirmation code' + phone: "Telephone" + confirmation_code: "Confirmation code" email: - recipient: 'Email' \ No newline at end of file + recipient: "Email" \ No newline at end of file diff --git a/config/locales/activemodel.es.yml b/config/locales/activemodel.es.yml index 9bda561cf..e45eade16 100644 --- a/config/locales/activemodel.es.yml +++ b/config/locales/activemodel.es.yml @@ -2,17 +2,17 @@ es: activemodel: models: verification: - residence: Residencia - sms: SMS + residence: "Residencia" + sms: "SMS" attributes: verification: residence: - document_type: Tipo documento - document_number: Numero de documento (incluida letra) - date_of_birth: Fecha de nacimiento - postal_code: 'Código postal' + document_type: "Tipo documento" + document_number: "Numero de documento (incluida letra)" + date_of_birth: "Fecha de nacimiento" + postal_code: "Código postal" sms: - phone: 'Teléfono' - confirmation_code: 'Código de confirmación' + phone: "Teléfono" + confirmation_code: "Código de confirmación" email: - recipient: 'Email' \ No newline at end of file + recipient: "Email" \ No newline at end of file diff --git a/config/locales/activerecord.en.yml b/config/locales/activerecord.en.yml index 3bf203bc5..4e9cd5931 100644 --- a/config/locales/activerecord.en.yml +++ b/config/locales/activerecord.en.yml @@ -7,46 +7,68 @@ en: email: password_already_set: "This user already has a password" models: - activity: Activity - comment: Comment - debate: Debate - proposal: Proposal - tag: Topic - user: User - vote: Vote - organization: Organization + activity: + one: "activity" + other: "activities" + comment: + one: "Comment" + other: "Comments" + debate: + one: "Debate" + other: "Debates" + tag: + one: "Tag" + other: "Tags" + user: + one: "User" + other: "Users" + moderator: + one: "Moderator" + other: "Moderators" + administrator: + one: "Administrator" + other: "Administrators" + vote: + one: "Vote" + other: "Votes" + organization: + one: "Organisation" + other: "Organisations" + proposal: + one: "Citizen proposal" + other: "Citizen proposals" attributes: comment: - body: Comment - user: User + body: "Comment" + user: "User" debate: - author: Author - description: Opinion - terms_of_service: Terms of service - title: Title + author: "Author" + description: "Opinion" + terms_of_service: "Terms of service" + title: "Title" proposal: - author: Author - title: Title - question: Question - description: Description - terms_of_service: Terms of service + author: "Author" + title: "Title" + question: "Question" + description: "Description" + terms_of_service: "Terms of service" user: - email: Email - username: Username - password: Password - phone_number: Phone number - official_position: Official position - official_level: Official level + email: "Email" + username: "Username" + password: "Password" + phone_number: "Phone number" + official_position: "Official position" + official_level: "Official level" organization: - name: Organization name - responsible_name: Person in charge + name: "Name of organisation" + responsible_name: "Person responsible for the group" errors: models: debate: attributes: tag_list: - less_than_or_equal_to: tags must be less than or equal to %{count} + less_than_or_equal_to: "tags must be less than or equal to %{count}" proposal: attributes: tag_list: - less_than_or_equal_to: tags must be less than or equal to %{count} \ No newline at end of file + less_than_or_equal_to: "tags must be less than or equal to %{count}" diff --git a/config/locales/activerecord.es.yml b/config/locales/activerecord.es.yml index b5db2f3ab..998bc4fb6 100644 --- a/config/locales/activerecord.es.yml +++ b/config/locales/activerecord.es.yml @@ -8,67 +8,67 @@ es: password_already_set: "Este usuario ya tiene una clave asociada" models: activity: - one: actividad - other: actividades + one: "actividad" + other: "actividades" comment: - one: Comentario - other: Comentarios + one: "Comentario" + other: "Comentarios" debate: - one: Debate - other: Debates + one: "Debate" + other: "Debates" tag: - one: Tema - other: Temas + one: "Tema" + other: "Temas" user: - one: Usuario - other: Usuarios + one: "Usuario" + other: "Usuarios" moderator: - one: Moderador - other: Moderadores + one: "Moderador" + other: "Moderadores" administrator: - one: Administrador - other: Administradores + one: "Administrador" + other: "Administradores" vote: - one: Voto - other: Voto + one: "Voto" + other: "Votos" organization: - one: Organización - other: Organizaciones + one: "Organización" + other: "Organizaciones" proposal: - one: Propuesta ciudadana - other: Propuestas ciudadanas + one: "Propuesta ciudadana" + other: "Propuestas ciudadanas" attributes: comment: - body: Comentario - user: Usuario + body: "Comentario" + user: "Usuario" debate: - author: Autor - description: Opinión - terms_of_service: Términos de servicio - title: Título + author: "Autor" + description: "Opinión" + terms_of_service: "Términos de servicio" + title: "Título" proposal: - author: Autor - title: Título - question: Pregunta - description: Descripción - terms_of_service: Términos de servicio + author: "Autor" + title: "Título" + question: "Pregunta" + description: "Descripción" + terms_of_service: "Términos de servicio" user: - email: Correo electrónico - username: Nombre de usuario - password: Contraseña - phone_number: Teléfono - official_position: Cargo público - official_level: Nivel del cargo + email: "Correo electrónico" + username: "Nombre de usuario" + password: "Contraseña" + phone_number: "Teléfono" + official_position: "Cargo público" + official_level: "Nivel del cargo" organization: - name: Nombre de organización - responsible_name: Persona responsable del colectivo + name: "Nombre de organización" + responsible_name: "Persona responsable del colectivo" errors: models: debate: attributes: tag_list: - less_than_or_equal_to: los temas deben ser menor o igual que %{count} + less_than_or_equal_to: "los temas deben ser menor o igual que %{count}" proposal: attributes: tag_list: - less_than_or_equal_to: los temas deben ser menor o igual que %{count} + less_than_or_equal_to: "los temas deben ser menor o igual que %{count}" diff --git a/config/locales/admin.en.yml b/config/locales/admin.en.yml old mode 100644 new mode 100755 index a70329132..276e3ca96 --- a/config/locales/admin.en.yml +++ b/config/locales/admin.en.yml @@ -2,177 +2,177 @@ en: admin: settings: index: - title: Global settings - update_setting: Update + title: "General settings" + update_setting: "Update" flash: - updated: 'Setting updated!' + updated: "Value updated" dashboard: index: - title: Administration + title: "Administration" menu: - settings: Global settings - debate_topics: Debate topics - hidden_proposals: Hidden proposals - hidden_debates: Hidden debates - hidden_comments: Hidden comments - hidden_users: Blocked users - incomplete_verifications: Incomplete verifications - organizations: Organizations - officials: Officials - moderators: Moderators - stats: Statistics - activity: Moderation Activity + settings: "General settings" + debate_topics: "Debate topics" + hidden_proposals: "Hidden proposals" + hidden_debates: "Hidden debates" + hidden_comments: "Hidden comments" + hidden_users: "Hidden users" + incomplete_verifications: "Incomplete verifications" + organizations: "Organisations" + officials: "Officials" + moderators: "Moderators" + stats: "Statistics" + activity: "Moderator activity" shared: user_search: - placeholder: 'Search user by name or email' - button: 'Search' + placeholder: "Search user by name or email'" + button: "Search" proposal_search: - placeholder: 'Search proposals by title, description or question' - button: 'Search' + placeholder: "Search proposals by title, description or question" + button: "Search" organizations: index: - title: Organizations - search_placeholder: "Name, email or phone" - search: Search - verify: Verify - reject: Reject - verified: Verified - rejected: Rejected - filter: Filter + title: "Organisations" + search_placeholder: "Name, email or phone number" + search: "Search" + verify: "Verify" + reject: "Reject" + verified: "Verified" + rejected: "Rejected" + filter: "Filter" filters: - all: All - pending: Pending - verified: Verified - rejected: Rejected + all: "All" + pending: "Pending" + verified: "Verified" + rejected: "Rejected" hidden_count: - one: "There is %{count} organization without user or with the user banned" - other: "There is %{count} organizations without user or with the user banned" + one: "There is also one organisation with no users or with a hidden user" + other: "There are %{count} organisations with no users or with a hidden user" search: - title: "Search Organizations" + title: "Search Organisations" actions: - hide: Hide - hide_author: Ban author - restore: Restore - confirm: 'Are you sure?' - confirm_hide: Confirm + hide: "Hide" + hide_author: "Hide author" + restore: "Restore" + confirm: "Are you sure?" + confirm_hide: "Confirm" tags: index: - title: 'Debate topics' - add_tag: 'Add a new debate topic' - mark_as_featured: 'Propose topic to create debate' + title: "Debate topics" + add_tag: "Add a new debate topic" + mark_as_featured: "Propose topic upon creating debate" name: - placeholder: 'Write a topic' - create: Create Topic - update: Update Topic - destroy: Delete Topic + placeholder: "Type the name of the topic" + create: "Create Topic" + update: "Update Topic" + destroy: "Destroy Topic" comments: index: - title: Hidden comments + title: "Hidden comments" hidden_proposal: "Hidden proposal" hidden_debate: "Hidden debate" - filter: Filter + filter: "Filter" filters: - all: All - with_confirmed_hide: Confirmed - without_confirmed_hide: Pending + all: "All" + with_confirmed_hide: "Confirmed" + without_confirmed_hide: "Pending" debates: index: - title: Hidden debates - filter: Filter + title: "Hidden debates" + filter: "Filter" filters: - all: All - with_confirmed_hide: Confirmed - without_confirmed_hide: Pending + all: "All" + with_confirmed_hide: "Confirmed" + without_confirmed_hide: "Pending" proposals: index: - title: Hidden proposals - filter: Filter + title: "Hidden proposals" + filter: "Filter" filters: - all: All - with_confirmed_hide: Confirmed - without_confirmed_hide: Pending + all: "All" + with_confirmed_hide: "Confirmed" + without_confirmed_hide: "Pending" users: index: - title: Banned users - filter: Filter + title: "Hidden users" + filter: "Filter" filters: - all: All - with_confirmed_hide: Confirmed - without_confirmed_hide: Pending + all: "All" + with_confirmed_hide: "Confirmed" + without_confirmed_hide: "Pending" show: - title: "User activity from %{user}" - back: Back + title: "Activity of user %{user}" + back: "Back" email: "Email:" registered_at: "Registered at:" hidden_at: "Hidden at:" verifications: index: - title: Incomplete verifications - phone_not_given: 'Phone not given' - sms_code_not_confirmed: 'Has not confirmed the sms code' + title: "Incomplete verifications" + phone_not_given: "Phone not given" + sms_code_not_confirmed: "Has not confirmed the sms code" officials: - level_0: Not an official - level_1: Level 1 - level_2: Level 2 - level_3: Level 3 - level_4: Level 4 - level_5: Level 5 + level_0: "Not official" + level_1: "Level 1" + level_2: "Level 2" + level_3: "Level 3" + level_4: "Level 4" + level_5: "Level 5" index: - title: Officials + title: "Officials" search: - title: 'Officials: Search users' - edit_official: Edit official - make_official: Make this user an official + title: "Official positions: User search" + edit_official: "Edit official" + make_official: "Make official" edit: - title: 'Officials: edit user' - destroy: "Remove 'Official' condition" - back: Back + title: "Officials: Edit user" + destroy: "Remove 'Official' status" + back: "Back" flash: - official_updated: 'Official position saved!' - official_destroyed: 'User is not an official anymore' + official_updated: "Details of official saved" + official_destroyed: "Details saved: the user is no longer an official" moderators: index: - title: Moderators + title: "Moderators" search: - email_placeholder: 'Search user by email' - search: Search - user_not_found: 'User not found' + email_placeholder: "Search user by email" + search: "Search" + user_not_found: "User not found" moderator: - delete: Delete - add: Add + delete: "Delete" + add: "Add" activity: show: - title: Activity of Moderators - action: Action - by: Moderated by - type: Type - filter: Show + title: "Moderator activity" + action: "Action" + by: "Moderated by" + type: "Type" + filter: "Show" filters: - all: All - on_proposals: On Proposals - on_debates: On Debates - on_comments: On Comments - on_users: On Users + all: "All" + on_proposals: "Proposals" + on_debates: "Debates" + on_comments: "Comments" + on_users: "Users" actions: - hide: Hidden - restore: Restored - block: Blocked + hide: "Hidden" + restore: "Restored" + block: "Blocked" stats: show: - stats_title: Stats - visits_title: Visits - combined_title: Combined + stats_title: "Stats" + visits_title: "Visits" + combined_title: "Combined" summary: - visits: Visits - debates: Debates - proposals: Proposals - comments: Comments - debate_votes: Debate votes - proposal_votes: Proposal votes - comment_votes: Comment votes - votes: Total votes - user_level_three: Level three users - user_level_two: Level two users - unverified_users: Unverified users - verified_users: Verified users - users: Total users \ No newline at end of file + visits: "Visits" + debates: "Debates" + proposals: "Proposals" + comments: "Comments" + debate_votes: "Debate votes" + proposal_votes: "Proposal votes" + comment_votes: "Comment votes" + votes: "Total votes" + user_level_three: "Level three users" + user_level_two: "Level two users" + unverified_users: "Unverified users" + verified_users: "Verified users" + users: "Total users" \ No newline at end of file diff --git a/config/locales/admin.es.yml b/config/locales/admin.es.yml index 40aef5f24..b124d60e3 100644 --- a/config/locales/admin.es.yml +++ b/config/locales/admin.es.yml @@ -2,177 +2,177 @@ es: admin: settings: index: - title: Configuración global - update_setting: Actualizar + title: "Configuración global" + update_setting: "Actualizar" flash: - updated: 'Valor actualizado' + updated: "Valor actualizado" dashboard: index: - title: Administración + title: "Administración" menu: - settings: Configuración global - debate_topics: Temas de debate - hidden_proposals: Propuestas ocultas - hidden_debates: Debates ocultos - hidden_comments: Comentarios ocultos - hidden_users: Usuarios bloqueados - incomplete_verifications: Verificaciones incompletas - organizations: Organizaciones - officials: Cargos públicos - moderators: Moderadores - stats: Estadísticas - activity: Actividad de moderadores + settings: "Configuración global" + debate_topics: "Temas de debate" + hidden_proposals: "Propuestas ocultas" + hidden_debates: "Debates ocultos" + hidden_comments: "Comentarios ocultos" + hidden_users: "Usuarios bloqueados" + incomplete_verifications: "Verificaciones incompletas" + organizations: "Organizaciones" + officials: "Cargos públicos" + moderators: "Moderadores" + stats: "Estadísticas" + activity: "Actividad de moderadores" shared: user_search: - placeholder: 'Buscar usuario por nombre o email' - button: 'Buscar' + placeholder: "Buscar usuario por nombre o email" + button: "Buscar" proposal_search: - placeholder: 'Buscar propuestas por título, descripción o pregunta' - button: 'Buscar' + placeholder: "Buscar propuestas por título, descripción o pregunta" + button: "Buscar" organizations: index: - title: Organizaciones + title: "Organizaciones" search_placeholder: "Nombre, email o teléfono" - search: Buscar - verify: Verificar - reject: Rechazar - verified: Verificada - rejected: Rechazada - filter: Filtro + search: "Buscar" + verify: "Verificar" + reject: "Rechazar" + verified: "Verificada" + rejected: "Rechazada" + filter: "Filtro" filters: - all: Todas - pending: Pendientes - verified: Verificadas - rejected: Rechazadas + all: "Todas" + pending: "Pendientes" + verified: "Verificadas" + rejected: "Rechazadas" hidden_count: one: "Hay además una organización sin usuario o con el usuario bloqueado" other: "Hay %{count} organizaciones sin usuario o con el usuario bloqueado" search: title: "Buscar Organizaciones" actions: - hide: Ocultar - hide_author: Bloquear al autor - restore: Volver a mostrar - confirm: '¿Estás seguro?' - confirm_hide: Confirmar + hide: "Ocultar" + hide_author: "Bloquear al autor" + restore: "Volver a mostrar" + confirm: "¿Estás seguro?" + confirm_hide: "Confirmar" tags: index: - title: 'Temas de debate' - add_tag: 'Añade un nuevo tema de debate' - mark_as_featured: 'Proponer tema al crear debate' + title: "Temas de debate" + add_tag: "Añade un nuevo tema de debate" + mark_as_featured: "Proponer tema al crear debate" name: - placeholder: 'Escribe el nombre del tema' - create: Crear Tema - update: Actualizar Tema - destroy: Eliminar Tema + placeholder: "Escribe el nombre del tema" + create: "Crear Tema" + update: "Actualizar Tema" + destroy: "Eliminar Tema" comments: index: - title: Comentarios ocultos + title: "Comentarios ocultos" hidden_proposal: "Propuesta oculta" hidden_debate: "Debate oculto" - filter: Filtro + filter: "Filtro" filters: - all: Todos - with_confirmed_hide: Confirmados - without_confirmed_hide: Pendientes + all: "Todos" + with_confirmed_hide: "Confirmados" + without_confirmed_hide: "Pendientes" debates: index: - title: Debates ocultos - filter: Filtro + title: "Debates ocultos" + filter: "Filtro" filters: - all: Todos - with_confirmed_hide: Confirmados - without_confirmed_hide: Pendientes + all: "Todos" + with_confirmed_hide: "Confirmados" + without_confirmed_hide: "Pendientes" proposals: index: - title: Propuestas ocultos - filter: Filtro + title: "Propuestas ocultos" + filter: "Filtro" filters: - all: Todas - with_confirmed_hide: Confirmadas - without_confirmed_hide: Pendientes + all: "Todas" + with_confirmed_hide: "Confirmadas" + without_confirmed_hide: "Pendientes" users: index: - title: Usuarios bloqueados - filter: Filtro + title: "Usuarios bloqueados" + filter: "Filtro" filters: - all: Todos - with_confirmed_hide: Confirmados - without_confirmed_hide: Pendientes + all: "Todos" + with_confirmed_hide: "Confirmados" + without_confirmed_hide: "Pendientes" show: title: "Actividad del usuario %{user}" - back: Volver + back: "Volver" email: "Email:" registered_at: "Fecha de alta:" hidden_at: "Bloqueado:" verifications: index: - title: Verificaciones incompletas - phone_not_given: 'No ha dado su teléfono' - sms_code_not_confirmed: 'No ha introducido su código de seguridad' + title: "Verificaciones incompletas" + phone_not_given: "No ha dado su teléfono" + sms_code_not_confirmed: "No ha introducido su código de seguridad" officials: level_0: "No es cargo público" - level_1: Nivel 1 - level_2: Nivel 2 - level_3: Nivel 3 - level_4: Nivel 4 - level_5: Nivel 5 + level_1: "Nivel 1" + level_2: "Nivel 2" + level_3: "Nivel 3" + level_4: "Nivel 4" + level_5: "Nivel 5" index: - title: Cargos Públicos + title: "Cargos Públicos" search: - title: 'Cargos Públicos: Búsqueda de usuarios' - edit_official: Editar cargo público - make_official: Convertir en cargo público + title: "Cargos Públicos: Búsqueda de usuarios" + edit_official: "Editar cargo público" + make_official: "Convertir en cargo público" edit: - title: 'Cargos Públicos: Editar usuario' + title: "Cargos Públicos: Editar usuario" destroy: "Eliminar condición de 'Cargo Público'" - back: Volver + back: "Volver" flash: - official_updated: 'Datos del cargo público guardados' - official_destroyed: 'Datos guardados: el usuario ya no es cargo público' + official_updated: "Datos del cargo público guardados" + official_destroyed: "Datos guardados: el usuario ya no es cargo público" moderators: index: - title: Moderadores + title: "Moderadores" search: - email_placeholder: 'Buscar usuario por email' - search: Buscar - user_not_found: 'Usuario no encontrado' + email_placeholder: "Buscar usuario por email" + search: "Buscar" + user_not_found: "Usuario no encontrado" moderator: - delete: Borrar - add: Añadir + delete: "Borrar" + add: "Añadir" activity: show: - title: Actividad de los Moderadores - action: 'Acción' - by: Moderado por - type: Tipo - filter: Mostrar + title: "Actividad de los Moderadores" + action: "Acción" + by: "Moderado por" + type: "Tipo" + filter: "Mostrar" filters: - all: Todo - on_proposals: Propuestas - on_debates: Debates - on_comments: Comentarios - on_users: Usuarios + all: "Todo" + on_proposals: "Propuestas" + on_debates: "Debates" + on_comments: "Comentarios" + on_users: "Usuarios" actions: - hide: Ocultado - restore: Restaurado - block: Bloqueado + hide: "Ocultado" + restore: "Restaurado" + block: "Bloqueado" stats: show: - stats_title: Estadísticas - visits_title: Visitas - combined_title: Combinado + stats_title: "Estadísticas" + visits_title: "Visitas" + combined_title: "Combinado" summary: - visits: Visitas - debates: Debates - proposals: Propuestas - comments: Comentarios - debate_votes: Votos en debates - proposal_votes: Votos en propuestas - comment_votes: Votos en comentarios - votes: Votos - user_level_three: Usuarios de nivel tres - user_level_two: Usuarios de nivel dos - unverified_users: Usuarios sin verificar - verified_users: Usuarios verificados - users: Usuarios + visits: "Visitas" + debates: "Debates" + proposals: "Propuestas" + comments: "Comentarios" + debate_votes: "Votos en debates" + proposal_votes: "Votos en propuestas" + comment_votes: "Votos en comentarios" + votes: "Votos" + user_level_three: "Usuarios de nivel tres" + user_level_two: "Usuarios de nivel dos" + unverified_users: "Usuarios sin verificar" + verified_users: "Usuarios verificados" + users: "Usuarios" diff --git a/config/locales/devise.en.yml b/config/locales/devise.en.yml old mode 100644 new mode 100755 index 26a10f292..473181f02 --- a/config/locales/devise.en.yml +++ b/config/locales/devise.en.yml @@ -3,58 +3,62 @@ en: devise: confirmations: - confirmed: "Your email address has been successfully confirmed." - send_instructions: "You will receive an email with instructions for how to confirm your email address in a few minutes." - send_paranoid_instructions: "If your email address exists in our database, you will receive an email with instructions for how to confirm your email address in a few minutes." + confirmed: "Your account has been confirmed." + send_instructions: "In a few minutes you will receive an email containing instructions on how to reset your password." + send_paranoid_instructions: "If your email address is in our database, in a few minutes you will receive an email containing instructions on how to reset your password." failure: already_authenticated: "You are already signed in." - inactive: "Your account is not activated yet." + inactive: "Your account has not yet been activated." invalid: "Invalid %{authentication_keys} or password." - locked: "Your account is locked." - last_attempt: "You have one more attempt before your account is locked." + locked: "Your account has been locked." + last_attempt: "You have one more attempt remaining before your account is blocked." not_found_in_database: "Invalid %{authentication_keys} or password." - timeout: "Your session expired. Please sign in again to continue." - unauthenticated: "You need to sign in or sign up before continuing." - unconfirmed: "You have to confirm your email address before continuing." + timeout: "Your session has expired. Please sign in again to continue." + unauthenticated: "You must sign in or register to continue." + unconfirmed: "You must confirm your account to continue." mailer: confirmation_instructions: subject: "Confirmation instructions" reset_password_instructions: - subject: "Reset password instructions" + subject: "Instructions for resetting your password" unlock_instructions: - subject: "Unlock instructions" + subject: "Unlocking instructions" omniauth_callbacks: - failure: "Could not authenticate you from %{kind} because \"%{reason}\"." - success: "Successfully authenticated from %{kind} account." + failure: "It has not been possible to authorise you as %{kind} because \"%{reason}\"." + success: "Successfully identified as %{kind}." passwords: - no_token: "You can't access this page without coming from a password reset email. If you do come from a password reset email, please make sure you used the full URL provided." - send_instructions: "You will receive an email with instructions on how to reset your password in a few minutes." - send_paranoid_instructions: "If your email address exists in our database, you will receive a password recovery link at your email address in a few minutes." - updated: "Your password has been changed successfully. You are now signed in." + no_token: "You cannot access this page except through a password reset link. If you have accessed it through a password reset link, please check that the URL is complete." + send_instructions: "In a few minutes, you will receive an email containing instructions on resetting your password." + send_paranoid_instructions: "If your email address is in our database, in a few minutes you will receive a link to use to reset your password." + updated: "Your password has been changed successfully. Authentication successful." updated_not_active: "Your password has been changed successfully." registrations: - destroyed: "Bye! Your account has been successfully cancelled. We hope to see you again soon." - signed_up: "Welcome! You have signed up successfully." - signed_up_but_inactive: "You have signed up successfully. However, we could not sign you in because your account is not yet activated." - signed_up_but_locked: "You have signed up successfully. However, we could not sign you in because your account is locked." - signed_up_but_unconfirmed: "A message with a confirmation link has been sent to your email address. Please follow the link to activate your account." - update_needs_confirmation: "You updated your account successfully, but we need to verify your new email address. Please check your email and follow the confirm link to confirm your new email address." + destroyed: + "Goodbye! Your account has been cancelled. We hope to see you again soon. In accordance with your request, personal data registered as + a user of the site decide.madrid.es and form part of the file 'Gestión de procesos participativos' under the responsibility of the + Dirección General de Participación Ciudadana, they have been canceled under the terms of the provisions of Article 16 of the + Ley Orgánica 15/1999 de Protección de Datos de Carácter Personal and Article 31 of its Reglamento de desarrollo (RD 1720/2007)." + signed_up: "Welcome! You have been authenticated." + signed_up_but_inactive: "Your registration was successful, but you could not be signed in because your account has not been activated." + signed_up_but_locked: "Your registration was successful, but you could not be signed in because your account is locked." + signed_up_but_unconfirmed: "You have been sent a message containing a verification link. Please click on this link to activate your account." + update_needs_confirmation: "Your account has been updated successfully; however, we need to verify your new email address. Please check your email and click on the link to complete the confirmation of your new email address." updated: "Your account has been updated successfully." sessions: - signed_in: "Signed in successfully." - signed_out: "Signed out successfully." - already_signed_out: "Signed out successfully." + signed_in: "You have been signed in successfully." + signed_out: "You have been signed out successfully." + already_signed_out: "You have been signed out successfully." unlocks: - send_instructions: "You will receive an email with instructions for how to unlock your account in a few minutes." - send_paranoid_instructions: "If your account exists, you will receive an email with instructions for how to unlock it in a few minutes." - unlocked: "Your account has been unlocked successfully. Please sign in to continue." + send_instructions: "In a few minutes, you will receive an email containing instructions on unlocking your account." + send_paranoid_instructions: "If you have an account, in a few minutes you will receive an email containing instructions on unlocking your account." + unlocked: "Your account has been unlocked. Please sign in to continue." errors: messages: - already_confirmed: "was already confirmed, please try signing in" - confirmation_period_expired: "needs to be confirmed within %{period}, please request a new one" - expired: "has expired, please request a new one" - not_found: "not found" - not_locked: "was not locked" + already_confirmed: "You have already been verified; please attempt to sign in." + confirmation_period_expired: "You need to be verified within %{period}; please make a repeat request." + expired: "has expired; please make a repeat request." + not_found: "not found." + not_locked: "was not locked." not_saved: - one: "1 error prohibited this %{resource} from being saved:" - other: "%{count} errors prohibited this %{resource} from being saved:" + one: "1 error prevented this %{resource} from being saved:" + other: "%{count} errors prevented this %{resource} from being saved:" diff --git a/config/locales/devise.es.yml b/config/locales/devise.es.yml index c2bc246e9..bf81e4199 100644 --- a/config/locales/devise.es.yml +++ b/config/locales/devise.es.yml @@ -31,7 +31,11 @@ es: updated: "Tu contraseña ha cambiado correctamente. Has sido identificado correctamente." updated_not_active: "Tu contraseña se ha cambiado correctamente." registrations: - destroyed: "¡Adiós! Tu cuenta ha sido cancelada. Esperamos volver a verte pronto." + destroyed: + "¡Adiós! Tu cuenta ha sido cancelada. Esperamos volver a verte pronto. Le informamos que de conformidad con su petición, + sus datos personales registrados como usuario de la Web decide.madrid.es y que forman parte del fichero 'Gestión de procesos participativos' + cuyo responsable es la Dirección General de Participación Ciudadana, han sido cancelados en los términos de lo previsto en el artículo 16 de la + Ley Orgánica 15/1999 de Protección de Datos de Carácter Personal y del artículo 31 de su Reglamento de desarrollo (RD 1720/2007)." signed_up: "¡Bienvenido! Has sido identificado." signed_up_but_inactive: "Te has registrado correctamente, pero no has podido iniciar sesión porque tu cuenta no ha sido activada." signed_up_but_locked: "Te has registrado correctamente, pero no has podido iniciar sesión porque tu cuenta está bloqueada." diff --git a/config/locales/devise_views.en.yml b/config/locales/devise_views.en.yml old mode 100644 new mode 100755 index 2c7ef86bb..508cfd820 --- a/config/locales/devise_views.en.yml +++ b/config/locales/devise_views.en.yml @@ -2,9 +2,9 @@ en: devise_views: confirmations: new: - title: "Resend confirmation instructions" - email_label: Email - submit: "Resend confirmation" + title: "Re-send confirmation instructions" + email_label: "Email" + submit: "Re-send instructions" show: title: "Confirm my account" instructions_html: "Confirming the account with email %{email}" @@ -14,28 +14,28 @@ en: submit: "Confirm" mailer: confirmation_instructions: - title: "Welcome to open government portal" + title: "Welcome to the Open Government Portal of the Madrid City Council" welcome: "Welcome" - text: "You can confirm your account email through the link below:" + text: "You can confirm your email account at the following link:" confirm_link: "Confirm my account" reset_password_instructions: hello: "Hello" - title: Change your password - text: "Someone has requested to change your password. You can do this through the link below:" + title: "Change your password" + text: "We have received a request to change your password. You can do this at the following link:" change_link: "Change my password" - ignore_text: "If you didn't request this, please ignore this email." - info_text: "Your password won't change until you access the link above and create a new one." + ignore_text: "If you did not request a password change, you can ignore this email." + info_text: "Your password will not be changed unless you access the link and edit it." unlock_instructions: hello: "Hello" - title: Your account has been locked - info_text: "Your account has been locked due to an excessive number of unsuccessful sign in attempts." - instructions_text: "Click the link below to unlock your account:" + title: "Your account has been locked" + info_text: "Your account has been blocked due to an excessive number of failed sign-in attempts." + instructions_text: "Please click on this link to unlock your account:" unlock_link: "Unlock my account" menu: login_items: - logout: "Logout" - signup: "Sign up" - login: "Log in" + logout: "Sign out" + signup: "Register" + login: "Sign in" passwords: edit: title: "Change your password" @@ -43,40 +43,40 @@ en: password_confirmation_label: "Confirm new password" change_submit: "Change my password" new: - title: "Forgot your password?" + title: "Forgotten password?" email_label: "Email" - send_submit: "Send me reset password" + send_submit: "Send instructions" users: registrations: edit: edit: "Edit" email_label: "Email" - waiting_for: "Currently waiting confirmation for:" - leave_blank: "Leave blank if you don't want to change it" + waiting_for: "Awaiting confirmation of:" + leave_blank: "Leave blank if you do not wish to modify" password_label: "New password" password_confirmation_label: "Confirm new password" current_password_label: "Current password" - need_current: "We need your current password to confirm your changes" + need_current: "We need your current password to confirm the changes" update_submit: "Update" back_link: "Back" new: - title: "Sign up" + title: "Register" username_label: "Username" - username_note: "Username which will appear in your publications" + username_note: "Name that appears next to your posts" email_label: "Email" password_label: "Password" password_confirmation_label: "Confirm password" - submit: "Sign up" - organization_signup: "Do you represent an organization / group? %{signup_link}" + submit: "Register" + organization_signup: "Do you represent an organisation or collective? %{signup_link}" organization_signup_link: "Sign up here" - terms: "To sign up in this site your accept the %{terms}" - terms_link: "terms of use" + terms: "By registering you accept the %{terms}" + terms_link: "terms and conditions of use" success: - title: "Review your email inbox" - thank_you_html: "Thank you for registering. Now you must confirm your email account." - instructions_1_html: "Please review your email inbox - we have sent you a link to confirm your account." - instructions_2_html: "Once you click that link, you will be able to start participating" - back_to_index: "Understood, take me back to the home page" + title: "Modify your email" + thank_you_html: "Thank you for registering for the website. You must now confirm your email address." + instructions_1_html: "Please check your email - we have sent you a link to confirm your account." + instructions_2_html: "Once confirmed, you may begin participation." + back_to_index: "I understand; go back to main page" delete_form: title: "Erase account" info: "This action can not be undone. Please make sure this is what you want." @@ -86,41 +86,40 @@ en: organizations: registrations: new: - title: "Sign up as organization / collective" - organization_name_label: "Organization name" - responsible_name_label: "Name and surname of the person in charge" - responsible_name_note: "The responsible representative of the organization" + title: "Register as an organisation or collective" + organization_name_label: "Name of organisation" + responsible_name_label: "Full name of the person responsible for the collective" + responsible_name_note: "This would be the person representing the association/collective in whose name the proposals are presented" email_label: "Email" password_label: "Password" phone_number_label: "Phone number" password_confirmation_label: "Confirm password" - submit: "Sign up" + submit: "Register" success: - title: "Registration of organization / collective" - thank_you_html: "Thank you for registering your organization or collective in the website. Now is pending verification." - instructions_1_html: "We will contact you soon in order to verify that you represent your collective." - instructions_2_html: "Meanwhile, review your email. We have sent you a confirmation link to activate your account." - instructions_3_html: "When you confirm your account will then be able to participate as a non-verified organization." - back_to_index: "Understood, take me back to the home page" + title: "Registration of organisation / collective" + thank_you_html: "Thank you for registering your collective on the website. It is now pending verification." + instructions_1_html: "We will contact you soon to verify that you do in fact represent this collective." + instructions_2_html: "While your email is reviewed, we have sent you a link to confirm your account." + instructions_3_html: "Once confirmed, you may begin to participate as an unverified collective." + back_to_index: "I understand; go back to main page" sessions: new: - title: "Log in" + title: "Sign in" email_label: "Email" password_label: "Password" remember_me: "Remember me" - submit: "Log in" + submit: "Enter" unlocks: new: - title: "Resend unlock instructions" + title: "Re-sent unlocking instructions" email_label: "Email" - submit: "Resend unlock instructions" + submit: "Re-send unlocking instructions" shared: links: - login: "Log in" + login: "Enter" signup: "Don't have an account? %{signup_link}" signup_link: "Sign up" - #organization_signup: "Sign up as an organization / collective" signin_with_provider: "Sign in with %{provider}" - new_password: "Forgot your password?" - new_confirmation: "Didn't receive confirmation instructions?" - new_unlock: "Didn't receive unlock instructions?" + new_password: "Forgotten your password?" + new_confirmation: "Haven't received instructions to activate your account?" + new_unlock: "Haven't received unlocking instructions?" diff --git a/config/locales/devise_views.es.yml b/config/locales/devise_views.es.yml index 42576b6ff..83aea1d48 100644 --- a/config/locales/devise_views.es.yml +++ b/config/locales/devise_views.es.yml @@ -3,7 +3,7 @@ es: confirmations: new: title: "Reenviar instrucciones de confirmación" - email_label: Email + email_label: "Email" submit: "Reenviar instrucciones" show: title: "Confirmar mi cuenta" @@ -27,7 +27,7 @@ es: info_text: "Tu contraseña no cambiará hasta que no accedas al enlace y la modifiques." unlock_instructions: hello: "Hola" - title: Tu cuenta ha sido bloqueada + title: "Tu cuenta ha sido bloqueada" info_text: "Tu cuenta ha sido bloqueada debido a un excesivo número de intentos fallidos de alta." instructions_text: "Sigue el siguiente enlace para desbloquear tu cuenta:" unlock_link: "Desbloquear mi cuenta" @@ -119,7 +119,6 @@ es: login: "Entrar" signup: "¿No tienes una cuenta? %{signup_link}" signup_link: "Regístrate" - #organization_signup: "Registro para organizaciones / colectivos" signin_with_provider: "Entrar con %{provider}" new_password: "¿Olvidaste tu contraseña?" new_confirmation: "¿No has recibido instrucciones para confirmar tu cuenta?" diff --git a/config/locales/en.yml b/config/locales/en.yml old mode 100644 new mode 100755 index 21b4a6872..715b12d33 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1,58 +1,58 @@ en: - locale: English + locale: "English" errors: messages: user_not_found: "User not found" layouts: header: logo: "Madrid" - external_link_transparency: Transparency + external_link_transparency: "Transparency" external_link_transparency_url: "http://www.madrid.es/portales/munimadrid/es/Inicio/El-Ayuntamiento/Transparencia?vgnextfmt=default&vgnextchannel=20fd850769797310VgnVCM2000000c205a0aRCRD" - external_link_opendata: Open data + external_link_opendata: "Open data" external_link_opendata_url: "http://datos.madrid.es" - external_link_blog: Blog + external_link_blog: "Blog" external_link_blog_url: "/blog" open_gov: "%{open} government" - open: "Open" + open: "open" participation: "Participation" transparency: "Transparency" open_data: "Open data" - open_city_title: "The city you want, it will be the city you want." + open_city_title: "Love the city, and it will become a city you love." open_city_slogan_html: - "Start listening to Madrid. - For that we open this digital Puerta del Sol, where all the locals can meet to discuss and share everything we want." + "There are cities that are governed directly by their inhabitants, who discuss the topics they are concerned about, propose ideas to improve + their lives and decide among themselves which ones will be carried out. Madrid is already one of these cities." see_all: "See proposals" - my_account_link: My account + my_account_link: "My account" locale: "Language:" - administration: Administration - moderation: Moderation - highlights: "Highlights" + administration: "Administration" + moderation: "Moderation" + # highlights: "Highlights" more_information: "More information" - debates: Debates - proposals: Proposals + debates: "Debates" + proposals: "Citizen proposals" footer: - description: "This portal use %{consul}, is %{open_source}. Madrid, for the whole world." - open_source: "software libre" + description: "This portal uses the %{consul} which is %{open_source}. From Madrid out into the world." + open_source: "open-source software" open_source_url: "http://www.gnu.org/licenses/agpl-3.0.html" consul: "Consul application" consul_url: "https://github.com/ayuntamientomadrid" copyright: "Ayuntamiento de Madrid, %{year}" participation_title: "Participation" - participation_text: Decide what should be the city of Madrid you want. - transparency_title: Transparency - transparency_text: Get any information on the City of Madrid. - open_data_title: Open Data - open_data_text: "All City Council data are yours." - contact_us: "For technical support contact us" + participation_text: "Decide how to shape the Madrid you want to live in." + transparency_title: "Transparency" + transparency_text: "Find out anything about the Madrid City Council." + open_data_title: "Open data" + open_data_text: "Every detail about the City Council is yours to access." + contact_us: "Contact us at" privacy: "Privacy Policy" - conditions: "Terms of use" + conditions: "Terms and conditions of use" more_info: "More information" accessibility: "Accessibility" application: - ie_title: "This site is not optimized for your browser" + ie_title: "This website is not optimised for your browser" ie: - "You are using Internet Explorer. - For a better experience we recommend use %{chrome} or %{firefox}." + "We have detected that you are browsing with Internet Explorer. + For an enhanced experience, we recommend using %{chrome} or %{firefox}." chrome: "Google Chrome" firefox: "Firefox" social: @@ -61,89 +61,86 @@ en: blog: "Blog" youtube: "YouTube" form: - error: error - errors: errors - not_saved: "prohibited this %{resource} from being saved:" - accept_terms: "I accept the %{policy} and the %{conditions}" - policy: "Privacy policy" - conditions: "Terms of use" - user: account - debate: debate - proposal: proposal - verification::sms: phone - verification::letter: verification + error: "error" + errors: "errors" + not_saved: "prevented this %{resource} from being saved:" + accept_terms: "I agree to the %{policy} and the %{conditions}" + policy: "Privacy Policy" + conditions: "Terms and conditions of use" + user: "Account" + debate: "Debate" + proposal: "Proposal" + verification::sms: "Telephone" + verification::letter: "the verification" application: - alert: - only_beta_testers: "Sorry only Beta Testers are allowed access at the moment" close: "Close" menu: "Menu" debates: index: - title: Debates - start_debate: Start a debate - select_order: Order by - select_order_long: Order debates by + title: "Debates" + start_debate: "Start a debate" + select_order: "Order by" + select_order_long: "You are viewing debates according to:" orders: - confidence_score: best rated - hot_score: most active - created_at: newest - most_commented: most commented - random: random + confidence_score: "highest rated" + hot_score: "most active" + created_at: "newest" + most_commented: "most commented" + random: "random" filter_topic: - one: " with the topic '%{topic}'" - other: " with the topic '%{topic}'" + one: " with topic '%{topic}'" + other: " with topic '%{topic}'" search_form: - title: Search - button: Search + title: "Search" + button: "Search" placeholder: "Search debates..." search_results: - one: " containing '%{search_term}'" - other: " containing '%{search_term}'" + one: " containing the term '%{search_term}'" + other: " containing the term '%{search_term}'" debate: - debate: Debate + debate: "Debate" comments: - zero: No comments - one: 1 Comment - other: "%{count} Comments" + zero: "No comments" + one: "1 comment" + other: "%{count} comments" votes: - zero: No votes - one: 1 vote + zero: "No votes" + one: "1 vote" other: "%{count} votes" form: - debate_title: Debate title - debate_text: Initial text for debate - tags_label: Topics - tags_instructions: > - Tag this debate. You can choose among our proposals on the list or add any other topic you want. - tags_placeholder: "Add topics writing them separated by ','" + debate_title: "Debate title" + debate_text: "Initial debate text" + tags_label: "Topics" + tags_instructions: "Tag this debate. You can choose from our suggestions or enter your own." + tags_placeholder: "Enter the tags you would like to use, separated by commas (',')" show: - back_link: Back - author_deleted: Deleted user - comments_title: Comments + back_link: "Go back" + author_deleted: "User deleted" + comments_title: "Comments" comments: - zero: No comments - one: 1 Comment - other: "%{count} Comments" - login_to_comment: "You need to %{signin} or %{signup} to comment." - edit_debate_link: "Edit debate" - share: Share - flag: "This debate has been flag as innapropiate for some users." + zero: "No comments" + one: "1 comment" + other: "%{count} comments" + login_to_comment: "You must %{signin} or %{signup} to leave a comment." + edit_debate_link: "Edit" + share: "Share" + flag: "This debate has been flagged as inappropriate by several users." edit: - editing: Edit debate - show_link: Show debate - back_link: Back + editing: "Edit debate" + show_link: "View debate" + back_link: "Go back" form: submit_button: "Save changes" new: - start_new: Start a debate - info: "A debate is a discussion forum, not a proposal. And soon... we opened the section of citizen proposals." - more_info: "More info" - back_link: Back - recommendations_title: Tips for creating a debate - recommendation_one: "Do not write the title of the debate or whole sentences in capital. On the Internet this is considered shouting. And nobody likes to scream." - recommendation_two: "Any discussion or comment that involves an illegal act will be eliminated, also intending to sabotage the debate spaces, everything else is permitted." - recommendation_three: "The harsh criticism are very welcome. This is a space of thought but we recommend preserving the elegance and intelligence. The world is better with them present." - recommendation_four: "Enjoy this space, voices that fill it, it is yours too." + start_new: "Start a debate" + info: "A debate is a discussion forum, not a citizen proposal. Very soon we will be opening the citizen proposal section, where anyone will be able to present a proposal which, if they receive support, will be implemented by the City Council." + more_info: "More information" + back_link: "Go back" + recommendations_title: "Recommendations for creating a debate" + recommendation_one: "Do not use capital letters for the debate title or for whole sentences. On the internet, this is considered shouting. And nobody likes being shouted at." + recommendation_two: "Any debate or comment suggesting illegal action will be deleted, as well as those intending to sabotage the debate spaces. Anything else is allowed." + recommendation_three: "Ruthless criticism is very welcome. This is a space for reflection. But we recommend that you stick to elegance and intelligence. The world is a better place with these virtues in it." + recommendation_four: "Enjoy this space and the voices that fill it. It belongs to you too." form: submit_button: "Start a debate" create: @@ -154,91 +151,90 @@ en: submit_button: "Save changes" proposals: index: - title: Proposals + title: "Proposals" featured_proposals_html: "Featured
proposals" - start_proposal: Start a proposal - select_order: Order by - select_order_long: Order proposals by + start_proposal: "Create a proposal" + select_order: "Order by" + select_order_long: "You are viewing proposals according to:" orders: - confidence_score: "most supported" - hot_score: "most active today" - created_at: newest - most_commented: most commented - random: random + confidence_score: "highest rated" + hot_score: "most active" + created_at: "newest" + most_commented: "most commented" + random: "random" filter_topic: - one: " with the topic '%{topic}'" - other: " with the topic '%{topic}'" + one: " with topic '%{topic}'" + other: " with topic '%{topic}'" search_form: - title: Search - button: Search - placeholder: "Search proposals..." + title: "Search" + button: "Search" + placeholder: "Search citizen proposals..." search_results: - one: " containing '%{search_term}'" - other: " containing '%{search_term}'" + one: " containing the term '%{search_term}'" + other: " containing the term '%{search_term}'" proposal: - proposal: Proposal + proposal: "Proposal" support: "Support" support_title: "Support this proposal" comments: - zero: No comments - one: 1 Comment - other: "%{count} Comments" + zero: "No comments" + one: "1 comment" + other: "%{count} comments" supports: - zero: No supports - one: 1 support + zero: "No supports" + one: "1 support" other: "%{count} supports" - supports_necessary: "53.726 necessary supports" - census_percent: "2% of census" + supports_necessary: "53,726 supports needed" + census_percent: "2% of Census" total_percent: "100%" - already_supported: "You already supported this proposal, share it!" + already_supported: "You have already supported this proposal. Share it!" form: - proposal_title: Proposal title - proposal_question: Proposal question - proposal_question_example_html: "Debe ser resumida en una pregunta cuya respuesta sea Sí o No. Ej. '¿Está usted de acuerdo en peatonalizar la calle Mayor?'" - proposal_text: Initial text for proposal - proposal_external_url: Link to additional documentation - proposal_video_url: "Enlace a vídeo externo" - proposal_video_url_note: "Puedes añadir un enlace a YouTube o Vimeo" + proposal_title: "Proposal title" + proposal_question: "Proposal question" + proposal_question_example_html: "Must be summarised in one question with a Yes or No answer. E.g. 'Do you agree with the pedestrianisation of Calle Mayor?'" proposal_summary: "Proposal summary" - proposal_summary_note: "200 chars. maximum" - proposal_responsible_name: "First and last name of the person making this proposal" - proposal_responsible_name_note: "(individualmente o como representante de un colectivo; no se mostrará públicamente)" - tags_label: Topics - tags_instructions: > - Tag this proposal. You can choose among our proposals on the list or add any other topic you want. - tags_placeholder: "Add topics writing them separated by ','" + proposal_summary_note: "(maximum 200 characters)" + proposal_text: "Proposal text" + proposal_external_url: "Link to additional documentation" + proposal_video_url: "Link to external video" + proposal_video_url_note: "You may add a link to YouTube or Vimeo" + proposal_responsible_name: "Full name of the person submitting the proposal" + proposal_responsible_name_note: "(individually or as representative of a collective; will not be displayed publically)" + tags_label: "Tags" + tags_instructions: "Tag this proposal. You can choose from our tags or add your own." + tags_placeholder: "Enter the tags you would like to use, separated by commas (',')" show: - back_link: Back - author_deleted: Deleted user + back_link: "Go back" + author_deleted: "User deleted" code: "Proposal code:" - comments_title: Comments + comments_title: "Comments" comments: - zero: No comments - one: 1 Comment - other: "%{count} Comments" - login_to_comment: "You need to %{signin} or %{signup} to comment." - edit_proposal_link: "Edit proposal" - share: Share - flag: "This proposal has been flag as innapropiate for some users." + zero: "No comments" + one: "1 comment" + other: "%{count} comments" + login_to_comment: "You must %{signin} or %{signup} to leave a comment." + edit_proposal_link: "Edit" + share: "Share" + flag: "This proposal has been flagged as inappropriate by several users." edit: - editing: Edit proposal - show_link: Show proposal - back_link: Back + editing: "Edit proposal" + show_link: "View proposal" + back_link: "Go back" form: submit_button: "Save changes" new: - start_new: Start a proposal - more_info: "¿Cómo funcionan las propuestas ciudadanas?" - back_link: Back - recommendations_title: Tips for creating a proposal - recommendation_one: "Do not write the title of the proposal or whole sentences in capital. On the Internet this is considered shouting. And nobody likes to scream." - recommendation_two: "Any discussion or comment that involves an illegal act will be eliminated, also intending to sabotage the proposal spaces, everything else is permitted." - recommendation_three: "Enjoy this space, voices that fill it, it is yours too." + start_new: "Create new proposal" + more_info: "How do citizen proposals work?" + back_link: "Go back" + recommendations_title: "Recommendations for creating a proposal" + recommendation_one: "Do not use capital letters for the proposal title or for whole sentences. On the internet, this is considered shouting. And nobody likes being shouted at." + recommendation_two: "Any proposal or comment suggesting illegal action will be deleted, as well as those intending to sabotage the debate spaces. Anything else is allowed." + recommendation_three: "Enjoy this space and the voices that fill it. It belongs to you too." form: - submit_button: "Start a proposal" + submit_button: "Create proposal" create: form: - submit_button: "Start a proposal" + submit_button: "Create proposal" update: form: submit_button: "Save changes" @@ -248,56 +244,56 @@ en: confidence_score: "Most voted" created_at: "Newest" form: - leave_comment: Write a comment - comment_as_moderator: Comment as moderator - comment_as_admin: Comment as administrator + leave_comment: "Leave your comment" + comment_as_moderator: "Comment as moderator" + comment_as_admin: "Comment as admin" comment: - author: Author - moderator: Moderator - admin: Administrator - deleted: This comment has been deleted - user_deleted: Deleted user + author: "Author" + moderator: "Moderator" + admin: "Administrator" + deleted: "This comment has been deleted" + user_deleted: "User deleted" responses: - zero: No Responses - one: 1 Response - other: "%{count} Responses" + zero: "No responses" + one: "1 response" + other: "%{count} responses" votes: - zero: No votes - one: 1 vote + zero: "No votes" + one: "1 vote" other: "%{count} votes" comments_helper: - comment_link: Comment - comment_button: Publish comment - reply_link: Reply - reply_button: Publish reply + comment_link: "Comment" + comment_button: "Publish comment" + reply_link: "Reply" + reply_button: "Publish reply" votes: - agree: I agree - disagree: I disagree - supports: Supports - unauthenticated: "You need to %{signin} or %{signup} before continuing." - signin: sign in - signup: sign up - anonymous: "Too many anonymous votes, %{verify_account} to vote." - verified_only: "Proposals can only be voted by verified users, %{verify_account}." - verify_account: verify your account - organizations: Organizations can not vote + agree: "I agree" + disagree: "I disagree" + supports: "Supports" + unauthenticated: "You must %{signin} or %{signup} to continue." + signin: "Sign in" + signup: "Sign up" + anonymous: "Too many anonymous votes to admit vote %{verify_account}." + verified_only: "Only verified users can vote on proposals; %{verify_account}." + verify_account: "verify your account" + organizations: "Organisations are not permitted to vote" account: show: title: "My account" save_changes_submit: "Save changes" change_credentials_link: "Change my credentials" - email_on_comment_label: "Receive email when someone comments on my debates or proposals" - email_on_comment_reply_label: "Receive email when someone replies to my comments" + email_on_comment_label: "Notify me by email when someone comments on my proposals or debates" + email_on_comment_reply_label: "Notify me by email when someone replies to my comments" erase_account_link: "Erase my account" - personal: "Personal data" + personal: "Personal details" username_label: "Username" phone_number_label: "Phone number" - organization_name_label: "Organization name" - organization_responsible_name_placeholder: "The responsible representative of the organization" - notifications: Notifications - finish_verification: "Finish verification" - verified_account: Verified account - verify_my_account: Verify my account + organization_name_label: "Name of organisation" + organization_responsible_name_placeholder: "Representative of the organisation/collective" + notifications: "Notifications" + finish_verification: "Complete verification" + verified_account: "Account verified" + verify_my_account: "Verify my account" user_permission_title: "Participation" user_permission_info: "With your account you can..." user_permission_debates: "Participate on debates" @@ -307,45 +303,45 @@ en: user_permission_verify: "To perform all the actions verify your account." user_permission_verify_info: "* Only for users on Madrid City Census." simple_captcha: - placeholder: "Enter the image value" - label: "Enter the image value in the next form" + placeholder: "Enter the text from the image" + label: "Enter the text from the image in the box below" refresh_button_text: "Refresh" message: - user: "secret code did not match with the image" - debate: "secret code did not match with the image" - proposal: "secret code did not match with the image" + user: "the secret code does not match the image" + debate: "the secret code does not match the image" + proposal: "the secret code does not match the image" shared: author_info: - author_deleted: Deleted user + author_deleted: "User deleted" tags_cloud: - tags: Trend + tags: "Trending" print: print_button: "Print this info" - flag: Flag as inappropriate - unflag: Undo flag - collective: Collective - check: Select - check_all: All - check_none: None + flag: "Flag as inappropriate" + unflag: "Unflag" + collective: "Collective" + check: "Select" + check_all: "All" + check_none: "None" unauthorized: - default: "You are not authorized to access this page." + default: "You do not have permission to access this page." manage: - all: "You are not authorized to %{action} %{subject}." + all: "You do not have permission to carry out the action '%{action}' on %{subject}." welcome: highlights: "Highlights: " - signed_in_home_title: Recent activity + signed_in_home_title: "Recent activity" debates: - title: "Debate" - description: "Meet, discuss and share what we think is important in our city." + title: "Debates" + description: "For meeting, discussing and sharing the things that matter to us in our city." proposal: title: "You propose" - description: "Open to citizens proposals on the kind of city we want to live." + description: "Open space for citizen proposals about the kind of city we want to live in." decide: title: "You decide" - description: "Citizenship decide whether to accept or reject the most supported proposals." + description: "The public decides if it accepts or rejects the most supported proposals." do: - title: "It does" - description: "If the proposal is accepted mostly, the City Council makes his own and done." + title: "It gets done" + description: "If the proposal is accepted by the majority, the City Council accepts it as its own and it gets done." welcome: title: "Participate" go_to_index: "See proposals and debates" @@ -353,19 +349,19 @@ en: user_permission_debates: "Participate on debates" user_permission_proposal: "Create new proposals" user_permission_support_proposal: "Support proposals*" - user_permission_votes: "Participate on final voting*" + user_permission_votes: "Participate on final voting" user_permission_verify: "To perform all the actions %{verify}." user_permission_verify_url: "verify your account" - user_permission_verify_info: "* Only for users on Madrid City Census." + user_permission_verify_info: "* Only for users on Madrid Census." omniauth: finish_signup: - title: Add Email + title: "Add your email address" twitter: - sign_in: Sign in with Twitter - sign_up: Sign up with Twitter + sign_in: "Sign in with Twitter" + sign_up: "Sign up with Twitter" facebook: - sign_in: Sign in with Facebook - sign_up: Sign up with Facebook + sign_in: "Sign in with Facebook" + sign_up: "Sign up with Facebook" google_oauth2: - sign_in: Sign in with Google - sign_up: Sign up with Google + sign_in: "Sign in with Google" + sign_up: "Sign up with Google" diff --git a/config/locales/es.yml b/config/locales/es.yml index 9150404e3..96ea81c10 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -6,11 +6,11 @@ es: layouts: header: logo: "Madrid" - external_link_transparency: Transparencia + external_link_transparency: "Transparencia" external_link_transparency_url: "http://www.madrid.es/portales/munimadrid/es/Inicio/El-Ayuntamiento/Transparencia?vgnextfmt=default&vgnextchannel=20fd850769797310VgnVCM2000000c205a0aRCRD" - external_link_opendata: Datos abiertos + external_link_opendata: "Datos abiertos" external_link_opendata_url: "http://datos.madrid.es" - external_link_blog: Blog + external_link_blog: "Blog" external_link_blog_url: "/blog" open_gov: "Gobierno %{open}" open: "abierto" @@ -22,14 +22,14 @@ es: "Existen ciudades gobernadas directamente por sus habitantes, que debaten sobre temas que les preocupan, proponen ideas para mejorar sus vidas y deciden entre todas y todos las que se llevan a cabo. Madrid ya es una de ellas." see_all: "Ver propuestas" - my_account_link: Mi cuenta + my_account_link: "Mi cuenta" locale: "Idioma:" - administration: Administrar - moderation: Moderar - highlights: "Portada" + administration: "Administrar" + moderation: "Moderar" + # highlights: "Portada" more_information: "Más información" - debates: Debates - proposals: Propuestas ciudadanas + debates: "Debates" + proposals: "Propuestas ciudadanas" footer: description: "Este portal usa la %{consul} que es %{open_source}. De Madrid, para el mundo entero." open_source: "software libre" @@ -39,9 +39,9 @@ es: copyright: "Ayuntamiento de Madrid, %{year}" participation_title: "Participación" participation_text: "Decide cómo debe ser la ciudad de Madrid que quieres." - transparency_title: Transparencia + transparency_title: "Transparencia" transparency_text: "Obtén cualquier información sobre el Ayuntamiento de Madrid." - open_data_title: Datos Abiertos + open_data_title: "Datos Abiertos" open_data_text: "Todos los datos del Ayuntamiento son tuyos." contact_us: "Para asistencia técnica contáctenos en" privacy: "Política de privacidad" @@ -61,28 +61,26 @@ es: blog: "Blog" youtube: "YouTube" form: - error: error - errors: errores - not_saved: "impidieron guardar %{resource}:" - accept_terms: "Acepto la %{policy} y las %{conditions}" - policy: "Política de privacidad" - conditions: "Condiciones de uso" - user: la cuenta - debate: el debate - proposal: la propuesta - verification::sms: el teléfono - verification::letter: la verificación + error: "error" + errors: "errores" + not_saved: "impidieron guardar %{resource}:" + accept_terms: "Acepto la %{policy} y las %{conditions}" + policy: "Política de privacidad" + conditions: "Condiciones de uso" + user: "la cuenta" + debate: "el debate" + proposal: "la propuesta" + verification::sms: "el teléfono" + verification::letter: "la verificación" application: - alert: - only_beta_testers: "Lo sentimos sólo los usuarios de pruebas tienen acceso de momento" close: "Cerrar" menu: "Menú" debates: index: - title: Debates - start_debate: Empieza un debate - select_order: Ordenar por - select_order_long: Estás viendo los debates + title: "Debates" + start_debate: "Empieza un debate" + select_order: "Ordenar por" + select_order_long: "Estás viendo los debates" orders: confidence_score: "mejor valorados" hot_score: "más activos" @@ -93,53 +91,52 @@ es: one: " con el tema '%{topic}'" other: " con el tema '%{topic}'" search_form: - title: Buscar - button: Buscar + title: "Buscar" + button: "Buscar" placeholder: "Buscar debates..." search_results: one: " que contiene '%{search_term}'" other: " que contienen '%{search_term}'" debate: - debate: Debate + debate: "Debate" comments: - zero: Sin comentarios - one: 1 Comentario + zero: "Sin comentarios" + one: "1 Comentario" other: "%{count} Comentarios" votes: - zero: Sin votos - one: 1 voto + zero: "Sin votos" + one: "1 voto" other: "%{count} votos" form: - debate_title: Título del debate - debate_text: Texto inicial del debate - tags_label: Temas - tags_instructions: > - Etiqueta este debate. Puedes elegir entre nuestras propuestas o introducir las que desees. + debate_title: "Título del debate" + debate_text: "Texto inicial del debate" + tags_label: "Temas" + tags_instructions: "Etiqueta este debate. Puedes elegir entre nuestras propuestas o introducir las que desees." tags_placeholder: "Escribe las etiquetas que desees separadas por coma (',')" show: - back_link: Volver - author_deleted: Usuario eliminado - comments_title: Comentarios + back_link: "Volver" + author_deleted: "Usuario eliminado" + comments_title: "Comentarios" comments: - zero: Sin comentarios - one: 1 Comentario + zero: "Sin comentarios" + one: "1 Comentario" other: "%{count} Comentarios" login_to_comment: "Necesitas %{signin} o %{signup} para comentar." edit_debate_link: "Editar debate" - share: Compartir + share: "Compartir" flag: "Este debate ha sido marcado como inapropiado por varios usuarios." edit: - editing: Editar debate - show_link: Ver debate - back_link: Volver + editing: "Editar debate" + show_link: "Ver debate" + back_link: "Volver" form: submit_button: "Guardar cambios" new: - start_new: Empezar un debate + start_new: "Empezar un debate" info: "Un debate es un foro de discusión, no una propuesta ciudadana. Muy pronto abriremos la sección de propuestas ciudadanas, donde cualquiera podrá presentar propuestas y, si reciben apoyo, serán puestas en marcha por el Ayuntamiento." more_info: "Más información" - back_link: Volver - recommendations_title: Recomendaciones para crear un debate + back_link: "Volver" + recommendations_title: "Recomendaciones para crear un debate" recommendation_one: "No escribas el título del debate o frases enteras en mayúsculas. En internet eso se considera gritar. Y a nadie le gusta que le griten." recommendation_two: "Cualquier debate o comentario que implique una acción ilegal será eliminado, también los que tengan la intención de sabotear los espacios de debate, todo lo demás está permitido." recommendation_three: "Las críticas despiadadas son muy bienvenidas. Este es un espacio de pensamiento. Pero te recomendamos conservar la elegancia y la inteligencia. El mundo es mejor con ellas presentes." @@ -154,11 +151,11 @@ es: submit_button: "Guardar cambios" proposals: index: - title: Propuestas ciudadanas + title: "Propuestas ciudadanas" featured_proposals_html: "Propuestas
destacadas" - start_proposal: Crea una propuesta - select_order: Ordenar por - select_order_long: Estás viendo las propuestas + start_proposal: "Crea una propuesta" + select_order: "Ordenar por" + select_order_long: "Estás viendo las propuestas" orders: confidence_score: "más apoyadas" hot_score: "más activas hoy" @@ -169,68 +166,67 @@ es: one: " con el tema '%{topic}'" other: " con el tema '%{topic}'" search_form: - title: Search - button: Search + title: "Buscar" + button: "Buscar" placeholder: "Buscar propuestas ciudadanas..." search_results: one: " que contiene '%{search_term}'" other: " que contienen '%{search_term}'" proposal: - proposal: Propuesta + proposal: "Propuesta" support: "Apoyar" support_title: "Apoyar esta propuesta" comments: - zero: Sin comentarios - one: 1 Comentario + zero: "Sin comentarios" + one: "1 Comentario" other: "%{count} Comentarios" supports: - zero: Sin apoyos - one: 1 apoyo + zero: "Sin apoyos" + one: "1 apoyo" other: "%{count} apoyos" supports_necessary: "53.726 apoyos necesarios" census_percent: "2% del Censo" total_percent: "100%" already_supported: "¡Ya has apoyado esta propuesta, compártela!" form: - proposal_title: Título de la propuesta - proposal_question: Pregunta de la propuesta + proposal_title: "Título de la propuesta" + proposal_question: "Pregunta de la propuesta" proposal_question_example_html: "Debe ser resumida en una pregunta cuya respuesta sea Sí o No. Ej. '¿Está usted de acuerdo en peatonalizar la calle Mayor?'" proposal_summary: "Resumen de la propuesta" proposal_summary_note: "(máximo 200 caracteres)" - proposal_text: Texto desarrollado de la propuesta - proposal_external_url: Enlace a documentación adicional + proposal_text: "Texto desarrollado de la propuesta" + proposal_external_url: "Enlace a documentación adicional" proposal_video_url: "Enlace a vídeo externo" proposal_video_url_note: "Puedes añadir un enlace a YouTube o Vimeo" proposal_responsible_name: "Nombre y apellidos de la persona que hace esta propuesta" proposal_responsible_name_note: "(individualmente o como representante de un colectivo; no se mostrará públicamente)" - tags_label: Temas - tags_instructions: > - Etiqueta esta propuesta. Puedes elegir entre nuestras propuestas o introducir las que desees. + tags_label: "Temas" + tags_instructions: "Etiqueta esta propuesta. Puedes elegir entre nuestras propuestas o introducir las que desees." tags_placeholder: "Escribe las etiquetas que desees separadas por una coma (',')" show: - back_link: Volver - author_deleted: Usuario eliminado + back_link: "Volver" + author_deleted: "Usuario eliminado" code: "Código de la propuesta:" - comments_title: Comentarios + comments_title: "Comentarios" comments: - zero: Sin comentarios - one: 1 Comentario + zero: "Sin comentarios" + one: "1 Comentario" other: "%{count} Comentarios" login_to_comment: "Necesitas %{signin} o %{signup} para comentar." edit_proposal_link: "Editar propuesta" - share: Compartir + share: "Compartir" flag: "Esta propuesta ha sido marcada como inapropiada por varios usuarios." edit: - editing: Editar propuesta - show_link: Ver propuesta - back_link: Volver + editing: "Editar propuesta" + show_link: "Ver propuesta" + back_link: "Volver" form: submit_button: "Guardar cambios" new: - start_new: Crear una propuesta + start_new: "Crear una propuesta" more_info: "¿Cómo funcionan las propuestas ciudadanas?" - back_link: Volver - recommendations_title: Recomendaciones para crear una propuesta + back_link: "Volver" + recommendations_title: "Recomendaciones para crear una propuesta" recommendation_one: "No escribas el título de la propuesta o frases enteras en mayúsculas. En internet eso se considera gritar. Y a nadie le gusta que le griten." recommendation_two: "Cualquier propuesta o comentario que implique una acción ilegal será eliminada, también las que tengan la intención de sabotear los espacios de propuesta, todo lo demás está permitido." recommendation_three: "Disfruta de este espacio, de las voces que lo llenan, también es tuyo." @@ -248,39 +244,39 @@ es: confidence_score: "Más votados" created_at: "Más nuevos" form: - leave_comment: Deja tu comentario - comment_as_moderator: Comentar como moderador - comment_as_admin: Comentar como administrador + leave_comment: "Deja tu comentario" + comment_as_moderator: "Comentar como moderador" + comment_as_admin: "Comentar como administrador" comment: - author: Autor - moderator: Moderador - admin: Administrador - deleted: Este comentario ha sido eliminado - user_deleted: Usuario eliminado + author: "Autor" + moderator: "Moderador" + admin: "Administrador" + deleted: "Este comentario ha sido eliminado" + user_deleted: "Usuario eliminado" responses: - zero: Sin respuestas - one: 1 Respuesta + zero: "Sin respuestas" + one: "1 Respuesta" other: "%{count} Respuestas" votes: - zero: Sin votos - one: 1 voto + zero: "Sin votos" + one: "1 voto" other: "%{count} votos" comments_helper: - comment_link: Comentar - comment_button: Publicar comentario - reply_link: Responder - reply_button: Publicar respuesta + comment_link: "Comentar" + comment_button: "Publicar comentario" + reply_link: "Responder" + reply_button: "Publicar respuesta" votes: - agree: Estoy de acuerdo - disagree: No estoy de acuerdo - supports: Apoyos + agree: "Estoy de acuerdo" + disagree: "No estoy de acuerdo" + supports: "Apoyos" unauthenticated: "Necesitas %{signin} o %{signup} para continuar." - signin: iniciar sesión - signup: registrarte + signin: "iniciar sesión" + signup: "registrarte" anonymous: "Demasiados votos anónimos, para poder votar %{verify_account}." verified_only: "Las propuestas sólo pueden ser votadas por usuarios verificados, %{verify_account}." - verify_account: verifica tu cuenta - organizations: Las organizaciones no pueden votar + verify_account: "verifica tu cuenta" + organizations: "Las organizaciones no pueden votar" account: show: title: "Mi cuenta" @@ -294,10 +290,10 @@ es: phone_number_label: "Teléfono" organization_name_label: "Nombre de la organización" organization_responsible_name_placeholder: "Representante de la asociación/colectivo" - notifications: Notificaciones + notifications: "Notificaciones" finish_verification: "Finalizar verificación" - verified_account: Cuenta verificada - verify_my_account: Verificar mi cuenta + verified_account: "Cuenta verificada" + verify_my_account: "Verificar mi cuenta" user_permission_title: "Participación" user_permission_info: "Con tu cuenta ya puedes..." user_permission_debates: "Participar en debates" @@ -318,22 +314,22 @@ es: author_info: author_deleted: Usuario eliminado tags_cloud: - tags: Tendencias + tags: "Tendencias" print: print_button: "Imprimir esta información" - flag: Denunciar como inapropiado - unflag: Deshacer denuncia - collective: Colectivo - check: Seleccionar - check_all: Todos - check_none: Ninguno + flag: "Denunciar como inapropiado" + unflag: "Deshacer denuncia" + collective: "Colectivo" + check: "Seleccionar" + check_all: "Todos" + check_none: "Ninguno" unauthorized: default: "No tienes permiso para acceder a esta página." manage: all: "No tienes permiso para realizar la acción '%{action}' sobre %{subject}." welcome: highlights: "Portada: " - signed_in_home_title: Actividad reciente + signed_in_home_title: "Actividad reciente" debates: title: "Debates" description: "Encontrarnos, debatir y compartir lo que nos parece importante en nuestra ciudad." @@ -359,13 +355,13 @@ es: user_permission_verify_info: "* Sólo usuarios empadronados en el municipio de Madrid." omniauth: finish_signup: - title: Añade tu email + title: "Añade tu email" twitter: - sign_in: Entra con Twitter - sign_up: Regístrate con Twitter + sign_in: "Entra con Twitter" + sign_up: "Regístrate con Twitter" facebook: - sign_in: Entra con Facebook - sign_up: Regístrate con Facebook + sign_in: "Entra con Facebook" + sign_up: "Regístrate con Facebook" google_oauth2: - sign_in: Entra con Google - sign_up: Regístrate con Google + sign_in: "Entra con Google" + sign_up: "Regístrate con Google" diff --git a/config/locales/kaminari.en.yml b/config/locales/kaminari.en.yml old mode 100644 new mode 100755 index e2a79c6b1..b357b1688 --- a/config/locales/kaminari.en.yml +++ b/config/locales/kaminari.en.yml @@ -3,19 +3,19 @@ en: pagination: first: "« First" last: "Last »" - previous: "‹ Prev" + previous: "‹ Previous" next: "Next ›" truncate: "…" helpers: page_entries_info: entry: - zero: "entries" - one: "entry" - other: "entries" + zero: "Entries" + one: "Entry" + other: "Entries" one_page: display_entries: - zero: "No %{entry_name} found" - one: "Displaying 1 %{entry_name}" - other: "Displaying all %{count} %{entry_name}" + zero: "%{entry_name} cannot be found" + one: "There is 1 %{entry_name}" + other: "There are %{count} %{entry_name}" more_pages: - display_entries: "Displaying %{entry_name} %{first} - %{last} of %{total} in total" + display_entries: "Displaying %{first} - %{last} of %{total} %{entry_name}" diff --git a/config/locales/mailers.en.yml b/config/locales/mailers.en.yml old mode 100644 new mode 100755 index 50330a69f..e3f791185 --- a/config/locales/mailers.en.yml +++ b/config/locales/mailers.en.yml @@ -2,19 +2,18 @@ en: mailers: comment: subject: "Someone has commented on your %{commentable}" - hi: Hello - title: New comment - new_comment_by_html: "There is a new comment by %{commenter} on" + hi: "Hi" + title: "New comment" + new_comment_by_html: "There is a new comment from %{commenter}" reply: - subject: Someone has replied to your comment - hi: Hello - title: New reply on your comment - new_reply_by_html: "There'is a new reply by %{commenter} to your comment on" + subject: "Someone has responded to your comment" + hi: "Hi" + title: "New response to your comment" + new_reply_by_html: "There is a new response from %{commenter} to your comment on" email_verification: - subject: Verify your email - title: Please verify yourself - instructions_html: "We need to verify you using this email, which we got from the Census. %{verification_link}" - click_here_to_verify: "Please click here to verify yourself" + subject: "Confirm your email" + title: "Confirm your account using the following link" + instructions_html: "To complete the verification of your user account in the Open Government Portal of the Madrid City Council, you must click %{verification_link}." + click_here_to_verify: "this link" instructions_2_html: "This email will verify your account with %{document_type} %{document_number}. If these don't belong to you, please don't click on the previous link and ignore this email." - thanks: "Thanks" - + thanks: "Thank you very much." diff --git a/config/locales/mailers.es.yml b/config/locales/mailers.es.yml index bf8b276e1..350c4c423 100644 --- a/config/locales/mailers.es.yml +++ b/config/locales/mailers.es.yml @@ -2,17 +2,17 @@ es: mailers: comment: subject: "Alguien ha comentado en tu %{commentable}" - hi: Hola - title: Nuevo comentario + hi: "Hola" + title: "Nuevo comentario" new_comment_by_html: "Hay un nuevo comentario de %{commenter} en" reply: - subject: Alguien ha respondido a tu comentario - hi: Hola - title: Nueva respuesta a tu comentario + subject: "Alguien ha respondido a tu comentario" + hi: "Hola" + title: "Nueva respuesta a tu comentario" new_reply_by_html: "Hay una nueva respuesta de %{commenter} a tu comentario en" email_verification: - subject: Verifica tu email - title: Verifica tu cuenta con el siguiente enlace + subject: "Verifica tu email" + title: "Verifica tu cuenta con el siguiente enlace" instructions_html: "Para terminar de verificar tu cuenta de usuario en el Portal de Gobierno Abierto del Ayuntamiento de Madrid, necesitamos que pulses %{verification_link}." click_here_to_verify: "en este enlace" instructions_2_html: "Este email es para verificar tu cuenta con %{document_type} %{document_number}. Si esos no son tus datos, por favor no pulses el enlace anterior e ignora este email." diff --git a/config/locales/management.en.yml b/config/locales/management.en.yml index 936c9694d..da94e3c79 100644 --- a/config/locales/management.en.yml +++ b/config/locales/management.en.yml @@ -28,9 +28,9 @@ en: proposals: create_proposal: "Create proposal" print: - print_button: Print + print_button: "Print" alert: - unverified_user: User is not verified + unverified_user: "User is not verified" permissions: debates: "Engage in debates" create_proposals: "Create proposals" @@ -65,3 +65,7 @@ en: "We have sent an email to the email address %{email} in order to verify that it belongs to this user. It contains a link they have to click. Then they will have to set their access password before being able to log in to the website" + print: + proposals_title: "Proposals:" + info: "Create yor proposal on http://decide.madrid.es" + note: "The proposals more supported will be voted. If are accepted by a majority, the city Council shall be carried out." \ No newline at end of file diff --git a/config/locales/management.es.yml b/config/locales/management.es.yml index da38ee209..bedc1252d 100644 --- a/config/locales/management.es.yml +++ b/config/locales/management.es.yml @@ -28,9 +28,9 @@ es: proposals: create_proposal: "Crear propuesta" print: - print_button: Imprimir + print_button: "Imprimir" alert: - unverified_user: Este usuario no está verificado + unverified_user: "Este usuario no está verificado" permissions: debates: "Participar en debates" create_proposals: "Crear nuevas propuestas" @@ -65,3 +65,7 @@ es: "Hemos enviado un correo electrónico a %{email} para verificar que es suya. El correo enviado contiene un link que el usuario deberá pulsar. Entonces podrá seleccionar una clave de acceso, y entrar en la web de participación." + print: + proposals_title: "Propuestas:" + info: "Haz tu propuesta en http://decide.madrid.es" + note: "Las propuestas más apoyadas serán llevadas a votación. Y si las acepta una mayoría, el Ayuntamiento las llevará a cabo." \ No newline at end of file diff --git a/config/locales/moderation.en.yml b/config/locales/moderation.en.yml old mode 100644 new mode 100755 index c49b3bc4a..b66ffd136 --- a/config/locales/moderation.en.yml +++ b/config/locales/moderation.en.yml @@ -1,75 +1,75 @@ en: moderation: menu: - proposals: Proposals - flagged_debates: Debates - flagged_comments: Comments - users: Ban users + proposals: "Proposals" + flagged_debates: "Debates" + flagged_comments: "Comments" + users: "Block users" dashboard: index: - title: Moderation + title: "Moderation" comments: index: - hide_comments: Hide comments - block_authors: Block authors - ignore_flags: Ignore flags - title: Comments + hide_comments: "Hide comments" + block_authors: "Block authors" + ignore_flags: "Mark as viewed" + title: "Comments" headers: - comment: Comment - moderate: Moderate - filter: Filter + comment: "Comment" + moderate: "Moderate" + filter: "Filter" filters: - all: All - pending_flag_review: Pending - with_ignored_flag: Ignored - order: Order + all: "All" + pending_flag_review: "Pending" + with_ignored_flag: "Marked as viewed" + order: "Order" orders: - created_at: Newest - flags: Most flagged - confirm: Are you sure? + created_at: "Newest" + flags: "Most flagged" + confirm: "Are you sure?" debates: index: - hide_debates: Hide debates - block_authors: Block authors - ignore_flags: Ignore flags - title: Debates + hide_debates: "Hide debates" + block_authors: "Block authors" + ignore_flags: "Mark as viewed" + title: "Debates" headers: - debate: Debate - moderate: Moderate - filter: Filter + debate: "Debate" + moderate: "Moderate" + filter: "Filter" filters: - all: All - pending_flag_review: Pending - with_ignored_flag: Ignored - order: Order + all: "All" + pending_flag_review: "Pending" + with_ignored_flag: "Marked as viewed" + order: "Order" orders: - created_at: Newest - flags: Most flagged - confirm: Are you sure? + created_at: "Newest" + flags: "Most flagged" + confirm: "Are you sure?" proposals: index: - hide_proposals: Hide proposals - block_authors: Block authors - ignore_flags: Ignore flags - title: Proposals + hide_proposals: "Hide proposals" + block_authors: "Block authors" + ignore_flags: "Mark as viewed" + title: "Proposals" headers: - proposal: Proposal - moderate: Moderate - filter: Filter + proposal: "Proposal" + moderate: "Moderate" + filter: "Filter" filters: - all: All - pending_flag_review: Pending - with_ignored_flag: Ignored - order: Order + all: "All" + pending_flag_review: "Pending review" + with_ignored_flag: "Mark as viewed" + order: "Order by" orders: - created_at: Newest - flags: Most flagged - confirm: Are you sure? + created_at: "Most recent" + flags: "Most flagged" + confirm: "Are you sure?" users: - notice_hide: User banned. + notice_hide: "User blocked. All of this user's debates and comments have been hidden." index: - title: User search and banning - search_placeholder: email or username - search: Search - hide: Ban - hidden: Banned + title: "Block users" + search_placeholder: "email or name of user" + search: "Search" + hide: "Block" + hidden: "Blocked" diff --git a/config/locales/moderation.es.yml b/config/locales/moderation.es.yml index bee1798df..6b4a64692 100644 --- a/config/locales/moderation.es.yml +++ b/config/locales/moderation.es.yml @@ -1,75 +1,75 @@ es: moderation: menu: - proposals: Propuestas - flagged_debates: Debates - flagged_comments: Comentarios - users: Bloquear usuarios + proposals: "Propuestas" + flagged_debates: "Debates" + flagged_comments: "Comentarios" + users: "Bloquear usuarios" dashboard: index: - title: Moderación + title: "Moderación" comments: index: - hide_comments: Ocultar comentarios - block_authors: Bloquear autores - ignore_flags: Marcar como revisados - title: Comentarios + hide_comments: "Ocultar comentarios" + block_authors: "Bloquear autores" + ignore_flags: "Marcar como revisados" + title: "Comentarios" headers: - comment: Comentario - moderate: Moderar - filter: Filtrar + comment: "Comentario" + moderate: "Moderar" + filter: "Filtrar" filters: - all: Todos - pending_flag_review: Pendientes - with_ignored_flag: Marcados como revisados - order: Orden + all: "Todos" + pending_flag_review: "Pendientes" + with_ignored_flag: "Marcados como revisados" + order: "Orden" orders: - created_at: Más nuevos - flags: Más denunciados - confirm: ¿Estás seguro? + created_at: "Más nuevos" + flags: "Más denunciados" + confirm: "¿Estás seguro?" debates: index: - hide_debates: Ocultar debates - block_authors: Bloquear autores - ignore_flags: Marcar como revisados - title: Debates + hide_debates: "Ocultar debates" + block_authors: "Bloquear autores" + ignore_flags: "Marcar como revisados" + title: "Debates" headers: - debate: Debate - moderate: Moderar - filter: Filtrar + debate: "Debate" + moderate: "Moderar" + filter: "Filtrar" filters: - all: Todos - pending_flag_review: Pendientes - with_ignored_flag: Marcados como revisados - order: Orden + all: "Todos" + pending_flag_review: "Pendientes" + with_ignored_flag: "Marcados como revisados" + order: "Orden" orders: - created_at: Más nuevos - flags: Más denunciados - confirm: ¿Estás seguro? + created_at: "Más nuevos" + flags: "Más denunciados" + confirm: "¿Estás seguro?" proposals: index: - hide_proposals: Ocultar Propuestas - block_authors: Bloquear autores - ignore_flags: Marcar como revisadas - title: Propuestas + hide_proposals: "Ocultar Propuestas" + block_authors: "Bloquear autores" + ignore_flags: "Marcar como revisadas" + title: "Propuestas" headers: - proposal: Propuesta - moderate: Moderar - filter: Filtro + proposal: "Propuesta" + moderate: "Moderar" + filter: "Filtro" filters: - all: Todas - pending_flag_review: Pendientes de revisión - with_ignored_flag: Marcadas como revisadas - order: Ordenar por + all: "Todas" + pending_flag_review: "Pendientes de revisión" + with_ignored_flag: "Marcadas como revisadas" + order: "Ordenar por" orders: - created_at: Más recientes - flags: Más denunciadas - confirm: ¿Estás seguro? + created_at: "Más recientes" + flags: "Más denunciadas" + confirm: "¿Estás seguro?" users: - notice_hide: Usuario bloqueado. Se han ocultado todos sus debates y comentarios. + notice_hide: "Usuario bloqueado. Se han ocultado todos sus debates y comentarios." index: - title: Bloquear usuarios - search_placeholder: email o nombre de usuario - search: Buscar - hide: Bloquear - hidden: Bloqueado + title: "Bloquear usuarios" + search_placeholder: "email o nombre de usuario" + search: "Buscar" + hide: "Bloquear" + hidden: "Bloqueado" diff --git a/config/locales/pages.en.yml b/config/locales/pages.en.yml old mode 100644 new mode 100755 index ef2b271a9..6ee7c9bdd --- a/config/locales/pages.en.yml +++ b/config/locales/pages.en.yml @@ -8,17 +8,18 @@ en: conditions: "Terms of use" accessibility: "Accessibility" conditions: - "Terms of use" + "Terms and conditions of use" privacy: "Privacy Policy" general_terms: "Terms and Conditions" census_terms: - "Census Terms" + "To confirm the account, you must be 16 or older and be registered as resident in Madrid, having provided the information requested previously, which the Directorate-General of Civil Participation will verify against the files 'Municipal Census of Inhabitants', for which the Directorate-General for Statistics is responsible, and the 'Citizen Support Services', for which the Directorate-General for Quality and Citizen Services is responsible. + By accepting the verification process, you also consent to the verification of this information, as well as the contact methods featuring in said files. + The data provided will be acquired and processed by the Directorate-General for Civil Participation in the file 'Management of Participatory Activities' mentioned previously in the terms and conditions of use for the Portal." transparency: "Transparency" - opendata: - "Open Data" + opendata: "Open Data" verify: title: "Verify your account" info: "For verufy your account introduce your access data:" @@ -26,4 +27,4 @@ en: email: "Email" password: "Password" code: "Code you received in letter" - submit: "Verify my account" \ No newline at end of file + submit: "Verify my account" diff --git a/config/locales/responders.en.yml b/config/locales/responders.en.yml old mode 100644 new mode 100755 index 68bf8581b..1f0010f6f --- a/config/locales/responders.en.yml +++ b/config/locales/responders.en.yml @@ -2,13 +2,11 @@ en: flash: actions: create: - notice: '%{resource_name} was successfully created.' - # alert: '%{resource_name} could not be created.' + notice: "%{resource_name} created successfully." update: - notice: '%{resource_name} was successfully updated.' - # alert: '%{resource_name} could not be updated.' + notice: "%{resource_name} updated successfully." # destroy: - # notice: '%{resource_name} was successfully destroyed.' - # alert: '%{resource_name} could not be destroyed.' + # notice: "%{resource_name} destroyed successfully." + # alert: "%{resource_name} could not be destroyed." save_changes: - notice: "Saved" + notice: "Changes saved" diff --git a/config/locales/settings.en.yml b/config/locales/settings.en.yml old mode 100644 new mode 100755 index 88846e308..5527736b8 --- a/config/locales/settings.en.yml +++ b/config/locales/settings.en.yml @@ -1,12 +1,12 @@ en: settings: - official_level_1_name: "Level 1 official positions" - official_level_2_name: "Level 2 official positions" - official_level_3_name: "Level 3 official positions" - official_level_4_name: "Level 4 official positions" - official_level_5_name: "Level 5 official positions" - max_ratio_anon_votes_on_debates: "Max allowed percentage of anonymous votes per Debate" - max_votes_for_proposal_edit: "Number of votes where a Proposal is not editable anymore" - max_votes_for_debate_edit: "Number of votes where a Debate is not editable anymore" - proposal_code_prefix: "Prefix for Proposals codes" - votes_for_proposal_success: "Number of votes needed for Proposal approval" + official_level_1_name: "Level 1 public official" + official_level_2_name: "Level 2 public official" + official_level_3_name: "Level 3 public official" + official_level_4_name: "Level 4 public official" + official_level_5_name: "Level 5 public official" + max_ratio_anon_votes_on_debates: "Maximum ratio of anonymous votes per Debate" + max_votes_for_proposal_edit: "Number of votes from which a Proposal can no longer be edited" + max_votes_for_debate_edit: "Number of votes from which a Debate can no longer be edited" + proposal_code_prefix: "Prefix for Proposal codes" + votes_for_proposal_success: "Number of votes necessary for approval of a Proposal" diff --git a/config/locales/social_share_button.en.yml b/config/locales/social_share_button.en.yml index 95dba5da9..b06cb5ad3 100644 --- a/config/locales/social_share_button.en.yml +++ b/config/locales/social_share_button.en.yml @@ -1,19 +1,19 @@ en: social_share_button: - share_to: Share to %{name} - weibo: Sina Weibo - twitter: Twitter - facebook: Facebook - douban: Douban - qq: Qzone - tqq: Tqq - delicious: Delicious - baidu: Baidu.com - kaixin001: Kaixin001.com - renren: Renren.com - google_plus: Google+ - google_bookmark: Google Bookmark - tumblr: Tumblr - plurk: Plurk - pinterest: Pinterest - email: Email + share_to: "Share to %{name}" + weibo: "Sina Weibo" + twitter: "Twitter" + facebook: "Facebook" + douban: "Douban" + qq: "Qzone" + tqq: "Tqq" + delicious: "Delicious" + baidu: "Baidu.com" + kaixin001: "Kaixin001.com" + renren: "Renren.com" + google_plus: "Google+" + google_bookmark: "Google Bookmark" + tumblr: "Tumblr" + plurk: "Plurk" + pinterest: "Pinterest" + email: "Email" diff --git a/config/locales/social_share_button.es.yml b/config/locales/social_share_button.es.yml index e0520c19b..45e4ab2a5 100644 --- a/config/locales/social_share_button.es.yml +++ b/config/locales/social_share_button.es.yml @@ -1,19 +1,19 @@ es: social_share_button: - share_to: Compartir en %{name} - weibo: Sina Weibo - twitter: Twitter - facebook: Facebook - douban: Douban - qq: Qzone - tqq: Tqq - delicious: Delicious - baidu: Baidu.com - kaixin001: Kaixin001.com - renren: Renren.com - google_plus: Google+ - google_bookmark: Google Bookmark - tumblr: Tumblr - plurk: Plurk - pinterest: Pinterest - email: Correo electrónico + share_to: "Compartir en %{name}" + weibo: "Sina Weibo" + twitter: "Twitter" + facebook: "Facebook" + douban: "Douban" + qq: "Qzone" + tqq: "Tqq" + delicious: "Delicious" + baidu: "Baidu.com" + kaixin001: "Kaixin001.com" + renren: "Renren.com" + google_plus: "Google+" + google_bookmark: "Google Bookmark" + tumblr: "Tumblr" + plurk: "Plurk" + pinterest: "Pinterest" + email: "Correo electrónico" diff --git a/config/locales/verification.en.yml b/config/locales/verification.en.yml old mode 100644 new mode 100755 index bde3561fc..97208ec37 --- a/config/locales/verification.en.yml +++ b/config/locales/verification.en.yml @@ -1,108 +1,108 @@ en: verification: - back: "Back to my account" + back: "Return to my account" step_1: "Residence" - step_2: "SMS confirmation" + step_2: "Confirmation code" step_3: "Final verification" alert: - lock: "You have reached the maximum number of verification tries. Please try again later." + lock: "You have reached the maximum number of attempts. Please try again later." user_permission_info: "Verifing your information you'll be able to..." - user_permission_debates: "Participar en debates" - user_permission_proposal: "Crear nuevas propuestas" - user_permission_support_proposal: "Apoyar propuestas*" - user_permission_votes: "Participar en las votaciones finales*" + user_permission_debates: "Participate on debates" + user_permission_proposal: "Create new proposals" + user_permission_support_proposal: "Support proposals*" + user_permission_votes: "Participate on final voting*" residence: new: title: "Verify residence" document_type_label: "Document type" document_type: - spanish_id: "Spanish ID" + spanish_id: "DNI" passport: "Passport" residence_card: "Residence card" document_number: "Document number" date_of_birth: "Date of birth" - postal_code: "Postal code" + postal_code: "Postcode" postal_code_note: "To verify your account you must be on Madrid city Census" - accept_terms_text: "I accept %{terms_url} to access the city Census" - terms: "the terms" + accept_terms_text: "I accept %{terms_url} of the Census" + terms: "the terms and conditions of access" verify_residence: "Verify residence" - form_errors: "prevented your residence verification" - error_verifying_census: "The census of the city of Madrid could not verify your information. Pero revise de information and try again or get in touch with us calling to 010 (or 915298210) or visit any of %{offices}." + form_errors: "prevented the verification of your residence" + error_verifying_census: "The Madrid Census was unable to verify your information. Please confirm that your census details are correct by calling 010 (or 915298210) or visit any of %{offices}." error_verifying_census_offices: "26 Office of Citizen" - error_not_allowed_age: "You need yo be at least 16 years old" - error_not_allowed_postal_code: "To verify your account you need to be in the census of the Madrid town." + error_not_allowed_age: "You must be at least 16 years old" + error_not_allowed_postal_code: "In order to be verified, you must be registered in the municipality of Madrid." create: flash: success: "Residence verified" alert: - unconfirmed_residency: "You have not yet confirmed your residence" + unconfirmed_residency: "You have not yet confirmed your residency" sms: new: - title: "Phone verification" - phone: "Enter your phone for recive the code" + title: "Send confirmation code" + phone: "Enter your mobile phone number to receive the code" phone_note: "We only user your phone for send to you a code, we never contact to you." submit_button: "Send" create: flash: - success: "Enter the confirmation code we have sent your phone" + success: "Enter the confirmation code sent to you by text message" edit: - title: "Phone confirmation" - confirmation_code: "Code confirmation" - resend_sms_text: "You have not received the confirmation code in your phone?" - resend_sms_link: "Request a new code" + title: "Security code confirmation" + confirmation_code: "Enter the code you received on your mobile" + resend_sms_text: "Didn't get a text with your confirmation code?" + resend_sms_link: "Click here to send it again" submit_button: "Send" update: error: "Incorrect confirmation code" flash: level_three: - success: "Correct code. Your account is verified" + success: "Code correct. Your account is now verified" level_two: - success: "Correct code" + success: "Code correct" email: show: flash: - success: "You are now a verified user" + success: "You are a verified user" alert: - failure: "Incorrect verification code" + failure: "Verification code incorrect" create: flash: - success: "We have send you a confirmation email to your email account: %{email}" + success: "We have sent a confirmation email to your account: %{email}" alert: - failure: "There was a problem sending you an email to your account" + failure: "There was a problem with sending an email to your account" letter: new: - title: "Final Verification" + title: "Congratulations!" user_permission_info: "With your account you can..." explanation: "For participate on final voting you can:" office: "Verify in any %{office}" - offices: "Office of Citizen" + offices: "Citizen Support Offices" offices_url: "http://www.madrid.es/portales/munimadrid/es/Inicio/El-Ayuntamiento/Atencion-al-ciudadano/Oficinas-de-Atencion-al-Ciudadano?vgnextfmt=default&vgnextchannel=5b99cde2e09a4310VgnVCM1000000b205a0aRCRD" - send_letter: "Request a letter" + send_letter: "Send me a letter with the code" go_to_index: "See proposals" create: flash: - success_html: "Before voting you'll receive a letter whith the instructions for verify your account.
Remember you can verify your information in any %{offices}." - offices: "Office of Citizen" + success_html: "Thank you for requesting your maximum security code (only required for the final votes). In a few days we will send it to the address featuring in the data we have on file. Please remember that, if you prefer, you can collect your code from any of the %{offices}." + offices: "Citizen Support Offices" offices_url: "http://www.madrid.es/portales/munimadrid/es/Inicio/El-Ayuntamiento/Atencion-al-ciudadano/Oficinas-de-Atencion-al-Ciudadano?vgnextfmt=default&vgnextchannel=5b99cde2e09a4310VgnVCM1000000b205a0aRCRD" edit: title: "Letter requested" see_all: "See proposals" update: flash: - success: "Your account has been verified" + success: "Code correct. Your account is now verified" alert: - unconfirmed_code: "You have not yet enter the confirmation code" + unconfirmed_code: "You have not yet entered the confirmation code" errors: - incorrect_code: "Incorrect confirmation code" + incorrect_code: "Verification code incorrect" verified_user: show: title: "Available information" - explanation: "We currently have the following data in the Census, choose where you want to send the confirmation code." + explanation: "We currently hold the following details on the Register; please select a method for your confirmation code to be sent." email_title: "Emails" - phone_title: "Phones" - use_another_phone: "Use another phone" + phone_title: "Phone numbers" + use_another_phone: "Use other phone" form: submit_button: "Send code" redirect_notices: - email_already_sent: "We already sent you a confirmation email, if you have not received it you can try resend it here" - already_verified: "You are a verified user!" + email_already_sent: "We have already sent an email with a confirmation link. If you cannot locate the email, you can request a reissue here" + already_verified: "Your account is already verified" diff --git a/db/migrate/20151028213830_add_unaccent_extension.rb b/db/migrate/20151028213830_add_unaccent_extension.rb new file mode 100644 index 000000000..60fbc1310 --- /dev/null +++ b/db/migrate/20151028213830_add_unaccent_extension.rb @@ -0,0 +1,5 @@ +class AddUnaccentExtension < ActiveRecord::Migration + def change + execute "create extension if not exists unaccent" + end +end diff --git a/db/migrate/20151028221647_add_pg_trgm_extension.rb b/db/migrate/20151028221647_add_pg_trgm_extension.rb new file mode 100644 index 000000000..97443c2c2 --- /dev/null +++ b/db/migrate/20151028221647_add_pg_trgm_extension.rb @@ -0,0 +1,5 @@ +class AddPgTrgmExtension < ActiveRecord::Migration + def change + execute "create extension if not exists pg_trgm" + end +end diff --git a/db/migrate/20151030182217_add_physical_votes_to_proposals.rb b/db/migrate/20151030182217_add_physical_votes_to_proposals.rb new file mode 100644 index 000000000..367f09f48 --- /dev/null +++ b/db/migrate/20151030182217_add_physical_votes_to_proposals.rb @@ -0,0 +1,5 @@ +class AddPhysicalVotesToProposals < ActiveRecord::Migration + def change + add_column :proposals, :physical_votes, :integer, default: 0 + end +end diff --git a/db/schema.rb b/db/schema.rb index 67626bf0b..cbe2fd671 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,10 +11,12 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20151028145921) do +ActiveRecord::Schema.define(version: 20151030182217) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" + enable_extension "unaccent" + enable_extension "pg_trgm" create_table "activities", force: :cascade do |t| t.integer "user_id" @@ -211,6 +213,7 @@ ActiveRecord::Schema.define(version: 20151028145921) do t.string "responsible_name", limit: 60 t.text "summary" t.string "video_url" + t.integer "physical_votes", default: 0 end add_index "proposals", ["author_id", "hidden_at"], name: "index_proposals_on_author_id_and_hidden_at", using: :btree diff --git a/lib/capistrano/tasks/beta_testers.cap b/lib/capistrano/tasks/beta_testers.cap deleted file mode 100644 index f83f81c78..000000000 --- a/lib/capistrano/tasks/beta_testers.cap +++ /dev/null @@ -1,12 +0,0 @@ -namespace :deploy do - desc "compiles assets locally then rsyncs" - task :beta_testers do - on roles(:app) do |role| - run_locally do - execute"rsync -av ./config/beta-testers.txt #{role.user}@#{role.hostname}:#{shared_path}/config/beta-testers.txt;" - end - "chmod -R 755 #{shared_path}/config/beta-testers.txt" - execute "ln -nfs #{shared_path}/config/beta-testers.txt #{current_path}/config/beta-testers.txt" - end - end -end diff --git a/spec/features/account_spec.rb b/spec/features/account_spec.rb index 029864ec9..bc9c38dae 100644 --- a/spec/features/account_spec.rb +++ b/spec/features/account_spec.rb @@ -37,7 +37,7 @@ feature 'Account' do check 'account_email_on_comment_reply' click_button 'Save changes' - expect(page).to have_content "Saved" + expect(page).to have_content "Changes saved" visit account_path @@ -55,7 +55,7 @@ feature 'Account' do check 'account_email_on_comment_reply' click_button 'Save changes' - expect(page).to have_content "Saved" + expect(page).to have_content "Changes saved" visit account_path @@ -91,7 +91,7 @@ feature 'Account' do click_button 'Erase my account' - expect(page).to have_content "Your account has been successfully cancelled" + expect(page).to have_content "Goodbye! Your account has been cancelled. We hope to see you again soon." login_through_form_as(@user) diff --git a/spec/features/admin/activity_spec.rb b/spec/features/admin/activity_spec.rb index d2836b2d1..715c65f55 100644 --- a/spec/features/admin/activity_spec.rb +++ b/spec/features/admin/activity_spec.rb @@ -201,7 +201,7 @@ feature 'Admin activity' do visit proposal_path(proposal) within("#proposal_#{proposal.id}") do - click_link 'Ban author' + click_link 'Hide author' end visit admin_activity_path @@ -221,7 +221,7 @@ feature 'Admin activity' do visit moderation_users_path(name_or_email: user.username) within(".admin-list") do - click_link 'Ban' + click_link 'Block' end visit admin_activity_path diff --git a/spec/features/admin/comments_spec.rb b/spec/features/admin/comments_spec.rb index d6369272a..34768596f 100644 --- a/spec/features/admin/comments_spec.rb +++ b/spec/features/admin/comments_spec.rb @@ -18,7 +18,7 @@ feature 'Admin comments' do visit proposal_path(proposal) within("#proposal_#{proposal.id}") do - click_link 'Ban author' + click_link 'Hide author' end visit admin_comments_path diff --git a/spec/features/admin/officials_spec.rb b/spec/features/admin/officials_spec.rb index 926f6681e..08c7c27a4 100644 --- a/spec/features/admin/officials_spec.rb +++ b/spec/features/admin/officials_spec.rb @@ -32,7 +32,7 @@ feature 'Admin officials' do select '3', from: 'user_official_level', exact: false click_button 'Update User' - expect(page).to have_content 'Official position saved!' + expect(page).to have_content 'Details of official saved' visit admin_officials_path @@ -55,7 +55,7 @@ feature 'Admin officials' do select '4', from: 'user_official_level', exact: false click_button 'Update User' - expect(page).to have_content 'Official position saved!' + expect(page).to have_content 'Details of official saved' visit admin_officials_path @@ -68,9 +68,9 @@ feature 'Admin officials' do scenario 'Destroy' do visit edit_admin_official_path(@official) - click_link "Remove 'Official' condition" + click_link "Remove 'Official' status" - expect(page).to have_content 'User is not an official anymore' + expect(page).to have_content 'Details saved: the user is no longer an official' expect(current_path).to eq(admin_officials_path) expect(page).to_not have_content @citizen.name expect(page).to_not have_content @official.name diff --git a/spec/features/admin/organizations_spec.rb b/spec/features/admin/organizations_spec.rb index 2acce362b..814aa9df2 100644 --- a/spec/features/admin/organizations_spec.rb +++ b/spec/features/admin/organizations_spec.rb @@ -22,7 +22,7 @@ feature 'Admin::Organizations' do expect(page).to have_content(org.user.email) expect(page).to_not have_content("Greentroll") expect(page).to_not have_content("trol@troller.com") - expect(page).to have_content("There is 1 organization without user or with the user banned") + expect(page).to have_content("There is also one organisation with no users or with a hidden user") end end diff --git a/spec/features/admin/settings_spec.rb b/spec/features/admin/settings_spec.rb index db10e0de7..3673ccd4f 100644 --- a/spec/features/admin/settings_spec.rb +++ b/spec/features/admin/settings_spec.rb @@ -25,6 +25,6 @@ feature 'Admin settings' do click_button 'Update' end - expect(page).to have_content 'Setting updated!' + expect(page).to have_content 'Value updated' end end \ No newline at end of file diff --git a/spec/features/admin/tags_spec.rb b/spec/features/admin/tags_spec.rb index a56f10ffa..74579c1b8 100644 --- a/spec/features/admin/tags_spec.rb +++ b/spec/features/admin/tags_spec.rb @@ -54,7 +54,7 @@ feature 'Admin tags' do expect(page).to have_content tag2.name within("#edit_tag_#{tag2.id}") do - click_link 'Delete Topic' + click_link 'Destroy Topic' end visit admin_tags_path @@ -73,7 +73,7 @@ feature 'Admin tags' do expect(page).to have_content tag2.name within("#edit_tag_#{tag2.id}") do - click_link 'Delete Topic' + click_link 'Destroy Topic' end visit admin_tags_path diff --git a/spec/features/admin/verifications_spec.rb b/spec/features/admin/verifications_spec.rb index 975d5c3e2..9ecd39314 100644 --- a/spec/features/admin/verifications_spec.rb +++ b/spec/features/admin/verifications_spec.rb @@ -43,7 +43,7 @@ feature 'Incomplete verifications' do visit admin_verifications_path within "#user_#{incompletely_verified_user.id}" do - expect(page).to have_content "Spanish ID" + expect(page).to have_content "DNI" expect(page).to have_content incompletely_verified_user.document_number expect(page).to have_content Date.new(1900, 1, 1) expect(page).to have_content "28000" diff --git a/spec/features/admin_spec.rb b/spec/features/admin_spec.rb index ec991e388..644c20f9d 100644 --- a/spec/features/admin_spec.rb +++ b/spec/features/admin_spec.rb @@ -17,7 +17,7 @@ feature 'Admin' do expect(current_path).not_to eq(admin_root_path) expect(current_path).to eq(proposals_path) - expect(page).to have_content "not authorized" + expect(page).to have_content "You do not have permission to access this page" end scenario 'Access as a moderator is not authorized' do @@ -26,7 +26,7 @@ feature 'Admin' do expect(current_path).not_to eq(admin_root_path) expect(current_path).to eq(proposals_path) - expect(page).to have_content "not authorized" + expect(page).to have_content "You do not have permission to access this page" end scenario 'Access as an administrator is authorized' do @@ -34,7 +34,7 @@ feature 'Admin' do visit admin_root_path expect(current_path).to eq(admin_root_path) - expect(page).to_not have_content "not authorized" + expect(page).to_not have_content "You do not have permission to access this page" end scenario "Admin access links" do @@ -99,7 +99,7 @@ feature 'Admin' do expect(page).to have_content 'Mi barrio' - click_link 'Delete Topic' + click_link 'Destroy Topic' expect(page).not_to have_content 'Mi barrio' end diff --git a/spec/features/beta_testers_spec.rb b/spec/features/beta_testers_spec.rb deleted file mode 100644 index 66492b219..000000000 --- a/spec/features/beta_testers_spec.rb +++ /dev/null @@ -1,44 +0,0 @@ -require 'rails_helper' - -feature 'Beta testers' do - - background do - allow_any_instance_of(ApplicationController). - to receive(:beta_site?).and_return(true) - - allow_any_instance_of(ApplicationController). - to receive(:beta_testers).and_return(['isabel@example.com']) - end - - scenario 'Beta testers should have access' do - visit root_path - sign_up('isabel@example.com', 'secretpassword') - confirm_email - - fill_in 'user_email', with: 'isabel@example.com' - fill_in 'user_password', with: 'secretpassword' - click_button 'Log in' - - expect(page).to have_content "Signed in successfully." - end - - scenario 'Non beta testers should not have access' do - visit root_path - sign_up('other@example.com', 'secretpassword') - confirm_email - - fill_in 'user_email', with: 'other@example.com' - fill_in 'user_password', with: 'secretpassword' - click_button 'Log in' - - expect(page).to have_content "Sorry only Beta Testers are allowed access at the moment" - end - - scenario "Trying to access site without being logged in" do - visit debates_path - - expect(page).to have_content "Sorry only Beta Testers are allowed access at the moment" - expect(current_path).to eq(new_user_session_path) - end - -end \ No newline at end of file diff --git a/spec/features/comments/debates_spec.rb b/spec/features/comments/debates_spec.rb index b077e4773..cd00e98f8 100644 --- a/spec/features/comments/debates_spec.rb +++ b/spec/features/comments/debates_spec.rb @@ -100,7 +100,7 @@ feature 'Commenting debates' do create(:comment, commentable: debate) visit debate_path(debate) - expect(page).to have_content 'You need to sign in or sign up to comment' + expect(page).to have_content 'You must Sign in or Sign up to leave a comment' within('#comments') do expect(page).to_not have_content 'Write a comment' expect(page).to_not have_content 'Reply' @@ -233,7 +233,7 @@ feature 'Commenting debates' do visit debate_path(debate) within "#comment_#{comment.id}" do - expect(page).to have_content('Deleted user') + expect(page).to have_content('User deleted') expect(page).to have_content('this should be visible') end end diff --git a/spec/features/comments/proposals_spec.rb b/spec/features/comments/proposals_spec.rb index a706bcfaa..90b6f7d02 100644 --- a/spec/features/comments/proposals_spec.rb +++ b/spec/features/comments/proposals_spec.rb @@ -100,7 +100,7 @@ feature 'Commenting proposals' do create(:comment, commentable: proposal) visit proposal_path(proposal) - expect(page).to have_content 'You need to sign in or sign up to comment' + expect(page).to have_content 'You must Sign in or Sign up to leave a comment' within('#comments') do expect(page).to_not have_content 'Write a comment' expect(page).to_not have_content 'Reply' @@ -233,7 +233,7 @@ feature 'Commenting proposals' do visit proposal_path(proposal) within "#comment_#{comment.id}" do - expect(page).to have_content('Deleted user') + expect(page).to have_content('User deleted') expect(page).to have_content('this should be visible') end end diff --git a/spec/features/debates_spec.rb b/spec/features/debates_spec.rb index 717f02c20..e38c7edc7 100644 --- a/spec/features/debates_spec.rb +++ b/spec/features/debates_spec.rb @@ -56,7 +56,7 @@ feature 'Debates' do visit debates_path(order: :hot_score, page: 1) first(:link, debate.title).click - link_text = find_link('Back')[:href] + link_text = find_link('Go back')[:href] expect(link_text).to include(debates_path order: :hot_score, page: 1) end @@ -74,7 +74,7 @@ feature 'Debates' do click_button 'Start a debate' expect(page).to have_content 'A title for a debate' - expect(page).to have_content 'Debate was successfully created.' + expect(page).to have_content 'Debate created successfully.' expect(page).to have_content 'This is very important because...' expect(page).to have_content author.name expect(page).to have_content I18n.l(Debate.last.created_at.to_date) @@ -91,13 +91,13 @@ feature 'Debates' do click_button "Start a debate" - expect(page).to_not have_content "Debate was successfully created." + expect(page).to_not have_content "Debate created successfully." expect(page).to have_content "1 error" fill_in 'debate_captcha', with: correct_captcha_text click_button "Start a debate" - expect(page).to have_content "Debate was successfully created." + expect(page).to have_content "Debate created successfully." end scenario 'Failed creation goes back to new showing featured tags' do @@ -113,7 +113,7 @@ feature 'Debates' do click_button "Start a debate" - expect(page).to_not have_content "Debate was successfully created." + expect(page).to_not have_content "Debate created successfully." expect(page).to have_content "error" within(".tags") do expect(page).to have_content featured_tag.name @@ -142,7 +142,7 @@ feature 'Debates' do click_button 'Start a debate' - expect(page).to have_content 'Debate was successfully created.' + expect(page).to have_content 'Debate created successfully.' expect(page).to have_content 'Testing an attack' expect(page.html).to include '

This is alert("an attack");

' expect(page.html).to_not include '' @@ -161,7 +161,7 @@ feature 'Debates' do click_button 'Start a debate' - expect(page).to have_content 'Debate was successfully created.' + expect(page).to have_content 'Debate created successfully.' expect(page).to have_content 'Testing auto link' expect(page).to have_link('www.example.org', href: 'http://www.example.org') end @@ -178,13 +178,13 @@ feature 'Debates' do click_button 'Start a debate' - expect(page).to have_content 'Debate was successfully created.' + expect(page).to have_content 'Debate created successfully.' expect(page).to have_content 'Testing auto link' expect(page).to have_link('http://example.org', href: 'http://example.org') expect(page).not_to have_link('click me') expect(page.html).to_not include "" - click_link 'Edit debate' + click_link 'Edit' expect(current_path).to eq edit_debate_path(Debate.last) expect(page).not_to have_link('click me') @@ -216,7 +216,7 @@ feature 'Debates' do click_button 'Start a debate' - expect(page).to have_content 'Debate was successfully created.' + expect(page).to have_content 'Debate created successfully.' ['Medio Ambiente', 'Ciencia'].each do |tag_name| expect(page).to have_content tag_name end @@ -234,7 +234,7 @@ feature 'Debates' do click_button 'Start a debate' - expect(page).to have_content 'Debate was successfully created.' + expect(page).to have_content 'Debate created successfully.' expect(page).to have_content 'user_id1' expect(page).to have_content 'a3' expect(page).to have_content 'scriptalert("hey");script' @@ -250,7 +250,7 @@ feature 'Debates' do visit edit_debate_path(debate) expect(current_path).not_to eq(edit_debate_path(debate)) expect(current_path).to eq(proposals_path) - expect(page).to have_content 'not authorized' + expect(page).to have_content "You do not have permission to carry out the action 'edit' on debate." end scenario 'Update should not be posible if debate is not editable' do @@ -265,7 +265,7 @@ feature 'Debates' do expect(current_path).not_to eq(edit_debate_path(debate)) expect(current_path).to eq(proposals_path) - expect(page).to have_content 'not authorized' + expect(page).to have_content 'You do not have permission to' end scenario 'Update should be posible for the author of an editable debate' do @@ -281,7 +281,7 @@ feature 'Debates' do click_button "Save changes" - expect(page).to have_content "Debate was successfully updated." + expect(page).to have_content "Debate updated successfully." expect(page).to have_content "End child poverty" expect(page).to have_content "Let's do something to end child poverty" end @@ -308,13 +308,13 @@ feature 'Debates' do fill_in 'debate_captcha', with: "wrong!" click_button "Save changes" - expect(page).to_not have_content "Debate was successfully updated." + expect(page).to_not have_content "Debate updated successfully." expect(page).to have_content "error" fill_in 'debate_captcha', with: correct_captcha_text click_button "Save changes" - expect(page).to have_content "Debate was successfully updated." + expect(page).to have_content "Debate updated successfully." end scenario 'Failed update goes back to edit showing featured tags' do @@ -330,7 +330,7 @@ feature 'Debates' do fill_in 'debate_captcha', with: correct_captcha_text click_button "Save changes" - expect(page).to_not have_content "Debate was successfully updated." + expect(page).to_not have_content "Debate updated successfully." expect(page).to have_content "error" within(".tags") do expect(page).to have_content featured_tag.name @@ -419,7 +419,7 @@ feature 'Debates' do create(:debate, title: 'Medium').update_column(:confidence_score, 5) visit debates_path - select 'best rated', from: 'order-selector' + select 'highest rated', from: 'order-selector' expect(page).to have_selector('.js-order-selector[data-order="confidence_score"]') @@ -504,10 +504,12 @@ feature 'Debates' do within("#debates") do expect(page).to have_css('.debate', count: 4) + expect(page).to have_content(debate2.title) expect(page).to have_content(debate4.title) expect(page).to have_content(debate5.title) expect(page).to have_content(debate6.title) + expect(page).to_not have_content(debate1.title) expect(page).to_not have_content(debate3.title) end @@ -518,10 +520,10 @@ feature 'Debates' do conflictive_debate = create(:debate, :conflictive) visit debate_path(conflictive_debate) - expect(page).to have_content "This debate has been flag as innapropiate for some users." + expect(page).to have_content "This debate has been flagged as inappropriate by several users." visit debate_path(good_debate) - expect(page).to_not have_content "This debate has been flag as innapropiate for some users." + expect(page).to_not have_content "This debate has been flagged as inappropriate by several users." end scenario 'Erased author' do @@ -530,9 +532,9 @@ feature 'Debates' do user.erase visit debates_path - expect(page).to have_content('Deleted user') + expect(page).to have_content('User deleted') visit debate_path(debate) - expect(page).to have_content('Deleted user') + expect(page).to have_content('User deleted') end end diff --git a/spec/features/emails_spec.rb b/spec/features/emails_spec.rb index 3058de44c..b5052d582 100644 --- a/spec/features/emails_spec.rb +++ b/spec/features/emails_spec.rb @@ -19,7 +19,7 @@ feature 'Emails' do reset_password email = open_last_email - expect(email).to have_subject('Reset password instructions') + expect(email).to have_subject('Instructions for resetting your password') expect(email).to deliver_to('manuela@madrid.es') expect(email).to have_body_text(edit_user_password_path) end @@ -31,7 +31,7 @@ feature 'Emails' do comment_on(proposal) email = open_last_email - expect(email).to have_subject('Someone has commented on your proposal') + expect(email).to have_subject('Someone has commented on your citizen proposal') expect(email).to deliver_to(proposal.author) expect(email).to have_body_text(proposal_path(proposal)) end @@ -88,7 +88,7 @@ feature 'Emails' do reply_to(user) email = open_last_email - expect(email).to have_subject('Someone has replied to your comment') + expect(email).to have_subject('Someone has responded to your comment') expect(email).to deliver_to(user) expect(email).to have_body_text(debate_path(Comment.first.commentable)) end diff --git a/spec/features/highlights_spec.rb b/spec/features/highlights_spec.rb index 33ade0063..c17ee17ce 100644 --- a/spec/features/highlights_spec.rb +++ b/spec/features/highlights_spec.rb @@ -27,7 +27,7 @@ feature "Highlights" do visit highlights_path - expect(page).to have_link("Start a proposal") + expect(page).to have_link("Create a proposal") expect(page).to have_link("Start a debate") end diff --git a/spec/features/home_spec.rb b/spec/features/home_spec.rb index 0764b353e..f5eec3121 100644 --- a/spec/features/home_spec.rb +++ b/spec/features/home_spec.rb @@ -6,7 +6,7 @@ feature "Home" do scenario 'Welcome message' do visit root_path - expect(page).to have_content "we open this digital Puerta del Sol" + expect(page).to have_content "Love the city, and it will become a city you love" end end diff --git a/spec/features/management/email_verifications_spec.rb b/spec/features/management/email_verifications_spec.rb index cb695a0f7..22987f317 100644 --- a/spec/features/management/email_verifications_spec.rb +++ b/spec/features/management/email_verifications_spec.rb @@ -25,10 +25,10 @@ feature 'EmailVerifications' do sent_token = /.*email_verification_token=(.*)".*/.match(ActionMailer::Base.deliveries.last.body.to_s)[1] visit email_path(email_verification_token: sent_token) - expect(page).to have_content "You are now a verified user" + expect(page).to have_content "You are a verified user" expect(page).to_not have_link "Verify my account" - expect(page).to have_content "Verified account" + expect(page).to have_content "Account verified" expect(user.reload.document_number).to eq('1234') expect(user).to be_level_three_verified diff --git a/spec/features/management/proposals_spec.rb b/spec/features/management/proposals_spec.rb index 2764efca7..e33c1a179 100644 --- a/spec/features/management/proposals_spec.rb +++ b/spec/features/management/proposals_spec.rb @@ -30,9 +30,9 @@ feature 'Proposals' do fill_in 'proposal_captcha', with: correct_captcha_text check 'proposal_terms_of_service' - click_button 'Start a proposal' + click_button 'Create proposal' - expect(page).to have_content 'Proposal was successfully created.' + expect(page).to have_content 'Proposal created successfully.' expect(page).to have_content 'Help refugees' expect(page).to have_content '¿Would you like to give assistance to war refugees?' @@ -120,7 +120,7 @@ feature 'Proposals' do find('.in-favor a').click expect(page).to have_content "1 support" - expect(page).to have_content "You already supported this proposal" + expect(page).to have_content "You have already supported this proposal. Share it!" end expect(current_path).to eq(management_proposals_path) end @@ -139,7 +139,7 @@ feature 'Proposals' do find('.in-favor a').click expect(page).to have_content "1 support" - expect(page).to have_content "You already supported this proposal" + expect(page).to have_content "You have already supported this proposal. Share it!" expect(current_path).to eq(management_proposal_path(proposal)) end diff --git a/spec/features/management/users_spec.rb b/spec/features/management/users_spec.rb index 2e2564df8..31e4bbeeb 100644 --- a/spec/features/management/users_spec.rb +++ b/spec/features/management/users_spec.rb @@ -39,7 +39,7 @@ feature 'users' do expect(user.reload).to be_confirmed - expect(page).to have_content "Your email address has been successfully confirmed." + expect(page).to have_content "Your account has been confirmed." end end \ No newline at end of file diff --git a/spec/features/moderation/comments_spec.rb b/spec/features/moderation/comments_spec.rb index 431e7a31d..1774a1585 100644 --- a/spec/features/moderation/comments_spec.rb +++ b/spec/features/moderation/comments_spec.rb @@ -75,7 +75,7 @@ feature 'Moderate comments' do end scenario 'Ignore the comment' do - click_on "Ignore flags" + click_on "Mark as viewed" expect(page).to_not have_css("comment_#{@comment.id}") expect(@comment.reload).to be_ignored_flag expect(@comment.reload).to_not be_hidden @@ -106,7 +106,7 @@ feature 'Moderate comments' do visit moderation_comments_path(filter: 'all', page: '2', order: 'created_at') - click_on "Ignore flags" + click_on "Mark as viewed" expect(page).to have_selector('.js-order-selector[data-order="created_at"]') @@ -120,27 +120,27 @@ feature 'Moderate comments' do visit moderation_comments_path expect(page).to_not have_link('Pending') expect(page).to have_link('All') - expect(page).to have_link('Ignored') + expect(page).to have_link('Marked as viewed') visit moderation_comments_path(filter: 'all') within('.sub-nav') do expect(page).to_not have_link('All') expect(page).to have_link('Pending') - expect(page).to have_link('Ignored') + expect(page).to have_link('Marked as viewed') end visit moderation_comments_path(filter: 'pending_flag_review') within('.sub-nav') do expect(page).to have_link('All') expect(page).to_not have_link('Pending') - expect(page).to have_link('Ignored') + expect(page).to have_link('Marked as viewed') end visit moderation_comments_path(filter: 'with_ignored_flag') within('.sub-nav') do expect(page).to have_link('All') expect(page).to have_link('Pending') - expect(page).to_not have_link('Ignored') + expect(page).to_not have_link('Marked as viewed') end end diff --git a/spec/features/moderation/debates_spec.rb b/spec/features/moderation/debates_spec.rb index 303950e45..1f68ee80a 100644 --- a/spec/features/moderation/debates_spec.rb +++ b/spec/features/moderation/debates_spec.rb @@ -74,7 +74,7 @@ feature 'Moderate debates' do end scenario 'Ignore the debate' do - click_on "Ignore flags" + click_on "Mark as viewed" expect(page).to_not have_css("debate_#{@debate.id}") expect(@debate.reload).to be_ignored_flag expect(@debate.reload).to_not be_hidden @@ -105,7 +105,7 @@ feature 'Moderate debates' do visit moderation_debates_path(filter: 'all', page: '2', order: 'created_at') - click_on "Ignore flags" + click_on "Mark as viewed" expect(page).to have_selector('.js-order-selector[data-order="created_at"]') @@ -119,27 +119,27 @@ feature 'Moderate debates' do visit moderation_debates_path expect(page).to_not have_link('Pending') expect(page).to have_link('All') - expect(page).to have_link('Ignored') + expect(page).to have_link('Marked as viewed') visit moderation_debates_path(filter: 'all') within('.sub-nav') do expect(page).to_not have_link('All') expect(page).to have_link('Pending') - expect(page).to have_link('Ignored') + expect(page).to have_link('Marked as viewed') end visit moderation_debates_path(filter: 'pending_flag_review') within('.sub-nav') do expect(page).to have_link('All') expect(page).to_not have_link('Pending') - expect(page).to have_link('Ignored') + expect(page).to have_link('Marked as viewed') end visit moderation_debates_path(filter: 'with_ignored_flag') within('.sub-nav') do expect(page).to have_link('All') expect(page).to have_link('Pending') - expect(page).to_not have_link('Ignored') + expect(page).to_not have_link('Marked as viewed') end end diff --git a/spec/features/moderation/proposals_spec.rb b/spec/features/moderation/proposals_spec.rb index 81cc319b2..e41a69bb2 100644 --- a/spec/features/moderation/proposals_spec.rb +++ b/spec/features/moderation/proposals_spec.rb @@ -74,7 +74,7 @@ feature 'Moderate proposals' do end scenario 'Ignore the proposal' do - click_on "Ignore flags" + click_button "Mark as viewed" expect(page).to_not have_css("proposal_#{@proposal.id}") expect(@proposal.reload).to be_ignored_flag expect(@proposal.reload).to_not be_hidden @@ -105,7 +105,7 @@ feature 'Moderate proposals' do visit moderation_proposals_path(filter: 'all', page: '2', order: 'created_at') - click_on "Ignore flags" + click_button "Mark as viewed" expect(page).to have_selector('.js-order-selector[data-order="created_at"]') @@ -119,27 +119,27 @@ feature 'Moderate proposals' do visit moderation_proposals_path expect(page).to_not have_link('Pending') expect(page).to have_link('All') - expect(page).to have_link('Ignored') + expect(page).to have_link('Mark as viewed') visit moderation_proposals_path(filter: 'all') within('.sub-nav') do expect(page).to_not have_link('All') - expect(page).to have_link('Pending') - expect(page).to have_link('Ignored') + expect(page).to have_link('Pending review') + expect(page).to have_link('Mark as viewed') end visit moderation_proposals_path(filter: 'pending_flag_review') within('.sub-nav') do expect(page).to have_link('All') expect(page).to_not have_link('Pending') - expect(page).to have_link('Ignored') + expect(page).to have_link('Mark as viewed') end visit moderation_proposals_path(filter: 'with_ignored_flag') within('.sub-nav') do expect(page).to have_link('All') - expect(page).to have_link('Pending') - expect(page).to_not have_link('Ignored') + expect(page).to have_link('Pending review') + expect(page).to_not have_link('Marked as viewed') end end diff --git a/spec/features/moderation/users_spec.rb b/spec/features/moderation/users_spec.rb index c30623ee5..46ab7fe2a 100644 --- a/spec/features/moderation/users_spec.rb +++ b/spec/features/moderation/users_spec.rb @@ -25,7 +25,7 @@ feature 'Moderate users' do visit debate_path(debate1) within("#debate_#{debate1.id}") do - click_link 'Ban author' + click_link 'Hide author' end expect(current_path).to eq(debates_path) @@ -37,12 +37,12 @@ feature 'Moderate users' do expect(page).to_not have_content(comment3.body) - click_link("Logout") + click_link("Sign out") - click_link 'Log in' + click_link 'Sign in' fill_in 'user_email', with: citizen.email fill_in 'user_password', with: citizen.password - click_button 'Log in' + click_button 'Enter' expect(page).to have_content 'Invalid email or password' expect(current_path).to eq(new_user_session_path) @@ -62,13 +62,13 @@ feature 'Moderate users' do within(".admin-list") do expect(page).to have_content citizen.name - expect(page).not_to have_content "Banned" - click_link 'Ban' + expect(page).not_to have_content "Blocked" + click_link 'Block' end within(".admin-list") do expect(page).to have_content citizen.name - expect(page).to have_content "Banned" + expect(page).to have_content "Blocked" end end diff --git a/spec/features/moderation_spec.rb b/spec/features/moderation_spec.rb index 9cb2ff19d..c13a23461 100644 --- a/spec/features/moderation_spec.rb +++ b/spec/features/moderation_spec.rb @@ -12,7 +12,7 @@ feature 'Admin' do expect(current_path).not_to eq(moderation_root_path) expect(current_path).to eq(proposals_path) - expect(page).to have_content "not authorized" + expect(page).to have_content "You do not have permission to access this page" end scenario 'Access as a moderator is authorized' do @@ -25,7 +25,7 @@ feature 'Admin' do click_on "Moderation" expect(current_path).to eq(moderation_root_path) - expect(page).to_not have_content "not authorized" + expect(page).to_not have_content "You do not have permission to access this page" end scenario 'Access as an administrator is authorized' do @@ -38,7 +38,7 @@ feature 'Admin' do click_on "Moderation" expect(current_path).to eq(moderation_root_path) - expect(page).to_not have_content "not authorized" + expect(page).to_not have_content "You do not have permission to access this page" end end diff --git a/spec/features/organizations_spec.rb b/spec/features/organizations_spec.rb index a42e78dad..052b3bae5 100644 --- a/spec/features/organizations_spec.rb +++ b/spec/features/organizations_spec.rb @@ -16,7 +16,7 @@ feature 'Organizations' do fill_in 'user_captcha', with: correct_captcha_text check 'user_terms_of_service' - click_button 'Sign up' + click_button 'Register' user = User.organizations.where(email: 'green@peace.com').first expect(user).to be @@ -27,7 +27,7 @@ feature 'Organizations' do scenario 'Errors on create' do visit new_organization_registration_path - click_button 'Sign up' + click_button 'Register' expect(page).to have_content error_message end diff --git a/spec/features/proposals_spec.rb b/spec/features/proposals_spec.rb index 5b83e37b3..711820574 100644 --- a/spec/features/proposals_spec.rb +++ b/spec/features/proposals_spec.rb @@ -87,9 +87,9 @@ feature 'Proposals' do fill_in 'proposal_captcha', with: correct_captcha_text check 'proposal_terms_of_service' - click_button 'Start a proposal' + click_button 'Create proposal' - expect(page).to have_content 'Proposal was successfully created.' + expect(page).to have_content 'Proposal created successfully.' expect(page).to have_content 'Help refugees' expect(page).to have_content '¿Would you like to give assistance to war refugees?' expect(page).to have_content 'In summary, what we want is...' @@ -115,9 +115,9 @@ feature 'Proposals' do fill_in 'proposal_responsible_name', with: 'Isabel Garcia' check 'proposal_terms_of_service' - click_button 'Start a proposal' + click_button 'Create proposal' - expect(page).to have_content 'Proposal was successfully created.' + expect(page).to have_content 'Proposal created successfully.' expect(Proposal.last.responsible_name).to eq('Isabel Garcia') end @@ -136,9 +136,9 @@ feature 'Proposals' do fill_in 'proposal_captcha', with: correct_captcha_text check 'proposal_terms_of_service' - click_button 'Start a proposal' + click_button 'Create proposal' - expect(page).to have_content 'Proposal was successfully created.' + expect(page).to have_content 'Proposal created successfully.' end scenario 'Captcha is required for proposal creation' do @@ -154,15 +154,15 @@ feature 'Proposals' do fill_in 'proposal_captcha', with: "wrongText!" check 'proposal_terms_of_service' - click_button "Start a proposal" + click_button "Create proposal" - expect(page).to_not have_content "Proposal was successfully created." + expect(page).to_not have_content "Proposal created successfully." expect(page).to have_content "1 error" fill_in 'proposal_captcha', with: correct_captcha_text - click_button "Start a proposal" + click_button "Create proposal" - expect(page).to have_content "Proposal was successfully created." + expect(page).to have_content "Proposal created successfully." end scenario 'Failed creation goes back to new showing featured tags' do @@ -180,9 +180,9 @@ feature 'Proposals' do fill_in 'proposal_captcha', with: correct_captcha_text check 'proposal_terms_of_service' - click_button "Start a proposal" + click_button "Create proposal" - expect(page).to_not have_content "Proposal was successfully created." + expect(page).to_not have_content "Proposal created successfully." expect(page).to have_content "error" within(".tags") do expect(page).to have_content featured_tag.name @@ -195,7 +195,7 @@ feature 'Proposals' do login_as(author) visit new_proposal_path - click_button 'Start a proposal' + click_button 'Create proposal' expect(page).to have_content error_message end @@ -213,9 +213,9 @@ feature 'Proposals' do fill_in 'proposal_captcha', with: correct_captcha_text check 'proposal_terms_of_service' - click_button 'Start a proposal' + click_button 'Create proposal' - expect(page).to have_content 'Proposal was successfully created.' + expect(page).to have_content 'Proposal created successfully.' expect(page).to have_content 'Testing an attack' expect(page.html).to include '

This is alert("an attack");

' expect(page.html).to_not include '' @@ -235,9 +235,9 @@ feature 'Proposals' do fill_in 'proposal_captcha', with: correct_captcha_text check 'proposal_terms_of_service' - click_button 'Start a proposal' + click_button 'Create proposal' - expect(page).to have_content 'Proposal was successfully created.' + expect(page).to have_content 'Proposal created successfully.' expect(page).to have_content 'Testing auto link' expect(page).to have_link('www.example.org', href: 'http://www.example.org') end @@ -255,15 +255,15 @@ feature 'Proposals' do fill_in 'proposal_captcha', with: correct_captcha_text check 'proposal_terms_of_service' - click_button 'Start a proposal' + click_button 'Create proposal' - expect(page).to have_content 'Proposal was successfully created.' + expect(page).to have_content 'Proposal created successfully.' expect(page).to have_content 'Testing auto link' expect(page).to have_link('http://example.org', href: 'http://example.org') expect(page).not_to have_link('click me') expect(page.html).to_not include "" - click_link 'Edit proposal' + click_link 'Edit' expect(current_path).to eq edit_proposal_path(Proposal.last) expect(page).not_to have_link('click me') @@ -297,9 +297,9 @@ feature 'Proposals' do find('.js-add-tag-link', text: tag_name).click end - click_button 'Start a proposal' + click_button 'Create proposal' - expect(page).to have_content 'Proposal was successfully created.' + expect(page).to have_content 'Proposal created successfully.' ['Medio Ambiente', 'Ciencia'].each do |tag_name| expect(page).to have_content tag_name end @@ -319,9 +319,9 @@ feature 'Proposals' do fill_in 'proposal_tag_list', with: 'user_id=1, &a=3, ' - click_button 'Start a proposal' + click_button 'Create proposal' - expect(page).to have_content 'Proposal was successfully created.' + expect(page).to have_content 'Proposal created successfully.' expect(page).to have_content 'user_id1' expect(page).to have_content 'a3' expect(page).to have_content 'scriptalert("hey");script' @@ -337,7 +337,7 @@ feature 'Proposals' do visit edit_proposal_path(proposal) expect(current_path).not_to eq(edit_proposal_path(proposal)) expect(current_path).to eq(proposals_path) - expect(page).to have_content 'not authorized' + expect(page).to have_content 'You do not have permission' end scenario 'Update should not be posible if proposal is not editable' do @@ -352,7 +352,7 @@ feature 'Proposals' do expect(current_path).not_to eq(edit_proposal_path(proposal)) expect(current_path).to eq(proposals_path) - expect(page).to have_content 'not authorized' + expect(page).to have_content 'You do not have permission' end scenario 'Update should be posible for the author of an editable proposal' do @@ -372,7 +372,7 @@ feature 'Proposals' do click_button "Save changes" - expect(page).to have_content "Proposal was successfully updated." + expect(page).to have_content "Proposal updated successfully." expect(page).to have_content "Basically..." expect(page).to have_content "End child poverty" expect(page).to have_content "Let's do something to end child poverty" @@ -400,13 +400,13 @@ feature 'Proposals' do fill_in 'proposal_captcha', with: "wrong!" click_button "Save changes" - expect(page).to_not have_content "Proposal was successfully updated." + expect(page).to_not have_content "Proposal updated successfully." expect(page).to have_content "error" fill_in 'proposal_captcha', with: correct_captcha_text click_button "Save changes" - expect(page).to have_content "Proposal was successfully updated." + expect(page).to have_content "Proposal updated successfully." end scenario 'Failed update goes back to edit showing featured tags' do @@ -422,7 +422,7 @@ feature 'Proposals' do fill_in 'proposal_captcha', with: correct_captcha_text click_button "Save changes" - expect(page).to_not have_content "Proposal was successfully updated." + expect(page).to_not have_content "Proposal updated successfully." expect(page).to have_content "error" within(".tags") do expect(page).to have_content featured_tag.name @@ -482,7 +482,7 @@ feature 'Proposals' do create(:proposal, title: 'Medium proposal').update_column(:confidence_score, 5) visit proposals_path - select 'most supported', from: 'order-selector' + select 'highest rated', from: 'order-selector' expect(page).to have_selector('.js-order-selector[data-order="confidence_score"]') @@ -559,7 +559,7 @@ feature 'Proposals' do end end - scenario 'proposal index search' do + scenario 'Proposal index search' do proposal1 = create(:proposal, title: "Show me what you got") proposal2 = create(:proposal, title: "Get Schwifty") proposal3 = create(:proposal) @@ -574,23 +574,47 @@ feature 'Proposals' do within("#proposals") do expect(page).to have_css('.proposal', count: 3) + expect(page).to have_content(proposal2.title) expect(page).to have_content(proposal4.title) expect(page).to have_content(proposal5.title) + expect(page).to_not have_content(proposal1.title) expect(page).to_not have_content(proposal3.title) end end + scenario 'Index search does not show featured proposals' do + featured_proposals = create_featured_proposals + proposal = create(:proposal, title: "Abcdefghi") + + visit proposals_path + fill_in "search", with: proposal.title + click_button "Search" + + expect(page).to_not have_selector('#proposals .proposal-featured') + expect(page).to_not have_selector('#featured-proposals') + end + + scenario 'Tag index tag does not show featured proposals' do + featured_proposals = create_featured_proposals + proposal = create(:proposal, tag_list: "123") + + visit proposals_path(tag: "123") + + expect(page).to_not have_selector('#proposals .proposal-featured') + expect(page).to_not have_selector('#featured-proposals') + end + scenario 'Conflictive' do good_proposal = create(:proposal) conflictive_proposal = create(:proposal, :conflictive) visit proposal_path(conflictive_proposal) - expect(page).to have_content "This proposal has been flag as innapropiate for some users." + expect(page).to have_content "This proposal has been flagged as inappropriate by several users." visit proposal_path(good_proposal) - expect(page).to_not have_content "This proposal has been flag as innapropiate for some users." + expect(page).to_not have_content "This proposal has been flagged as inappropriate by several users." end scenario "Flagging", :js do @@ -634,14 +658,14 @@ feature 'Proposals' do user.erase visit proposals_path - expect(page).to have_content('Deleted user') + expect(page).to have_content('User deleted') visit proposal_path(proposal) - expect(page).to have_content('Deleted user') + expect(page).to have_content('User deleted') create_featured_proposals visit proposals_path - expect(page).to have_content('Deleted user') + expect(page).to have_content('User deleted') end end diff --git a/spec/features/tags_spec.rb b/spec/features/tags_spec.rb index 3f310071e..2bd729448 100644 --- a/spec/features/tags_spec.rb +++ b/spec/features/tags_spec.rb @@ -84,7 +84,7 @@ feature 'Tags' do click_button 'Start a debate' - expect(page).to have_content 'Debate was successfully created.' + expect(page).to have_content 'Debate created successfully.' expect(page).to have_content 'Economía' expect(page).to have_content 'Hacienda' expect(page).to have_content 'Impuestos' @@ -104,7 +104,7 @@ feature 'Tags' do click_button 'Start a debate' - expect(page).to have_content '1 error prohibited this debate from being saved:' + expect(page).to have_content error_message expect(page).to have_content 'tags must be less than or equal to 6' end @@ -120,7 +120,7 @@ feature 'Tags' do fill_in 'debate_captcha', with: correct_captcha_text click_button 'Save changes' - expect(page).to have_content 'Debate was successfully updated.' + expect(page).to have_content 'Debate updated successfully.' within('.tags') do expect(page).to have_css('a', text: 'Economía') expect(page).to have_css('a', text: 'Hacienda') @@ -137,7 +137,7 @@ feature 'Tags' do fill_in 'debate_captcha', with: correct_captcha_text click_button 'Save changes' - expect(page).to have_content 'Debate was successfully updated.' + expect(page).to have_content 'Debate updated successfully.' expect(page).to_not have_content 'Economía' end diff --git a/spec/features/users_spec.rb b/spec/features/users_spec.rb index 2a3b19b5d..b23d956ac 100644 --- a/spec/features/users_spec.rb +++ b/spec/features/users_spec.rb @@ -5,7 +5,7 @@ feature 'Users' do context 'Regular authentication' do scenario 'Sign up' do visit '/' - click_link 'Sign up' + click_link 'Register' fill_in 'user_username', with: 'Manuela Carmena' fill_in 'user_email', with: 'manuela@madrid.es' @@ -14,20 +14,20 @@ feature 'Users' do fill_in 'user_captcha', with: correct_captcha_text check 'user_terms_of_service' - click_button 'Sign up' + click_button 'Register' - expect(page).to have_content "A message with a confirmation link has been sent to your email address. Please follow the link to activate your account." + expect(page).to have_content "You have been sent a message containing a verification link. Please click on this link to activate your account." sent_token = /.*confirmation_token=(.*)".*/.match(ActionMailer::Base.deliveries.last.body.to_s)[1] visit user_confirmation_path(confirmation_token: sent_token) - expect(page).to have_content "Your email address has been successfully confirmed" + expect(page).to have_content "Your account has been confirmed." end scenario 'Errors on sign up' do visit '/' - click_link 'Sign up' - click_button 'Sign up' + click_link 'Register' + click_button 'Register' expect(page).to have_content error_message end @@ -36,12 +36,12 @@ feature 'Users' do create(:user, email: 'manuela@madrid.es', password: 'judgementday') visit '/' - click_link 'Log in' + click_link 'Sign in' fill_in 'user_email', with: 'manuela@madrid.es' fill_in 'user_password', with: 'judgementday' - click_button 'Log in' + click_button 'Enter' - expect(page).to have_content 'Signed in successfully.' + expect(page).to have_content 'You have been signed in successfully.' end end @@ -70,7 +70,7 @@ feature 'Users' do OmniAuth.config.add_mock(:twitter, omniauth_twitter_hash) visit '/' - click_link 'Sign up' + click_link 'Register' expect do expect do @@ -105,7 +105,7 @@ feature 'Users' do OmniAuth.config.add_mock(:twitter, omniauth_twitter_hash) visit '/' - click_link 'Sign up' + click_link 'Register' expect do expect do @@ -122,7 +122,7 @@ feature 'Users' do expect(user.email).to eq("omniauth@participacion-12345-twitter.com") fill_in 'user_email', with: 'manueladelascarmenas@example.com' - click_button 'Sign up' + click_button 'Register' sent_token = /.*confirmation_token=(.*)".*/.match(ActionMailer::Base.deliveries.last.body.to_s)[1] visit user_confirmation_path(confirmation_token: sent_token) @@ -145,7 +145,7 @@ feature 'Users' do OmniAuth.config.add_mock(:twitter, omniauth_twitter_hash) visit '/' - click_link 'Log in' + click_link 'Sign in' expect do expect do @@ -163,22 +163,22 @@ feature 'Users' do login_as(user) visit "/" - click_link 'Logout' + click_link 'Sign out' - expect(page).to have_content 'Signed out successfully.' + expect(page).to have_content 'You have been signed out successfully.' end scenario 'Reset password' do create(:user, email: 'manuela@madrid.es') visit '/' - click_link 'Log in' - click_link 'Forgot your password?' + click_link 'Sign in' + click_link 'Forgotten your password?' fill_in 'user_email', with: 'manuela@madrid.es' - click_button 'Send me reset password' + click_button 'Send instructions' - expect(page).to have_content "You will receive an email with instructions on how to reset your password in a few minutes." + expect(page).to have_content "In a few minutes, you will receive an email containing instructions on resetting your password." sent_token = /.*reset_password_token=(.*)".*/.match(ActionMailer::Base.deliveries.last.body.to_s)[1] visit edit_user_password_path(reset_password_token: sent_token) @@ -187,6 +187,6 @@ feature 'Users' do fill_in 'user_password_confirmation', with: 'new password' click_button 'Change my password' - expect(page).to have_content "Your password has been changed successfully. You are now signed in." + expect(page).to have_content "Your password has been changed successfully." end end diff --git a/spec/features/verification/email_spec.rb b/spec/features/verification/email_spec.rb index 95f6360c5..58a3f71fb 100644 --- a/spec/features/verification/email_spec.rb +++ b/spec/features/verification/email_spec.rb @@ -22,15 +22,15 @@ feature 'Verify email' do click_button "Send code" end - expect(page).to have_content 'We have send you a confirmation email to your email account: rock@example.com' + expect(page).to have_content 'We have sent a confirmation email to your account: rock@example.com' sent_token = /.*email_verification_token=(.*)".*/.match(ActionMailer::Base.deliveries.last.body.to_s)[1] visit email_path(email_verification_token: sent_token) - expect(page).to have_content "You are now a verified user" + expect(page).to have_content "You are a verified user" expect(page).to_not have_link "Verify my account" - expect(page).to have_content "Verified account" + expect(page).to have_content "Account verified" end scenario "Errors on token verification" do @@ -39,7 +39,7 @@ feature 'Verify email' do login_as(user) visit email_path(email_verification_token: "1234") - expect(page).to have_content "Incorrect verification code" + expect(page).to have_content "Verification code incorrect" end scenario "Errors on sending confirmation email" do @@ -60,6 +60,6 @@ feature 'Verify email' do verified_user.destroy click_button "Send code" - expect(page).to have_content "There was a problem sending you an email to your account" + expect(page).to have_content "There was a problem with sending an email to your account" end end \ No newline at end of file diff --git a/spec/features/verification/letter_spec.rb b/spec/features/verification/letter_spec.rb index bd98dd6cc..50635a73c 100644 --- a/spec/features/verification/letter_spec.rb +++ b/spec/features/verification/letter_spec.rb @@ -9,9 +9,9 @@ feature 'Verify Letter' do login_as(user) visit new_letter_path - click_link "Request a letter" + click_link "Send me a letter with the code" - expect(page).to have_content "Before voting you'll receive a letter whith the instructions for verify your account." + expect(page).to have_content "Thank you for requesting your maximum security code (only required for the final votes). In a few days we will send it to the address featuring in the data we have on file." user.reload @@ -26,7 +26,7 @@ feature 'Verify Letter' do login_as(user) visit new_letter_path - expect(page).to have_link "Office of Citizen", href: "http://www.madrid.es/portales/munimadrid/es/Inicio/El-Ayuntamiento/Atencion-al-ciudadano/Oficinas-de-Atencion-al-Ciudadano?vgnextfmt=default&vgnextchannel=5b99cde2e09a4310VgnVCM1000000b205a0aRCRD" + expect(page).to have_link "Citizen Support Offices", href: "http://www.madrid.es/portales/munimadrid/es/Inicio/El-Ayuntamiento/Atencion-al-ciudadano/Oficinas-de-Atencion-al-Ciudadano?vgnextfmt=default&vgnextchannel=5b99cde2e09a4310VgnVCM1000000b205a0aRCRD" end scenario "Deny access unless verified residence" do @@ -35,7 +35,7 @@ feature 'Verify Letter' do login_as(user) visit new_letter_path - expect(page).to have_content 'You have not yet confirmed your residence' + expect(page).to have_content 'You have not yet confirmed your residency' expect(current_path).to eq(new_residence_path) end @@ -45,7 +45,7 @@ feature 'Verify Letter' do login_as(user) visit new_letter_path - expect(page).to have_content 'You have not yet enter the confirmation code' + expect(page).to have_content 'You have not yet entered the confirmation code' expect(current_path).to eq(new_sms_path) end @@ -64,7 +64,7 @@ feature 'Verify Letter' do fill_in "verification_letter_verification_code", with: user.letter_verification_code click_button "Verify my account" - expect(page).to have_content "Your account has been verified" + expect(page).to have_content "Code correct. Your account is now verified" expect(current_path).to eq(account_path) end @@ -81,7 +81,7 @@ feature 'Verify Letter' do fill_in "verification_letter_verification_code", with: "12345" click_button "Verify my account" - expect(page).to have_content "Your account has been verified" + expect(page).to have_content "Account verified" expect(current_path).to eq(account_path) end @@ -97,7 +97,7 @@ feature 'Verify Letter' do fill_in "verification_letter_verification_code", with: user.letter_verification_code click_button "Verify my account" - expect(page).to have_content "Your account has been verified" + expect(page).to have_content "Code correct. Your account is now verified" expect(current_path).to eq(account_path) end @@ -135,7 +135,7 @@ feature 'Verify Letter' do click_button "Verify my account" end - expect(page).to have_content "You have reached the maximum number of verification tries. Please try again later." + expect(page).to have_content "You have reached the maximum number of attempts. Please try again later." expect(current_path).to eq(account_path) end diff --git a/spec/features/verification/level_three_verification_spec.rb b/spec/features/verification/level_three_verification_spec.rb index b03741f42..9a1cfaa6e 100644 --- a/spec/features/verification/level_three_verification_spec.rb +++ b/spec/features/verification/level_three_verification_spec.rb @@ -20,16 +20,16 @@ feature 'Level three verification' do click_button "Send code" end - expect(page).to have_content 'Phone confirmation' + expect(page).to have_content 'Security code confirmation' user = user.reload fill_in 'sms_confirmation_code', with: user.sms_confirmation_code click_button 'Send' - expect(page).to have_content "Correct code. Your account is verified" + expect(page).to have_content "Code correct. Your account is now verified" expect(page).to_not have_link "Verify my account" - expect(page).to have_content "Verified account" + expect(page).to have_content "Account verified" end scenario 'Verification with residency and verified email' do @@ -51,15 +51,15 @@ feature 'Level three verification' do click_button "Send code" end - expect(page).to have_content 'We have send you a confirmation email to your email account: rock@example.com' + expect(page).to have_content 'We have sent a confirmation email to your account: rock@example.com' sent_token = /.*email_verification_token=(.*)".*/.match(ActionMailer::Base.deliveries.last.body.to_s)[1] visit email_path(email_verification_token: sent_token) - expect(page).to have_content "You are now a verified user" + expect(page).to have_content "You are a verified user" expect(page).to_not have_link "Verify my account" - expect(page).to have_content "Verified account" + expect(page).to have_content "Account verified" end scenario 'Verification with residency and sms and letter' do @@ -75,16 +75,16 @@ feature 'Level three verification' do fill_in 'sms_phone', with: "611111111" click_button 'Send' - expect(page).to have_content 'Phone confirmation' + expect(page).to have_content 'Security code confirmation' user = user.reload fill_in 'sms_confirmation_code', with: user.sms_confirmation_code click_button 'Send' - expect(page).to have_content 'Correct code' + expect(page).to have_content 'Code correct' - click_link "Request a letter" + click_link "Send me a letter with the code" - expect(page).to have_content "Before voting you'll receive a letter whith the instructions for verify your account." + expect(page).to have_content "Thank you for requesting your maximum security code (only required for the final votes). In a few days we will send it to the address featuring in the data we have on file." end end \ No newline at end of file diff --git a/spec/features/verification/level_two_verification_spec.rb b/spec/features/verification/level_two_verification_spec.rb index ac0bf1a2f..e0374825f 100644 --- a/spec/features/verification/level_two_verification_spec.rb +++ b/spec/features/verification/level_two_verification_spec.rb @@ -14,13 +14,13 @@ feature 'Level two verification' do fill_in 'sms_phone', with: "611111111" click_button 'Send' - expect(page).to have_content 'Phone confirmation' + expect(page).to have_content 'Security code confirmation' user = user.reload fill_in 'sms_confirmation_code', with: user.sms_confirmation_code click_button 'Send' - expect(page).to have_content 'Correct code' + expect(page).to have_content 'Code correct' end end \ No newline at end of file diff --git a/spec/features/verification/residence_spec.rb b/spec/features/verification/residence_spec.rb index 29e20ea5a..447438472 100644 --- a/spec/features/verification/residence_spec.rb +++ b/spec/features/verification/residence_spec.rb @@ -10,7 +10,7 @@ feature 'Residence' do click_link 'Verify my account' fill_in 'residence_document_number', with: "12345678Z" - select 'Spanish ID', from: 'residence_document_type' + select 'DNI', from: 'residence_document_type' select_date '31-December-1980', from: 'residence_date_of_birth' fill_in 'residence_postal_code', with: '28013' check 'residence_terms_of_service' @@ -29,7 +29,7 @@ feature 'Residence' do click_button 'Verify residence' - expect(page).to have_content /\d errors? prevented your residence verification/ + expect(page).to have_content /\d errors? prevented the verification of your residence/ end scenario 'Error on postal code not in Madrid census' do @@ -40,7 +40,7 @@ feature 'Residence' do click_link 'Verify my account' fill_in 'residence_document_number', with: "12345678Z" - select 'Spanish ID', from: 'residence_document_type' + select 'DNI', from: 'residence_document_type' select '1997', from: 'residence_date_of_birth_1i' select 'January', from: 'residence_date_of_birth_2i' select '1', from: 'residence_date_of_birth_3i' @@ -49,7 +49,7 @@ feature 'Residence' do click_button 'Verify residence' - expect(page).to have_content 'To verify your account you need to be in the census of the Madrid town.' + expect(page).to have_content 'In order to be verified, you must be registered in the municipality of Madrid' end scenario 'Error on Madrid census' do @@ -60,7 +60,7 @@ feature 'Residence' do click_link 'Verify my account' fill_in 'residence_document_number', with: "12345678Z" - select 'Spanish ID', from: 'residence_document_type' + select 'DNI', from: 'residence_document_type' select '1997', from: 'residence_date_of_birth_1i' select 'January', from: 'residence_date_of_birth_2i' select '1', from: 'residence_date_of_birth_3i' @@ -69,7 +69,7 @@ feature 'Residence' do click_button 'Verify residence' - expect(page).to have_content 'The census of the city of Madrid could not verify your information' + expect(page).to have_content 'The Madrid Census was unable to verify your information' end scenario '5 tries allowed' do @@ -81,7 +81,7 @@ feature 'Residence' do 5.times do fill_in 'residence_document_number', with: "12345678Z" - select 'Spanish ID', from: 'residence_document_type' + select 'DNI', from: 'residence_document_type' select '1997', from: 'residence_date_of_birth_1i' select 'January', from: 'residence_date_of_birth_2i' select '1', from: 'residence_date_of_birth_3i' @@ -89,15 +89,15 @@ feature 'Residence' do check 'residence_terms_of_service' click_button 'Verify residence' - expect(page).to have_content 'The census of the city of Madrid could not verify your information' + expect(page).to have_content 'The Madrid Census was unable to verify your information' end click_button 'Verify residence' - expect(page).to have_content "You have reached the maximum number of verification tries. Please try again later." + expect(page).to have_content "You have reached the maximum number of attempts. Please try again later." expect(current_path).to eq(account_path) visit new_residence_path - expect(page).to have_content "You have reached the maximum number of verification tries. Please try again later." + expect(page).to have_content "You have reached the maximum number of attempts. Please try again later." expect(current_path).to eq(account_path) end end \ No newline at end of file diff --git a/spec/features/verification/sms_spec.rb b/spec/features/verification/sms_spec.rb index 1d8026b81..97e5917f7 100644 --- a/spec/features/verification/sms_spec.rb +++ b/spec/features/verification/sms_spec.rb @@ -11,13 +11,13 @@ feature 'SMS Verification' do fill_in 'sms_phone', with: "611111111" click_button 'Send' - expect(page).to have_content 'Phone confirmation' + expect(page).to have_content 'Security code confirmation' user = user.reload fill_in 'sms_confirmation_code', with: user.sms_confirmation_code click_button 'Send' - expect(page).to have_content 'Correct code' + expect(page).to have_content 'Code correct' end scenario 'Errors on phone number' do @@ -40,7 +40,7 @@ feature 'SMS Verification' do fill_in 'sms_phone', with: "611111111" click_button 'Send' - expect(page).to have_content 'Phone confirmation' + expect(page).to have_content 'Security code confirmation' click_button 'Send' @@ -53,7 +53,7 @@ feature 'SMS Verification' do visit new_sms_path - expect(page).to have_content 'You have not yet confirmed your residence' + expect(page).to have_content 'You have not yet confirmed your residency' expect(current_path).to eq(new_residence_path) end @@ -66,14 +66,14 @@ feature 'SMS Verification' do 5.times do fill_in 'sms_phone', with: "611111111" click_button 'Send' - click_link 'Request a new code' + click_link 'Click here to send it again' end - expect(page).to have_content "You have reached the maximum number of verification tries. Please try again later." + expect(page).to have_content "You have reached the maximum number of attempts. Please try again later." expect(current_path).to eq(account_path) visit new_sms_path - expect(page).to have_content "You have reached the maximum number of verification tries. Please try again later." + expect(page).to have_content "You have reached the maximum number of attempts. Please try again later." expect(current_path).to eq(account_path) end diff --git a/spec/features/verification/verification_path_spec.rb b/spec/features/verification/verification_path_spec.rb index 7ec9fa8ff..c6da931df 100644 --- a/spec/features/verification/verification_path_spec.rb +++ b/spec/features/verification/verification_path_spec.rb @@ -19,7 +19,7 @@ feature 'Verification path' do visit verification_path expect(current_path).to eq account_path - expect(page).to have_content 'You are a verified user!' + expect(page).to have_content 'Your account is already verified' end scenario "User requested a letter" do @@ -95,7 +95,7 @@ feature 'Verification path' do visit step_path expect(current_path).to eq account_path - expect(page).to have_content 'You are a verified user!' + expect(page).to have_content 'Your account is already verified' end end end \ No newline at end of file diff --git a/spec/features/verification/verified_user_spec.rb b/spec/features/verification/verified_user_spec.rb index 032136b84..38097004e 100644 --- a/spec/features/verification/verified_user_spec.rb +++ b/spec/features/verification/verified_user_spec.rb @@ -86,7 +86,7 @@ feature 'Verified users' do click_button "Send code" end - expect(page).to have_content 'We have send you a confirmation email to your email account: rock@example.com' + expect(page).to have_content 'We have sent a confirmation email to your account: rock@example.com' expect(current_path).to eq(account_path) end @@ -121,7 +121,7 @@ feature 'Verified users' do login_as(user) visit verified_user_path - click_link "Use another phone" + click_link "Use other phone" expect(current_path).to eq(new_sms_path) end diff --git a/spec/features/votes_spec.rb b/spec/features/votes_spec.rb index 31498191a..776cfabb4 100644 --- a/spec/features/votes_spec.rb +++ b/spec/features/votes_spec.rb @@ -177,8 +177,6 @@ feature 'Votes' do expect(current_path).to eq(debates_path) end end - - end feature 'Proposals' do @@ -194,15 +192,15 @@ feature 'Votes' do within("#proposals") do within("#proposal_#{proposal1.id}_votes") do - expect(page).to have_content "You already supported this proposal, share it!" + expect(page).to have_content "You have already supported this proposal. Share it!" end within("#proposal_#{proposal2.id}_votes") do - expect(page).to_not have_content "You already supported this proposal, share it!" + expect(page).to_not have_content "You have already supported this proposal. Share it!" end within("#proposal_#{proposal3.id}_votes") do - expect(page).to_not have_content "You already supported this proposal, share it!" + expect(page).to_not have_content "You have already supported this proposal. Share it!" end end end @@ -246,7 +244,7 @@ feature 'Votes' do find('.in-favor a').click expect(page).to have_content "1 support" - expect(page).to have_content "You already supported this proposal, share it!" + expect(page).to have_content "You have already supported this proposal. Share it!" end end @@ -258,7 +256,7 @@ feature 'Votes' do find('.in-favor a').click expect(page).to have_content "1 support" - expect(page).to have_content "You already supported this proposal, share it!" + expect(page).to have_content "You have already supported this proposal. Share it!" end expect(current_path).to eq(proposals_path) end @@ -269,7 +267,7 @@ feature 'Votes' do within("#proposal_#{@proposal.id}") do find('.in-favor a').click - expect(page).to have_content "You already supported this proposal, share it!" + expect(page).to have_content "You have already supported this proposal. Share it!" end expect(current_path).to eq(proposals_path) end @@ -284,12 +282,6 @@ feature 'Votes' do find("div.votes").hover expect_message_you_need_to_sign_in end - - visit debate_path(debate) - within("#debate_#{debate.id}") do - find("div.votes").hover - expect_message_you_need_to_sign_in - end end scenario 'Not logged user trying to vote proposals', :js do diff --git a/spec/features/welcome_spec.rb b/spec/features/welcome_spec.rb index f75eadd0c..a98ff6e43 100644 --- a/spec/features/welcome_spec.rb +++ b/spec/features/welcome_spec.rb @@ -21,9 +21,9 @@ feature "Welcome screen" do fill_in 'user_email', with: user.email fill_in 'user_password', with: user.password - click_button 'Log in' + click_button 'Enter' - expect(page).to have_content("You are now a verified user") + expect(page).to have_content("You are a verified user") expect(current_path).to eq(account_path) end diff --git a/spec/helpers/user_helper_spec.rb b/spec/helpers/user_helper_spec.rb index bb0df0de5..a30b2eecf 100644 --- a/spec/helpers/user_helper_spec.rb +++ b/spec/helpers/user_helper_spec.rb @@ -4,7 +4,7 @@ describe UserHelper do describe '#humanize_document_type' do it "should return a humanized document type" do - expect(humanize_document_type("1")).to eq "Spanish ID" + expect(humanize_document_type("1")).to eq "DNI" expect(humanize_document_type("2")).to eq "Passport" expect(humanize_document_type("3")).to eq "Residence card" end diff --git a/spec/models/debate_spec.rb b/spec/models/debate_spec.rb index 159ebdbb1..dba82ea6b 100644 --- a/spec/models/debate_spec.rb +++ b/spec/models/debate_spec.rb @@ -318,35 +318,6 @@ describe Debate do end - describe "self.search" do - it "find debates by title" do - debate1 = create(:debate, title: "Karpov vs Kasparov") - create(:debate, title: "Bird vs Magic") - search = Debate.search("Kasparov") - expect(search.size).to eq(1) - expect(search.first).to eq(debate1) - end - - it "find debates by description" do - debate1 = create(:debate, description: "...chess masters...") - create(:debate, description: "...basket masters...") - search = Debate.search("chess") - expect(search.size).to eq(1) - expect(search.first).to eq(debate1) - end - - it "find debates by title and description" do - create(:debate, title: "Karpov vs Kasparov", description: "...played like Gauss...") - create(:debate, title: "Euler vs Gauss", description: "...math masters...") - search = Debate.search("Gauss") - expect(search.size).to eq(2) - end - - it "returns no results if no search term provided" do - expect(Debate.search(" ").size).to eq(0) - end - end - describe "cache" do let(:debate) { create(:debate) } @@ -457,4 +428,169 @@ describe Debate do end + describe "search" do + + context "attributes" do + + xit "searches by title" do + debate = create(:debate, title: 'save the world') + results = Debate.search('save the world') + expect(results).to eq([debate]) + end + + xit "searches by description" do + debate = create(:debate, description: 'in order to save the world one must think about...') + results = Debate.search('one must think') + expect(results).to eq([debate]) + end + + end + + context "stemming" do + + xit "searches word stems" do + debate = create(:debate, title: 'limpiar') + + results = Debate.search('limpiará') + expect(results).to eq([debate]) + + results = Debate.search('limpiémos') + expect(results).to eq([debate]) + + results = Debate.search('limpió') + expect(results).to eq([debate]) + end + + end + + context "accents" do + + xit "searches with accents" do + debate = create(:debate, title: 'difusión') + + results = Debate.search('difusion') + expect(results).to eq([debate]) + + debate2 = create(:debate, title: 'estadisticas') + results = Debate.search('estadísticas') + expect(results).to eq([debate2]) + end + + end + + context "case" do + + xit "searches case insensite" do + debate = create(:debate, title: 'SHOUT') + + results = Debate.search('shout') + expect(results).to eq([debate]) + + debate2 = create(:debate, title: "scream") + results = Debate.search("SCREAM") + expect(results).to eq([debate2]) + end + + end + + context "typos" do + + xit "searches with typos" do + debate = create(:debate, title: 'difusión') + + results = Debate.search('difuon') + expect(results).to eq([debate]) + + debate2 = create(:debate, title: 'desarrollo') + results = Debate.search('desarolo') + expect(results).to eq([debate2]) + end + + end + + context "order" do + + xit "orders by weight" do + debate_description = create(:debate, description: 'stop corruption') + debate_title = create(:debate, title: 'stop corruption') + + results = Debate.search('stop corruption') + + expect(results.first).to eq(debate_title) + expect(results.second).to eq(debate_description) + end + + xit "orders by weight and then votes" do + title_some_votes = create(:debate, title: 'stop corruption', cached_votes_up: 5) + title_least_voted = create(:debate, title: 'stop corruption', cached_votes_up: 2) + title_most_voted = create(:debate, title: 'stop corruption', cached_votes_up: 10) + description_most_voted = create(:debate, description: 'stop corruption', cached_votes_up: 10) + + results = Debate.search('stop corruption') + + expect(results.first).to eq(title_most_voted) + expect(results.second).to eq(description_most_voted) + expect(results.third).to eq(title_some_votes) + expect(results.fourth).to eq(title_least_voted) + end + + xit "orders by weight and then votes and then created_at" do + newest = create(:debate, title: 'stop corruption', cached_votes_up: 5, created_at: Time.now) + oldest = create(:debate, title: 'stop corruption', cached_votes_up: 5, created_at: 1.month.ago) + old = create(:debate, title: 'stop corruption', cached_votes_up: 5, created_at: 1.week.ago) + + results = Debate.search('stop corruption') + + expect(results.first).to eq(newest) + expect(results.second).to eq(old) + expect(results.third).to eq(oldest) + end + + end + + context "tags" do + + xit "searches by tags" do + debate = create(:debate, tag_list: 'Latina') + + results = Debate.search('Latina') + expect(results.first).to eq(debate) + end + + end + + context "no results" do + + xit "no words match" do + debate = create(:debate, title: 'save world') + + results = Debate.search('destroy planet') + expect(results).to eq([]) + end + + xit "too many typos" do + debate = create(:debate, title: 'fantastic') + + results = Debate.search('frantac') + expect(results).to eq([]) + end + + xit "too much stemming" do + debate = create(:debate, title: 'reloj') + + results = Debate.search('superrelojimetro') + expect(results).to eq([]) + end + + xit "empty" do + debate = create(:debate, title: 'great') + + results = Debate.search('') + expect(results).to eq([]) + end + + end + + end + end diff --git a/spec/models/letter_spec.rb b/spec/models/letter_spec.rb index 48bf05309..fdec7f390 100644 --- a/spec/models/letter_spec.rb +++ b/spec/models/letter_spec.rb @@ -38,7 +38,7 @@ describe 'Verification::Letter' do letter.verification_code = "5555" expect(letter.valid?).to eq(false) - expect(letter.errors[:verification_code].first).to eq("Incorrect confirmation code") + expect(letter.errors[:verification_code].first).to eq("Verification code incorrect") end it "correct code" do diff --git a/spec/models/proposal_spec.rb b/spec/models/proposal_spec.rb index bb13f0769..8193bf701 100644 --- a/spec/models/proposal_spec.rb +++ b/spec/models/proposal_spec.rb @@ -355,4 +355,185 @@ describe Proposal do end end + describe "search" do + + context "attributes" do + + it "searches by title" do + proposal = create(:proposal, title: 'save the world') + results = Proposal.search('save the world') + expect(results).to eq([proposal]) + end + + it "searches by summary" do + proposal = create(:proposal, summary: 'basically...') + results = Proposal.search('basically') + expect(results).to eq([proposal]) + end + + it "searches by description" do + proposal = create(:proposal, description: 'in order to save the world one must think about...') + results = Proposal.search('one must think') + expect(results).to eq([proposal]) + end + + it "searches by question" do + proposal = create(:proposal, question: 'to be or not to be') + results = Proposal.search('to be or not to be') + expect(results).to eq([proposal]) + end + + end + + context "stemming" do + + it "searches word stems" do + proposal = create(:proposal, summary: 'limpiar') + + results = Proposal.search('limpiará') + expect(results).to eq([proposal]) + + results = Proposal.search('limpiémos') + expect(results).to eq([proposal]) + + results = Proposal.search('limpió') + expect(results).to eq([proposal]) + end + + end + + context "accents" do + + it "searches with accents" do + proposal = create(:proposal, summary: 'difusión') + + results = Proposal.search('difusion') + expect(results).to eq([proposal]) + + proposal2 = create(:proposal, summary: 'estadisticas') + results = Proposal.search('estadísticas') + expect(results).to eq([proposal2]) + end + + end + + context "case" do + + it "searches case insensite" do + proposal = create(:proposal, title: 'SHOUT') + + results = Proposal.search('shout') + expect(results).to eq([proposal]) + + proposal2 = create(:proposal, title: "scream") + results = Proposal.search("SCREAM") + expect(results).to eq([proposal2]) + end + + end + + context "typos" do + + it "searches with typos" do + proposal = create(:proposal, summary: 'difusión') + + results = Proposal.search('difuon') + expect(results).to eq([proposal]) + + proposal2 = create(:proposal, summary: 'desarrollo') + results = Proposal.search('desarolo') + expect(results).to eq([proposal2]) + end + + end + + context "order" do + + it "orders by weight" do + proposal_question = create(:proposal, question: 'stop corruption') + proposal_title = create(:proposal, title: 'stop corruption') + proposal_description = create(:proposal, description: 'stop corruption') + proposal_summary = create(:proposal, summary: 'stop corruption') + + results = Proposal.search('stop corruption') + + expect(results.first).to eq(proposal_title) + expect(results.second).to eq(proposal_question) + expect(results.third).to eq(proposal_summary) + expect(results.fourth).to eq(proposal_description) + end + + it "orders by weight and then votes" do + title_some_votes = create(:proposal, title: 'stop corruption', cached_votes_up: 5) + title_least_voted = create(:proposal, title: 'stop corruption', cached_votes_up: 2) + title_most_voted = create(:proposal, title: 'stop corruption', cached_votes_up: 10) + summary_most_voted = create(:proposal, summary: 'stop corruption', cached_votes_up: 10) + + results = Proposal.search('stop corruption') + + expect(results.first).to eq(title_most_voted) + expect(results.second).to eq(summary_most_voted) + expect(results.third).to eq(title_some_votes) + expect(results.fourth).to eq(title_least_voted) + end + + it "orders by weight and then votes and then created_at" do + newest = create(:proposal, title: 'stop corruption', cached_votes_up: 5, created_at: Time.now) + oldest = create(:proposal, title: 'stop corruption', cached_votes_up: 5, created_at: 1.month.ago) + old = create(:proposal, title: 'stop corruption', cached_votes_up: 5, created_at: 1.week.ago) + + results = Proposal.search('stop corruption') + + expect(results.first).to eq(newest) + expect(results.second).to eq(old) + expect(results.third).to eq(oldest) + end + + end + + context "tags" do + + it "searches by tags" do + proposal = create(:proposal, tag_list: 'Latina') + + results = Proposal.search('Latina') + expect(results.first).to eq(proposal) + end + + end + + context "no results" do + + it "no words match" do + proposal = create(:proposal, title: 'save world') + + results = Proposal.search('destroy planet') + expect(results).to eq([]) + end + + it "too many typos" do + proposal = create(:proposal, title: 'fantastic') + + results = Proposal.search('frantac') + expect(results).to eq([]) + end + + it "too much stemming" do + proposal = create(:proposal, title: 'reloj') + + results = Proposal.search('superrelojimetro') + expect(results).to eq([]) + end + + it "empty" do + proposal = create(:proposal, title: 'great') + + results = Proposal.search('') + expect(results).to eq([]) + end + + end + + end + end diff --git a/spec/models/residence_spec.rb b/spec/models/residence_spec.rb index 5396aacd3..33f339012 100644 --- a/spec/models/residence_spec.rb +++ b/spec/models/residence_spec.rb @@ -26,7 +26,7 @@ describe Verification::Residence do it "should validate user has allowed age" do residence = Verification::Residence.new({"date_of_birth(3i)"=>"1", "date_of_birth(2i)"=>"1", "date_of_birth(1i)"=>"#{5.year.ago.year}"}) expect(residence).to_not be_valid - expect(residence.errors[:date_of_birth]).to include("You need yo be at least 16 years old") + expect(residence.errors[:date_of_birth]).to include("You must be at least 16 years old") end describe "postal code" do @@ -48,7 +48,7 @@ describe Verification::Residence do residence.postal_code = "13280" residence.valid? expect(residence.errors[:postal_code].size).to eq(1) - expect(residence.errors[:postal_code]).to include("To verify your account you need to be in the census of the Madrid town.") + expect(residence.errors[:postal_code]).to include("In order to be verified, you must be registered in the municipality of Madrid.") end end diff --git a/spec/support/common_actions.rb b/spec/support/common_actions.rb index 5a3f2d7e5..ecb8a6f10 100644 --- a/spec/support/common_actions.rb +++ b/spec/support/common_actions.rb @@ -2,7 +2,8 @@ module CommonActions def sign_up(email='manuela@madrid.es', password='judgementday') visit '/' - click_link 'Sign up' + + click_link 'Register' fill_in 'user_username', with: "Manuela Carmena #{rand(99999)}" fill_in 'user_email', with: email @@ -11,17 +12,17 @@ module CommonActions fill_in 'user_captcha', with: correct_captcha_text check 'user_terms_of_service' - click_button 'Sign up' + click_button 'Register' end def login_through_form_as(user) visit root_path - click_link 'Log in' + click_link 'Sign in' fill_in 'user_email', with: user.email fill_in 'user_password', with: user.password - click_button 'Log in' + click_button 'Enter' end def login_as_manager @@ -47,11 +48,11 @@ module CommonActions create(:user, email: 'manuela@madrid.es') visit '/' - click_link 'Log in' - click_link 'Forgot your password?' + click_link 'Sign in' + click_link 'Forgotten your password?' fill_in 'user_email', with: 'manuela@madrid.es' - click_button 'Send me reset password' + click_button 'Send instructions' end def comment_on(commentable, user = nil) @@ -107,7 +108,7 @@ module CommonActions end def error_message - /\d errors? prohibited this (.*) from being saved:/ + /\d errors? prevented this (.*) from being saved:/ end def expect_to_be_signed_in @@ -123,7 +124,7 @@ module CommonActions end def verify_residence - select 'Spanish ID', from: 'residence_document_type' + select 'DNI', from: 'residence_document_type' fill_in 'residence_document_number', with: "12345678Z" select_date '31-December-1980', from: 'residence_date_of_birth' fill_in 'residence_postal_code', with: '28013' @@ -137,27 +138,27 @@ module CommonActions fill_in 'sms_phone', with: "611111111" click_button 'Send' - expect(page).to have_content 'Phone confirmation' + expect(page).to have_content 'Enter the confirmation code sent to you by text message' user = User.last.reload fill_in 'sms_confirmation_code', with: user.sms_confirmation_code click_button 'Send' - expect(page).to have_content 'Correct code' + expect(page).to have_content 'Code correct' end def expect_message_you_need_to_sign_in - expect(page).to have_content 'You need to sign in or sign up before continuing' + expect(page).to have_content 'You must Sign in or Sign up to continue' expect(page).to have_selector('.in-favor a', visible: false) end def expect_message_to_many_anonymous_votes - expect(page).to have_content 'Too many anonymous votes, verify your account to vote.' + expect(page).to have_content 'Too many anonymous votes to admit vote' expect(page).to have_selector('.in-favor a', visible: false) end def expect_message_only_verified_can_vote_proposals - expect(page).to have_content 'Proposals can only be voted by verified users, verify your account.' + expect(page).to have_content 'Only verified users can vote on proposals' expect(page).to have_selector('.in-favor a', visible: false) end