diff --git a/README.md b/README.md index 648cefd8d..bc16cc385 100644 --- a/README.md +++ b/README.md @@ -22,8 +22,8 @@ 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 +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: diff --git a/app/assets/fonts/foundation-icons.eot b/app/assets/fonts/foundation-icons.eot deleted file mode 100644 index 1746ad407..000000000 Binary files a/app/assets/fonts/foundation-icons.eot and /dev/null differ diff --git a/app/assets/fonts/foundation-icons.svg b/app/assets/fonts/foundation-icons.svg deleted file mode 100644 index 4e014ff89..000000000 --- a/app/assets/fonts/foundation-icons.svg +++ /dev/null @@ -1,970 +0,0 @@ - - - - diff --git a/app/assets/fonts/foundation-icons.ttf b/app/assets/fonts/foundation-icons.ttf deleted file mode 100644 index 6cce217dd..000000000 Binary files a/app/assets/fonts/foundation-icons.ttf and /dev/null differ diff --git a/app/assets/fonts/foundation-icons.woff b/app/assets/fonts/foundation-icons.woff deleted file mode 100644 index e2cfe25dd..000000000 Binary files a/app/assets/fonts/foundation-icons.woff and /dev/null differ diff --git a/app/assets/fonts/icons.eot b/app/assets/fonts/icons.eot new file mode 100644 index 000000000..9d0c2321a Binary files /dev/null and b/app/assets/fonts/icons.eot differ diff --git a/app/assets/fonts/icons.svg b/app/assets/fonts/icons.svg new file mode 100644 index 000000000..9a8da8380 --- /dev/null +++ b/app/assets/fonts/icons.svg @@ -0,0 +1,22 @@ + + + diff --git a/app/assets/fonts/icons.ttf b/app/assets/fonts/icons.ttf new file mode 100644 index 000000000..787788696 Binary files /dev/null and b/app/assets/fonts/icons.ttf differ diff --git a/app/assets/fonts/icons.woff b/app/assets/fonts/icons.woff new file mode 100644 index 000000000..a6676b0db Binary files /dev/null and b/app/assets/fonts/icons.woff differ diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss index 2f0f5f47b..6ae9b1ecc 100644 --- a/app/assets/stylesheets/application.scss +++ b/app/assets/stylesheets/application.scss @@ -1,4 +1,4 @@ @import "foundation_and_overrides"; -@import "foundation_icons"; @import "fonts"; +@import "icons"; @import "debates"; \ No newline at end of file diff --git a/app/assets/stylesheets/debates.scss b/app/assets/stylesheets/debates.scss index 6e251d6dd..9e991d89b 100644 --- a/app/assets/stylesheets/debates.scss +++ b/app/assets/stylesheets/debates.scss @@ -1,6 +1,8 @@ // Table of Contents // // 01. Variables +// 01.1. Fonts +// 01.2. Colors // 02. Global styles // 03. Header // 04. Footer @@ -17,174 +19,170 @@ // 01. Variables // - - - - - - - - - - - - - - - - - - - - - - - - - +// 01.1. Fonts +// - - - - - - - - - - - - + $font-family-sans-serif: 'Roboto', 'Helvetica Neue', Helvetica, Arial, sans-serif; $line-height: rem-calc(24); +// 01.2. Colors +// - - - - - - - - - - - - + $background: #E9E9E9; $border: #DEE0E3; -$brand: #0077B9; +$brand: #0077B9; $debates: #008CCF; -$comments-bg: #FAF9F8; +$comments-bg: #F1F1F1;//FAF9F8; $comments-info: #A5B2B9; $comments-text: #3F4549; -$header-color: #292B33; +$header-color: #292B33; $link: #0077B9; $tags-bg: #FAFAFA; $tags-border: #F0F0F0; $tags-color: #8F8F8F; -$text-color: #919399; +$text-color: #222222; $text-medium: #999999; -$text-light: #a3a6ad; +$text-light: #A3A6AD; -$votes-background: #EDEDED; -$votes-border: #DEE0E3; -$votes-dislike: #EF8585; -$votes-dislike-b: #D26463;//FF7978; +$votes: #A0AEC4; +$votes-background: #F0F0F0; +$votes-border: #D8D8D8; +$votes-unlike: #EF8585; $votes-like: #7BD2A8; -$votes-like-b: #56A47D; +$votes-text: #54627C; // 02. Global styles // - - - - - - - - - - - - - - - - - - - - - - - - - *, html { - margin: 0; - padding: 0; + margin: 0; + padding: 0; } body { - background: white; - font-family: $font-family-sans-serif; - font-size: rem-calc(13); - font-weight: normal; - - p { - font-weight: normal; - } + background: white; + font-family: $font-family-sans-serif; + font-size: rem-calc(13); + font-weight: normal; + text-rendering: optimizeLegibility; } .row { - max-width: 1170px; + max-width: 1170px; } .row-full { - max-width: 100% !important; + max-width: 100% !important; } .clear { - clear: both; + clear: both; } .inline-block { - display: inline-block; + display: inline-block; } -::selection { - background: $brand; - color: white; -} - -::-moz-selection { - background: $brand; - color: white; +::selection, ::-moz-selection { + background: $brand; + color: white; } // 03. Header // - - - - - - - - - - - - - - - - - - - - - - - - - header { - background: url('home_header_bg.jpg'); - background-position: 50% 50%; - background-size: cover; - min-height: $line-height*20; + background: url('home_header_bg.jpg'); + background-position: 50% 50%; + background-size: cover; + min-height: $line-height*20; - &.results { - min-height: $line-height*8; - } + &.results { + min-height: $line-height*8; + } - h1 { - color: white; - font-size: rem-calc(45); - font-weight: bolder; - line-height: $line-height*3; - margin: $line-height 0 0 0; - padding: 0; - } + h1 { + color: white; + font-size: rem-calc(45); + font-weight: bolder; + line-height: $line-height*3; + margin: $line-height 0 0 0; + padding: 0; + } - h2 { - @extend h1; - font-size: rem-calc(24); - font-weight: normal; - line-height: $line-height*2; - margin: 0; - } + h2 { + @extend h1; + font-size: rem-calc(24); + font-weight: normal; + line-height: $line-height*2; + margin: 0; + } - .button { - background: none; - border: 2px solid white; - color: white; - margin-top: $line-height*2; - } + .button { + color: white; + margin-top: $line-height*2; + } } .contain-to-grid { - background: none; + background: none; } .top-bar { - background: white; - color: $header-color; - height: $line-height*4; - max-width: 1170px !important; + background: white; + color: $header-color; + height: $line-height*4; + max-width: 1170px !important; - .name a { - color: black; - font-family: 'Lato'; - font-size: rem-calc(36); - font-weight: lighter; - line-height: $line-height*4; - padding-left: 0; + .name a { + color: black; + font-family: 'Lato'; + font-size: rem-calc(36); + font-weight: lighter; + line-height: $line-height*4; + padding-left: 0; - span { - color: $brand; - font-size: rem-calc(24); - font-weight: normal; - } - - img { - margin-right: $line-height/2; - } + span { + color: $brand; + font-size: rem-calc(24); + font-weight: normal; } + + img { + margin-right: $line-height/2; + } + } } .top-bar-section { - li:not(.has-form) a:not(.button) { - background: white; - color: $brand; - line-height: $line-height*4; - } + li:not(.has-form) a:not(.button) { + background: white; + color: $brand; + line-height: $line-height*4; + } - li.active:not(.has-form) a:not(.button) { - height: $line-height*4; - line-height: $line-height*4; - } + li.active:not(.has-form) a:not(.button) { + height: $line-height*4; + line-height: $line-height*4; + } } .top-links { - color: white; - font-size: rem-calc(14); - height: $line-height*2; - padding: $line-height/2 0; + color: white; + font-size: rem-calc(14); + height: $line-height*2; + padding: $line-height/2 0; - a { - color: white; - } + a { + color: white; + } } // 04. Footer @@ -197,315 +195,448 @@ header { // 05. Debates // - - - - - - - - - - - - - - - - - - - - - - - - - +aside { + .button { + margin-top: $line-height; + } +} + // 05.1. Debates Index // - - - - - - - - - - - - -.debates-index { - margin-top: $line-height; +.debates-list { + margin-top: $line-height; } -.debate { +.debates-featured { + + .debate { .panel { - background: white; - box-shadow: 0 2px 0 rgba(0,0,0,.1); + background: white; + box-shadow: 0 2px 0 rgba(0,0,0,.1); + padding: rem-calc(20) rem-calc(20) 0 rem-calc(20); - .fi-comment-quotes { - color: $debates; - font-size: rem-calc(36); - line-height: $line-height; - margin-bottom: $line-height*0.77; + .debate-content { + min-height: $line-height*11; + } + + .label { + background: none; + clear: both; + color: $debates; + display: block; + font-weight: bold; + text-transform: uppercase; + padding: 0; + } + + .icon-quote-right { + color: $debates; + font-size: rem-calc(30); + line-height: $line-height; + position: absolute; + right: $line-height; + top: $line-height/2; + } + + .icon-chat-bubble-two { + vertical-align: middle; + } + + h3 { + margin: rem-calc(12) 0 0 0; + font-weight: bold; + + a { + clear: both; + color: $header-color; + display: block; + font-size: rem-calc(16); + line-height: $line-height; } + } - .fi-price-tag { - color: $text-color; - font-size: rem-calc(18); - line-height: $line-height; + .debate-info { + color: $text-light; + font-weight: lighter; + margin-bottom: 0; + + .icon-chat-bubble-two { + font-size: rem-calc(16); } + } - .label { - margin-top: $line-height/4; - } - - h3 { - margin: 0; - font-weight: bold; - - a { - clear: both; - color: $header-color; - display: block; - font-size: rem-calc(16); - line-height: $line-height; - } - } - - p { - color: $text-color; - font-size: rem-calc(13); - line-height: $line-height; - margin-bottom: $line-height; - } + p { + color: $text-color; + font-size: rem-calc(13); + line-height: $line-height; + margin-bottom: $line-height/2; + } } .votes { + border-top: 1px solid $votes-border; + padding: $line-height/2 0; + + .icon-like { background: $votes-background; - margin: -5px -20px -20px -20px; - padding: 1.25rem 1.25rem 0 1.25rem; + border: 1px solid $votes-border; + border-radius: rem-calc(3); + color: $votes; + display: inline-block; + font-size: rem-calc(30); + line-height: rem-calc(30); + padding: rem-calc(6) rem-calc(12); + //when active => color: $votes-like; - .fi-like { - color: $votes-like; - font-size: rem-calc(48); - line-height: $line-height*2; + &:hover { + background: white; + color: $brand; } + } - .fi-dislike { - color: $votes-dislike; - display: inline-block; - font-size: rem-calc(48); - line-height: $line-height*2; - padding-top: $line-height/3; + .icon-unlike { + background: $votes-background; + border: 1px solid $votes-border; + border-radius: rem-calc(3); + color: $votes; + display: inline-block; + font-size: rem-calc(30); + line-height: rem-calc(30); + padding: rem-calc(6) rem-calc(12); + //when active => color: $votes-unlike; + + &:hover { + background: white; + color: $brand; } + } - .in-favor { - color: $votes-like; - line-height: rem-calc(48); - vertical-align: top; + .like { + line-height: rem-calc(48); + vertical-align: super; - span { - display: inline-block; - line-height: 48px; - padding-top: 5px; - vertical-align: top; - } + span { + color: $votes-text; + display: inline-block; + font-size: rem-calc(18); + font-weight: bold; + line-height: $line-height*2; + padding-left: rem-calc(6); + vertical-align: top; } + } - .against { - @extend .in-favor; - color: $votes-dislike; - display: inline-block; - } + .unlike { + @extend .like; + } - .total-votes { - font-size: rem-calc(12); - line-height: $line-height*2; - } + .total-votes { + color: $votes-text; + line-height: $line-height*2; + } - .divider { - background: rgba(0,0,0, .1); - display: inline-block; - height: 3rem; - margin: 0 .5rem; - width: 1px; - } + .divider { + margin: 0 rem-calc(3); + } } + } +} + +.debates-index { + @extend .debates-featured; + + .debate { + margin-bottom: rem-calc(6); + + .panel { + border: 0; + box-shadow: none; + margin-bottom: 0; + padding: 0 rem-calc(6); + + p { + text-align: justify; + } + + .debate-content { + min-height: 0; + } + + .icon-quote-right { + font-size: rem-calc(14); + position: initial; + vertical-align: bottom; + } + + .label { + line-height: $line-height; + margin-right: rem-calc(5); + } + } + + .votes { + border: 0; + margin-top: $line-height; + + .like { + + span { + color: $votes-text; + display: block; + font-size: rem-calc(18); + font-weight: bold; + line-height: $line-height*1.5; + } + } + } + } } // 05.2. Debates Show // - - - - - - - - - - - - .debate-show { - color: $text-medium; - margin-top: $line-height; - margin-bottom: $line-height*2; - padding: 0 $line-height/2; + margin-top: $line-height; + padding: 0 rem-calc(12); - .back { - color: $text-light; - font-size: rem-calc(13); - line-height: $line-height; + .back { + color: $text-light; + font-size: rem-calc(13); + line-height: $line-height; + } + + .icon-angle-left { + @extend .back; + } + + h1 { + clear: both; + font-size: rem-calc(24); + font-weight: bold; + line-height: $line-height*2; + margin: 0; + } + + .debate-info { + clear: both; + color: $text-light; + font-weight: lighter; + line-height: $line-height*2; + text-align: justify; + + .bullet { + color: $border; } - h1 { - clear: both; - font-size: rem-calc(24); + p { + font-size: rem-calc(14); + line-height: $line-height; + margin-bottom: 0; + } + } + + .author-photo { + border-radius: 2px; + display: inline-block; + height: 32px; + line-height: $line-height*2; + margin-right: $line-height/4; + vertical-align: middle; + width: 32px; + } + + .author { + color: $text-color; + font-weight: bold; + } + + .votes { + padding-top: 0; + + @media (min-width: 480px) { + padding-top: $line-height*1.5; + } + + h3 { + border-bottom: 1px solid $border; + font-size: rem-calc(18); + margin: 0 0 $line-height 0; + text-transform: uppercase; + } + + .icon-like { + background: $votes-background; + border: 1px solid $votes-border; + border-radius: rem-calc(3); + color: $votes; + display: inline-block; + font-size: rem-calc(30); + line-height: rem-calc(30); + padding: rem-calc(6) rem-calc(12); + //when active => color: $votes-like; + + &:hover { + background: white; + color: $brand; + } + } + + .icon-unlike { + background: $votes-background; + border: 1px solid $votes-border; + border-radius: rem-calc(3); + color: $votes; + display: inline-block; + font-size: rem-calc(30); + line-height: rem-calc(30); + padding: rem-calc(6) rem-calc(12); + //when active => color: $votes-unlike; + + &:hover { + background: white; + color: $brand; + } + } + + .like { + + span { + color: $votes-text; + display: block; + font-size: rem-calc(18); font-weight: bold; - line-height: $line-height*1.3333; - margin: 0; - padding-top: $line-height/2; + line-height: $line-height*1.5; + } } - .debate-info { - color: $text-light; - font-weight: lighter; - line-height: $line-height*2; - margin-bottom: $line-height*0.5; - text-align: justify; - - span { - color: $border; - } - - p { - font-size: rem-calc(14); - line-height: $line-height; - margin-bottom: 0; - } + .unlike { + @extend .like; } - .author-photo { - border-radius: 2px; - display: inline-block; - height: 32px; - line-height: $line-height*2; - margin-right: $line-height/4; - vertical-align: middle; - width: 32px; + .total-votes { + color: $votes-text; + font-size: rem-calc(14); + line-height: $line-height; } - .votes { - border: 1px solid $votes-border; - box-shadow: 0 2px 0 rgba(0,0,0,.1); - border-radius: 3px; - padding: $line-height/2; - - .fi-like { - background: $votes-like; - border: 1px solid $votes-like-b; - border-radius: $line-height*2.5; - color: white; - display: block; - font-size: rem-calc(48); - height: $line-height*2.5; - line-height: $line-height*2.5; - width: $line-height*2.5; - } - - .fi-dislike { - background: $votes-dislike; - border: 1px solid $votes-dislike-b; - border-radius: $line-height*2.5; - color: white; - display: block; - font-size: rem-calc(48); - height: $line-height*2.5; - line-height: $line-height*2.5; - width: $line-height*2.5; - } - - .in-favor { - color: $votes-like; - line-height: rem-calc(48); - - span { - display: inline-block; - font-size: rem-calc(18); - font-weight: bold; - line-height: $line-height; - padding-top: $line-height/4; - vertical-align: top; - } - } - - .against { - @extend .in-favor; - color: $votes-dislike; - } - - .total-votes { - font-size: rem-calc(14); - margin: 0; - } - - .divider { - background: rgba(0,0,0,.05); - display: inline-block; - height: $line-height*4; - margin: 0 $line-height; - width: 1px; - } + .divider { + margin: 0 rem-calc(12); } + } - .publish-comment { - margin-top: $line-height; - } + .leave-comment { + display: inline-block; + margin-top: $line-height; + } } // 06. Comments // - - - - - - - - - - - - - - - - - - - - - - - - - .comments { - background: $comments-bg; - background-image: url('comments_divider.png'); - background-repeat: repeat-x; - padding-top: $line-height; - padding-bottom: $line-height*4; + background: $comments-bg; + background-image: url('comments_divider.png'); + background-repeat: repeat-x; + padding-top: $line-height; + padding-bottom: $line-height*4; - h2 { - margin: 0; - font-weight: bold; + h2 { + margin: 0; + font-weight: bold; + } + + .comment { + margin: $line-height/4 0; + + p { + color: $comments-text; + font-size: rem-calc(15); + margin-bottom: 0; } - .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; - } + 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 // - - - - - - - - - - - - - - - - - - - - - - - - - -.tags a { +.tags { + + a { background: $tags-bg; border: 1px solid $tags-border; border-radius: 3px; color: $tags-color; + display: inline-block; font-size: rem-calc(13); - margin-bottom: 8px; - margin-right: $line-height/3; - padding: $line-height/4 $line-height/3; + margin-bottom: rem-calc(8); + margin-right: rem-calc(8); + padding: 0 rem-calc(6); + &:hover { - color: $link; - cursor: pointer; - background: #e5f1f8; - border: 1px solid $brand; + color: $link; + cursor: pointer; + background: #e5f1f8; + border: 1px solid $brand; } + } +} + +.tag-cloud { + @extend .tags; + + h3 { + font-size: rem-calc(24); + font-weight: bold; + line-height: $line-height*2; + margin: 0; + } + + a { + padding: $line-height/4 $line-height/3; + } } // 08. Login and Sign Up @@ -515,57 +646,22 @@ header { // - - - - - - - - - - - - .auth { - background: $background; - box-shadow: 0px -4px 5px $background; - min-height: $line-height*20; + background: $background; + box-shadow: 0px -4px 5px $background; + min-height: $line-height*20; - .panel { - background: white; - margin-top: $line-height*2; + .panel { + background: white; + margin-top: $line-height*2; - h1 { - font-size: rem-calc(30); - font-weight: bolder; - } + h1 { + font-size: rem-calc(30); + font-weight: bolder; } + } } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/app/assets/stylesheets/foundation_icons.scss b/app/assets/stylesheets/foundation_icons.scss deleted file mode 100644 index 2b6855c55..000000000 --- a/app/assets/stylesheets/foundation_icons.scss +++ /dev/null @@ -1,594 +0,0 @@ -/* - * Foundation Icons v 3.0 - * Made by ZURB 2013 http://zurb.com/playground/foundation-icon-fonts-3 - * MIT License - */ - -@font-face { - font-family: 'foundation-icons'; - src: font-url('foundation-icons.eot'); - src: font-url('foundation-icons.eot?#iefix') format('embedded-opentype'), - font-url('foundation-icons.woff') format('woff'), - font-url('foundation-icons.ttf') format('truetype'), - font-url('foundation-icons.svg#fontcustom') format('svg'); - font-weight: normal; - font-style: normal; -} - -.fi-address-book:before, -.fi-alert:before, -.fi-align-center:before, -.fi-align-justify:before, -.fi-align-left:before, -.fi-align-right:before, -.fi-anchor:before, -.fi-annotate:before, -.fi-archive:before, -.fi-arrow-down:before, -.fi-arrow-left:before, -.fi-arrow-right:before, -.fi-arrow-up:before, -.fi-arrows-compress:before, -.fi-arrows-expand:before, -.fi-arrows-in:before, -.fi-arrows-out:before, -.fi-asl:before, -.fi-asterisk:before, -.fi-at-sign:before, -.fi-background-color:before, -.fi-battery-empty:before, -.fi-battery-full:before, -.fi-battery-half:before, -.fi-bitcoin-circle:before, -.fi-bitcoin:before, -.fi-blind:before, -.fi-bluetooth:before, -.fi-bold:before, -.fi-book-bookmark:before, -.fi-book:before, -.fi-bookmark:before, -.fi-braille:before, -.fi-burst-new:before, -.fi-burst-sale:before, -.fi-burst:before, -.fi-calendar:before, -.fi-camera:before, -.fi-check:before, -.fi-checkbox:before, -.fi-clipboard-notes:before, -.fi-clipboard-pencil:before, -.fi-clipboard:before, -.fi-clock:before, -.fi-closed-caption:before, -.fi-cloud:before, -.fi-comment-minus:before, -.fi-comment-quotes:before, -.fi-comment-video:before, -.fi-comment:before, -.fi-comments:before, -.fi-compass:before, -.fi-contrast:before, -.fi-credit-card:before, -.fi-crop:before, -.fi-crown:before, -.fi-css3:before, -.fi-database:before, -.fi-die-five:before, -.fi-die-four:before, -.fi-die-one:before, -.fi-die-six:before, -.fi-die-three:before, -.fi-die-two:before, -.fi-dislike:before, -.fi-dollar-bill:before, -.fi-dollar:before, -.fi-download:before, -.fi-eject:before, -.fi-elevator:before, -.fi-euro:before, -.fi-eye:before, -.fi-fast-forward:before, -.fi-female-symbol:before, -.fi-female:before, -.fi-filter:before, -.fi-first-aid:before, -.fi-flag:before, -.fi-folder-add:before, -.fi-folder-lock:before, -.fi-folder:before, -.fi-foot:before, -.fi-foundation:before, -.fi-graph-bar:before, -.fi-graph-horizontal:before, -.fi-graph-pie:before, -.fi-graph-trend:before, -.fi-guide-dog:before, -.fi-hearing-aid:before, -.fi-heart:before, -.fi-home:before, -.fi-html5:before, -.fi-indent-less:before, -.fi-indent-more:before, -.fi-info:before, -.fi-italic:before, -.fi-key:before, -.fi-laptop:before, -.fi-layout:before, -.fi-lightbulb:before, -.fi-like:before, -.fi-link:before, -.fi-list-bullet:before, -.fi-list-number:before, -.fi-list-thumbnails:before, -.fi-list:before, -.fi-lock:before, -.fi-loop:before, -.fi-magnifying-glass:before, -.fi-mail:before, -.fi-male-female:before, -.fi-male-symbol:before, -.fi-male:before, -.fi-map:before, -.fi-marker:before, -.fi-megaphone:before, -.fi-microphone:before, -.fi-minus-circle:before, -.fi-minus:before, -.fi-mobile-signal:before, -.fi-mobile:before, -.fi-monitor:before, -.fi-mountains:before, -.fi-music:before, -.fi-next:before, -.fi-no-dogs:before, -.fi-no-smoking:before, -.fi-page-add:before, -.fi-page-copy:before, -.fi-page-csv:before, -.fi-page-delete:before, -.fi-page-doc:before, -.fi-page-edit:before, -.fi-page-export-csv:before, -.fi-page-export-doc:before, -.fi-page-export-pdf:before, -.fi-page-export:before, -.fi-page-filled:before, -.fi-page-multiple:before, -.fi-page-pdf:before, -.fi-page-remove:before, -.fi-page-search:before, -.fi-page:before, -.fi-paint-bucket:before, -.fi-paperclip:before, -.fi-pause:before, -.fi-paw:before, -.fi-paypal:before, -.fi-pencil:before, -.fi-photo:before, -.fi-play-circle:before, -.fi-play-video:before, -.fi-play:before, -.fi-plus:before, -.fi-pound:before, -.fi-power:before, -.fi-previous:before, -.fi-price-tag:before, -.fi-pricetag-multiple:before, -.fi-print:before, -.fi-prohibited:before, -.fi-projection-screen:before, -.fi-puzzle:before, -.fi-quote:before, -.fi-record:before, -.fi-refresh:before, -.fi-results-demographics:before, -.fi-results:before, -.fi-rewind-ten:before, -.fi-rewind:before, -.fi-rss:before, -.fi-safety-cone:before, -.fi-save:before, -.fi-share:before, -.fi-sheriff-badge:before, -.fi-shield:before, -.fi-shopping-bag:before, -.fi-shopping-cart:before, -.fi-shuffle:before, -.fi-skull:before, -.fi-social-500px:before, -.fi-social-adobe:before, -.fi-social-amazon:before, -.fi-social-android:before, -.fi-social-apple:before, -.fi-social-behance:before, -.fi-social-bing:before, -.fi-social-blogger:before, -.fi-social-delicious:before, -.fi-social-designer-news:before, -.fi-social-deviant-art:before, -.fi-social-digg:before, -.fi-social-dribbble:before, -.fi-social-drive:before, -.fi-social-dropbox:before, -.fi-social-evernote:before, -.fi-social-facebook:before, -.fi-social-flickr:before, -.fi-social-forrst:before, -.fi-social-foursquare:before, -.fi-social-game-center:before, -.fi-social-github:before, -.fi-social-google-plus:before, -.fi-social-hacker-news:before, -.fi-social-hi5:before, -.fi-social-instagram:before, -.fi-social-joomla:before, -.fi-social-lastfm:before, -.fi-social-linkedin:before, -.fi-social-medium:before, -.fi-social-myspace:before, -.fi-social-orkut:before, -.fi-social-path:before, -.fi-social-picasa:before, -.fi-social-pinterest:before, -.fi-social-rdio:before, -.fi-social-reddit:before, -.fi-social-skillshare:before, -.fi-social-skype:before, -.fi-social-smashing-mag:before, -.fi-social-snapchat:before, -.fi-social-spotify:before, -.fi-social-squidoo:before, -.fi-social-stack-overflow:before, -.fi-social-steam:before, -.fi-social-stumbleupon:before, -.fi-social-treehouse:before, -.fi-social-tumblr:before, -.fi-social-twitter:before, -.fi-social-vimeo:before, -.fi-social-windows:before, -.fi-social-xbox:before, -.fi-social-yahoo:before, -.fi-social-yelp:before, -.fi-social-youtube:before, -.fi-social-zerply:before, -.fi-social-zurb:before, -.fi-sound:before, -.fi-star:before, -.fi-stop:before, -.fi-strikethrough:before, -.fi-subscript:before, -.fi-superscript:before, -.fi-tablet-landscape:before, -.fi-tablet-portrait:before, -.fi-target-two:before, -.fi-target:before, -.fi-telephone-accessible:before, -.fi-telephone:before, -.fi-text-color:before, -.fi-thumbnails:before, -.fi-ticket:before, -.fi-torso-business:before, -.fi-torso-female:before, -.fi-torso:before, -.fi-torsos-all-female:before, -.fi-torsos-all:before, -.fi-torsos-female-male:before, -.fi-torsos-male-female:before, -.fi-torsos:before, -.fi-trash:before, -.fi-trees:before, -.fi-trophy:before, -.fi-underline:before, -.fi-universal-access:before, -.fi-unlink:before, -.fi-unlock:before, -.fi-upload-cloud:before, -.fi-upload:before, -.fi-usb:before, -.fi-video:before, -.fi-volume-none:before, -.fi-volume-strike:before, -.fi-volume:before, -.fi-web:before, -.fi-wheelchair:before, -.fi-widget:before, -.fi-wrench:before, -.fi-x-circle:before, -.fi-x:before, -.fi-yen:before, -.fi-zoom-in:before, -.fi-zoom-out:before { - font-family: "foundation-icons"; - font-style: normal; - font-weight: normal; - font-variant: normal; - text-transform: none; - line-height: 1; - -webkit-font-smoothing: antialiased; - display: inline-block; - text-decoration: inherit; -} - -.fi-address-book:before { content: "\f100"; } -.fi-alert:before { content: "\f101"; } -.fi-align-center:before { content: "\f102"; } -.fi-align-justify:before { content: "\f103"; } -.fi-align-left:before { content: "\f104"; } -.fi-align-right:before { content: "\f105"; } -.fi-anchor:before { content: "\f106"; } -.fi-annotate:before { content: "\f107"; } -.fi-archive:before { content: "\f108"; } -.fi-arrow-down:before { content: "\f109"; } -.fi-arrow-left:before { content: "\f10a"; } -.fi-arrow-right:before { content: "\f10b"; } -.fi-arrow-up:before { content: "\f10c"; } -.fi-arrows-compress:before { content: "\f10d"; } -.fi-arrows-expand:before { content: "\f10e"; } -.fi-arrows-in:before { content: "\f10f"; } -.fi-arrows-out:before { content: "\f110"; } -.fi-asl:before { content: "\f111"; } -.fi-asterisk:before { content: "\f112"; } -.fi-at-sign:before { content: "\f113"; } -.fi-background-color:before { content: "\f114"; } -.fi-battery-empty:before { content: "\f115"; } -.fi-battery-full:before { content: "\f116"; } -.fi-battery-half:before { content: "\f117"; } -.fi-bitcoin-circle:before { content: "\f118"; } -.fi-bitcoin:before { content: "\f119"; } -.fi-blind:before { content: "\f11a"; } -.fi-bluetooth:before { content: "\f11b"; } -.fi-bold:before { content: "\f11c"; } -.fi-book-bookmark:before { content: "\f11d"; } -.fi-book:before { content: "\f11e"; } -.fi-bookmark:before { content: "\f11f"; } -.fi-braille:before { content: "\f120"; } -.fi-burst-new:before { content: "\f121"; } -.fi-burst-sale:before { content: "\f122"; } -.fi-burst:before { content: "\f123"; } -.fi-calendar:before { content: "\f124"; } -.fi-camera:before { content: "\f125"; } -.fi-check:before { content: "\f126"; } -.fi-checkbox:before { content: "\f127"; } -.fi-clipboard-notes:before { content: "\f128"; } -.fi-clipboard-pencil:before { content: "\f129"; } -.fi-clipboard:before { content: "\f12a"; } -.fi-clock:before { content: "\f12b"; } -.fi-closed-caption:before { content: "\f12c"; } -.fi-cloud:before { content: "\f12d"; } -.fi-comment-minus:before { content: "\f12e"; } -.fi-comment-quotes:before { content: "\f12f"; } -.fi-comment-video:before { content: "\f130"; } -.fi-comment:before { content: "\f131"; } -.fi-comments:before { content: "\f132"; } -.fi-compass:before { content: "\f133"; } -.fi-contrast:before { content: "\f134"; } -.fi-credit-card:before { content: "\f135"; } -.fi-crop:before { content: "\f136"; } -.fi-crown:before { content: "\f137"; } -.fi-css3:before { content: "\f138"; } -.fi-database:before { content: "\f139"; } -.fi-die-five:before { content: "\f13a"; } -.fi-die-four:before { content: "\f13b"; } -.fi-die-one:before { content: "\f13c"; } -.fi-die-six:before { content: "\f13d"; } -.fi-die-three:before { content: "\f13e"; } -.fi-die-two:before { content: "\f13f"; } -.fi-dislike:before { content: "\f140"; } -.fi-dollar-bill:before { content: "\f141"; } -.fi-dollar:before { content: "\f142"; } -.fi-download:before { content: "\f143"; } -.fi-eject:before { content: "\f144"; } -.fi-elevator:before { content: "\f145"; } -.fi-euro:before { content: "\f146"; } -.fi-eye:before { content: "\f147"; } -.fi-fast-forward:before { content: "\f148"; } -.fi-female-symbol:before { content: "\f149"; } -.fi-female:before { content: "\f14a"; } -.fi-filter:before { content: "\f14b"; } -.fi-first-aid:before { content: "\f14c"; } -.fi-flag:before { content: "\f14d"; } -.fi-folder-add:before { content: "\f14e"; } -.fi-folder-lock:before { content: "\f14f"; } -.fi-folder:before { content: "\f150"; } -.fi-foot:before { content: "\f151"; } -.fi-foundation:before { content: "\f152"; } -.fi-graph-bar:before { content: "\f153"; } -.fi-graph-horizontal:before { content: "\f154"; } -.fi-graph-pie:before { content: "\f155"; } -.fi-graph-trend:before { content: "\f156"; } -.fi-guide-dog:before { content: "\f157"; } -.fi-hearing-aid:before { content: "\f158"; } -.fi-heart:before { content: "\f159"; } -.fi-home:before { content: "\f15a"; } -.fi-html5:before { content: "\f15b"; } -.fi-indent-less:before { content: "\f15c"; } -.fi-indent-more:before { content: "\f15d"; } -.fi-info:before { content: "\f15e"; } -.fi-italic:before { content: "\f15f"; } -.fi-key:before { content: "\f160"; } -.fi-laptop:before { content: "\f161"; } -.fi-layout:before { content: "\f162"; } -.fi-lightbulb:before { content: "\f163"; } -.fi-like:before { content: "\f164"; } -.fi-link:before { content: "\f165"; } -.fi-list-bullet:before { content: "\f166"; } -.fi-list-number:before { content: "\f167"; } -.fi-list-thumbnails:before { content: "\f168"; } -.fi-list:before { content: "\f169"; } -.fi-lock:before { content: "\f16a"; } -.fi-loop:before { content: "\f16b"; } -.fi-magnifying-glass:before { content: "\f16c"; } -.fi-mail:before { content: "\f16d"; } -.fi-male-female:before { content: "\f16e"; } -.fi-male-symbol:before { content: "\f16f"; } -.fi-male:before { content: "\f170"; } -.fi-map:before { content: "\f171"; } -.fi-marker:before { content: "\f172"; } -.fi-megaphone:before { content: "\f173"; } -.fi-microphone:before { content: "\f174"; } -.fi-minus-circle:before { content: "\f175"; } -.fi-minus:before { content: "\f176"; } -.fi-mobile-signal:before { content: "\f177"; } -.fi-mobile:before { content: "\f178"; } -.fi-monitor:before { content: "\f179"; } -.fi-mountains:before { content: "\f17a"; } -.fi-music:before { content: "\f17b"; } -.fi-next:before { content: "\f17c"; } -.fi-no-dogs:before { content: "\f17d"; } -.fi-no-smoking:before { content: "\f17e"; } -.fi-page-add:before { content: "\f17f"; } -.fi-page-copy:before { content: "\f180"; } -.fi-page-csv:before { content: "\f181"; } -.fi-page-delete:before { content: "\f182"; } -.fi-page-doc:before { content: "\f183"; } -.fi-page-edit:before { content: "\f184"; } -.fi-page-export-csv:before { content: "\f185"; } -.fi-page-export-doc:before { content: "\f186"; } -.fi-page-export-pdf:before { content: "\f187"; } -.fi-page-export:before { content: "\f188"; } -.fi-page-filled:before { content: "\f189"; } -.fi-page-multiple:before { content: "\f18a"; } -.fi-page-pdf:before { content: "\f18b"; } -.fi-page-remove:before { content: "\f18c"; } -.fi-page-search:before { content: "\f18d"; } -.fi-page:before { content: "\f18e"; } -.fi-paint-bucket:before { content: "\f18f"; } -.fi-paperclip:before { content: "\f190"; } -.fi-pause:before { content: "\f191"; } -.fi-paw:before { content: "\f192"; } -.fi-paypal:before { content: "\f193"; } -.fi-pencil:before { content: "\f194"; } -.fi-photo:before { content: "\f195"; } -.fi-play-circle:before { content: "\f196"; } -.fi-play-video:before { content: "\f197"; } -.fi-play:before { content: "\f198"; } -.fi-plus:before { content: "\f199"; } -.fi-pound:before { content: "\f19a"; } -.fi-power:before { content: "\f19b"; } -.fi-previous:before { content: "\f19c"; } -.fi-price-tag:before { content: "\f19d"; } -.fi-pricetag-multiple:before { content: "\f19e"; } -.fi-print:before { content: "\f19f"; } -.fi-prohibited:before { content: "\f1a0"; } -.fi-projection-screen:before { content: "\f1a1"; } -.fi-puzzle:before { content: "\f1a2"; } -.fi-quote:before { content: "\f1a3"; } -.fi-record:before { content: "\f1a4"; } -.fi-refresh:before { content: "\f1a5"; } -.fi-results-demographics:before { content: "\f1a6"; } -.fi-results:before { content: "\f1a7"; } -.fi-rewind-ten:before { content: "\f1a8"; } -.fi-rewind:before { content: "\f1a9"; } -.fi-rss:before { content: "\f1aa"; } -.fi-safety-cone:before { content: "\f1ab"; } -.fi-save:before { content: "\f1ac"; } -.fi-share:before { content: "\f1ad"; } -.fi-sheriff-badge:before { content: "\f1ae"; } -.fi-shield:before { content: "\f1af"; } -.fi-shopping-bag:before { content: "\f1b0"; } -.fi-shopping-cart:before { content: "\f1b1"; } -.fi-shuffle:before { content: "\f1b2"; } -.fi-skull:before { content: "\f1b3"; } -.fi-social-500px:before { content: "\f1b4"; } -.fi-social-adobe:before { content: "\f1b5"; } -.fi-social-amazon:before { content: "\f1b6"; } -.fi-social-android:before { content: "\f1b7"; } -.fi-social-apple:before { content: "\f1b8"; } -.fi-social-behance:before { content: "\f1b9"; } -.fi-social-bing:before { content: "\f1ba"; } -.fi-social-blogger:before { content: "\f1bb"; } -.fi-social-delicious:before { content: "\f1bc"; } -.fi-social-designer-news:before { content: "\f1bd"; } -.fi-social-deviant-art:before { content: "\f1be"; } -.fi-social-digg:before { content: "\f1bf"; } -.fi-social-dribbble:before { content: "\f1c0"; } -.fi-social-drive:before { content: "\f1c1"; } -.fi-social-dropbox:before { content: "\f1c2"; } -.fi-social-evernote:before { content: "\f1c3"; } -.fi-social-facebook:before { content: "\f1c4"; } -.fi-social-flickr:before { content: "\f1c5"; } -.fi-social-forrst:before { content: "\f1c6"; } -.fi-social-foursquare:before { content: "\f1c7"; } -.fi-social-game-center:before { content: "\f1c8"; } -.fi-social-github:before { content: "\f1c9"; } -.fi-social-google-plus:before { content: "\f1ca"; } -.fi-social-hacker-news:before { content: "\f1cb"; } -.fi-social-hi5:before { content: "\f1cc"; } -.fi-social-instagram:before { content: "\f1cd"; } -.fi-social-joomla:before { content: "\f1ce"; } -.fi-social-lastfm:before { content: "\f1cf"; } -.fi-social-linkedin:before { content: "\f1d0"; } -.fi-social-medium:before { content: "\f1d1"; } -.fi-social-myspace:before { content: "\f1d2"; } -.fi-social-orkut:before { content: "\f1d3"; } -.fi-social-path:before { content: "\f1d4"; } -.fi-social-picasa:before { content: "\f1d5"; } -.fi-social-pinterest:before { content: "\f1d6"; } -.fi-social-rdio:before { content: "\f1d7"; } -.fi-social-reddit:before { content: "\f1d8"; } -.fi-social-skillshare:before { content: "\f1d9"; } -.fi-social-skype:before { content: "\f1da"; } -.fi-social-smashing-mag:before { content: "\f1db"; } -.fi-social-snapchat:before { content: "\f1dc"; } -.fi-social-spotify:before { content: "\f1dd"; } -.fi-social-squidoo:before { content: "\f1de"; } -.fi-social-stack-overflow:before { content: "\f1df"; } -.fi-social-steam:before { content: "\f1e0"; } -.fi-social-stumbleupon:before { content: "\f1e1"; } -.fi-social-treehouse:before { content: "\f1e2"; } -.fi-social-tumblr:before { content: "\f1e3"; } -.fi-social-twitter:before { content: "\f1e4"; } -.fi-social-vimeo:before { content: "\f1e5"; } -.fi-social-windows:before { content: "\f1e6"; } -.fi-social-xbox:before { content: "\f1e7"; } -.fi-social-yahoo:before { content: "\f1e8"; } -.fi-social-yelp:before { content: "\f1e9"; } -.fi-social-youtube:before { content: "\f1ea"; } -.fi-social-zerply:before { content: "\f1eb"; } -.fi-social-zurb:before { content: "\f1ec"; } -.fi-sound:before { content: "\f1ed"; } -.fi-star:before { content: "\f1ee"; } -.fi-stop:before { content: "\f1ef"; } -.fi-strikethrough:before { content: "\f1f0"; } -.fi-subscript:before { content: "\f1f1"; } -.fi-superscript:before { content: "\f1f2"; } -.fi-tablet-landscape:before { content: "\f1f3"; } -.fi-tablet-portrait:before { content: "\f1f4"; } -.fi-target-two:before { content: "\f1f5"; } -.fi-target:before { content: "\f1f6"; } -.fi-telephone-accessible:before { content: "\f1f7"; } -.fi-telephone:before { content: "\f1f8"; } -.fi-text-color:before { content: "\f1f9"; } -.fi-thumbnails:before { content: "\f1fa"; } -.fi-ticket:before { content: "\f1fb"; } -.fi-torso-business:before { content: "\f1fc"; } -.fi-torso-female:before { content: "\f1fd"; } -.fi-torso:before { content: "\f1fe"; } -.fi-torsos-all-female:before { content: "\f1ff"; } -.fi-torsos-all:before { content: "\f200"; } -.fi-torsos-female-male:before { content: "\f201"; } -.fi-torsos-male-female:before { content: "\f202"; } -.fi-torsos:before { content: "\f203"; } -.fi-trash:before { content: "\f204"; } -.fi-trees:before { content: "\f205"; } -.fi-trophy:before { content: "\f206"; } -.fi-underline:before { content: "\f207"; } -.fi-universal-access:before { content: "\f208"; } -.fi-unlink:before { content: "\f209"; } -.fi-unlock:before { content: "\f20a"; } -.fi-upload-cloud:before { content: "\f20b"; } -.fi-upload:before { content: "\f20c"; } -.fi-usb:before { content: "\f20d"; } -.fi-video:before { content: "\f20e"; } -.fi-volume-none:before { content: "\f20f"; } -.fi-volume-strike:before { content: "\f210"; } -.fi-volume:before { content: "\f211"; } -.fi-web:before { content: "\f212"; } -.fi-wheelchair:before { content: "\f213"; } -.fi-widget:before { content: "\f214"; } -.fi-wrench:before { content: "\f215"; } -.fi-x-circle:before { content: "\f216"; } -.fi-x:before { content: "\f217"; } -.fi-yen:before { content: "\f218"; } -.fi-zoom-in:before { content: "\f219"; } -.fi-zoom-out:before { content: "\f21a"; } diff --git a/app/assets/stylesheets/icons.scss b/app/assets/stylesheets/icons.scss new file mode 100644 index 000000000..b7b4a820f --- /dev/null +++ b/app/assets/stylesheets/icons.scss @@ -0,0 +1,75 @@ +@charset "UTF-8"; + +@font-face { + font-family: 'icons'; + src: font-url('icons.eot'); + src: font-url('icons.eot?#iefix') format('embedded-opentype'), + font-url('icons.woff') format('woff'), + font-url('icons.ttf') format('truetype'), + font-url('icons.svg#icons') format('svg'); + font-weight: normal; + font-style: normal; +} + +[data-icon]:before { + font-family: "icons" !important; + content: attr(data-icon); + font-style: normal !important; + font-weight: normal !important; + font-variant: normal !important; + text-transform: none !important; + speak: none; + line-height: 1; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +[class^="icon-"]:before, +[class*=" icon-"]:before { + font-family: "icons" !important; + font-style: normal !important; + font-weight: normal !important; + font-variant: normal !important; + text-transform: none !important; + speak: none; + line-height: 1; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +.icon-angle-down:before { + content: "a"; +} +.icon-angle-left:before { + content: "b"; +} +.icon-angle-right:before { + content: "c"; +} +.icon-angle-up:before { + content: "d"; +} +.icon-chat-bubble-two:before { + content: "e"; +} +.icon-like:before { + content: "f"; +} +.icon-unlike:before { + content: "g"; +} +.icon-twitter:before { + content: "h"; +} +.icon-quote-left:before { + content: "l"; +} +.icon-quote-right:before { + content: "i"; +} +.icon-calendar:before { + content: "j"; +} +.icon-lightbulb:before { + content: "k"; +} diff --git a/app/controllers/debates_controller.rb b/app/controllers/debates_controller.rb index e75f9a2fb..c49241ff8 100644 --- a/app/controllers/debates_controller.rb +++ b/app/controllers/debates_controller.rb @@ -6,10 +6,11 @@ class DebatesController < ApplicationController def index if params[:tag] - @debates = Debate.tagged_with(params[:tag]) + @debates = Debate.tagged_with(params[:tag]).order("created_at DESC") else - @debates = Debate.all + @debates = Debate.all.order("created_at DESC") end + @featured_debates = @debates.to_a.shift(3) end def show @@ -51,4 +52,9 @@ class DebatesController < ApplicationController raise ActiveRecord::RecordNotFound unless @debate.editable_by?(current_user) end + def verify_captcha? + return true unless recaptcha_keys? + verify_recaptcha(model: @debate) + end + end diff --git a/app/models/debate.rb b/app/models/debate.rb index d82cfb8ac..836e3bf34 100644 --- a/app/models/debate.rb +++ b/app/models/debate.rb @@ -35,6 +35,10 @@ class Debate < ActiveRecord::Base editable? && author == user end + def description + super.try :html_safe + end + protected def sanitize_description diff --git a/app/views/debates/_debate.html.erb b/app/views/debates/_debate.html.erb index 4253143a6..f37f1c5bc 100644 --- a/app/views/debates/_debate.html.erb +++ b/app/views/debates/_debate.html.erb @@ -1,33 +1,39 @@ -
+ <%= pluralize(debate.comment_threads.count, t("debates.debate.comment"), t("debates.debate.comments")) %> +
+ <%= debate.description %> + <%= render "shared/tags", debate: debate %> +Por <%= debate.author.name %> el <%= l debate.created_at.to_date %>
-<%= sanitize(debate.description.html_safe) %>
+ -<%= render 'shared/tags', debate: debate %>
- -<%= pluralize(debate.total_votes, t("debates.debate.vote"), t("debates.debate.votes")) %>
-+ <%= pluralize(featured_debate.comment_threads.count, t("debates.show.comment"), t("debates.show.comments")) %> +
+<%= sanitize(truncate(featured_debate.description, length: 200).html_safe) %>
+<%= render "shared/tags", debate: featured_debate %>
+<%= render 'shared/tags', debate: @debate %>
-<%= render 'shared/tags', debate: @debate %>
+
<%= t("debates.show.comments") %>
-<%= t("debates.show.comments") %>
+<%= t("shared.tags_cloud.tags") %>
<% tag_cloud Debate.tag_counts, %w[s m l] do |tag, css_class| %> <%= link_to sanitize("#{tag.name}(#{tag.taggings_count})"), debates_path(tag: tag.name), class: css_class %> <% end %> -+
<%= pluralize(@debate.total_votes, t("debates.debate.vote"), t("debates.debate.votes")) %>
-<%= t("votes.supports") %>
+ +This is
' check 'debate_terms_of_service' click_button 'Create Debate' expect(page).to have_content 'Debate was successfully created.' expect(page).to have_content 'A test' - expect(page).to have_content 'This is alert("an attack");' + expect(page.html).to include 'This is alert("an attack");
' expect(page.html).to_not include '' + expect(page.html).to_not include '<p>This is' end scenario 'tagging using dangerous strings' do diff --git a/spec/features/tags_spec.rb b/spec/features/tags_spec.rb index 6b5889ea7..46610632f 100644 --- a/spec/features/tags_spec.rb +++ b/spec/features/tags_spec.rb @@ -18,17 +18,19 @@ feature 'Tags' do end scenario 'Filtered' do - 2.times { create(:debate, tag_list: 'Salud') } - 2.times { create(:debate, tag_list: 'Hacienda') } + debate1 = create(:debate, tag_list: 'Salud') + debate2 = create(:debate, tag_list: 'Salud') + debate3 = create(:debate, tag_list: 'Hacienda') + debate4 = create(:debate, tag_list: 'Hacienda') visit debates_path first(:link, "Salud").click - within('#debates') do - expect(page).to have_css('.debate', count: 2) - expect(page).to have_content('Salud') - expect(page).to_not have_content('Hacienda') - end + expect(page).to have_css('.debate', count: 2) + expect(page).to have_content(debate1.title) + expect(page).to have_content(debate2.title) + expect(page).to_not have_content(debate3.title) + expect(page).to_not have_content(debate4.title) end scenario 'Show' do diff --git a/spec/models/debate_spec.rb b/spec/models/debate_spec.rb index f2af2cf0a..00f6217bd 100644 --- a/spec/models/debate_spec.rb +++ b/spec/models/debate_spec.rb @@ -20,15 +20,22 @@ describe Debate do expect(@debate).to_not be_valid end - it "should not be valid without a description" do - @debate.description = nil - expect(@debate).to_not be_valid - end + describe "#description" do + it "should be mandatory" do + @debate.description = nil + expect(@debate).to_not be_valid + end - it "should sanitize the description" do - @debate.description = "" - @debate.valid? - expect(@debate.description).to eq("alert('danger');") + it "should be sanitized" do + @debate.description = "" + @debate.valid? + expect(@debate.description).to eq("alert('danger');") + end + + it "should be html_safe" do + @debate.description = "" + expect(@debate.description).to be_html_safe + end end it "should sanitize the tag list" do