38
CONTRIBUTING.md
Normal file
38
CONTRIBUTING.md
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
## Miembros del equipo
|
||||||
|
|
||||||
|
* Raimond Garcia [github](https://github.com/voodoorai2000) | [twitter](https://twitter.com/voodoorai2000)
|
||||||
|
* Juanjo Bazán [github](https://github.com/xuanxu) | [twitter](https://twitter.com/xuanxu)
|
||||||
|
* Enrique García Cota [github](https://github.com/kikito) | [twitter](https://twitter.com/otikik)
|
||||||
|
* Alberto Garcia Cabeza [github](https://github.com/decabeza) | [twitter](https://twitter.com/decabeza)
|
||||||
|
|
||||||
|
## Comunicación general y de incidencias
|
||||||
|
|
||||||
|
El método preferido para informar sobre una incidencia en el proyecto es [creando una incidencia en la cuenta de Github del proyecto](https://github.com/AyuntamientoMadrid/participacion/issues/new).
|
||||||
|
|
||||||
|
Para comunicación más puntual e informal, contacta con los miembros del equipo por twitter.
|
||||||
|
|
||||||
|
## Resolver una incidencia
|
||||||
|
|
||||||
|
Cuando quieras resolver una incidencia mediante código:
|
||||||
|
|
||||||
|
* Avisa de que vas a trabajar en esta incidencia añadiendo un comentario
|
||||||
|
* Haz un fork del proyecto
|
||||||
|
* Crea una rama para resolver la incidencia desde la rama `master`
|
||||||
|
* Añade el código necesario para resolver la incidencia en tantos commits como sea preciso
|
||||||
|
* Asegúrate de que los tests pasan (y escribe más tests para probar la nueva funcionalidad si fuera preciso)
|
||||||
|
* Envía una *pull request* al repositorio principal indicando la incidencia que se está arreglando
|
||||||
|
|
||||||
|
## Otras formas de contribuir sin código
|
||||||
|
|
||||||
|
* Si crees que hay una funcionalidad que hace falta, o descubres un problema, abre una incidencia (asegúrate de que
|
||||||
|
no haya una incidencia para lo mismo ya abierta antes)
|
||||||
|
* También puedes ayudar dando este proyecto a conocer
|
||||||
|
|
||||||
|
## Cómo escribir una incidencia
|
||||||
|
|
||||||
|
* Trata de darle un título descriptivo (algo más que "xxx no funciona").
|
||||||
|
* Es buena idea incluir las siguientes secciones:
|
||||||
|
* Pasos que se han realizado para producir la incidencia
|
||||||
|
* Lo que se esperaba que pasara
|
||||||
|
* Lo que ha pasado
|
||||||
|
* También es buena idea que incluyas tu sistema operativo, navegador, versión de navegador y plugins instalados.
|
||||||
21
MIT-LICENSE.md
Normal file
21
MIT-LICENSE.md
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
# The MIT License (MIT)
|
||||||
|
|
||||||
|
## Copyright (c) 2015 Ayuntamiento de Madrid
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in
|
||||||
|
all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
THE SOFTWARE.
|
||||||
45
README.md
Normal file
45
README.md
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
# Aplicación de Participación Ciudadana del Ayuntamiento de Madrid
|
||||||
|
|
||||||
|
Este es el repositorio de código abierto de la Aplicación de Participación Ciudadana del Ayuntamiento de Madrid.
|
||||||
|
|
||||||
|
## Estado del proyecto
|
||||||
|
|
||||||
|
El desarrollo de esta aplicación comenzó el [15 de Julio de 2015](https://github.com/AyuntamientoMadrid/participacion/commit/8db36308379accd44b5de4f680a54c41a0cc6fc6)
|
||||||
|
|
||||||
|
Este proyecto está en las primeras fases de su desarrollo. Las funcionalidades actualmente presentes en el código, así como sus nombres, deben considerarse como provisionales.
|
||||||
|
|
||||||
|
## Tecnología
|
||||||
|
|
||||||
|
El backend de esta aplicación se desarrolla con el lenguaje de programación [Ruby](https://www.ruby-lang.org/) sobre el *framework* [Ruby on Rails](http://rubyonrails.org/).
|
||||||
|
Las herramientas utilizadas para el frontend no están cerradas aún. Los estilos de la página usan [SCSS](http://sass-lang.com/) sobre [Foundation](http://foundation.zurb.com/)
|
||||||
|
|
||||||
|
## Configuración para desarrollo y tests
|
||||||
|
|
||||||
|
Prerequisitos: tener instalado git, Ruby 2.2.2, la gema `bundler`, y una librería moderna de PostgreSQL.
|
||||||
|
|
||||||
|
```
|
||||||
|
cd participacion
|
||||||
|
bundle install
|
||||||
|
cp config/database.yml.example config/database.yml
|
||||||
|
cp config/secrets.yml.example config/secrets.yml
|
||||||
|
bundle exec bin/rake db:create db:schema_load
|
||||||
|
RAILS_ENV=test bundle exec rake db:create db:schema_load
|
||||||
|
```
|
||||||
|
|
||||||
|
Para ejecutar la aplicación en local:
|
||||||
|
```
|
||||||
|
bundle exec bin/rails s
|
||||||
|
```
|
||||||
|
|
||||||
|
Para ejecutar los tests:
|
||||||
|
```
|
||||||
|
bundle exec bin/rspec
|
||||||
|
```
|
||||||
|
|
||||||
|
## Licencia
|
||||||
|
|
||||||
|
El código de este proyecto está publicado bajo la licencia MIT (ver MIT-license.md)
|
||||||
|
|
||||||
|
## Contribuciones
|
||||||
|
|
||||||
|
Ver fichero CONTRIBUTING.md
|
||||||
28
README.rdoc
28
README.rdoc
@@ -1,28 +0,0 @@
|
|||||||
== README
|
|
||||||
|
|
||||||
This README would normally document whatever steps are necessary to get the
|
|
||||||
application up and running.
|
|
||||||
|
|
||||||
Things you may want to cover:
|
|
||||||
|
|
||||||
* Ruby version
|
|
||||||
|
|
||||||
* System dependencies
|
|
||||||
|
|
||||||
* Configuration
|
|
||||||
|
|
||||||
* Database creation
|
|
||||||
|
|
||||||
* Database initialization
|
|
||||||
|
|
||||||
* How to run the test suite
|
|
||||||
|
|
||||||
* Services (job queues, cache servers, search engines, etc.)
|
|
||||||
|
|
||||||
* Deployment instructions
|
|
||||||
|
|
||||||
* ...
|
|
||||||
|
|
||||||
|
|
||||||
Please feel free to use a different markup language if you do not plan to run
|
|
||||||
<tt>rake doc:app</tt>.
|
|
||||||
BIN
app/assets/images/comments_divider.png
Normal file
BIN
app/assets/images/comments_divider.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.5 KiB |
BIN
app/assets/images/user_default_2.jpg
Normal file
BIN
app/assets/images/user_default_2.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.7 KiB |
@@ -8,7 +8,7 @@
|
|||||||
// 05.1. Debates Index
|
// 05.1. Debates Index
|
||||||
// 05.2. Debates Show
|
// 05.2. Debates Show
|
||||||
// 06. Comments
|
// 06. Comments
|
||||||
// 06. Tags
|
// 07. Tags
|
||||||
//
|
//
|
||||||
|
|
||||||
// 01. Variables
|
// 01. Variables
|
||||||
@@ -24,6 +24,9 @@ $brand: #0077B9;
|
|||||||
$debates: #008CCF;
|
$debates: #008CCF;
|
||||||
|
|
||||||
$comments-bg: #FAF9F8;
|
$comments-bg: #FAF9F8;
|
||||||
|
$comments-info: #A5B2B9;
|
||||||
|
$comments-text: #3F4549;
|
||||||
|
|
||||||
|
|
||||||
$header-color: #292B33;
|
$header-color: #292B33;
|
||||||
$link: #0077B9;
|
$link: #0077B9;
|
||||||
@@ -33,7 +36,7 @@ $tags-border: #F0F0F0;
|
|||||||
$tags-color: #8F8F8F;
|
$tags-color: #8F8F8F;
|
||||||
|
|
||||||
$text-color: #919399;
|
$text-color: #919399;
|
||||||
$text-medium: #999999;
|
$text-medium: #999999;
|
||||||
$text-light: #a3a6ad;
|
$text-light: #a3a6ad;
|
||||||
|
|
||||||
$votes-background: #EDEDED;
|
$votes-background: #EDEDED;
|
||||||
@@ -92,7 +95,7 @@ header {
|
|||||||
}
|
}
|
||||||
|
|
||||||
h1 {
|
h1 {
|
||||||
color: white;
|
color: white;
|
||||||
font-size: rem-calc(45);
|
font-size: rem-calc(45);
|
||||||
font-weight: bolder;
|
font-weight: bolder;
|
||||||
line-height: $line-height*3;
|
line-height: $line-height*3;
|
||||||
@@ -231,7 +234,7 @@ header {
|
|||||||
margin-bottom: $line-height;
|
margin-bottom: $line-height;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.votes {
|
.votes {
|
||||||
background: $votes-background;
|
background: $votes-background;
|
||||||
margin: -5px -20px -20px -20px;
|
margin: -5px -20px -20px -20px;
|
||||||
@@ -291,15 +294,16 @@ header {
|
|||||||
.debate-show {
|
.debate-show {
|
||||||
color: $text-medium;
|
color: $text-medium;
|
||||||
margin-top: $line-height;
|
margin-top: $line-height;
|
||||||
padding: 0 $line-height/2;
|
margin-bottom: $line-height*2;
|
||||||
|
padding: 0 $line-height/2;
|
||||||
|
|
||||||
.back {
|
.back {
|
||||||
color: $text-light;
|
color: $text-light;
|
||||||
font-size: rem-calc(13);
|
font-size: rem-calc(13);
|
||||||
line-height: $line-height;
|
line-height: $line-height;
|
||||||
}
|
}
|
||||||
|
|
||||||
h1 {
|
h1 {
|
||||||
clear: both;
|
clear: both;
|
||||||
font-size: rem-calc(24);
|
font-size: rem-calc(24);
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
@@ -323,7 +327,7 @@ header {
|
|||||||
font-size: rem-calc(14);
|
font-size: rem-calc(14);
|
||||||
line-height: $line-height;
|
line-height: $line-height;
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.author-photo {
|
.author-photo {
|
||||||
@@ -335,13 +339,13 @@ header {
|
|||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
width: 32px;
|
width: 32px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.votes {
|
.votes {
|
||||||
border: 1px solid $votes-border;
|
border: 1px solid $votes-border;
|
||||||
box-shadow: 0 2px 0 rgba(0,0,0,.1);
|
box-shadow: 0 2px 0 rgba(0,0,0,.1);
|
||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
padding: $line-height/2;
|
padding: $line-height/2;
|
||||||
|
|
||||||
.fi-like {
|
.fi-like {
|
||||||
background: $votes-like;
|
background: $votes-like;
|
||||||
border: 1px solid $votes-like-b;
|
border: 1px solid $votes-like-b;
|
||||||
@@ -398,6 +402,10 @@ header {
|
|||||||
width: 1px;
|
width: 1px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.publish-comment {
|
||||||
|
margin-top: $line-height;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 06. Comments
|
// 06. Comments
|
||||||
@@ -405,19 +413,71 @@ header {
|
|||||||
|
|
||||||
.comments {
|
.comments {
|
||||||
background: $comments-bg;
|
background: $comments-bg;
|
||||||
margin-top: $line-height*2;
|
background-image: url('comments_divider.png');
|
||||||
|
background-repeat: repeat-x;
|
||||||
padding-top: $line-height;
|
padding-top: $line-height;
|
||||||
|
padding-bottom: $line-height*4;
|
||||||
|
|
||||||
h2 {
|
h2 {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.comment {
|
||||||
|
margin: $line-height/4 0;
|
||||||
|
|
||||||
|
p {
|
||||||
|
color: $comments-text;
|
||||||
|
font-size: rem-calc(15);
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
a {
|
||||||
|
color: $comments-info;
|
||||||
|
}
|
||||||
|
|
||||||
|
.user-photo {
|
||||||
|
border-radius: 2px;
|
||||||
|
display: inline-block;
|
||||||
|
height: 32px;
|
||||||
|
line-height: $line-height*2;
|
||||||
|
margin-right: $line-height/4;
|
||||||
|
vertical-align: top;
|
||||||
|
width: 32px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.comment-body {
|
||||||
|
margin-left: $line-height*1.6;
|
||||||
|
|
||||||
|
.reply {
|
||||||
|
font-size: rem-calc(12);
|
||||||
|
font-weight: lighter;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.comment-children {
|
||||||
|
border-left: 1px dotted $border;
|
||||||
|
margin-left: $line-height*1.6;
|
||||||
|
padding-left: $line-height/4;
|
||||||
|
|
||||||
|
@media only screen and (max-width: 40em) {
|
||||||
|
margin-left: $line-height/1.5;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.comment-info {
|
||||||
|
color: $comments-info;
|
||||||
|
font-size: rem-calc(13);
|
||||||
|
font-weight: lighter;
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 07. Tags
|
// 07. Tags
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
.tags a {
|
.tags a {
|
||||||
background: $tags-bg;
|
background: $tags-bg;
|
||||||
border: 1px solid $tags-border;
|
border: 1px solid $tags-border;
|
||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
|
|||||||
23
app/controllers/account_controller.rb
Normal file
23
app/controllers/account_controller.rb
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
class AccountController < ApplicationController
|
||||||
|
|
||||||
|
before_action :authenticate_user!
|
||||||
|
before_action :set_account
|
||||||
|
|
||||||
|
def show
|
||||||
|
end
|
||||||
|
|
||||||
|
def update
|
||||||
|
flash[:notice] = t("flash.actions.save_changes.notice") if @account.update(account_params)
|
||||||
|
redirect_to account_path
|
||||||
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
def set_account
|
||||||
|
@account = current_user
|
||||||
|
end
|
||||||
|
|
||||||
|
def account_params
|
||||||
|
params.require(:account).permit(:first_name, :last_name)
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
13
app/views/account/show.html.erb
Normal file
13
app/views/account/show.html.erb
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
<h1><%= t("account.show.title") %></h1>
|
||||||
|
|
||||||
|
<%= form_for @account, as: :account, url: account_path do |f| %>
|
||||||
|
<%= f.label :first_name, t("account.show.first_name_label") %>
|
||||||
|
<%= f.text_field :first_name %>
|
||||||
|
<%= f.label :last_name, t("account.show.last_name_label") %>
|
||||||
|
<%= f.text_field :last_name %>
|
||||||
|
|
||||||
|
<%= f.submit t("account.show.save_changes_submit"), class: "button radius" %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
<%= link_to t("account.show.change_credentials_link"), edit_user_registration_path %>
|
||||||
|
|
||||||
@@ -1,13 +1,18 @@
|
|||||||
<div id="comment-<%= comment.id %>" class='comment' style="padding-bottom:30px">
|
<div class="row">
|
||||||
<p><%= comment.user.name %></p>
|
<div id="comment-<%= comment.id %>" class="small-12 column comment">
|
||||||
<p>hace <%= time_ago_in_words(comment.created_at) %></p>
|
|
||||||
<p><%= comment.body %></p>
|
|
||||||
|
|
||||||
<div style="margin-left:50px">
|
<%= image_tag('user_default_2.jpg', class: 'user-photo left', size: '32x32') %>
|
||||||
<%= render comment.children %>
|
|
||||||
</div>
|
<div class="comment-body">
|
||||||
|
<span class="comment-info">
|
||||||
<div style="margin-left:50px">
|
<%= comment.user.name %> • <%= time_ago_in_words(comment.created_at) %>
|
||||||
<%= render 'comments/form', parent: comment %>
|
</span>
|
||||||
</div>
|
<p><%= comment.body %></p>
|
||||||
|
<p class="reply"><%= render 'comments/form', parent: comment %></p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="comment-children">
|
||||||
|
<%= render comment.children %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -6,6 +6,6 @@
|
|||||||
<%= f.hidden_field :commentable_type, value: parent.class %>
|
<%= f.hidden_field :commentable_type, value: parent.class %>
|
||||||
<%= f.hidden_field :commentable_id, value: parent.id %>
|
<%= f.hidden_field :commentable_id, value: parent.id %>
|
||||||
|
|
||||||
<%= f.submit comment_button_text(parent), class: "button radius" %>
|
<%= f.submit comment_button_text(parent), class: "button radius small" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
<div class="small-12 medium-9 column">
|
<div class="small-12 medium-9 column">
|
||||||
|
|
||||||
<%= link_to "< ".html_safe + t("debates.show.back_link"), debates_path, class: 'left back' %>
|
<%= link_to "« ".html_safe + t("debates.show.back_link"), debates_path, class: 'left back' %>
|
||||||
|
|
||||||
<h1><%= @debate.title %></h1>
|
<h1><%= @debate.title %></h1>
|
||||||
<div class="debate-info">
|
<div class="debate-info">
|
||||||
@@ -25,7 +25,7 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div id="comments" class="small-12 column">
|
<div id="comments" class="small-12 column">
|
||||||
<h2><%= t("debates.show.comments") %></h2>
|
<h2><%= t("debates.show.comments") %></h2>
|
||||||
<div style="padding-bottom:60px">
|
<div>
|
||||||
<%= t("debates.show.leave_comment") %>
|
<%= t("debates.show.leave_comment") %>
|
||||||
<%= render 'comments/form', parent: @debate %>
|
<%= render 'comments/form', parent: @debate %>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
<div style="background: #0077b9; width: 100%; margin-top: 48px;">
|
<div style="background: #0077b9; width: 100%;">
|
||||||
<%= image_tag('footer.jpg', style: 'width: 100%; max-width: 1170px;') %>
|
<%= image_tag('footer.jpg', style: 'width: 100%; max-width: 1170px;') %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -23,6 +23,12 @@
|
|||||||
|
|
||||||
<section class="top-bar-section">
|
<section class="top-bar-section">
|
||||||
<%= render 'devise/menu/login_items' %>
|
<%= render 'devise/menu/login_items' %>
|
||||||
|
|
||||||
|
<% if user_signed_in? %>
|
||||||
|
<ul class="right">
|
||||||
|
<li><%= link_to(t("layouts.header.my_account_link"), account_path) %></li>
|
||||||
|
</ul>
|
||||||
|
<% end %>
|
||||||
</section>
|
</section>
|
||||||
</nav>
|
</nav>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,23 +1,25 @@
|
|||||||
<div id="votes" class="votes small-12 medium-3 column">
|
<div id="votes" class="votes small-12 medium-3 column">
|
||||||
<div class="small-12 column text-center">
|
<div class="small-12 column text-center">
|
||||||
<div id="in_favor" class="inline-block">
|
<div id="in_favor" class="inline-block">
|
||||||
<%= link_to debate_votes_path(@debate, value: 'yes'), class: 'in-favor', method: "post" do %>
|
<%= link_to debate_votes_path(@debate, value: 'yes'), class: 'in-favor', method: "post" do %>
|
||||||
<i class="fi-like"></i>
|
<i class="fi-like"></i>
|
||||||
<span><%= percentage('likes', @debate) %></span>
|
<span><%= percentage('likes', @debate) %></span>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
|
||||||
|
|
||||||
<span class="divider"></span>
|
|
||||||
|
|
||||||
<div id="against" class="inline-block">
|
|
||||||
<%= link_to debate_votes_path(@debate, value: 'no'), class: 'against', method: "post" do %>
|
|
||||||
<i class="fi-dislike"></i>
|
|
||||||
<span><%= percentage('dislikes', @debate) %></span>
|
|
||||||
<% end %>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="small-12 column text-center">
|
<span class="divider"></span>
|
||||||
<p class="total-votes"><%= pluralize(@debate.total_votes, t("debates.debate.vote"), t("debates.debate.votes")) %></p>
|
|
||||||
|
<div id="against" class="inline-block">
|
||||||
|
<%= link_to debate_votes_path(@debate, value: 'no'), class: 'against', method: "post" do %>
|
||||||
|
<i class="fi-dislike"></i>
|
||||||
|
<span><%= percentage('dislikes', @debate) %></span>
|
||||||
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="small-12 column text-center">
|
||||||
|
<p class="total-votes">
|
||||||
|
<%= pluralize(@debate.total_votes, t("debates.debate.vote"), t("debates.debate.votes")) %>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
@@ -10,6 +10,7 @@ en:
|
|||||||
open_city: We are opening Madrid
|
open_city: We are opening Madrid
|
||||||
open_city_slogan: So the citizens can decide what kind of city they want.
|
open_city_slogan: So the citizens can decide what kind of city they want.
|
||||||
create_debate: Create a debate
|
create_debate: Create a debate
|
||||||
|
my_account_link: My account
|
||||||
debates:
|
debates:
|
||||||
debate:
|
debate:
|
||||||
debate: Debate
|
debate: Debate
|
||||||
@@ -40,4 +41,8 @@ en:
|
|||||||
back_link: Back
|
back_link: Back
|
||||||
votes:
|
votes:
|
||||||
notice_thanks: "Thanks for voting."
|
notice_thanks: "Thanks for voting."
|
||||||
notice_already_registered: "Your vote is already registered."
|
notice_already_registered: "Your vote is already registered."
|
||||||
|
account:
|
||||||
|
show:
|
||||||
|
title: "My account"
|
||||||
|
save_changes_submit: "Save changes"
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ es:
|
|||||||
open_city: Estamos abriendo Madrid
|
open_city: Estamos abriendo Madrid
|
||||||
open_city_slogan: Para que todos los madrileños decidamos que ciudad queremos tener.
|
open_city_slogan: Para que todos los madrileños decidamos que ciudad queremos tener.
|
||||||
create_debate: Crea un debate
|
create_debate: Crea un debate
|
||||||
|
my_account_link: Mi cuenta
|
||||||
debates:
|
debates:
|
||||||
debate:
|
debate:
|
||||||
debate: Debate
|
debate: Debate
|
||||||
@@ -40,4 +41,8 @@ es:
|
|||||||
back_link: Volver
|
back_link: Volver
|
||||||
votes:
|
votes:
|
||||||
notice_thanks: "Gracias por votar."
|
notice_thanks: "Gracias por votar."
|
||||||
notice_already_registered: "Tu voto ya ha sido registrado."
|
notice_already_registered: "Tu voto ya ha sido registrado."
|
||||||
|
account:
|
||||||
|
show:
|
||||||
|
title: "Mi cuenta"
|
||||||
|
save_changes_submit: "Guardar cambios"
|
||||||
|
|||||||
@@ -10,3 +10,6 @@ en:
|
|||||||
destroy:
|
destroy:
|
||||||
notice: '%{resource_name} was successfully destroyed.'
|
notice: '%{resource_name} was successfully destroyed.'
|
||||||
alert: '%{resource_name} could not be destroyed.'
|
alert: '%{resource_name} could not be destroyed.'
|
||||||
|
save_changes:
|
||||||
|
notice: "Saved"
|
||||||
|
|
||||||
|
|||||||
@@ -7,4 +7,6 @@ es:
|
|||||||
notice: "%{resource_name} actualizado correctamente."
|
notice: "%{resource_name} actualizado correctamente."
|
||||||
destroy:
|
destroy:
|
||||||
notice: "%{resource_name} borrado correctamente."
|
notice: "%{resource_name} borrado correctamente."
|
||||||
alert: "%{resource_name} no ha podido ser borrado."
|
alert: "%{resource_name} no ha podido ser borrado."
|
||||||
|
save_changes:
|
||||||
|
notice: "Cambios guardados"
|
||||||
|
|||||||
@@ -11,6 +11,8 @@ Rails.application.routes.draw do
|
|||||||
resources :comments, only: :create
|
resources :comments, only: :create
|
||||||
end
|
end
|
||||||
|
|
||||||
|
resource :account, controller: "account", only: [:show, :update]
|
||||||
|
|
||||||
# Example of regular route:
|
# Example of regular route:
|
||||||
# get 'products/:id' => 'catalog#view'
|
# get 'products/:id' => 'catalog#view'
|
||||||
|
|
||||||
|
|||||||
33
spec/features/account_spec.rb
Normal file
33
spec/features/account_spec.rb
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
require 'rails_helper'
|
||||||
|
|
||||||
|
feature 'Account' do
|
||||||
|
|
||||||
|
background do
|
||||||
|
@user = create(:user, first_name: "Manuela", last_name:"Colau")
|
||||||
|
end
|
||||||
|
|
||||||
|
scenario 'Show' do
|
||||||
|
login_as(@user)
|
||||||
|
visit root_path
|
||||||
|
click_link "My account"
|
||||||
|
|
||||||
|
expect(page).to have_selector("input[value='Manuela']")
|
||||||
|
expect(page).to have_selector("input[value='Colau']")
|
||||||
|
end
|
||||||
|
|
||||||
|
scenario 'Edit' do
|
||||||
|
login_as(@user)
|
||||||
|
visit account_path
|
||||||
|
|
||||||
|
fill_in 'account_first_name', with: 'Larry'
|
||||||
|
fill_in 'account_last_name', with: 'Bird'
|
||||||
|
click_button 'Save changes'
|
||||||
|
|
||||||
|
expect(page).to have_content "Saved"
|
||||||
|
|
||||||
|
visit account_path
|
||||||
|
|
||||||
|
expect(page).to have_selector("input[value='Larry']")
|
||||||
|
expect(page).to have_selector("input[value='Bird']")
|
||||||
|
end
|
||||||
|
end
|
||||||
Reference in New Issue
Block a user