Merge branch 'master' into budget
This commit is contained in:
BIN
app/assets/images/ballot.gif
Normal file
BIN
app/assets/images/ballot.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 7.0 KiB |
BIN
app/assets/images/ballot_tiny.gif
Normal file
BIN
app/assets/images/ballot_tiny.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.5 KiB |
@@ -46,6 +46,7 @@
|
||||
//= require valuation_spending_proposal_form
|
||||
//= require embed_video
|
||||
//= require banners
|
||||
//= require social_share
|
||||
//= require custom
|
||||
|
||||
var initialize_modules = function() {
|
||||
@@ -68,6 +69,7 @@ var initialize_modules = function() {
|
||||
App.ValuationSpendingProposalForm.initialize();
|
||||
App.EmbedVideo.initialize();
|
||||
App.Banners.initialize();
|
||||
App.SocialShare.initialize();
|
||||
};
|
||||
|
||||
$(function(){
|
||||
|
||||
7
app/assets/javascripts/social_share.js.coffee
Normal file
7
app/assets/javascripts/social_share.js.coffee
Normal file
@@ -0,0 +1,7 @@
|
||||
App.SocialShare =
|
||||
|
||||
initialize: ->
|
||||
$(".social-share-button a").each ->
|
||||
element = $(this)
|
||||
site = element.data('site')
|
||||
element.append("<span class='sr-only'>#{site}</span>")
|
||||
@@ -3,17 +3,11 @@ App.Votes =
|
||||
hoverize: (votes) ->
|
||||
$(document).on {
|
||||
'mouseenter focus': ->
|
||||
$("div.anonymous-votes", this).show();
|
||||
$("div.organizations-votes", this).show();
|
||||
$("div.not-logged", this).show();
|
||||
$("div.no-supports-allowed", this).show();
|
||||
$("div.logged", this).hide();
|
||||
$("div.participation-not-allowed", this).show();
|
||||
$("div.participation-allowed", this).hide();
|
||||
mouseleave: ->
|
||||
$("div.anonymous-votes", this).hide();
|
||||
$("div.organizations-votes", this).hide();
|
||||
$("div.not-logged", this).hide();
|
||||
$("div.no-supports-allowed", this).hide();
|
||||
$("div.logged", this).show();
|
||||
$("div.participation-not-allowed", this).hide();
|
||||
$("div.participation-allowed", this).show();
|
||||
}, votes
|
||||
|
||||
initialize: ->
|
||||
|
||||
@@ -48,47 +48,39 @@
|
||||
// --------------------
|
||||
|
||||
$base-font-size: rem-calc(17);
|
||||
$base-line-height: rem-calc(26);
|
||||
$base-line: rem-calc(26);
|
||||
$small-font-size: rem-calc(14);
|
||||
$line-height: rem-calc(24);
|
||||
$tiny-font-size: rem-calc(12);
|
||||
|
||||
$brand: #004A83;
|
||||
$body: #E9E9E9;
|
||||
$background: #EDEFF0;
|
||||
$border: #DEE0E3;
|
||||
$dark: darken($brand, 10%);
|
||||
|
||||
$text: #222222;
|
||||
$text-medium: #999999;
|
||||
$text-light: #CCCCCC;
|
||||
|
||||
$border: #DEE0E3;
|
||||
|
||||
$link: #2895F1;
|
||||
$link-hover: #2178BF;
|
||||
$link-hover: darken($link, 20%);
|
||||
|
||||
$debates: #008CCF;
|
||||
$votes-bg: #26AEEE;
|
||||
$votes-border: #1F94CB;
|
||||
|
||||
$votes-like: #7BD2A8;
|
||||
$votes-like-act: #5D9E7F;
|
||||
$votes-unlike: #EF8585;
|
||||
$votes-unlike-act: #BD6A6A;
|
||||
$like: #7BD2A8;
|
||||
$unlike: #EF8585;
|
||||
|
||||
$delete: #F04124;
|
||||
$check: #46DB91;
|
||||
|
||||
$proposals: #FFA42D;
|
||||
$proposals-border: #CC8425;
|
||||
|
||||
$budget: #454372;
|
||||
$budget-hover: #7571BF;
|
||||
|
||||
$highlight: #E7F2FC;
|
||||
$featured: #FED900;
|
||||
$featured: #FFDC5C;
|
||||
|
||||
$footer-bg: #DEE0E2;
|
||||
$footer-color: #171819;
|
||||
$footer-link: #454A4C;
|
||||
$footer-border: #BFC1C3;
|
||||
|
||||
$success-bg: #DFF0D8;
|
||||
|
||||
@@ -91,7 +91,7 @@ body.admin {
|
||||
|
||||
.admin-content {
|
||||
|
||||
.proposal-new, .proposal-edit {
|
||||
.proposal-form {
|
||||
padding-top: 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -23,6 +23,11 @@
|
||||
// 01. Global styles
|
||||
// -----------------
|
||||
|
||||
::selection {
|
||||
color: white;
|
||||
background-color: $brand;
|
||||
}
|
||||
|
||||
body {
|
||||
font-size: $base-font-size;
|
||||
}
|
||||
@@ -35,7 +40,7 @@ h1, h2, h3, h4, h5, h6 {
|
||||
p {
|
||||
font-size: $base-font-size;
|
||||
font-weight: 400;
|
||||
line-height: $base-line-height;
|
||||
line-height: $base-line;
|
||||
}
|
||||
|
||||
a {
|
||||
@@ -148,10 +153,6 @@ a {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.wrap {
|
||||
background: white;
|
||||
}
|
||||
|
||||
.footer, .push {
|
||||
clear: both;
|
||||
min-height: $line-height*12;
|
||||
@@ -479,8 +480,16 @@ header {
|
||||
&.active {
|
||||
border-bottom: 2px solid $brand;
|
||||
color: $brand;
|
||||
|
||||
&:hover {
|
||||
text-decoration: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
h2 {
|
||||
font-size: $base-font-size;
|
||||
}
|
||||
}
|
||||
|
||||
.search-form-header input[type=text] {
|
||||
@@ -491,7 +500,7 @@ header {
|
||||
// ----------
|
||||
|
||||
footer {
|
||||
color: $footer-color;
|
||||
color: $text;
|
||||
|
||||
.logo a {
|
||||
font-family: 'Lato' !important;
|
||||
@@ -511,10 +520,11 @@ footer {
|
||||
}
|
||||
|
||||
a, a:active, a:focus {
|
||||
color: $footer-link;
|
||||
color: $text;
|
||||
text-decoration: underline;
|
||||
|
||||
&:hover {
|
||||
color: $footer-color;
|
||||
color: $text-medium;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -523,7 +533,7 @@ footer {
|
||||
}
|
||||
|
||||
h2 a {
|
||||
border-bottom: 1px solid $footer-border;
|
||||
border-bottom: 1px solid $text-light;
|
||||
display: block;
|
||||
font-size: rem-calc(24);
|
||||
line-height: rem-calc(31);
|
||||
@@ -533,14 +543,14 @@ footer {
|
||||
}
|
||||
|
||||
.footer {
|
||||
background: $footer-bg;
|
||||
background: $border;
|
||||
border-top: 6px solid $brand;
|
||||
margin-top: $line-height*2;
|
||||
padding-top: $line-height;
|
||||
}
|
||||
|
||||
.subfooter {
|
||||
border-top: 1px solid $footer-border;
|
||||
border-top: 1px solid $text-light;
|
||||
padding-top: $line-height/2;
|
||||
}
|
||||
|
||||
@@ -567,8 +577,8 @@ footer {
|
||||
color: $link;
|
||||
|
||||
&:hover {
|
||||
background: $highlight;
|
||||
color: $link-hover;
|
||||
background: $brand;
|
||||
color: white;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -737,6 +747,56 @@ form {
|
||||
// 07. Callout
|
||||
// -----------
|
||||
|
||||
.callout-slide {
|
||||
animation-duration: 1s;
|
||||
-webkit-animation-duration: 1s;
|
||||
animation-fill-mode: both;
|
||||
-webkit-animation-fill-mode: both;
|
||||
animation-name: slide;
|
||||
-webkit-animation-name: slide;
|
||||
}
|
||||
|
||||
@-webkit-keyframes slide {
|
||||
from {
|
||||
-webkit-transform: translate3d(100%, 0, 0);
|
||||
transform: translate3d(100%, 0, 0);
|
||||
visibility: visible;
|
||||
}
|
||||
|
||||
to {
|
||||
-webkit-transform: translate3d(0, 0, 0);
|
||||
transform: translate3d(0, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes slide {
|
||||
from {
|
||||
-webkit-transform: translate3d(100%, 0, 0);
|
||||
transform: translate3d(100%, 0, 0);
|
||||
visibility: visible;
|
||||
}
|
||||
|
||||
to {
|
||||
-webkit-transform: translate3d(0, 0, 0);
|
||||
transform: translate3d(0, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
.notice-container {
|
||||
min-width: $line-height*12;
|
||||
position: absolute;
|
||||
right: 24px;
|
||||
top: 24px;
|
||||
|
||||
.notice {
|
||||
height: $line-height*4;
|
||||
|
||||
.notice-text {
|
||||
width: 95%;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.callout {
|
||||
font-size: $small-font-size;
|
||||
|
||||
@@ -956,15 +1016,6 @@ img.avatar, img.admin-avatar, img.moderator-avatar, img.initialjs-avatar {
|
||||
// 09. Search
|
||||
// ----------
|
||||
|
||||
.search-form h3 {
|
||||
border-top: 1px solid $votes-border;
|
||||
display: inline-block;
|
||||
font-size: rem-calc(16);
|
||||
margin: -1px 0 $line-height/2;
|
||||
padding-top: $line-height/4;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.search-results h2 {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
@@ -1209,13 +1260,14 @@ table {
|
||||
}
|
||||
|
||||
.share-supported {
|
||||
text-align: center;
|
||||
|
||||
.social-share-button {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.ssb-twitter {
|
||||
background: none;
|
||||
background: #45B0E3;
|
||||
color: white;
|
||||
height: $line-height;
|
||||
position: relative;
|
||||
@@ -1238,7 +1290,7 @@ table {
|
||||
}
|
||||
|
||||
.ssb-facebook {
|
||||
background: none;
|
||||
background: #3B5998;
|
||||
color: white;
|
||||
height: rem-calc(24);
|
||||
position: relative;
|
||||
@@ -1261,7 +1313,7 @@ table {
|
||||
}
|
||||
|
||||
.ssb-google_plus {
|
||||
background: none;
|
||||
background: #DE4C34;
|
||||
color: white;
|
||||
height: rem-calc(24);
|
||||
position: relative;
|
||||
@@ -1512,7 +1564,7 @@ table {
|
||||
|
||||
.comment-votes {
|
||||
color: $text-medium;
|
||||
font-size: rem-calc(14);
|
||||
font-size: $small-font-size;
|
||||
line-height: $line-height;
|
||||
|
||||
a {
|
||||
@@ -1522,12 +1574,21 @@ table {
|
||||
|
||||
&:hover {
|
||||
color: $text-medium;
|
||||
text-decoration: none;
|
||||
|
||||
.icon-like {
|
||||
color: $like;
|
||||
}
|
||||
|
||||
.icon-unlike {
|
||||
color: $unlike;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[class^="icon-"] {
|
||||
font-size: rem-calc(20);
|
||||
vertical-align: middle;
|
||||
font-size: $base-font-size;
|
||||
vertical-align: sub;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1542,6 +1603,7 @@ table {
|
||||
font-size: $small-font-size;
|
||||
margin: rem-calc(6) 0;
|
||||
padding: rem-calc(6);
|
||||
position: relative;
|
||||
|
||||
[class^="icon-arrow"] {
|
||||
font-size: rem-calc(18);
|
||||
@@ -1646,7 +1708,8 @@ table {
|
||||
}
|
||||
|
||||
.flag-disable, .flag-active {
|
||||
vertical-align: middle;
|
||||
line-height: 0;
|
||||
vertical-align: sub;
|
||||
}
|
||||
|
||||
.flag-disable {
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
font-size: rem-calc(24);
|
||||
font-weight: lighter;
|
||||
|
||||
@include breakpoint(small) {
|
||||
@include breakpoint(medium) {
|
||||
line-height: $line-height*2;
|
||||
margin-top: 0;
|
||||
}
|
||||
@@ -22,7 +22,7 @@
|
||||
height: 48px;
|
||||
width: 48px;
|
||||
|
||||
@include breakpoint(small) {
|
||||
@include breakpoint(medium) {
|
||||
height: 80px;
|
||||
margin-right: $line-height/2;
|
||||
margin-top: 0;
|
||||
|
||||
@@ -6,21 +6,28 @@
|
||||
// 04. List participation
|
||||
// 05. Featured
|
||||
// 06. Budget
|
||||
// 07. Proposals successfull
|
||||
//
|
||||
|
||||
// 01. Votes and supports
|
||||
// ----------------------
|
||||
|
||||
@mixin votes {
|
||||
background: $votes-bg;
|
||||
border-top: 1px solid $votes-border;
|
||||
margin: 0 rem-calc(-12);
|
||||
padding: rem-calc(14) rem-calc(12);
|
||||
border-top: 1px solid $border;
|
||||
margin-top: $line-height;
|
||||
padding: $line-height 0;
|
||||
position: relative;
|
||||
|
||||
.icon-like {
|
||||
@include breakpoint(medium) {
|
||||
border-left: 1px solid $border;
|
||||
border-top: 0;
|
||||
margin-top: 0;
|
||||
padding-top: $line-height*2;
|
||||
}
|
||||
|
||||
.icon-like, .icon-unlike {
|
||||
background: white;
|
||||
border: 2px solid $votes-border;
|
||||
border: 2px solid $text-light;
|
||||
border-radius: rem-calc(3);
|
||||
color: $text-light;
|
||||
display: inline-block;
|
||||
@@ -29,191 +36,150 @@
|
||||
padding: rem-calc(3) rem-calc(6);
|
||||
position: relative;
|
||||
|
||||
&:hover {
|
||||
background: $votes-like;
|
||||
border-color: white;
|
||||
&:hover, &:active {
|
||||
color: white;
|
||||
cursor: pointer;
|
||||
opacity: 1 !important;
|
||||
}
|
||||
}
|
||||
|
||||
&:active {
|
||||
border-color: $votes-like-act;
|
||||
.icon-like {
|
||||
|
||||
&:hover, &:active {
|
||||
background: $like;
|
||||
border: 2px solid $like;
|
||||
}
|
||||
}
|
||||
|
||||
.icon-unlike {
|
||||
background: white;
|
||||
border: 2px solid $votes-border;
|
||||
border-radius: rem-calc(3);
|
||||
color: $text-light;
|
||||
display: inline-block;
|
||||
font-size: rem-calc(30);
|
||||
line-height: rem-calc(30);
|
||||
padding: rem-calc(3) rem-calc(6);
|
||||
position: relative;
|
||||
|
||||
&:hover {
|
||||
background: $votes-unlike;
|
||||
border-color: white;
|
||||
color: white;
|
||||
cursor: pointer;
|
||||
opacity: 1 !important;
|
||||
}
|
||||
|
||||
&:active {
|
||||
border-color: $votes-unlike-act;
|
||||
&:hover, &:active {
|
||||
background: $unlike;
|
||||
border: 2px solid $unlike;
|
||||
}
|
||||
}
|
||||
|
||||
.like, .unlike {
|
||||
line-height: rem-calc(48);
|
||||
vertical-align: super;
|
||||
text-decoration: none;
|
||||
|
||||
span.percentage {
|
||||
color: white;
|
||||
color: $text;
|
||||
display: inline-block;
|
||||
font-size: rem-calc(16);
|
||||
font-size: $small-font-size;
|
||||
line-height: $line-height*2;
|
||||
padding-left: rem-calc(8);
|
||||
padding-right: $line-height/2;
|
||||
vertical-align: top;
|
||||
|
||||
@include breakpoint(medium) {
|
||||
display: block;
|
||||
line-height: $line-height;
|
||||
padding-right: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.voted {
|
||||
.icon-like {
|
||||
background: $votes-like;
|
||||
border-color: white;
|
||||
|
||||
.icon-like, .icon-unlike {
|
||||
color: white;
|
||||
}
|
||||
|
||||
.icon-like {
|
||||
background: $like;
|
||||
border: 2px solid $like;
|
||||
}
|
||||
|
||||
.icon-unlike {
|
||||
background: $votes-unlike;
|
||||
border-color: white;
|
||||
color: white;
|
||||
background: $unlike;
|
||||
border: 2px solid $unlike;
|
||||
}
|
||||
}
|
||||
|
||||
.no-voted {
|
||||
|
||||
.icon-like, .icon-unlike {
|
||||
opacity: .5;
|
||||
opacity: .3;
|
||||
}
|
||||
}
|
||||
|
||||
.total-votes {
|
||||
color: white;
|
||||
font-weight: bold;
|
||||
float: right;
|
||||
line-height: $line-height*2;
|
||||
|
||||
@include breakpoint(medium) {
|
||||
display: block;
|
||||
float: none;
|
||||
}
|
||||
}
|
||||
|
||||
.divider {
|
||||
margin: 0 rem-calc(6);
|
||||
}
|
||||
|
||||
.not-logged {
|
||||
background: rgba(22,99,135,.9);
|
||||
color: white;
|
||||
font-size: $small-font-size;
|
||||
height: 100%;
|
||||
left: 0;
|
||||
position: absolute;
|
||||
text-align: center;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr='#222222', endColorstr='#222222'); /* IE */
|
||||
|
||||
a {
|
||||
color: white;
|
||||
text-decoration: underline;
|
||||
}
|
||||
}
|
||||
|
||||
.anonymous-votes, .organizations-votes {
|
||||
background: $warning-bg;
|
||||
color: $color-warning;
|
||||
height: 100%;
|
||||
left: 0;
|
||||
line-height: $line-height;
|
||||
padding-top: rem-calc(12);
|
||||
position: absolute;
|
||||
text-align: center;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
|
||||
p {
|
||||
color: $color-warning;
|
||||
margin: 0 rem-calc(12);
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
a {
|
||||
color: $color-warning;
|
||||
font-weight: bold;
|
||||
text-decoration: underline;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@mixin supports {
|
||||
background: $proposals;
|
||||
border-top: 1px solid $proposals-border;
|
||||
margin: 0 rem-calc(-12);
|
||||
padding: rem-calc(14) rem-calc(12);
|
||||
padding: $line-height 0;
|
||||
position: relative;
|
||||
|
||||
.progress {
|
||||
background-color: rgba(255,255,255,.8);
|
||||
height: $line-height/2;
|
||||
background: lighten($proposals, 35%);
|
||||
border: 1px solid lighten($proposals, 35%);
|
||||
height: rem-calc(14);
|
||||
position: relative;
|
||||
|
||||
.meter {
|
||||
background: $votes-like;
|
||||
background: $proposals;
|
||||
border-radius: 0;
|
||||
border-bottom-right-radius: rem-calc(3);
|
||||
border-top-right-radius: rem-calc(3);
|
||||
display: block;
|
||||
height: $line-height/2;
|
||||
}
|
||||
}
|
||||
|
||||
.percentage {
|
||||
font-size: rem-calc(10);
|
||||
color: $brand;
|
||||
vertical-align: top;
|
||||
color: $text;
|
||||
font-size: $tiny-font-size;
|
||||
position: absolute;
|
||||
top: 13px;
|
||||
right: 20px;
|
||||
right: 6px;
|
||||
top: -2px;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
abbr {
|
||||
color: white;
|
||||
color: $text-medium;
|
||||
|
||||
&[title] {
|
||||
border-bottom: 1px dotted white;
|
||||
border-bottom: 1px dotted $text-medium;
|
||||
}
|
||||
}
|
||||
|
||||
.button-support {
|
||||
background: white;
|
||||
background: $proposals;
|
||||
color: $text;
|
||||
display: inline-block;
|
||||
font-size: $small-font-size;
|
||||
margin-top: rem-calc(12);
|
||||
|
||||
&:hover {
|
||||
background: $proposals-border;
|
||||
color: white;
|
||||
&:hover, &:active {
|
||||
background: lighten($proposals, 25%);
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
&:active {
|
||||
opacity: .75;
|
||||
}
|
||||
}
|
||||
|
||||
.total-supports {
|
||||
color: white;
|
||||
color: $text;
|
||||
display: block;
|
||||
font-weight: bold;
|
||||
text-align: center;
|
||||
font-size: $small-font-size;
|
||||
|
||||
span {
|
||||
display: block;
|
||||
font-size: $small-font-size;
|
||||
font-weight: normal;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -221,82 +187,77 @@
|
||||
margin: 0 rem-calc(6);
|
||||
}
|
||||
|
||||
.not-logged {
|
||||
background: rgba(255,164,45,.9);
|
||||
color: white;
|
||||
font-size: $small-font-size;
|
||||
height: 100%;
|
||||
left: 0;
|
||||
position: absolute;
|
||||
text-align: center;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr='#222222', endColorstr='#222222'); /* IE */
|
||||
|
||||
a {
|
||||
color: white;
|
||||
text-decoration: underline;
|
||||
}
|
||||
}
|
||||
|
||||
.anonymous-votes, .organizations-votes, .no-supports-allowed {
|
||||
background: $warning-bg;
|
||||
color: $color-warning;
|
||||
height: 100%;
|
||||
left: 0;
|
||||
line-height: $line-height;
|
||||
padding-top: rem-calc(12);
|
||||
position: absolute;
|
||||
text-align: center;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
|
||||
p {
|
||||
color: $color-warning;
|
||||
margin: 0 rem-calc(12);
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
a {
|
||||
color: $color-warning;
|
||||
font-weight: bold;
|
||||
text-decoration: underline;
|
||||
}
|
||||
}
|
||||
|
||||
.supported {
|
||||
color: white;
|
||||
color: $text;
|
||||
margin-top: rem-calc(12);
|
||||
}
|
||||
}
|
||||
|
||||
.supports-container {
|
||||
border-top: 1px solid $border;
|
||||
|
||||
@include breakpoint(medium) {
|
||||
border-left: 1px solid $border;
|
||||
border-top: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.participation-not-allowed {
|
||||
background: $warning-bg;
|
||||
color: $color-warning;
|
||||
height: 100%;
|
||||
left: 0;
|
||||
line-height: $line-height;
|
||||
padding: $line-height $line-height/2;
|
||||
position: absolute;
|
||||
text-align: center;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
z-index: 2;
|
||||
|
||||
p {
|
||||
color: $color-warning !important;
|
||||
margin: 0 rem-calc(12);
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
a {
|
||||
color: $color-warning !important;
|
||||
font-weight: bold;
|
||||
text-decoration: underline;
|
||||
}
|
||||
}
|
||||
|
||||
.reply .participation-not-allowed {
|
||||
padding-right: $line-height/2;
|
||||
padding-top: $line-height/6;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
// 02. New participation
|
||||
// ---------------------
|
||||
|
||||
.debate-new, .debate-edit,
|
||||
.proposal-new, .proposal-edit,
|
||||
.budget-proposal-new, .budget-proposal-edit,
|
||||
.spending-proposal-new, .spending-proposal-edit {
|
||||
.debate-form,
|
||||
.proposal-form,
|
||||
.budget-investment-form,
|
||||
.spending-proposal-form {
|
||||
|
||||
.icon-debates, .icon-proposals, .icon-budget {
|
||||
font-size: rem-calc(50);
|
||||
line-height: $line-height;
|
||||
opacity: .5;
|
||||
}
|
||||
|
||||
.icon-debates {
|
||||
color: $debates;
|
||||
font-size: rem-calc(60);
|
||||
line-height: $line-height;
|
||||
opacity: .5;
|
||||
}
|
||||
|
||||
.icon-proposals {
|
||||
color: $proposals;
|
||||
font-size: rem-calc(50);
|
||||
line-height: $line-height;
|
||||
opacity: .5;
|
||||
}
|
||||
|
||||
.icon-budget {
|
||||
color: $budget;
|
||||
font-size: rem-calc(50);
|
||||
line-height: $line-height;
|
||||
opacity: .5;
|
||||
}
|
||||
|
||||
.recommendations {
|
||||
@@ -316,14 +277,14 @@
|
||||
}
|
||||
}
|
||||
|
||||
.debate-new, .debate-edit {
|
||||
.debate-form {
|
||||
|
||||
.recommendations li:before {
|
||||
color: $debates;
|
||||
}
|
||||
}
|
||||
|
||||
.proposal-new, .proposal-edit {
|
||||
.proposal-form {
|
||||
|
||||
.recommendations li:before {
|
||||
color: $proposals;
|
||||
@@ -333,7 +294,10 @@
|
||||
// 03. Show participation
|
||||
// ----------------------
|
||||
|
||||
.debate-show, .proposal-show, .investment-project-show, .budget-investment-show {
|
||||
.debate-show,
|
||||
.proposal-show,
|
||||
.investment-project-show,
|
||||
.budget-investment-show {
|
||||
|
||||
p {
|
||||
word-wrap: break-word;
|
||||
@@ -470,57 +434,8 @@
|
||||
}
|
||||
}
|
||||
|
||||
.votes {
|
||||
@include votes;
|
||||
border: 0;
|
||||
border-radius: 0;
|
||||
margin: 0;
|
||||
|
||||
.total-votes {
|
||||
display: block;
|
||||
float: none;
|
||||
line-height: $line-height;
|
||||
}
|
||||
|
||||
.not-logged {
|
||||
line-height: $line-height;
|
||||
padding: rem-calc(24);
|
||||
}
|
||||
|
||||
@include breakpoint(small + rem-calc(1) and medium down) {
|
||||
.in-favor, .against {
|
||||
text-align: left;
|
||||
width: rem-calc(100);
|
||||
}
|
||||
}
|
||||
|
||||
.divider {
|
||||
display: none;
|
||||
}
|
||||
|
||||
@include breakpoint(medium) {
|
||||
.divider {
|
||||
display: inline-block;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.supports {
|
||||
@include supports;
|
||||
border: 0;
|
||||
border-radius: 0;
|
||||
margin: 0;
|
||||
|
||||
.total-supports {
|
||||
display: block;
|
||||
float: none;
|
||||
line-height: $line-height;
|
||||
}
|
||||
|
||||
.not-logged {
|
||||
line-height: $line-height;
|
||||
padding: rem-calc(24);
|
||||
}
|
||||
}
|
||||
|
||||
.leave-comment {
|
||||
@@ -545,26 +460,36 @@
|
||||
word-break: break-word;
|
||||
}
|
||||
|
||||
.proposal-show, .investment-project-show {
|
||||
|
||||
.supports {
|
||||
padding: $line-height/2 0 0;
|
||||
}
|
||||
|
||||
.share-supported {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
// 04. List participation
|
||||
// ----------------------
|
||||
|
||||
.debates-list, .proposals-list, .investment-projects-list, .budget-investments-list {
|
||||
|
||||
@include breakpoint(small) {
|
||||
@include breakpoint(medium) {
|
||||
margin-bottom: rem-calc(48);
|
||||
}
|
||||
}
|
||||
|
||||
.investment-projects-list, .budget-investments-list {
|
||||
|
||||
@include breakpoint(small) {
|
||||
@include breakpoint(medium) {
|
||||
min-height: $line-height*15;
|
||||
}
|
||||
}
|
||||
|
||||
.debate, .proposal, .investment-project, .budget-investment {
|
||||
margin-bottom: 0;
|
||||
margin-top: 0;
|
||||
margin: $line-height/4 0;
|
||||
|
||||
.panel {
|
||||
background: white;
|
||||
@@ -576,7 +501,7 @@
|
||||
min-height: rem-calc(192);
|
||||
padding: rem-calc(12) rem-calc(12) 0 rem-calc(12);
|
||||
|
||||
@include breakpoint(small) {
|
||||
@include breakpoint(medium) {
|
||||
margin-bottom: rem-calc(-1);
|
||||
padding-bottom: rem-calc(12);
|
||||
}
|
||||
@@ -701,15 +626,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
.not-logged {
|
||||
line-height: $line-height;
|
||||
padding-top: rem-calc(24);
|
||||
}
|
||||
|
||||
.anonymous-votes, .organizations-votes {
|
||||
padding-top: rem-calc(24);
|
||||
}
|
||||
|
||||
.divider {
|
||||
display: none;
|
||||
}
|
||||
@@ -731,107 +647,30 @@
|
||||
}
|
||||
}
|
||||
|
||||
.debate {
|
||||
.debate, .debate-show {
|
||||
|
||||
.votes {
|
||||
@include votes;
|
||||
border: 1px solid $votes-border;
|
||||
margin: 0 rem-calc(-12);
|
||||
|
||||
@include breakpoint(small) {
|
||||
border-top-left-radius: 3px;
|
||||
border-bottom-left-radius: 3px;
|
||||
margin: 0 rem-calc(-25) 0 rem-calc(12);
|
||||
.against {
|
||||
margin-left: $line-height/4;
|
||||
}
|
||||
|
||||
&:after {
|
||||
content: none;
|
||||
position: absolute;
|
||||
display: block;
|
||||
border-style: solid;
|
||||
border-color: #166387 transparent transparent transparent;
|
||||
bottom: -14px;
|
||||
border-left-width: 0;
|
||||
border-right-color: transparent;
|
||||
right: -1px;
|
||||
border-width: 13px 13px 0 0;
|
||||
|
||||
@include breakpoint(small) {
|
||||
content: "";
|
||||
}
|
||||
}
|
||||
|
||||
.total-votes {
|
||||
display: inline-block;
|
||||
line-height: $line-height;
|
||||
margin-left: rem-calc(24);
|
||||
padding-top: rem-calc(12);
|
||||
vertical-align: top;
|
||||
|
||||
@include breakpoint(small) {
|
||||
display: block;
|
||||
float: none;
|
||||
line-height: $line-height*2;
|
||||
margin-left: 0;
|
||||
padding-top: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@include breakpoint(small) {
|
||||
.like, .unlike {
|
||||
|
||||
span.percentage {
|
||||
display: block;
|
||||
line-height: $line-height/2;
|
||||
}
|
||||
}
|
||||
@include breakpoint(medium) {
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.debate-show .votes {
|
||||
border: 0;
|
||||
padding: $line-height/2 0;
|
||||
}
|
||||
|
||||
.proposal {
|
||||
|
||||
.supports {
|
||||
@include supports;
|
||||
border: 1px solid $proposals-border;
|
||||
margin: 0 rem-calc(-12);
|
||||
|
||||
@include breakpoint(small) {
|
||||
border-top-left-radius: 3px;
|
||||
border-bottom-left-radius: 3px;
|
||||
margin: 0 rem-calc(-25) 0 rem-calc(12);
|
||||
}
|
||||
|
||||
&:after {
|
||||
content: none;
|
||||
position: absolute;
|
||||
display: block;
|
||||
border-style: solid;
|
||||
border-color: #664212 transparent transparent transparent;
|
||||
bottom: -14px;
|
||||
border-left-width: 0;
|
||||
border-right-color: transparent;
|
||||
right: -1px;
|
||||
border-width: 13px 13px 0 0;
|
||||
|
||||
@include breakpoint(small) {
|
||||
content: "";
|
||||
}
|
||||
}
|
||||
|
||||
.total-supports {
|
||||
display: inline-block;
|
||||
line-height: $line-height;
|
||||
padding-top: rem-calc(12);
|
||||
vertical-align: top;
|
||||
|
||||
@include breakpoint(small) {
|
||||
display: block;
|
||||
float: none;
|
||||
margin-left: 0;
|
||||
padding-top: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -840,20 +679,6 @@
|
||||
|
||||
.supports {
|
||||
@include supports;
|
||||
background: none;
|
||||
border: 0;
|
||||
border-left: 1px solid $border;
|
||||
margin: 0 rem-calc(-12);
|
||||
min-height: rem-calc(180);
|
||||
padding-top: 0;
|
||||
|
||||
@include breakpoint(small) {
|
||||
padding-top: $line-height*1.5;
|
||||
}
|
||||
|
||||
&:after {
|
||||
content: none;
|
||||
}
|
||||
|
||||
.investment-project-amount,
|
||||
.budget-investment-amount {
|
||||
@@ -884,36 +709,11 @@
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.supported {
|
||||
color: $budget;
|
||||
margin-top: 0;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.remove .icon-check-circle {
|
||||
display: block;
|
||||
font-size: rem-calc(70);
|
||||
line-height: rem-calc(70);
|
||||
}
|
||||
|
||||
.no-supports-allowed {
|
||||
background: rgba(69,67,114,.96);
|
||||
color: white;
|
||||
padding: rem-calc(12);
|
||||
}
|
||||
|
||||
.no-supports-allowed p, .no-supports-allowed a {
|
||||
color: white;
|
||||
}
|
||||
|
||||
.share-supported {
|
||||
|
||||
.ssb-twitter,
|
||||
.ssb-facebook,
|
||||
.ssb-google_plus {
|
||||
color: $budget;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -940,7 +740,8 @@
|
||||
// 05. Featured
|
||||
// ------------
|
||||
|
||||
.featured-debates, .featured-proposals {
|
||||
.featured-debates, .featured-proposals,
|
||||
.proposals-ballot, .proposals-ballot-list {
|
||||
padding: $line-height/2 0;
|
||||
|
||||
@include breakpoint(medium) {
|
||||
@@ -997,21 +798,23 @@
|
||||
}
|
||||
|
||||
.button-support {
|
||||
background: $text;
|
||||
color: $featured;
|
||||
margin-top: 0;
|
||||
|
||||
&:hover {
|
||||
background: white;
|
||||
color: $text;
|
||||
}
|
||||
}
|
||||
|
||||
.not-logged,
|
||||
.organizations-votes,
|
||||
.anonymous-votes {
|
||||
.participation-not-allowed {
|
||||
background: $featured;
|
||||
color: $color-warning;
|
||||
font-size: $small-font-size;
|
||||
line-height: $line-height;
|
||||
padding-top: 0;
|
||||
|
||||
a {
|
||||
color: $color-warning;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
p {
|
||||
@@ -1023,6 +826,7 @@
|
||||
|
||||
.supported {
|
||||
margin-top: 0;
|
||||
font-size: $small-font-size;
|
||||
}
|
||||
|
||||
.share-supported {
|
||||
@@ -1030,7 +834,10 @@
|
||||
.ssb-twitter,
|
||||
.ssb-facebook,
|
||||
.ssb-google_plus {
|
||||
height: rem-calc(33);
|
||||
background: none;
|
||||
color: $text;
|
||||
height: rem-calc(33) !important;
|
||||
|
||||
|
||||
&:before {
|
||||
font-size: rem-calc(18);
|
||||
@@ -1175,6 +982,36 @@
|
||||
}
|
||||
}
|
||||
|
||||
// 07. Proposals successfull
|
||||
// -------------------------
|
||||
|
||||
.dark-heading {
|
||||
background: #2D3E50;
|
||||
color: white;
|
||||
|
||||
@include breakpoint(medium) {
|
||||
padding-bottom: $line-height;
|
||||
}
|
||||
|
||||
p {
|
||||
margin-bottom: 0;
|
||||
|
||||
&.title {
|
||||
color: #FFD200;
|
||||
}
|
||||
}
|
||||
|
||||
.info {
|
||||
background: #314253;
|
||||
padding-top: $line-height;
|
||||
|
||||
@include breakpoint(medium) {
|
||||
border-top: rem-calc(6) solid #FFD200;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.big-number {
|
||||
color: $budget;
|
||||
font-size: rem-calc(60);
|
||||
@@ -1302,3 +1139,83 @@ ul.ballot-list {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.featured-proposals-ballot-banner {
|
||||
background: #2D3E50 image-url("ballot_tiny.gif") no-repeat;
|
||||
background-position: 75% 0;
|
||||
position: relative;
|
||||
|
||||
h2, a:hover h2 {
|
||||
color: #FFD200 !important;
|
||||
}
|
||||
|
||||
p {
|
||||
color: white;
|
||||
}
|
||||
|
||||
@include breakpoint(medium) {
|
||||
margin-left: 0 !important;
|
||||
margin-right: 0 !important;
|
||||
}
|
||||
|
||||
@include breakpoint(large) {
|
||||
background: #2D3E50 image-url("ballot.gif") no-repeat;
|
||||
background-position: 90% 0;
|
||||
}
|
||||
}
|
||||
|
||||
.featured-proposals-ballot-banner,
|
||||
.successfull .panel {
|
||||
|
||||
.icon-successfull {
|
||||
border-right: 60px solid #FFD200;
|
||||
border-top: 0;
|
||||
border-bottom: 60px solid transparent;
|
||||
height: 0;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 0;
|
||||
width: 0;
|
||||
|
||||
&:after {
|
||||
color: #1B254C;
|
||||
content: "\59";
|
||||
font-family: "icons" !important;
|
||||
left: 34px;
|
||||
position: absolute;
|
||||
top: 5px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.proposals-ballot-list {
|
||||
|
||||
.proposal-sucessfull {
|
||||
background: white;
|
||||
border-top: 1px solid $border;
|
||||
padding: $line-height 0;
|
||||
position: relative;
|
||||
}
|
||||
}
|
||||
|
||||
.successfull {
|
||||
|
||||
.panel {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.truncate {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.message {
|
||||
@include supports;
|
||||
background: none;
|
||||
border-top: 0;
|
||||
|
||||
@include breakpoint(medium) {
|
||||
border-left: 1px solid $border;
|
||||
margin: $line-height rem-calc(-25) 0 rem-calc(12);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,4 +29,4 @@ class AccountController < ApplicationController
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
@@ -38,6 +38,7 @@ class Admin::BannersController < Admin::BaseController
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def banner_params
|
||||
params.require(:banner).permit(:title, :description, :target_url, :style, :image, :post_started_at, :post_ended_at)
|
||||
end
|
||||
@@ -53,4 +54,5 @@ class Admin::BannersController < Admin::BaseController
|
||||
def banner_imgs
|
||||
@banner_imgs = Setting.all.banner_img.map { |banner_img| [banner_img.value, banner_img.key.split('.')[1]] }
|
||||
end
|
||||
|
||||
end
|
||||
@@ -20,8 +20,9 @@ class Admin::CommentsController < Admin::BaseController
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def load_comment
|
||||
@comment = Comment.with_hidden.find(params[:id])
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
@@ -3,4 +3,4 @@ class Admin::DashboardController < Admin::BaseController
|
||||
def index
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
@@ -29,4 +29,4 @@ class Admin::DebatesController < Admin::BaseController
|
||||
@debate = Debate.with_hidden.find(params[:id])
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
@@ -25,8 +25,9 @@ class Admin::OfficialsController < Admin::BaseController
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def user_params
|
||||
params.require(:user).permit(:official_position, :official_level)
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
@@ -27,4 +27,4 @@ class Admin::OrganizationsController < Admin::BaseController
|
||||
redirect_to request.query_parameters.merge(action: :index)
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
@@ -25,4 +25,4 @@ class Admin::ProposalsController < Admin::BaseController
|
||||
@proposal = Proposal.with_hidden.find(params[:id])
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
@@ -15,7 +15,9 @@ class Admin::SettingsController < Admin::BaseController
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def settings_params
|
||||
params.require(:setting).permit(:value)
|
||||
end
|
||||
|
||||
end
|
||||
@@ -54,4 +54,4 @@ class Admin::SpendingProposalsController < Admin::BaseController
|
||||
@tags = ActsAsTaggableOn::Tag.spending_proposal_tags
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
@@ -32,4 +32,5 @@ class Admin::StatsController < Admin::BaseController
|
||||
@direct_messages = DirectMessage.count
|
||||
@users_who_have_sent_message = DirectMessage.select(:sender_id).distinct.count
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
@@ -30,4 +30,4 @@ class Admin::UsersController < Admin::BaseController
|
||||
@user = User.with_hidden.find(params[:id])
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
@@ -30,8 +30,10 @@ class Admin::ValuatorsController < Admin::BaseController
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def create_params
|
||||
params[:valuator][:description] = nil if params[:valuator][:description].blank?
|
||||
params.require(:valuator).permit(:user_id, :description)
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
@@ -77,4 +77,4 @@ class CommentsController < ApplicationController
|
||||
Notification.add(notifiable.author_id, notifiable) unless comment.author_id == notifiable.author_id
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
@@ -12,7 +12,7 @@ module CommentableActions
|
||||
|
||||
@tag_cloud = tag_cloud
|
||||
@banners = Banner.with_active
|
||||
|
||||
|
||||
set_resource_votes(@resources)
|
||||
set_resources_instance
|
||||
end
|
||||
@@ -155,4 +155,4 @@ module CommentableActions
|
||||
nil
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
@@ -4,9 +4,9 @@ module ModerateActions
|
||||
|
||||
def index
|
||||
@resources = @resources.send(@current_filter)
|
||||
.send("sort_by_#{@current_order}")
|
||||
.page(params[:page])
|
||||
.per(50)
|
||||
.send("sort_by_#{@current_order}")
|
||||
.page(params[:page])
|
||||
.per(50)
|
||||
set_resources_instance
|
||||
end
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
module Polymorphic
|
||||
|
||||
private
|
||||
|
||||
def resource
|
||||
@resource ||= instance_variable_get("@#{resource_name}")
|
||||
end
|
||||
|
||||
@@ -21,7 +21,8 @@ class DebatesController < ApplicationController
|
||||
respond_to :html, :js
|
||||
|
||||
def index_customization
|
||||
@featured_debates = @debates.featured
|
||||
@featured_debates = @debates.featured
|
||||
@proposal_successfull_exists = Proposal.successfull.exists?
|
||||
end
|
||||
|
||||
def show
|
||||
@@ -40,7 +41,7 @@ class DebatesController < ApplicationController
|
||||
end
|
||||
|
||||
def mark_featured
|
||||
@debate.update_attribute(:featured_at, Time.now)
|
||||
@debate.update_attribute(:featured_at, Time.current)
|
||||
redirect_to request.query_parameters.merge(action: :index)
|
||||
end
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ class Management::AccountController < Management::BaseController
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def only_verified_users
|
||||
check_verified_user t("management.account.alert.unverified_user")
|
||||
end
|
||||
|
||||
@@ -3,4 +3,4 @@ class Management::DashboardController < Management::BaseController
|
||||
def index
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
@@ -33,17 +33,17 @@ class Management::DocumentVerificationsController < Management::BaseController
|
||||
|
||||
private
|
||||
|
||||
def document_verification_params
|
||||
params.require(:document_verification).permit(:document_type, :document_number)
|
||||
end
|
||||
def document_verification_params
|
||||
params.require(:document_verification).permit(:document_type, :document_number)
|
||||
end
|
||||
|
||||
def set_document
|
||||
session[:document_type] = params[:document_verification][:document_type]
|
||||
session[:document_number] = params[:document_verification][:document_number]
|
||||
end
|
||||
def set_document
|
||||
session[:document_type] = params[:document_verification][:document_type]
|
||||
session[:document_number] = params[:document_verification][:document_number]
|
||||
end
|
||||
|
||||
def clean_document_number
|
||||
params[:document_verification][:document_number] = params[:document_verification][:document_number].gsub(/[^a-z0-9]+/i, "").upcase unless params[:document_verification][:document_number].blank?
|
||||
end
|
||||
def clean_document_number
|
||||
params[:document_verification][:document_number] = params[:document_verification][:document_number].gsub(/[^a-z0-9]+/i, "").upcase unless params[:document_verification][:document_number].blank?
|
||||
end
|
||||
|
||||
end
|
||||
@@ -16,8 +16,8 @@ class Management::EmailVerificationsController < Management::BaseController
|
||||
|
||||
private
|
||||
|
||||
def email_verification_params
|
||||
params.require(:email_verification).permit(:document_type, :document_number, :email)
|
||||
end
|
||||
def email_verification_params
|
||||
params.require(:email_verification).permit(:document_type, :document_number, :email)
|
||||
end
|
||||
|
||||
end
|
||||
@@ -53,4 +53,4 @@ class Management::ProposalsController < Management::BaseController
|
||||
@comment_flags = managed_user ? managed_user.comment_flags(comments) : {}
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
@@ -42,4 +42,4 @@ class Management::SessionsController < ActionController::Base
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
@@ -10,4 +10,4 @@ class Management::UserInvitesController < Management::BaseController
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
@@ -8,8 +8,8 @@ class Management::UsersController < Management::BaseController
|
||||
@user = User.new(user_params)
|
||||
@user.skip_password_validation = true
|
||||
@user.terms_of_service = '1'
|
||||
@user.residence_verified_at = Time.now
|
||||
@user.verified_at = Time.now
|
||||
@user.residence_verified_at = Time.current
|
||||
@user.verified_at = Time.current
|
||||
|
||||
if @user.save then
|
||||
render :show
|
||||
|
||||
@@ -21,13 +21,13 @@ class Moderation::UsersController < Moderation::BaseController
|
||||
|
||||
private
|
||||
|
||||
def load_users
|
||||
@users = User.with_hidden.search(params[:name_or_email]).page(params[:page]).for_render
|
||||
end
|
||||
def load_users
|
||||
@users = User.with_hidden.search(params[:name_or_email]).page(params[:page]).for_render
|
||||
end
|
||||
|
||||
def block_user
|
||||
@user.block
|
||||
Activity.log(current_user, :block, @user)
|
||||
end
|
||||
def block_user
|
||||
@user.block
|
||||
Activity.log(current_user, :block, @user)
|
||||
end
|
||||
|
||||
end
|
||||
@@ -24,6 +24,7 @@ class Organizations::RegistrationsController < Devise::RegistrationsController
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
def after_inactive_sign_up_path_for(resource)
|
||||
organizations_sign_up_success_path
|
||||
end
|
||||
|
||||
8
app/controllers/proposal_ballots_controller.rb
Normal file
8
app/controllers/proposal_ballots_controller.rb
Normal file
@@ -0,0 +1,8 @@
|
||||
class ProposalBallotsController < ApplicationController
|
||||
skip_authorization_check
|
||||
|
||||
def index
|
||||
@proposal_ballots = Proposal.successfull.sort_by_confidence_score
|
||||
end
|
||||
|
||||
end
|
||||
@@ -26,8 +26,8 @@ class ProposalNotificationsController < ApplicationController
|
||||
|
||||
private
|
||||
|
||||
def proposal_notification_params
|
||||
params.require(:proposal_notification).permit(:title, :body, :proposal_id)
|
||||
end
|
||||
def proposal_notification_params
|
||||
params.require(:proposal_notification).permit(:title, :body, :proposal_id)
|
||||
end
|
||||
|
||||
end
|
||||
@@ -12,7 +12,7 @@ class ProposalsController < ApplicationController
|
||||
|
||||
invisible_captcha only: [:create, :update], honeypot: :subtitle
|
||||
|
||||
has_orders %w{hot_score confidence_score created_at relevance}, only: :index
|
||||
has_orders %w{hot_score confidence_score created_at relevance archival_date}, only: :index
|
||||
has_orders %w{most_voted newest oldest}, only: :show
|
||||
|
||||
load_and_authorize_resource
|
||||
@@ -26,8 +26,10 @@ class ProposalsController < ApplicationController
|
||||
end
|
||||
|
||||
def index_customization
|
||||
discard_archived
|
||||
load_retired
|
||||
load_featured
|
||||
load_proposal_ballots
|
||||
load_featured unless @proposal_successfull_exists
|
||||
end
|
||||
|
||||
def vote
|
||||
@@ -36,7 +38,7 @@ class ProposalsController < ApplicationController
|
||||
end
|
||||
|
||||
def retire
|
||||
if valid_retired_params? && @proposal.update(retired_params.merge(retired_at: Time.now))
|
||||
if valid_retired_params? && @proposal.update(retired_params.merge(retired_at: Time.current))
|
||||
redirect_to proposal_path(@proposal), notice: t('proposals.notice.retired')
|
||||
else
|
||||
render action: :retire_form
|
||||
@@ -80,6 +82,10 @@ class ProposalsController < ApplicationController
|
||||
@featured_proposals_votes = current_user ? current_user.proposal_votes(proposals) : {}
|
||||
end
|
||||
|
||||
def discard_archived
|
||||
@resources = @resources.not_archived unless @current_order == "archival_date"
|
||||
end
|
||||
|
||||
def load_retired
|
||||
if params[:retired].present?
|
||||
@resources = @resources.retired
|
||||
@@ -90,11 +96,15 @@ class ProposalsController < ApplicationController
|
||||
end
|
||||
|
||||
def load_featured
|
||||
@featured_proposals = Proposal.all.sort_by_confidence_score.limit(3) if (!@advanced_search_terms && @search_terms.blank? && @tag_filter.blank? && params[:retired].blank?)
|
||||
@featured_proposals = Proposal.not_archived.sort_by_confidence_score.limit(3) if (!@advanced_search_terms && @search_terms.blank? && @tag_filter.blank? && params[:retired].blank?)
|
||||
if @featured_proposals.present?
|
||||
set_featured_proposal_votes(@featured_proposals)
|
||||
@resources = @resources.where('proposals.id NOT IN (?)', @featured_proposals.map(&:id))
|
||||
end
|
||||
end
|
||||
|
||||
def load_proposal_ballots
|
||||
@proposal_successfull_exists = Proposal.successfull.exists?
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -23,6 +23,6 @@ class StatsController < ApplicationController
|
||||
private
|
||||
|
||||
def daily_cache(key, &block)
|
||||
Rails.cache.fetch("public_stats/#{Time.now.strftime("%Y-%m-%d")}/#{key}", &block)
|
||||
Rails.cache.fetch("public_stats/#{Time.current.strftime("%Y-%m-%d")}/#{key}", &block)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -44,4 +44,4 @@ class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController
|
||||
@user.save || @user.save_requiring_finish_signup
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
@@ -77,4 +77,4 @@ class Valuation::SpendingProposalsController < Valuation::BaseController
|
||||
@spending_proposal.errors.empty?
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
@@ -6,7 +6,7 @@ class Verification::EmailController < ApplicationController
|
||||
|
||||
def show
|
||||
if Verification::Email.find(current_user, params[:email_verification_token])
|
||||
current_user.update(verified_at: Time.now)
|
||||
current_user.update(verified_at: Time.current)
|
||||
redirect_to account_path, notice: t('verification.email.show.flash.success')
|
||||
else
|
||||
redirect_to verified_user_path, alert: t('verification.email.show.alert.failure')
|
||||
|
||||
@@ -29,7 +29,7 @@ class Verification::LetterController < ApplicationController
|
||||
def update
|
||||
@letter = Verification::Letter.new(letter_params.merge(user: current_user, verify: true))
|
||||
if @letter.valid?
|
||||
current_user.update(verified_at: Time.now)
|
||||
current_user.update(verified_at: Time.current)
|
||||
redirect_to account_path, notice: t('verification.letter.update.flash.success')
|
||||
else
|
||||
Lock.increase_tries(@letter.user) if @letter.user
|
||||
@@ -56,5 +56,4 @@ class Verification::LetterController < ApplicationController
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
||||
@@ -31,7 +31,7 @@ class Verification::SmsController < ApplicationController
|
||||
ahoy.track(:level_2_user, user_id: current_user.id) rescue nil
|
||||
|
||||
if VerifiedUser.phone?(current_user)
|
||||
current_user.update(verified_at: Time.now)
|
||||
current_user.update(verified_at: Time.current)
|
||||
end
|
||||
|
||||
redirect_to_next_path
|
||||
@@ -69,4 +69,4 @@ class Verification::SmsController < ApplicationController
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
@@ -9,6 +9,7 @@ class Verification::VerifiedUserController < ApplicationController
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def user_data_present?
|
||||
return false if @verified_users.blank?
|
||||
|
||||
|
||||
@@ -16,5 +16,4 @@ class WelcomeController < ApplicationController
|
||||
redirect_to verification_path if signed_in?
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
||||
@@ -5,7 +5,7 @@ module AdminHelper
|
||||
end
|
||||
|
||||
def official_level_options
|
||||
options = [["",0]]
|
||||
options = [["", 0]]
|
||||
(1..5).each do |i|
|
||||
options << [[t("admin.officials.level_#{i}"), setting["official_level_#{i}_name"]].compact.join(': '), i]
|
||||
end
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
module BannersHelper
|
||||
|
||||
def has_banners
|
||||
@banners.count > 0
|
||||
end
|
||||
|
||||
end
|
||||
@@ -39,4 +39,5 @@ module CommentsHelper
|
||||
"" # Default not author class
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
@@ -1,6 +1,7 @@
|
||||
module DebatesHelper
|
||||
|
||||
def has_featured?
|
||||
def has_featured?
|
||||
Debate.all.featured.count > 0
|
||||
end
|
||||
|
||||
end
|
||||
@@ -9,15 +9,15 @@ module EmbedVideosHelper
|
||||
end
|
||||
|
||||
if server == "Vimeo"
|
||||
regExp = /vimeo.*(staffpicks\/|channels\/|videos\/|video\/|\/)([^#\&\?]*).*/
|
||||
reg_exp = /vimeo.*(staffpicks\/|channels\/|videos\/|video\/|\/)([^#\&\?]*).*/
|
||||
src = "https://player.vimeo.com/video/"
|
||||
elsif server == "YouTube"
|
||||
regExp = /youtu.*(be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/
|
||||
reg_exp = /youtu.*(be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/
|
||||
src = "https://www.youtube.com/embed/"
|
||||
end
|
||||
|
||||
if regExp
|
||||
match = link.match(regExp)
|
||||
if reg_exp
|
||||
match = link.match(reg_exp)
|
||||
end
|
||||
|
||||
if match and match[2]
|
||||
|
||||
@@ -26,4 +26,4 @@ module FlagsHelper
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
8
app/helpers/locales_helper.rb
Normal file
8
app/helpers/locales_helper.rb
Normal file
@@ -0,0 +1,8 @@
|
||||
module LocalesHelper
|
||||
|
||||
def name_for_locale(locale)
|
||||
default = I18n.t("locale", locale: locale)
|
||||
I18n.backend.translate(locale, "i18n.language.name", default: default)
|
||||
end
|
||||
|
||||
end
|
||||
@@ -1,4 +1,2 @@
|
||||
module NotificationsHelper
|
||||
|
||||
|
||||
end
|
||||
|
||||
@@ -2,19 +2,19 @@ module ProposalsHelper
|
||||
|
||||
def progress_bar_percentage(proposal)
|
||||
case proposal.cached_votes_up
|
||||
when 0 then 0
|
||||
when 1..Proposal.votes_needed_for_success then (proposal.total_votes.to_f * 100 / Proposal.votes_needed_for_success).floor
|
||||
else 100
|
||||
when 0 then 0
|
||||
when 1..Proposal.votes_needed_for_success then (proposal.total_votes.to_f * 100 / Proposal.votes_needed_for_success).floor
|
||||
else 100
|
||||
end
|
||||
end
|
||||
|
||||
def supports_percentage(proposal)
|
||||
percentage = (proposal.total_votes.to_f * 100 / Proposal.votes_needed_for_success)
|
||||
case percentage
|
||||
when 0 then "0%"
|
||||
when 0..(0.1) then "0.1%"
|
||||
when (0.1)..100 then number_to_percentage(percentage, strip_insignificant_zeros: true, precision: 1)
|
||||
else "100%"
|
||||
when 0 then "0%"
|
||||
when 0..(0.1) then "0.1%"
|
||||
when (0.1)..100 then number_to_percentage(percentage, strip_insignificant_zeros: true, precision: 1)
|
||||
else "100%"
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -8,4 +8,4 @@ module SettingsHelper
|
||||
@all_settings ||= Hash[ Setting.all.map{|s| [s.key, s.value.presence]} ]
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
@@ -20,4 +20,5 @@ module StatsHelper
|
||||
opt[:data][:graph] = admin_api_stats_path(spending_proposals: true)
|
||||
content_tag :div, "", opt
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
module TracksHelper
|
||||
|
||||
def track_event(data={})
|
||||
track_data = ""
|
||||
prefix = " data-track-event-"
|
||||
@@ -9,4 +10,5 @@ module TracksHelper
|
||||
track_data
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
@@ -12,9 +12,9 @@ class Banner < ActiveRecord::Base
|
||||
validates :post_started_at, presence: true
|
||||
validates :post_ended_at, presence: true
|
||||
|
||||
scope :with_active, -> {where("post_started_at <= ?", Time.now).
|
||||
where("post_ended_at >= ?", Time.now) }
|
||||
scope :with_active, -> {where("post_started_at <= ?", Time.current).
|
||||
where("post_ended_at >= ?", Time.current) }
|
||||
|
||||
scope :with_inactive,-> {where("post_started_at > ? or post_ended_at < ?", Time.now, Time.now) }
|
||||
scope :with_inactive,-> {where("post_started_at > ? or post_ended_at < ?", Time.current, Time.current) }
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
@@ -24,8 +24,8 @@ class Comment < ActiveRecord::Base
|
||||
scope :not_as_admin_or_moderator, -> { where("administrator_id IS NULL").where("moderator_id IS NULL")}
|
||||
scope :sort_by_flags, -> { order(flags_count: :desc, updated_at: :desc) }
|
||||
|
||||
scope :sort_by_most_voted , -> { order(confidence_score: :desc, created_at: :desc) }
|
||||
scope :sort_descendants_by_most_voted , -> { order(confidence_score: :desc, created_at: :asc) }
|
||||
scope :sort_by_most_voted, -> { order(confidence_score: :desc, created_at: :desc) }
|
||||
scope :sort_descendants_by_most_voted, -> { order(confidence_score: :desc, created_at: :asc) }
|
||||
|
||||
scope :sort_by_newest, -> { order(created_at: :desc) }
|
||||
scope :sort_descendants_by_newest, -> { order(created_at: :desc) }
|
||||
@@ -95,7 +95,7 @@ class Comment < ActiveRecord::Base
|
||||
end
|
||||
|
||||
def self.body_max_length
|
||||
Setting['comments_body_max_length'].to_i
|
||||
Setting['comments_body_max_length'].to_i
|
||||
end
|
||||
|
||||
def calculate_confidence_score
|
||||
|
||||
@@ -13,7 +13,7 @@ module Flaggable
|
||||
end
|
||||
|
||||
def ignore_flag
|
||||
update(ignored_flag_at: Time.now)
|
||||
update(ignored_flag_at: Time.current)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -28,7 +28,7 @@ class Debate < ActiveRecord::Base
|
||||
before_save :calculate_hot_score, :calculate_confidence_score
|
||||
|
||||
scope :for_render, -> { includes(:tags) }
|
||||
scope :sort_by_hot_score , -> { reorder(hot_score: :desc) }
|
||||
scope :sort_by_hot_score, -> { reorder(hot_score: :desc) }
|
||||
scope :sort_by_confidence_score, -> { reorder(confidence_score: :desc) }
|
||||
scope :sort_by_created_at, -> { reorder(created_at: :desc) }
|
||||
scope :sort_by_most_commented, -> { reorder(comments_count: :desc) }
|
||||
|
||||
@@ -4,7 +4,7 @@ class Lock < ActiveRecord::Base
|
||||
before_save :set_locked_until
|
||||
|
||||
def locked?
|
||||
locked_until > Time.now
|
||||
locked_until > Time.current
|
||||
end
|
||||
|
||||
def set_locked_until
|
||||
@@ -12,7 +12,7 @@ class Lock < ActiveRecord::Base
|
||||
end
|
||||
|
||||
def lock_time
|
||||
Time.now + (2**tries).minutes
|
||||
Time.current + (2**tries).minutes
|
||||
end
|
||||
|
||||
def too_many_tries?
|
||||
|
||||
@@ -49,4 +49,5 @@ class Notification < ActiveRecord::Base
|
||||
def linkable_resource
|
||||
notifiable.is_a?(ProposalNotification) ? notifiable.proposal : notifiable
|
||||
end
|
||||
|
||||
end
|
||||
@@ -14,11 +14,11 @@ class Organization < ActiveRecord::Base
|
||||
scope :rejected, -> { where.not(rejected_at: nil).where("(organizations.verified_at IS NULL or organizations.verified_at < rejected_at)") }
|
||||
|
||||
def verify
|
||||
update(verified_at: Time.now)
|
||||
update(verified_at: Time.current)
|
||||
end
|
||||
|
||||
def reject
|
||||
update(rejected_at: Time.now)
|
||||
update(rejected_at: Time.current)
|
||||
end
|
||||
|
||||
def verified?
|
||||
|
||||
@@ -44,9 +44,13 @@ class Proposal < ActiveRecord::Base
|
||||
scope :sort_by_random, -> { reorder("RANDOM()") }
|
||||
scope :sort_by_relevance, -> { all }
|
||||
scope :sort_by_flags, -> { order(flags_count: :desc, updated_at: :desc) }
|
||||
scope :sort_by_archival_date, -> { archived.sort_by_confidence_score }
|
||||
scope :archived, -> { where("proposals.created_at <= ?", Setting["months_to_archive_proposals"].to_i.months.ago)}
|
||||
scope :not_archived, -> { where("proposals.created_at > ?", Setting["months_to_archive_proposals"].to_i.months.ago)}
|
||||
scope :last_week, -> { where("proposals.created_at >= ?", 7.days.ago)}
|
||||
scope :retired, -> { where.not(retired_at: nil) }
|
||||
scope :not_retired, -> { where(retired_at: nil) }
|
||||
scope :successfull, -> { where("cached_votes_up + physical_votes >= ?", Proposal.votes_needed_for_success)}
|
||||
|
||||
def to_param
|
||||
"#{id}-#{title}".parameterize
|
||||
@@ -115,7 +119,7 @@ class Proposal < ActiveRecord::Base
|
||||
end
|
||||
|
||||
def register_vote(user, vote_value)
|
||||
if votable_by?(user)
|
||||
if votable_by?(user) && !archived?
|
||||
vote_by(voter: user, vote: vote_value)
|
||||
end
|
||||
end
|
||||
@@ -151,6 +155,14 @@ class Proposal < ActiveRecord::Base
|
||||
Setting['votes_for_proposal_success'].to_i
|
||||
end
|
||||
|
||||
def successfull?
|
||||
total_votes >= Proposal.votes_needed_for_success
|
||||
end
|
||||
|
||||
def archived?
|
||||
self.created_at <= Setting["months_to_archive_proposals"].to_i.months.ago
|
||||
end
|
||||
|
||||
def notifications
|
||||
proposal_notifications
|
||||
end
|
||||
|
||||
@@ -9,9 +9,9 @@ class ProposalNotification < ActiveRecord::Base
|
||||
|
||||
def minimum_interval
|
||||
return true if proposal.try(:notifications).blank?
|
||||
if proposal.notifications.last.created_at > (Time.now - Setting[:proposal_notification_minimum_interval_in_days].to_i.days).to_datetime
|
||||
if proposal.notifications.last.created_at > (Time.current - Setting[:proposal_notification_minimum_interval_in_days].to_i.days).to_datetime
|
||||
errors.add(:title, I18n.t('activerecord.errors.models.proposal_notification.attributes.minimum_interval.invalid', interval: Setting[:proposal_notification_minimum_interval_in_days]))
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
@@ -114,7 +114,7 @@ class SpendingProposal < ActiveRecord::Base
|
||||
|
||||
def send_unfeasible_email
|
||||
Mailer.unfeasible_spending_proposal(self).deliver_later
|
||||
update(unfeasible_email_sent_at: Time.now)
|
||||
update(unfeasible_email_sent_at: Time.current)
|
||||
end
|
||||
|
||||
def reason_for_not_being_votable_by(user)
|
||||
|
||||
@@ -2,8 +2,8 @@ class User < ActiveRecord::Base
|
||||
|
||||
include Verification
|
||||
|
||||
devise :database_authenticatable, :registerable, :confirmable,
|
||||
:recoverable, :rememberable, :trackable, :validatable, :omniauthable, :async
|
||||
devise :database_authenticatable, :registerable, :confirmable, :recoverable, :rememberable,
|
||||
:trackable, :validatable, :omniauthable, :async, :password_expirable, :secure_validatable
|
||||
|
||||
acts_as_voter
|
||||
acts_as_paranoid column: :hidden_at
|
||||
@@ -70,7 +70,7 @@ class User < ActiveRecord::Base
|
||||
oauth_email: oauth_email,
|
||||
password: Devise.friendly_token[0,20],
|
||||
terms_of_service: '1',
|
||||
confirmed_at: oauth_email_confirmed ? DateTime.now : nil
|
||||
confirmed_at: oauth_email_confirmed ? DateTime.current : nil
|
||||
)
|
||||
end
|
||||
|
||||
@@ -164,7 +164,7 @@ class User < ActiveRecord::Base
|
||||
|
||||
def erase(erase_reason = nil)
|
||||
self.update(
|
||||
erased_at: Time.now,
|
||||
erased_at: Time.current,
|
||||
erase_reason: erase_reason,
|
||||
username: nil,
|
||||
email: nil,
|
||||
@@ -252,6 +252,7 @@ class User < ActiveRecord::Base
|
||||
delegate :can?, :cannot?, to: :ability
|
||||
|
||||
private
|
||||
|
||||
def clean_document_number
|
||||
self.document_number = self.document_number.gsub(/[^a-z0-9]+/i, "").upcase unless self.document_number.blank?
|
||||
end
|
||||
|
||||
@@ -17,7 +17,7 @@ class Verification::Letter
|
||||
end
|
||||
|
||||
def letter_requested!
|
||||
user.update(letter_requested_at: Time.now, letter_verification_code: generate_verification_code)
|
||||
user.update(letter_requested_at: Time.current, letter_verification_code: generate_verification_code)
|
||||
end
|
||||
|
||||
def validate_existing_user
|
||||
|
||||
@@ -40,7 +40,7 @@ class Verification::Management::Document
|
||||
end
|
||||
|
||||
def verify
|
||||
user.update(verified_at: Time.now) if user?
|
||||
user.update(verified_at: Time.current) if user?
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -27,8 +27,8 @@ class Verification::Management::Email
|
||||
|
||||
user.update(document_type: document_type,
|
||||
document_number: document_number,
|
||||
residence_verified_at: Time.now,
|
||||
level_two_verified_at: Time.now,
|
||||
residence_verified_at: Time.current,
|
||||
level_two_verified_at: Time.current,
|
||||
email_verification_token: plain_token)
|
||||
|
||||
Mailer.email_verification(user, email, encrypted_token, document_type, document_number).deliver_later
|
||||
|
||||
@@ -31,7 +31,7 @@ class Verification::Residence
|
||||
geozone: self.geozone,
|
||||
date_of_birth: date_of_birth.to_datetime,
|
||||
gender: gender,
|
||||
residence_verified_at: Time.now)
|
||||
residence_verified_at: Time.current)
|
||||
end
|
||||
|
||||
def allowed_age
|
||||
|
||||
@@ -6,13 +6,17 @@
|
||||
<span class="in_favor">
|
||||
<% if can?(:vote, comment) %>
|
||||
<%= link_to vote_comment_path(comment, value: 'yes'),
|
||||
method: "post", remote: true do %>
|
||||
<span class="icon-angle-up">
|
||||
method: "post", remote: true, title: t('votes.agree') do %>
|
||||
<span class="icon-like">
|
||||
<span class="sr-only"><%= t('votes.agree') %></span>
|
||||
</span>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<span class="icon-angle-up"></span>
|
||||
<%= link_to new_user_session_path do %>
|
||||
<span class="icon-like">
|
||||
<span class="sr-only"><%= t('votes.agree') %></span>
|
||||
</span>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<%= comment.total_likes %>
|
||||
</span>
|
||||
@@ -20,47 +24,63 @@
|
||||
<span class="against">
|
||||
<% if can?(:vote, comment) %>
|
||||
<%= link_to vote_comment_path(comment, value: 'no'),
|
||||
method: "post", remote: true do %>
|
||||
<span class="icon-angle-down">
|
||||
method: "post", remote: true, title: t('votes.disagree') do %>
|
||||
<span class="icon-unlike">
|
||||
<span class="sr-only"><%= t('votes.disagree') %></span>
|
||||
</span>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<span class="icon-angle-down"></span>
|
||||
<span class="icon-unlike">
|
||||
<span class="sr-only"><%= t('votes.disagree') %></span>
|
||||
</span>
|
||||
<% end %>
|
||||
<%= comment.total_dislikes %>
|
||||
</span>
|
||||
|
||||
<% elsif !user_signed_in? %>
|
||||
|
||||
<div class="logged" >
|
||||
<div class="participation-allowed">
|
||||
<%= t('comments.comment.votes', count: comment.total_votes) %>
|
||||
|
|
||||
|
||||
<span class="in_favor">
|
||||
<% if can?(:vote, comment) %>
|
||||
<%= link_to vote_comment_path(comment, value: 'yes'),
|
||||
method: "post", remote: true do %>
|
||||
<span class="icon-angle-up"></span>
|
||||
method: "post", remote: true, title: t('votes.agree') do %>
|
||||
<span class="icon-like">
|
||||
<span class="sr-only"><%= t('votes.agree') %></span>
|
||||
</span>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<span class="icon-angle-up"></span>
|
||||
<%= link_to new_user_session_path do %>
|
||||
<span class="icon-like">
|
||||
<span class="sr-only"><%= t('votes.agree') %></span>
|
||||
</span>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<%= comment.total_likes %>
|
||||
</span>
|
||||
|
||||
<span class="against">
|
||||
<% if can?(:vote, comment) %>
|
||||
<%= link_to vote_comment_path(comment, value: 'no'),
|
||||
method: "post", remote: true do %>
|
||||
<span class="icon-angle-down"></span>
|
||||
method: "post", remote: true, title: t('votes.disagree') do %>
|
||||
<span class="icon-unlike">
|
||||
<span class="sr-only"><%= t('votes.disagree') %></span>
|
||||
</span>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<span class="icon-angle-down"></span>
|
||||
<%= link_to new_user_session_path do %>
|
||||
<span class="icon-unlike">
|
||||
<span class="sr-only"><%= t('votes.disagree') %></span>
|
||||
</span>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<%= comment.total_dislikes %>
|
||||
</span>
|
||||
</div>
|
||||
<div class="not-logged" style='display:none'>
|
||||
</div>
|
||||
|
||||
<div class="participation-not-allowed" style='display:none' aria-hidden="false">
|
||||
<%= t("votes.comment_unauthenticated",
|
||||
signin: link_to(t("votes.signin"), new_user_session_path),
|
||||
signup: link_to(t("votes.signup"), new_user_registration_path)).html_safe %>
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="<%= dom_id(debate) %>_votes" class="small-12 medium-3 column text-center">
|
||||
<div id="<%= dom_id(debate) %>_votes" class="small-12 medium-3 column">
|
||||
<%= render 'debates/votes', debate: debate %>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -26,23 +26,23 @@
|
||||
</span>
|
||||
|
||||
<% if user_signed_in? && current_user.organization? %>
|
||||
<div class="organizations-votes" style='display:none' aria-hidden="false">
|
||||
<p>
|
||||
<%= t("votes.organizations") %>
|
||||
</p>
|
||||
</div>
|
||||
<div class="participation-not-allowed" style='display:none' aria-hidden="false">
|
||||
<p>
|
||||
<%= t("votes.organizations") %>
|
||||
</p>
|
||||
</div>
|
||||
<% elsif user_signed_in? && !debate.votable_by?(current_user)%>
|
||||
<div class="anonymous-votes" style='display:none' aria-hidden="false">
|
||||
<p>
|
||||
<%= t("votes.anonymous",
|
||||
verify_account: link_to(t("votes.verify_account"), verification_path )).html_safe %>
|
||||
</p>
|
||||
</div>
|
||||
<div class="participation-not-allowed" style='display:none' aria-hidden="false">
|
||||
<p>
|
||||
<%= t("votes.anonymous",
|
||||
verify_account: link_to(t("votes.verify_account"), verification_path )).html_safe %>
|
||||
</p>
|
||||
</div>
|
||||
<% elsif !user_signed_in? %>
|
||||
<div class="not-logged" style='display:none' aria-hidden="false">
|
||||
<%= t("votes.unauthenticated",
|
||||
signin: link_to(t("votes.signin"), new_user_session_path),
|
||||
signup: link_to(t("votes.signup"), new_user_registration_path)).html_safe %>
|
||||
</div>
|
||||
<div class="participation-not-allowed" style='display:none' aria-hidden="false">
|
||||
<%= t("votes.unauthenticated",
|
||||
signin: link_to(t("votes.signin"), new_user_session_path),
|
||||
signup: link_to(t("votes.signup"), new_user_registration_path)).html_safe %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<div class="debate-edit row">
|
||||
<div class="debate-form row">
|
||||
|
||||
<div class="small-12 column">
|
||||
<%= render "shared/back_link" %>
|
||||
|
||||
@@ -6,7 +6,9 @@
|
||||
<% end %>
|
||||
|
||||
<main>
|
||||
<div class="wrap row">
|
||||
<h1 class="sr-only"><%= t("shared.outline.debates") %></h1>
|
||||
|
||||
<div class="row">
|
||||
<div id="debates" class="debates-list small-12 medium-9 column">
|
||||
|
||||
<div class="small-12 search-results">
|
||||
@@ -29,7 +31,11 @@
|
||||
<%= render "shared/banner" %>
|
||||
<% end %>
|
||||
|
||||
<% unless @tag_filter || @search_terms || !has_featured? %>
|
||||
<% if @proposal_successfull_exists %>
|
||||
<%= render "proposals/proposal_ballots_banner" %>
|
||||
<% end %>
|
||||
|
||||
<% unless @tag_filter || @search_terms || !has_featured? || @proposal_ballots.present? || @proposal_successfull_exists %>
|
||||
<%= render "featured_debates" %>
|
||||
<% end %>
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<div class="debate-new row">
|
||||
<div class="debate-form row">
|
||||
|
||||
<div class="small-12 medium-9 column">
|
||||
<%= render "shared/back_link" %>
|
||||
|
||||
@@ -45,10 +45,8 @@
|
||||
<aside class="small-12 medium-3 column">
|
||||
<div class="sidebar-divider"></div>
|
||||
<h3><%= t("votes.supports") %></h3>
|
||||
<div class="text-center">
|
||||
<div id="<%= dom_id(@debate) %>_votes">
|
||||
<%= render 'debates/votes', debate: @debate %>
|
||||
</div>
|
||||
<div id="<%= dom_id(@debate) %>_votes">
|
||||
<%= render 'debates/votes', debate: @debate %>
|
||||
</div>
|
||||
<div class="sidebar-divider"></div>
|
||||
<h3><%= t("debates.show.share") %></h3>
|
||||
|
||||
13
app/views/devise/password_expired/show.html.erb
Normal file
13
app/views/devise/password_expired/show.html.erb
Normal file
@@ -0,0 +1,13 @@
|
||||
<h2><%= t("devise.password_expired.expire_password") %></h2>
|
||||
|
||||
<%= form_for(resource, :as => resource_name, :url => [resource_name, :password_expired], :html => { :method => :put }) do |f| %>
|
||||
|
||||
<%= f.password_field :current_password %></p>
|
||||
|
||||
<%= f.label t("devise.password_expired.new_password") %>
|
||||
<%= f.password_field :password, label: false %></p>
|
||||
|
||||
<%= f.password_field :password_confirmation %></p>
|
||||
|
||||
<p><%= f.submit t("devise.password_expired.change_password") %></p>
|
||||
<% end %>
|
||||
@@ -13,6 +13,6 @@
|
||||
</div>
|
||||
|
||||
<h1><%= @direct_message.title %></h1>
|
||||
<p><%= @direct_message.body %></p>
|
||||
<p><%= simple_format text_with_links(@direct_message.body), {}, sanitize: false %></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<%= paginator.render do -%>
|
||||
<div class="pagination-centered">
|
||||
<nav>
|
||||
<h1 class="sr-only"><%= t("shared.outline.pagination") %></h1>
|
||||
<ul class="pagination text-center margin-top" aria-label="Pagination">
|
||||
<%= first_page_tag unless current_page.first? %>
|
||||
<%= prev_page_tag unless current_page.first? %>
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
<% flash.each do |flash_key, flash_message| %>
|
||||
<div id="<%= flash_key %>" data-alert class="row" data-closable>
|
||||
<div class="callout <%= flash_key %>">
|
||||
<div id="<%= flash_key %>" data-alert class="notice-container callout-slide" data-closable>
|
||||
<div class="callout notice <%= flash_key %>">
|
||||
<button class="close-button" aria-label="<%= t("application.close") %>" type="button" data-close>
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<%= flash_message %>
|
||||
<div class="notice-text">
|
||||
<%= flash_message %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
<div class="subfooter row">
|
||||
<div class="small-12 medium-8 column">
|
||||
<p>
|
||||
<%= t("layouts.footer.copyright", year: Time.now.year) %> |
|
||||
<%= t("layouts.footer.copyright", year: Time.current.year) %> |
|
||||
<%= link_to t("layouts.footer.more_info"), page_path('more_information') %> |
|
||||
<%= link_to t("layouts.footer.privacy"), page_path('privacy') %> |
|
||||
<%= link_to t("layouts.footer.conditions"), page_path('conditions') %> |
|
||||
|
||||
@@ -22,6 +22,8 @@
|
||||
<%= setting['per_page_code'].try(:html_safe) %>
|
||||
</head>
|
||||
<body>
|
||||
<h1 class="sr-only"><%= setting['org_name'] %></h1>
|
||||
|
||||
<div class="wrapper">
|
||||
<%= render 'layouts/header' %>
|
||||
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
<%= @direct_message.title %>
|
||||
</h1>
|
||||
|
||||
<p style="font-family: 'Open Sans','Helvetica Neue',arial,sans-serif;font-size: 14px;font-weight: normal;line-height: 24px;">
|
||||
<%= @direct_message.body %>
|
||||
</p>
|
||||
<div style="font-family: 'Open Sans','Helvetica Neue',arial,sans-serif;font-size: 14px;font-weight: normal;line-height: 24px;">
|
||||
<%= simple_format text_with_links(@direct_message.body), {}, sanitize: false %>
|
||||
</div>
|
||||
|
||||
<table style="width: 100%; border-top: 1px solid #DEE0E3; margin-top: 60px;">
|
||||
<tbody>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<%= @direct_message.title %>
|
||||
</h2>
|
||||
|
||||
<p style="font-family: 'Open Sans','Helvetica Neue',arial,sans-serif;font-size: 14px;font-weight: normal;line-height: 24px;">
|
||||
<%= @direct_message.body %>
|
||||
</p>
|
||||
<div style="font-family: 'Open Sans','Helvetica Neue',arial,sans-serif;font-size: 14px;font-weight: normal;line-height: 24px;">
|
||||
<%= simple_format text_with_links(@direct_message.body), {}, sanitize: false %>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<main>
|
||||
<%= render 'admin/shared/proposal_search', url: management_proposals_path %>
|
||||
|
||||
<div class="wrap row">
|
||||
<div class="row">
|
||||
<div id="proposals" class="proposals-list small-12 medium-9 column">
|
||||
|
||||
<div class="filters">
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<div class="proposal-new">
|
||||
<div class="proposal-form">
|
||||
|
||||
<div class="clear float-right">
|
||||
<%= render '/shared/print' %>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<%= render 'admin/shared/spending_proposal_search', url: management_spending_proposals_path %>
|
||||
</span>
|
||||
|
||||
<div class="wrap row">
|
||||
<div class="row">
|
||||
<div id="investment-projects" class="investment-projects-list small-12 medium-9 column">
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<div class="spending-proposal-new">
|
||||
<div class="spending-proposal-form">
|
||||
|
||||
<div class="clear float-right">
|
||||
<%= render '/shared/print' %>
|
||||
|
||||
13
app/views/proposal_ballots/_successfull_proposal.html.erb
Normal file
13
app/views/proposal_ballots/_successfull_proposal.html.erb
Normal file
@@ -0,0 +1,13 @@
|
||||
<div id="<%= dom_id(proposal) %>" class="proposal-sucessfull">
|
||||
<h3><%= link_to proposal.title, proposal %></h3>
|
||||
<div class="info">
|
||||
<% if proposal.author.hidden? || proposal.author.erased? %>
|
||||
<%= t("proposals.show.author_deleted") %>
|
||||
<% else %>
|
||||
<%= proposal.author.name %>
|
||||
<% end %>
|
||||
|
||||
<span class="bullet"> • </span>
|
||||
<%= l proposal.created_at.to_date %>
|
||||
</div>
|
||||
</div>
|
||||
35
app/views/proposal_ballots/index.html.erb
Normal file
35
app/views/proposal_ballots/index.html.erb
Normal file
@@ -0,0 +1,35 @@
|
||||
<div class="expanded no-margin-top margin-bottom dark-heading">
|
||||
<div class="row" data-equalizer>
|
||||
<div class="small-12 medium-6 column padding" data-equalizer-watch>
|
||||
<h2>
|
||||
<%= t("proposal_ballots.title") %>
|
||||
</h2>
|
||||
<p>
|
||||
<%= t("proposal_ballots.description_html").html_safe %>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="small-12 medium-4 column info" data-equalizer-watch>
|
||||
<p class="title"><strong><%= t("proposal_ballots.date_title") %></strong></p>
|
||||
<h3><%= t("proposal_ballots.date") %></h3>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<main>
|
||||
<div class="row">
|
||||
<div class="small-12 column">
|
||||
<% if @proposal_ballots.present? %>
|
||||
<div class="proposals-ballot-list">
|
||||
<% @proposal_ballots.each do |proposal_for_vote| %>
|
||||
<%= render "successfull_proposal", proposal: proposal_for_vote %>
|
||||
<% end %>
|
||||
</div>
|
||||
<% else %>
|
||||
<p>
|
||||
<%= t("proposal_ballots.nothing_to_vote") %>
|
||||
</p>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
@@ -1,4 +1,4 @@
|
||||
<div class="supports">
|
||||
<div class="supports text-center">
|
||||
<div class="in-favor">
|
||||
<% if voted_for?(@featured_proposals_votes, proposal) %>
|
||||
<div class="supported">
|
||||
@@ -14,24 +14,24 @@
|
||||
</div>
|
||||
|
||||
<% if user_signed_in? && current_user.organization? %>
|
||||
<div class="organizations-votes" style='display:none'>
|
||||
<p>
|
||||
<%= t("votes.organizations") %>
|
||||
</p>
|
||||
</div>
|
||||
<div class="participation-not-allowed" style='display:none' aria-hidden="false">
|
||||
<p>
|
||||
<%= t("votes.organizations") %>
|
||||
</p>
|
||||
</div>
|
||||
<% elsif user_signed_in? && !proposal.votable_by?(current_user)%>
|
||||
<div class="anonymous-votes" style='display:none'>
|
||||
<p>
|
||||
<%= t("votes.verified_only",
|
||||
verify_account: link_to(t("votes.verify_account"), verification_path )).html_safe %>
|
||||
</p>
|
||||
</div>
|
||||
<div class="participation-not-allowed" style='display:none' aria-hidden="false">
|
||||
<p>
|
||||
<%= t("votes.verified_only",
|
||||
verify_account: link_to(t("votes.verify_account"), verification_path )).html_safe %>
|
||||
</p>
|
||||
</div>
|
||||
<% elsif !user_signed_in? %>
|
||||
<div class="not-logged" style='display:none'>
|
||||
<%= t("votes.unauthenticated",
|
||||
signin: link_to(t("votes.signin"), new_user_session_path),
|
||||
signup: link_to(t("votes.signup"), new_user_registration_path)).html_safe %>
|
||||
</div>
|
||||
<div class="participation-not-allowed" style='display:none' aria-hidden="false">
|
||||
<%= t("votes.unauthenticated",
|
||||
signin: link_to(t("votes.signin"), new_user_session_path),
|
||||
signup: link_to(t("votes.signup"), new_user_registration_path)).html_safe %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<% if voted_for?(@featured_proposals_votes, proposal) %>
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
<div id="<%= dom_id(proposal) %>" class="proposal clear" data-type="proposal">
|
||||
<div id="<%= dom_id(proposal) %>"
|
||||
class="proposal clear <%= ("successfull" if proposal.total_votes > Proposal.votes_needed_for_success) %>"
|
||||
data-type="proposal">
|
||||
<div class="panel">
|
||||
<div class="icon-successfull"></div>
|
||||
<div class="row">
|
||||
|
||||
<div class="small-12 medium-9 column">
|
||||
<div class="proposal-content">
|
||||
|
||||
<% cache [locale_and_user_status(proposal), 'index', proposal, proposal.author] do %>
|
||||
<span class="label-proposal float-left"><%= t("proposals.proposal.proposal") %></span>
|
||||
<span class="icon-proposals"></span>
|
||||
@@ -50,11 +52,22 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="<%= dom_id(proposal) %>_votes" class="small-12 medium-3 column text-center">
|
||||
<%= render 'votes',
|
||||
{ proposal: proposal, vote_url: vote_proposal_path(proposal, value: 'yes') } %>
|
||||
<div id="<%= dom_id(proposal) %>_votes" class="small-12 medium-3 column supports-container">
|
||||
<div class="supports text-center">
|
||||
<% if proposal.successfull? %>
|
||||
<p>
|
||||
<%= t("proposal_ballots.successfull",
|
||||
voting: link_to(t("proposal_ballots.voting"), proposal_ballots_path)).html_safe %>
|
||||
</p>
|
||||
<% elsif proposal.archived? %>
|
||||
<strong><%= t("proposals.proposal.supports", count: proposal.total_votes) %></strong>
|
||||
<p><%= t("proposals.proposal.archived") %></p>
|
||||
<% else %>
|
||||
<%= render 'votes',
|
||||
{ proposal: proposal, vote_url: vote_proposal_path(proposal, value: 'yes') } %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
9
app/views/proposals/_proposal_ballots_banner.html.erb
Normal file
9
app/views/proposals/_proposal_ballots_banner.html.erb
Normal file
@@ -0,0 +1,9 @@
|
||||
<div id="next-voting" class="row featured-proposals-ballot-banner">
|
||||
<%= link_to proposal_ballots_path do %>
|
||||
<div class="small-12 column padding">
|
||||
<div class="icon-successfull"></div>
|
||||
<h2><%= t("proposal_ballots.featured_title") %></h2>
|
||||
<p><%= t("proposal_ballots.info") %></p>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user