Skip to content

Commit

Permalink
Go next merge into next (#88)
Browse files Browse the repository at this point in the history
* release go-v1

* change version

* add extra

* fix

* add authmethod

* fix npm

* add overflow check

* fix syntax

* log error, return

* update locales

* release 103111.2

* change version to go v3

* set grunt-merge-json to 0.9.5 because last version gives problems with chalk (eirslett/frontend-maven-plugin#629)

* change version to go v4

* fix issue regarding ballot encoding checking that was causing some perfectly valid ballots not to be accepted (false negatives)

* config version is v3

* set version to go v4

* adding some extra comments for increased readability

* go v5

* set url for social share links to election/id/public/home

* add global variables, and external script at the end

* make election accessible and updated as global var

* undo add to index.html

* refactor to set global vars when election is loaded

* simplify

* change version to go v6

* change version to go v7

* change version to go v8

* remove not real warnings

* fixing booth scroll in mobile: when multiple options were selected, a space at the bottom was very large

* Accessible (#81)

* moar accessibility fixes

* move powered by and doc links instead of hiding them on xs

* keyboard fixes

* fixes

* aria label close in modals

* fix css

* moar css fixes

* fix header

* review screen focus fixes

* fix success social buttons css

* add alt to logo img (#82)

* adding missing i18n (#83)

* Pode 20 (#84)

* trying to disable dnd in phones

* fix typo

* Enma 6 (#85)

* fixing wording in gl

* fix merge

* fix i18n

* Suggest select category when selecting many options (#86)

* starting working on showing a dialog to select a whole category when many options from a category are selected sequentially

* fix build

* fixing selectAllLastCategory

* adding i18n

* fix typo

* show category in the modal dialog

* making modal dialog bigger

* showing category in dialog

* improve wording

* making dialog bigger

* add missing file

* fixing smaller devices

* making threshold bigger

* Fix reorder options (#87)

* starting to work in reordering options support

* working on fixing reordering of options

* improving handle

* making it more usable

* trying the draggable div fix

* small css detail

* change wording

* adding static backdrop

* applying category order when selecting options

* update some deps that are making build fail
  • Loading branch information
edulix authored Jan 24, 2019
1 parent 4ee782c commit 8b11ee5
Show file tree
Hide file tree
Showing 52 changed files with 636 additions and 206 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ root = true

[*]
indent_style = space
indent_size = 4
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
Expand Down
28 changes: 14 additions & 14 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
'use strict';

var pkg = require('./package.json');
var AV_CONFIG_VERSION = '17.04';
var AV_CONFIG_VERSION = '103111.8';

//Using exclusion patterns slows down Grunt significantly
//instead of creating a set of patterns like '**/*.js' and '!**/node_modules/**'
Expand Down Expand Up @@ -204,13 +204,13 @@ module.exports = function (grunt) {
remove: ['script[data-remove!="false"]','link[data-remove!="false"]'],
append: [
{selector:'body',html:'<%= variables.booth_html_body_include %>'},
{selector:'body',html:'<!--[if lte IE 8]><script src="/booth/libcompat-v17.04.min.js"></script><![endif]--><!--[if gte IE 9]><script src="/booth/libnocompat-v17.04.min.js"></script><![endif]--><!--[if !IE]><!--><script src="/booth/libnocompat-v17.04.min.js"></script><!--<![endif]-->'},
{selector:'body',html:'<!--[if lte IE 8]><script src="/booth/libcompat-v103111.8.min.js"></script><![endif]--><!--[if gte IE 9]><script src="/booth/libnocompat-v103111.8.min.js"></script><![endif]--><!--[if !IE]><!--><script src="/booth/libnocompat-v103111.8.min.js"></script><!--<![endif]-->'},
{selector:'body',html:'<!--All the source code of this program under copyright. Take a look at the license details at https://github.com/agoravoting/agora-core-view/blob/master/README.md -->'},
{selector:'body',html:'<script src="/booth/lib-v17.04.min.js"></script>'},
{selector:'body',html:'<script src="/booth/avConfig-v17.04.js"></script>'},
{selector:'body',html:'<script src="/booth/avThemes-v17.04.js"></script>'},
{selector:'body',html:'<script src="/booth/app-v17.04.min.js"></script>'},
{selector:'body',html:'<script src="/booth/avPlugins-v17.04.js"></script>'},
{selector:'body',html:'<script src="/booth/lib-v103111.8.min.js"></script>'},
{selector:'body',html:'<script src="/booth/avConfig-v103111.8.js"></script>'},
{selector:'body',html:'<script src="/booth/avThemes-v103111.8.js"></script>'},
{selector:'body',html:'<script src="/booth/app-v103111.8.min.js"></script>'},
{selector:'body',html:'<script src="/booth/avPlugins-v103111.8.js"></script>'},
{selector:'head',html:'<link rel="stylesheet" id="theme" data-base="/booth/" href="/booth/themes/default/app.min.css">'}
]
},
Expand Down Expand Up @@ -243,9 +243,9 @@ module.exports = function (grunt) {
],
'temp/lib.js': ['<%= dom_munger.data.libjs %>'],
'temp/app.js': ['<%= dom_munger.data.appjs %>','<%= ngtemplates.main.dest %>'],
'dist/avConfig-v17.04.js': ['avConfig.js'],
'dist/avThemes-v17.04.js': ['bower_components/avCommon/dist/avThemes-v17.04.js'],
'dist/avPlugins-v17.04.js': ['plugins/**/*.js']
'dist/avConfig-v103111.8.js': ['avConfig.js'],
'dist/avThemes-v103111.8.js': ['bower_components/avCommon/dist/avThemes-v103111.8.js'],
'dist/avPlugins-v103111.8.js': ['plugins/**/*.js']
}
}
},
Expand Down Expand Up @@ -277,10 +277,10 @@ module.exports = function (grunt) {
beautify: true
},
files: {
'dist/app-v17.04.min.js': 'temp/app.js',
'dist/lib-v17.04.min.js': 'temp/lib.js',
'dist/libnocompat-v17.04.min.js': 'temp/libnocompat.js',
'dist/libcompat-v17.04.min.js': 'temp/libcompat.js',
'dist/app-v103111.8.min.js': 'temp/app.js',
'dist/lib-v103111.8.min.js': 'temp/lib.js',
'dist/libnocompat-v103111.8.min.js': 'temp/libnocompat.js',
'dist/libcompat-v103111.8.min.js': 'temp/libcompat.js',
'dist/avWidgets.min.js': 'avWidgets.js',

"dist/locales/moment/en.js": "bower_components/moment/lang/en-gb.js",
Expand Down
1 change: 1 addition & 0 deletions app.less
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
@import "avBooth/selected-options-directive/selected-options-directive.less";
@import "avBooth/too-few-answers-controller/too-few-answers-controller.less";
@import "avBooth/simultaneous-questions-screen-directive/simultaneous-questions-screen-directive.less";
@import "avBooth/select-all-category-controller/select-all-category-controller.less";
@import "avBooth/start-screen-directive/start-screen-directive.less";
@import "avBooth/circle-option-directive/circle-option-directive.less";
@import "avBooth/success-screen-directive/success-screen-directive.less";
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
<div class="row avb-top-navbar">
<div class="pull-left">
<span ng-if="election.logo_url">
<img
<img
alt="Logo Image"
class="logo-img"
ng-src="{{election.logo_url}}"
>
Expand Down
194 changes: 118 additions & 76 deletions avBooth/accordion-option-directive/accordion-option-directive.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,25 @@
<div
class="opt-data vertilize-wrapper"
class="opt-data vertilize-wrapper has-handle"
tabindex="0"
ng-space-click
dnd-nodrag
ng-if="isTouchDevice && selectedOptions"
ng-class="{
'hide-link': !urls.URL,
'show-category': showCategory && !!option.category,
'preset': isPreset}"
ng-click="!isPreset && toggleSelectItem(option)">
'selected-options': selectedOptions,
'preset': isPreset}">

<div ng-if="selectedOptions" dnd-handle class="handle">
<span class="glyphicon glyphicon-list"></span>
</div>

<div
ng-if="selectedOptions"
ng-click="!isPreset && toggleSelectItem(option)"
class="remove-selected-item">
<span class="glyphicon glyphicon-remove"></span>
</div>

<span
class="label label-default"
Expand All @@ -13,117 +28,144 @@
</span>

<div
ng-if="!!isYoutube(option) && !isTouchDevice"
ng-if="!!isYoutube(option)"
class="videoWrapper">
<iframe
width="560"
height="315"
src="{{isYoutube(option)}}"
frameborder="0"
allowfullscreen>
width="560"
height="315"
src="{{isYoutube(option)}}"
frameborder="0"
allowfullscreen>
</iframe>
</div>
<div
class="vertilize">
<div class="vertilize-col vert-align-top">
<img
<img
parent
ng-if="!isTouchDevice && !isYoutube(option) && !!urls['Image URL']"
ng-if="!isYoutube(option) && !!urls['Image URL']"
ng-src="{{urls['Image URL']}}"
alt="{{option.text}}" />
</div>

<!-- texts -->
<div class="vertilize-col">
<div class="text-sibling">
<strong class="show-value">
<strong class="show-value">
<span ng-if="ordered && showSelectedPos && option.selected > -1">
{{option.selected + 1}}.
{{option.selected + 1}}.
</span>
<span>
<span ng-bind-html="option.text"></span>
<span
<span ng-bind-html="option.text"></span>
<span
ng-if="showPoints && option.selected > -1"
ng-i18next="[i18next]({points: getPoints()})avBooth.showSelectedOptionPoints">
</span>
</span>
</span>
</strong>
<p class="details visible-lg" ng-if="(dnd_disable || !selectedOptions || (!!selectedOptions && !isTouchDevice)) && option.details && option.details.length > 1" ng-bind-html="option.details">
<p class="details hidden-lg" ng-if="!selectedOptions && option.details && option.details.length > 1" ng-bind-html="option.details">
</p>
</strong>
<p class="details visible-lg" ng-if="(dnd_disable || !selectedOptions || (!!selectedOptions && !isTouchDevice)) && option.details && option.details.length > 1" ng-bind-html="option.details">
<p class="details hidden-lg" ng-if="!selectedOptions && option.details && option.details.length > 1" ng-bind-html="option.details">
</p>
</div>
</div>
</div>

<!-- remove action -->
<div class="visible-lg">
<div
class="show-remove"
ng-if="!selectedOptions || !!dnd_disable">
<div class="vertilize-wrapper">
<div class="vertilize">
<div class="vertilize-col ">
<span ng-i18next="avBooth.removeSelectedItem"></span>
<span class="glyphicon glyphicon-remove"></span>
</div>
</div>
</div>
</div>

<div
class="opt-data vertilize-wrapper no-handle"
tabindex="0"
ng-space-click
ng-if="!isTouchDevice || !selectedOptions"
ng-class="{
'hide-link': !urls.URL,
'show-category': showCategory && !!option.category,
'preset': isPreset}"
ng-click="!isPreset && toggleSelectItem(option)">

<span
class="label label-default"
ng-if="showCategory && !!option.category">
{{option.category}}
</span>

<div
ng-if="!!isYoutube(option)"
class="videoWrapper">
<iframe
width="560"
height="315"
src="{{isYoutube(option)}}"
frameborder="0"
allowfullscreen>
</iframe>
</div>
<div
class="vertilize">
<div class="vertilize-col vert-align-top">
<img
parent
ng-if="!isYoutube(option) && !!urls['Image URL']"
ng-src="{{urls['Image URL']}}"
alt="{{option.text}}" />
</div>
<div
class="show-remove"
ng-if="!!selectedOptions && !dnd_disable">
<div class="vertilize-wrapper">
<div class="vertilize">
<div class="vertilize-col">
<div class="pull-left margin-left">

<!-- remove action -->
<div class="visible-lg">
<div
class="show-remove"
ng-if="!selectedOptions || !!dnd_disable">
<div class="vertilize-wrapper">
<div class="vertilize">
<div class="vertilize-col ">
<span ng-i18next="avBooth.removeSelectedItem"></span>
<span class="glyphicon glyphicon-remove"></span>
</div>
</div>
<div class="vertilize-col">
<div class="pull-right margin-right">
<span class="glyphicon glyphicon-random"></span>
<span ng-i18next="avBooth.dragSelectedItem"></span>
</div>
</div>
</div>
</div>
</div>
</div>

<div class="hidden-lg">
<div
class="show-remove"
ng-if="!selectedOptions || !!dnd_disable">
<div class="vertilize-wrapper">
<div class="vertilize">
<div class="vertilize-col ">
<span ng-i18next="avBooth.removeSelectedItemShort"></span>
<span class="glyphicon glyphicon-remove"></span>
</div>
</div>
</div>
</div>
<div
class="show-remove gray-bg"
ng-if="!!selectedOptions && !dnd_disable">
<div class="vertilize-wrapper">
<div class="vertilize">
<div class="vertilize-col">
<div class="pull-left margin-left">
<span ng-i18next="avBooth.removeSelectedItemShort"></span>
<span class="glyphicon glyphicon-remove"></span>
<div
class="show-remove"
ng-if="!!selectedOptions && !dnd_disable">
<div class="vertilize-wrapper">
<div class="vertilize">
<div class="vertilize-col">
<div class="pull-left margin-left">
<span ng-i18next="avBooth.removeSelectedItem"></span>
<span class="glyphicon glyphicon-remove"></span>
</div>
</div>
</div>
<div class="vertilize-col">
<div class="pull-right margin-right">
<span class="glyphicon glyphicon-random"></span>
<span ng-i18next="avBooth.dragSelectedItemShort"></span>
<div class="vertilize-col">
<div class="pull-right margin-right">
<span class="glyphicon glyphicon-random"></span>
<span ng-i18next="avBooth.dragSelectedItem"></span>
</div>
</div>
</div>
</div>
</div>
</div>

<!-- texts -->
<div class="vertilize-col">
<div class="text-sibling">
<strong class="show-value">
<span ng-if="ordered && showSelectedPos && option.selected > -1">
{{option.selected + 1}}.
</span>
<span>
<span ng-bind-html="option.text"></span>
<span
ng-if="showPoints && option.selected > -1"
ng-i18next="[i18next]({points: getPoints()})avBooth.showSelectedOptionPoints">
</span>
</span>
</strong>
<p class="details visible-lg" ng-if="(dnd_disable || !selectedOptions || (!!selectedOptions && !isTouchDevice)) && option.details && option.details.length > 1" ng-bind-html="option.details">
<p class="details hidden-lg" ng-if="!selectedOptions && option.details && option.details.length > 1" ng-bind-html="option.details">
</p>
</div>
</div>
</div>

</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@
* Directive that shows an accordion option.
*/
angular.module('avBooth')
.directive('avbAccordionOption', function($sce) {
.directive('avbAccordionOption', function($sce, IsService) {

var link = function(scope, element, attrs) {

scope.isTouchDevice = IsService.touchDevice();
scope.urls = _.object(_.map(scope.option.urls, function(url) {
return [url.title, url.url];
}));
Expand Down Expand Up @@ -74,7 +75,7 @@ angular.module('avBooth')

scope.showPoints = false;

if (angular.isDefined(scope.question.extra_options) &&
if (angular.isDefined(scope.question.extra_options) &&
!!scope.question.extra_options.show_points) {
scope.showPoints = true;
}
Expand Down Expand Up @@ -130,4 +131,4 @@ angular.module('avBooth')
link: link,
templateUrl: 'avBooth/accordion-option-directive/accordion-option-directive.html'
};
});
});
Loading

0 comments on commit 8b11ee5

Please sign in to comment.