Skip to content

Commit

Permalink
Merge pull request #81 from TaturanaMobi/hotfix/small-bugs
Browse files Browse the repository at this point in the history
Hotfix/small bugs
  • Loading branch information
lpirola authored May 27, 2020
2 parents 97871a4 + c5b890c commit 4411f06
Show file tree
Hide file tree
Showing 11 changed files with 88 additions and 32 deletions.
2 changes: 1 addition & 1 deletion imports/ui/pages/admin/adm-report.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ <h3>{{film.title}}</h3>
<p><strong>Pessoas esperadas:</strong> {{quorum_expectation}}</p>
<p><strong>Pessoas que foram:</strong> {{real_quorum}}</p>
<p><strong>Como foi:</strong></p>
{{report_description}}
{{{report_description}}}

<hr />

Expand Down
2 changes: 1 addition & 1 deletion imports/ui/pages/contact.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Template.contact.events({
message,
};

const mailTemplate = 'contact.html';
const mailTemplate = '.templates/contact.html';

Meteor.call('sendEmail', pidgeon, mailTemplate, (err) => {
if (err) {
Expand Down
12 changes: 10 additions & 2 deletions imports/ui/pages/screenings.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { Router } from 'meteor/iron:router';
import { $ } from 'meteor/jquery';
import { _ } from 'meteor/underscore';
import { ReactiveDict } from 'meteor/reactive-dict';
require('select2');

import Films from '../../models/films.js';

Expand Down Expand Up @@ -93,6 +94,13 @@ Template.screenings.helpers({
});

Template.screenings.onCreated(function () {
$(document).ready(function() {
$('#month-selector').select2({allowClear: true, placeholder: 'Selecione'});
$('#film-selector').select2({allowClear: true, placeholder: 'Selecione'});
$('#state-selector').select2({allowClear: true, placeholder: 'Selecione'});
$('#city-selector').select2({allowClear: true, placeholder: 'Selecione'});
});

this.state = new ReactiveDict();

const r = Router.current();
Expand Down Expand Up @@ -188,7 +196,7 @@ const resetFilters = (e, instance) => {
Template.screenings.events({
'change #city-selector': updateFilters,
'change #state-selector': updateFilters,
'click #month-selector': updateFilters,
'click #film-selector': updateFilters,
'change #month-selector': updateFilters,
'change #film-selector': updateFilters,
'click #btn-resetar': resetFilters,
});
1 change: 0 additions & 1 deletion imports/ui/pages/show-film.html
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ <h3>Em quais regiões</h3>
<div class="ct-chart {{hideIfNotDifusaoPortfolio}}" id="zone-chart"></div>
<p>{{cities_total}} municipios alcançados</p>
</div>
{{else}}
<div class="col-md-6 reset-div film-graphs__box">
<h3>Em quantos estados</h3>
<ul>
Expand Down
36 changes: 23 additions & 13 deletions imports/ui/pages/show-film.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ import { $ } from 'meteor/jquery';
import { _ } from 'meteor/underscore';
import c3 from 'c3';
import Plyr from 'plyr';
// import d3 from 'd3';

// import Films from '../../models/films.js';
require('readmore-js');

import './show-film.html';

Expand Down Expand Up @@ -66,6 +64,14 @@ Template.showFilm.onRendered(() => {
autoplaySpeed: 6000,
});

$('.wrapper-overflow').readmore({
embedCSS: false,
speed: 75,
collapsedHeight: 420,
lessLink: '<a href="#">Fechar</a>',
moreLink: '<a href="#">Ler mais</a>'
});

const player = new Plyr('#player');
player.volume = 1;

Expand All @@ -78,19 +84,20 @@ Template.showFilm.onRendered(() => {
if (inventory.viewers_zones) {
const labels = [];
_.keys(inventory.viewers_zones).forEach((k) => {
labels.push([k, inventory.viewers_zones[k]]);
labels.push([k,
inventory.viewers_zones[k]]);
});

c3.generate({
bindto: '#zone-chart',
data: {
columns: labels,
type: 'pie',
// onclick: function (d, i) { d.preventDefault(); },
onclick: function (d, i) { d.preventDefault(); },
},
legend: {
item: {
// onclick: function (d, i) { d.preventDefault(); },
onclick: function (d, i) { d.preventDefault(); },
},
},
});
Expand All @@ -105,20 +112,23 @@ Template.showFilm.onRendered(() => {
bindto: '#viewers-chart',
data: {
columns: [
[].concat(['Espectadores'], _.values(inventory.viewers_per_month)),
[].concat(['Número Espectadores por mês'], _.values(inventory.viewers_per_month)),
],
type: 'spline',
// onclick: function (d, i) { d.preventDefault(); },
onclick: function (d, i) { d.preventDefault(); },
},
axis: {
x: {
type: 'category',
categories: _.keys(inventory.viewers_per_month),
},
y: {
label: 'Total de espectadores'
},
},
legend: {
item: {
// onclick: function (d, i) { d.preventDefault(); },
onclick: function (d, i) { d.preventDefault(); },
},
},
});
Expand All @@ -134,11 +144,11 @@ Template.showFilm.onRendered(() => {
data: {
columns: labels,
type: 'donut',
// onclick: function (d, i) { d.preventDefault(); },
onclick: function (d, i) { d.preventDefault(); },
},
legend: {
item: {
// onclick: function (d, i) { d.preventDefault(); },
onclick: function (d, i) { d.preventDefault(); },
},
position: 'right',
},
Expand All @@ -155,11 +165,11 @@ Template.showFilm.onRendered(() => {
data: {
columns: labels,
type: 'donut',
// onclick: function (d, i) { d.preventDefault(); },
onclick: function (d, i) { d.preventDefault(); },
},
legend: {
item: {
// onclick: function (d, i) { d.preventDefault(); },
onclick: function (d, i) { d.preventDefault(); },
},
position: 'right',
},
Expand Down
9 changes: 4 additions & 5 deletions imports/ui/stylesheets/show-films.scss
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,12 @@
}

.wrapper-overflow {
overflow: auto;
height: 420px;
overflow: hidden;
}

.box-synopsis .wrapper-overflow {
height: 520px;
}
// .box-synopsis .wrapper-overflow {
// height: 520px;
// }

.wrapper-fichaTecnica {
// h3 {
Expand Down
8 changes: 8 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"nouislider": "^12.1.0",
"papaparse": "^4.6.3",
"plyr": "^3.5.10",
"readmore-js": "^2.2.1",
"select2": "^4.0.13",
"select2-bootstrap-theme": "0.1.0-beta.10",
"simpl-schema": "^1.5.7",
Expand Down
Binary file modified public/Taturana-Mobi-Portfolio-EN.pdf
Binary file not shown.
Binary file modified public/Taturana-Mobi-Portfolio-PT.pdf
Binary file not shown.
49 changes: 40 additions & 9 deletions todo.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# TODO

- [x] Atualizar Portfolio ingles/portugues
- [x] html nos conteúdos do relatório
- [x] contato deu erro
- [x] Abaixo do gráfico de pizza de regiões, mostrar gráfico dos estados (bolinhas) quando filme em difusão/portfolio
- [x] melhorar barra de rolagem na descrição do filme
- [x] gráfico de pizza ao clicar na legenda, a fatia do gráfico some
- [x] melhorar legenda no gráfico de linhas de expectadores
- [x] filtro da agenda de exibições deve ser mais usável

- [ ] Listar sessões que tiveram seu status afetado após a mudança

- [ ] Cadastro de usuário e sessão em outros países - http://www.geonames.org/ - https://github.com/dr5hn/countries-states-cities-database
- [ ] Testar com mais sessões
- [ ] Melhorar performance do carregamento de sessão no admin

- [x] Revisar dados de estatísticas com dados atualizados de produção ( sessoes cadastradas em prod, usuarios cadastrados )
- [x] Remover do fluxo de 3 dias o template screening_date
- [x] Remover do fluxo de 9 dias o template screening_date
Expand All @@ -15,9 +30,6 @@
- [x] Adicionar nome e email na lista de fluxo de emails "embaixador" e "email de destino"
- [x] Corrigir inconsistência de dados nos gráficos
- [x] Incluir total de municípios quando o filme em difusão (icon geolocalização)
- [ ] Atualizar Portfolio ingles/portugues
- [ ] Melhorar performance do carregamento de sessão no admin
- [ ] Cadastro de usuário e sessão em outros países - http://www.geonames.org/ - https://github.com/dr5hn/countries-states-cities-database

# Regras de negócio

Expand Down Expand Up @@ -73,12 +85,15 @@

# MONGO QUERIES

Find by screeningId
## Find by screeningId

```
{ screening: { $elemMatch: { _id: 'xx' } } }
```

Count screenings before migrate
## Count screenings before migrate

```
db.films.aggregate([{
$project: {
_id: '$_id',
Expand All @@ -88,20 +103,36 @@ db.films.aggregate([{
}
}
}]);
```

Count screenings by status after migrate
## Count screenings by status after migrate

```
db.screenings.aggregate([
{ $match: { filmId: "X55no5BySn4B3Czxa" } },
{ $group : { _id : '$status', count : {$sum : 1}} }
]);
```

Count screenings
## Count screenings

```
db.screenings.aggregate( [
{ $count: "myCount" }
])
```

## Search User by Email


```
{ 'emails.0.address': 'email@gmail.com' }
```


## Total de sessões agrupadas por filmes e status

Search User by Email

{ 'emails.0.address': 'email@gmail.com' }
```
{ _id : {filmId: '$filmId', status:'$status'}, count : {$sum : 1}}
```

0 comments on commit 4411f06

Please sign in to comment.