Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

135 aplicar novo layout #168

Open
wants to merge 21 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
025402d
aplica estilo novo na splash screen
ebragaparah Jul 17, 2017
412b175
aplica parcialmente novo layout na pagina home :)
ebragaparah Jul 18, 2017
3b71488
adequa tela home ao novo layout com os dados que temos até agora (wip)
ebragaparah Jul 19, 2017
748789f
adiciona conceito de ocorrência mais frequente na aplicação. aplica e…
ebragaparah Aug 6, 2017
cb6aeb7
altera página de detalhes da ocorrência
ebragaparah Aug 8, 2017
45997fb
adiciona logo na barra de navegação, troca estilo de botões
ebragaparah Aug 9, 2017
1e802bc
troca cor da navbar para rosa em quase todas as telas ;)
ebragaparah Aug 9, 2017
92ed32c
teste comentado. :smirk:
ebragaparah Aug 9, 2017
a797d4c
Merge branch 'master' into 135-aplicar-novo-layout
ebragaparah Aug 9, 2017
561931f
corrige propriedade de botão.
ebragaparah Aug 10, 2017
c7ff6d8
corrigidos testes unitarios do placeDetails controller.
ebragaparah Aug 10, 2017
e29366a
testes funcionais passando, testes unitarios passando
ebragaparah Aug 14, 2017
bd1e35d
Revert "Merge branch 'master' into 135-aplicar-novo-layout"
ebragaparah Aug 14, 2017
c61e591
remove sleep e adiciona wait para que teste aguarde elemento ser most…
ebragaparah Aug 15, 2017
9e280c9
remove xvfb e adiciona versao mais recente do webdriver
ebragaparah Aug 15, 2017
a1bf096
configurações para baixar pacote de webdriver do apt
ebragaparah Aug 16, 2017
c17ec6a
alterado local de webdriver para travis.
ebragaparah Aug 16, 2017
1b3e455
inicia webdriver explicitamente. nem sei se é necessário
ebragaparah Aug 16, 2017
0cd6fef
Revert "inicia webdriver explicitamente. nem sei se é necessário"
ebragaparah Aug 16, 2017
fd93259
inicia webdriver de uma maneira diferente
ebragaparah Aug 16, 2017
82c060d
inicia xvfb dentro da task de script em vez da task before_script
ebragaparah Aug 16, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 3 additions & 8 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
{
"extends": ["airbnb", "angular"],
"plugins": [
"react",
"jasmine"
],
"env":{
"jasmine": true,
"browser": true
}
}
"react"
]
}
6 changes: 4 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ addons:
apt:
sources:
- google-chrome
- chromium-chromedriver
packages:
- google-chrome-stable
language: node_js
Expand All @@ -14,10 +15,11 @@ env:
global:
-secure: "meP3FKat278MD+Ve9zmJ90SMwdtiDHgu0/InD+EtOhJVXga2yr0IRzjyYXfA63B0XzQhZsENDp3aL7CjJ+g3FdfNbwgl/tIrJiGCBrrc4ZCjbRn/KjxmOlsQ/T9Prc4iw+HlgLh2aQpzkVf07+Y0DlQlpc2PR67o4MfvGXYVN0AjzpQNIvlhu0mZpakN4y5c0qngdSHGvdHv1CLxmupyMV2T1KpAq3Mwn+XdeuWEYS7bedN7mo9F1sst2rxBs7WG7e6fY7fm81Vve9ZSHRRnidiz8pIUh8DMqrif+8k7AJ95YJu9qMwOEuiuqWrONpr7NcKJiwQxwegjXHjx/RY/EMnznn4csO5Zc6gWHs06UldVmh56NAH0qCxJS8loYr2Tit3PsuBf7TAz9ussQVx8cgPlSqa1ec9OJiQ3eMKJC6rSpR+4vzMDmkY5j3x9nUpfonSxvpqZa/7yRjyGJg/5tnlCsp5CS9X7zmi7Y4dYBABH08tRd/LR/pThnPgki4Cazsv0Rh+IYswM5TEtodXEsZgqs8dtdORBLFbojraqZuxOyZEdFWXiTev2e593JLvXzEFLMnKYP/RvO58KrPOmZBd/guT7u7CM+A8roY8iq0yXfwiVo5mHlga5FPJbQgr4iJYENJQ357p31zlT1qg6PMcvdrofxMh7smsWl0tE5gI="
before_script:
- node_modules/protractor/bin/webdriver-manager update --versions.chrome 2.31
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
install:
- npm install
- node ./node_modules/protractor/bin/webdriver-manager update
script:
- node_modules/protractor/bin/webdriver-manager start > /dev/null 2>&1 &
- sh -e /etc/init.d/xvfb start
- npm run ci
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[![Stories in Ready](https://badge.waffle.io/VamosJuntas/vamosjuntas.png?label=ready&title=Ready)](https://waffle.io/VamosJuntas/vamosjuntas)
[![Build Status](https://travis-ci.org/VamosJuntas/vamosjuntas.svg?branch=master)](https://travis-ci.org/VamosJuntas/vamosjuntas)
[![Build Status](https://snap-ci.com/VamosJuntas/vamosjuntas/branch/master/build_image)](https://snap-ci.com/VamosJuntas/vamosjuntas/branch/master)

# Vamos Juntas

Expand Down
6 changes: 1 addition & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
"eslint-config-airbnb": "^1.0.2",
"eslint-config-angular": "^0.4.0",
"eslint-plugin-angular": "^0.14.0",
"eslint-plugin-jasmine": "^2.8.0",
"eslint-plugin-react": "^3.11.2",
"express": "^4.13.4",
"gulp": "^3.9.1",
Expand All @@ -32,7 +31,7 @@
"karma-cli": "*",
"karma-coverage": "^1.0.0",
"karma-jasmine": "^0.3.6",
"karma-phantomjs-launcher": "^1.0.2",
"karma-phantomjs-launcher": "^0.2.1",
"moment": "^2.17.1",
"node-sass": "^3.4.2",
"nodemon": "^1.9.1",
Expand Down Expand Up @@ -76,8 +75,5 @@
"ionic-emulate-ios-debugger": "gulp build-dev build-prod && ionic emulate -lc ios",
"ionic-state-restore": "ionic state restore",
"start-stubby": "stubby -q -s 3001 -l localhost -d ./stubs/reports.yml"
},
"devDependencies": {
"karma": "^0.13.22"
}
}
152 changes: 142 additions & 10 deletions scss/ionic.app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,34 @@ $error: #FA787E;
#splash-logo {
max-width: 100%;
display: block;
margin: 0 auto;
}

.logo {
max-width: 100%;
}

.terms-of-use {
a {
color: #cc3399;
}
}

#terms-check {
padding: 0 10px;
display: block;

#check-terms {
input:checked:before, input:checked+.checkbox-icon:before {
background: #cc3399;
border-color: #cc3399;
}
}

button {
with: 100%;
background: blue;
width: 100%;
background: #cc3399;
border-color: #cc3399;
margin-top: 10px;
}
}
Expand All @@ -66,22 +81,139 @@ ion-content {
padding: 0 10px;
}

.vamosjuntas-home-header {
padding-top: 30px;
div.title.title-center.header-item {
background: url("img/logo-27h.png") center no-repeat;
}

.vamosjuntas-search-button {
margin-top: 20px;
.bordered-places-list {
a {
margin-bottom: 10px;
}
}

ion-content {
padding: 0 10px;
h2, p, span {
font-family: OpenSans;
}

h4 {
font-family: OpenSans;
font-weight: 500;
}

.table-occurrences {
margin: auto;

.occurrences-counter {
font-size: 0.9em;
font-family: OpenSans;
padding: 0.75em;
font-weight: 700;
}
}

.report-period-date {
font-family: OpenSans;
float: right;
color: #cc3399;
}

.report-risk {
font-family: OpenSans;
font-weight: 600;
}

.grey-dot {
font-size: 0.9em;
color: #c4c4c4;
}

.number-of-occurrences {
font-weight: 600;
}

.vamosjuntas-home-header-wrapper {
text-align: center;
margin-bottom: 10px;
}

.vamosjuntas-home-header {
padding-top: 30px;
padding-top: 30px;
color: #cc3399;
font-family: OpenSans;
font-weight: 500;
}

p.pink-denunciation-title {
font-family: OpenSans;
font-size: 0.7em;
color: #cc3399;
}

.pink-horizontal-rule {
height: 1px;
color: #cc3399;
background-color: #cc3399;
border: none;
width: 95%;
}

.grey-horizontal-rule {
height: 1px;
color: #000000;
background-color: #000000;
border: none;
width: 100%;
}

.item-input {
padding: 0px 0 0px 16px;
}

.place-details-item {
margin-top: 20px;
}

label.item.item-input {
border-style: solid;
border-width: 1px;
border-color: #cc3399;
margin-top: 15px;
}

.button.button-positive {
border-color: #cc3399;
background-color: #cc3399;
font-weight: 600;
font-family: OpenSans;
margin-bottom: 50px;

&:visited, &:hover, &:active {
border-color: #cc3399;
background-color: #cc3399;
}
}

.place-details-navbar {
img {
margin-top: 5px;
}
}

.bar.bar-positive {
border-color: #cc3399;
background-color: #cc3399;
background-image: linear-gradient(0deg, #cc3399, #cc3399 50%, transparent 50%);
}

.vamosjuntas-search-button {
margin-top: 20px;
background-color: #cc3399;
border-color: #cc3399;
color: #fff;
font-weight: 600;
font-family: OpenSans;
border-radius: 0px;
}

ion-content {
padding: 0 10px;
}
Binary file added www/img/logo-27h.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 4 additions & 3 deletions www/js/controller/confirmation.controller.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
angular.module('vamosJuntas').controller('ConfirmationController', function confirmationController() {
$scope.placeDetails = { };
});
angular.module('vamosJuntas').controller('ConfirmationController',
['', function () {
$scope.placeDetails = { };
}]);
26 changes: 13 additions & 13 deletions www/js/controller/home.controller.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
angular.module('vamosJuntas').controller('HomeController',
['$scope', 'placeFactory', 'addressFactory', 'geolocationFactory', '$ionicLoading', function($scope, placeFactory, addressFactory, geolocationFactory, $ionicLoading) {

$scope.search = {};
$scope.errorMessage = false;
$scope.search = {};
$scope.errorMessage = false;

$ionicLoading.show();
$ionicLoading.show();

var coordinates = {};
var posOptions = {timeout: 5000, enableHighAccuracy: false};
var coordinates = {};
var posOptions = {timeout: 5000, enableHighAccuracy: false};

geolocationFactory
geolocationFactory
.getCurrentPosition(posOptions)
.then(function(position) {
.then(function (position) {

placeFactory.fetchPlaces(position.coords.latitude, position.coords.longitude).then(function(response) {
$scope.places = response.data;
Expand All @@ -27,13 +27,13 @@ angular.module('vamosJuntas').controller('HomeController',
$ionicLoading.hide();
});

$scope.getTotalOfOccurrences = function(place) {
var numberOfOccurrences = place.occurrences.reduce(function(total, occurrence) {
return total + occurrence.numberOfOccurrences;
}, 0);
$scope.getTotalOfOccurrences = function(place) {
var numberOfOccurrences = place.occurrences.reduce(function(total, occurrence) {
return total + occurrence.numberOfOccurrences;
}, 0);

return numberOfOccurrences;
};
return numberOfOccurrences;
};

$scope.getSpecificPlace = function(place) {
placeFactory.addPlace(place);
Expand Down
61 changes: 50 additions & 11 deletions www/js/controller/placeDetails.controller.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,56 @@
angular.module('vamosJuntas')
.controller('placeDetailsController', ['$scope', 'placeFactory', '$location', function($scope, placeFactory, $location) {
$scope.placeDetails = placeFactory.getPlace();
.controller('placeDetailsController', placeDetailsController);

$scope.allOccurrences = $scope.placeDetails.occurrences.map(function(ocurrence) {
return { risk: ocurrence.risk, reports: ocurrence.reports };
placeDetailsController.$inject = ['$scope', 'placeFactory', '$location'];

function placeDetailsController($scope, placeFactory, $location) {
$scope.placeDetails = placeFactory.getPlace();

$scope.allOccurrences = $scope.placeDetails.occurrences.map(function(ocurrence) {
return { risk: ocurrence.risk, reports: ocurrence.reports };
});

$scope.allOccurrencesReports = allOccurrencesReports($scope.allOccurrences);

function allOccurrencesReports(allOccurrences) {
var _allOccurrences = allOccurrences.slice();

return _allOccurrences.map(function(occurence) {
return occurence.reports.map(function(report) {
return { risk: occurence.risk, date: report.date, period: report. period };
});
}).reduce(function(previous, current) { return previous.concat(current); });
}

$scope.myGoBack = function() {
$ionicHistory.goBack();
};

$scope.submit = function() {
$location.path('/report');
};

$scope.mostFrequentOccurence = mostFrequentOccurence($scope.placeDetails.occurrences);
$scope.numberOfOtherOccurrences = numberOfOtherOccurrences($scope.placeDetails.occurrences);

function mostFrequentOccurence(allOccurrences) {
var _allOccurrences = allOccurrences.slice();
return _allOccurrences.sort(byNumberOfOcurrences).shift();
}

function numberOfOtherOccurrences(allOccurrences) {
var INITIAL_VALUE = 0;
var _allOccurrences = allOccurrences.slice();
var _otherOccurrences = _allOccurrences.sort(byNumberOfOcurrences).slice(1);

$scope.myGoBack = function() {
$ionicHistory.goBack();
};
var sumNumberOfOccurrences = function(previousOccurrence, currentOccurrence) {
return previousOccurrence + Number(currentOccurrence.numberOfOccurrences);
};

$scope.submit = function() {
$location.path('/report');
};
return _otherOccurrences.reduce(sumNumberOfOccurrences, INITIAL_VALUE);
}

}]);
function byNumberOfOcurrences(firstOccurrence, secondOccurrence) {
return Number(secondOccurrence.numberOfOccurrences) - Number(firstOccurrence.numberOfOccurrences);
}
}
Loading