Skip to content

Commit

Permalink
Remove poll votation types
Browse files Browse the repository at this point in the history
Unfortunately this feature wasn't properly reviewed and tested, and it
had many bugs, some of them critical and hard to fix, like validations
being skipped in concurrent requests.

So we're removing it before releasing version 1.1. We might add it back
in the future if we manage to solve the critical issues.

This commit reverts commit 836f9ba.
  • Loading branch information
javierm committed Oct 30, 2019
1 parent f3df3f4 commit af7c376
Show file tree
Hide file tree
Showing 53 changed files with 173 additions and 2,244 deletions.
4 changes: 0 additions & 4 deletions app/assets/javascripts/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@
//= require cookies
//= require columns_selector
//= require budget_edit_associations
//= require votations

var initialize_modules = function() {
"use strict";
Expand Down Expand Up @@ -143,9 +142,6 @@ var initialize_modules = function() {
App.ColumnsSelector.initialize();
}
App.BudgetEditAssociations.initialize();
if ($("#votation_type_enum_type").length) {
App.Votations.initialize();
}
};

$(function() {
Expand Down
15 changes: 0 additions & 15 deletions app/assets/javascripts/sortable.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,6 @@
});
}
});
$(".sortable-priotirized-votation").sortable({
update: function() {
var new_order;
new_order = $(this).sortable("toArray", {
attribute: "data-answer-id"
});
$.ajax({
url: $(this).data("js-url"),
data: {
ordered_list: new_order
},
type: "POST"
});
}
});
}
};
}).call(this);
56 changes: 0 additions & 56 deletions app/assets/javascripts/votations.js

This file was deleted.

13 changes: 0 additions & 13 deletions app/assets/stylesheets/admin.scss
Original file line number Diff line number Diff line change
Expand Up @@ -786,10 +786,6 @@ code {
font-weight: bold;
}

.hidden {
display: none;
}

table {

.callout {
Expand All @@ -800,15 +796,6 @@ table {
}
}

.info-type {
background-color: #ccf5ff;
padding: 15px;
}

.margin-description {
margin-top: rem-calc(20);
}

// 07. Legislation
// --------------

Expand Down
96 changes: 4 additions & 92 deletions app/assets/stylesheets/participation.scss
Original file line number Diff line number Diff line change
Expand Up @@ -1740,12 +1740,8 @@
background: #fafafa;
border-bottom: 1px solid #eee;

.margin-bottom {
margin-bottom: 0;
}

.orbit-bullets {
margin-bottom: 0;
.column:nth-child(odd) {
border-right: 2px solid $text;
}

.answer-divider {
Expand All @@ -1755,35 +1751,14 @@
padding-bottom: $line-height;
}

.answer-left-divider {
border-left: solid 1px $text;
padding-left: rem-calc(10);
}

.margin-top {
margin-top: rem-calc(10);
}

.margin-bottom {
margin-bottom: rem-calc(20);
}

.answer-description {
max-height: rem-calc(1000);
height: 100%;

&.short {
max-height: rem-calc(70);
height: rem-calc(300);
overflow: hidden;
max-width: rem-calc(700);
}
}

.question-divider {
border-bottom: rgba(219, 219, 219, 0.62) solid 1px;
margin-bottom: 1rem;
padding: rem-calc(24);
}

}

.orbit-bullets button {
Expand Down Expand Up @@ -2011,69 +1986,6 @@
}
}

.icon-like,
.icon-unlike {
background: #fff;
border: 2px solid $text-light;
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,
&:active {
color: #fff;
cursor: pointer;
opacity: 1 !important;
}
}

.active-like {
color: #fff;
cursor: pointer;
opacity: 1 !important;
background: $like;
border: 2px solid $like;
}

.active-unlike {
color: #fff;
cursor: pointer;
opacity: 1 !important;
background: $unlike;
border: 2px solid $unlike;
}

.icon-like {

&:hover,
&:active,
.picked {
background: $like;
border: 2px solid $like;
}
}

.icon-unlike {

&:hover,
&:active {
background: $unlike;
border: 2px solid $unlike;
}
}

.vote-align {
float: right;
}

.vote-divider {
border-bottom: 1px solid $text-light;
}

// 09. Polls results and stats
// ---------------------------

Expand Down
10 changes: 1 addition & 9 deletions app/controllers/admin/poll/questions_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ def new

def create
@question.author = @question.proposal&.author || current_user
@question.votation_type = VotationType.build_by_type(@question, params[:votation_type])

if @question.save
redirect_to admin_question_path(@question)
Expand Down Expand Up @@ -54,18 +53,11 @@ def destroy
redirect_to admin_questions_path, notice: notice
end

def get_options_traductions
render json: {
traduction: t("polls.index.descriptions.#{VotationType.enum_types.key params[:enum_type].to_i}")
}
end

private

def question_params
attributes = [:poll_id, :question, :proposal_id]
params.require(:poll_question).permit(*attributes, translation_params(Poll::Question),
:votation_type, :max_votes, :prioritization_type, :max_groups_answers)
params.require(:poll_question).permit(*attributes, translation_params(Poll::Question))
end

def search_params
Expand Down
67 changes: 0 additions & 67 deletions app/controllers/polls/answers_controller.rb

This file was deleted.

Loading

0 comments on commit af7c376

Please sign in to comment.