# HG changeset patch # User Chloe Laisne # Date 1467623725 -7200 # Node ID 989b9c36b84970b643510802e7a42388d8ed50e3 # Parent c174124d1849252e3fcc139646912326eb8c0f19 Toolbar and Notice component styles diff -r c174124d1849 -r 989b9c36b849 cms/app-client/app/components/notice-component.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cms/app-client/app/components/notice-component.js Mon Jul 04 11:15:25 2016 +0200 @@ -0,0 +1,36 @@ +import Ember from 'ember'; + +export default Ember.Component.extend({ + + player: Ember.inject.service(), + + classNames: ['notice-component'], + + item: Ember.computed('player.model', function() { + return this.get('player').get('model'); + }), + + participants: Ember.computed('player.model.contributors', function() { + var participants = []; + if(this.get('player').get('model')) { + this.get('player').get('model').get('contributors').forEach(function(contributor) { + if(contributor.name) { + participants.push({ name: contributor.name, role: contributor.role.split('/').pop() }); + } + }); + } + return participants; + }), + + location: Ember.computed('player.model.geoInfo', function() { + var location = ''; + if(this.get('player').get('model')) { + var meta = this.get('player').get('model').get('geoInfo').notes.find(element => element.lang); + if(meta) { + location = meta.value; + } + } + return location; + }) + +}); diff -r c174124d1849 -r 989b9c36b849 cms/app-client/app/components/toolbar-component.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cms/app-client/app/components/toolbar-component.js Mon Jul 04 11:15:25 2016 +0200 @@ -0,0 +1,7 @@ +import Ember from 'ember'; + +export default Ember.Component.extend({ + + classNames: ['toolbar-component'] + +}); diff -r c174124d1849 -r 989b9c36b849 cms/app-client/app/helpers/if-or.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cms/app-client/app/helpers/if-or.js Mon Jul 04 11:15:25 2016 +0200 @@ -0,0 +1,7 @@ +import Ember from 'ember'; + +export function ifOr(params) { + return params.find(element => element); +} + +export default Ember.Helper.helper(ifOr); diff -r c174124d1849 -r 989b9c36b849 cms/app-client/app/models/document.js --- a/cms/app-client/app/models/document.js Sun Jul 03 13:13:10 2016 +0200 +++ b/cms/app-client/app/models/document.js Mon Jul 04 11:15:25 2016 +0200 @@ -2,7 +2,7 @@ import Ember from 'ember'; import _ from 'lodash/lodash'; -var CPDocument = DS.Model.extend({ +export default DS.Model.extend({ uri: DS.attr('string'), issued: DS.attr('date'), @@ -10,6 +10,7 @@ language: DS.attr('string'), publishers: DS.attr({ defaultValue: function() { return []; } }), contributors: DS.attr({ defaultValue: function() { return []; } }), + geoInfo: DS.attr({ defaultValue: function() { return {}; } }), mediaArray: DS.attr({ defaultValue: function() { return []; } }), mediaList: Ember.computed('mediaArray', function() { @@ -26,8 +27,17 @@ res.unshift(mp3); } return res; + }), + + duration: Ember.computed('mediaArray', function() { + var self = this; + var duration = 0; + Object.keys(this.get('mediaArray')).forEach(function(key) { + if (!duration && self.get('mediaArray')[key].extent_ms) { + duration = self.get('mediaArray')[key].extent_ms; + }; + }); + return duration / 1000; }) }); - -export default CPDocument; diff -r c174124d1849 -r 989b9c36b849 cms/app-client/app/styles/app.scss --- a/cms/app-client/app/styles/app.scss Sun Jul 03 13:13:10 2016 +0200 +++ b/cms/app-client/app/styles/app.scss Mon Jul 04 11:15:25 2016 +0200 @@ -26,6 +26,8 @@ @import 'components/playlist-component'; @import 'components/discourses-component'; @import 'components/player-component'; + @import 'components/toolbar-component'; + @import 'components/notice-component'; } @@ -41,6 +43,11 @@ text-align: center; } +.corpus-app-modal { + background-color: #becfd4; + padding: 20px 40px; +} + .corpus-app-container { color: #687a84; box-sizing: border-box; @@ -49,10 +56,14 @@ .corpus-app-container h2 { padding: 15px; - font-size: 13px; + font-size: 14px; color: #253946; } +.corpus-window { + overflow: hidden; +} + body.tabs-discours .corpus-app-container, body.tabs-chrono .corpus-app-container { padding: 0px 20px; diff -r c174124d1849 -r 989b9c36b849 cms/app-client/app/styles/components/filter-component.scss --- a/cms/app-client/app/styles/components/filter-component.scss Sun Jul 03 13:13:10 2016 +0200 +++ b/cms/app-client/app/styles/components/filter-component.scss Mon Jul 04 11:15:25 2016 +0200 @@ -5,7 +5,7 @@ .filter-component h2 { color: #ffffff; - font-size: 13px; + font-size: 14px; } .filter-component ul { diff -r c174124d1849 -r 989b9c36b849 cms/app-client/app/styles/components/notice-component.scss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cms/app-client/app/styles/components/notice-component.scss Mon Jul 04 11:15:25 2016 +0200 @@ -0,0 +1,44 @@ +.notice-component { + +} + +.notice-component h2 { + color: #ffffff; + text-align: left; + font-size: 14px; + text-transform: uppercase; +} + +.notice-component h3 { + color: #ffffff; + line-height: 18px; + font-size: 14px; + padding: 5px 0px; +} + +.notice-component table { + line-height: 18px; + border-collapse: collapse; + width: 100%; + margin-top: 15px; +} + +.notice-component table tr { + border-bottom: solid 1px #13212d; +} + +.notice-component table tr td { + vertical-align: top; + padding: 10px 0px; +} + +.notice-component table tr td.title { + font-weight: bold; + color: #13212d; +} + +.notice-component table tr td ul { + list-style: none; + margin: 0; + padding: 0; +} \ No newline at end of file diff -r c174124d1849 -r 989b9c36b849 cms/app-client/app/styles/components/toolbar-component.scss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cms/app-client/app/styles/components/toolbar-component.scss Mon Jul 04 11:15:25 2016 +0200 @@ -0,0 +1,31 @@ +.toolbar-component { + height: 40px; + width: 100%; + line-height: 40px; + text-transform: none; + padding: 0px 15px; + text-align: left; + color: #ffffff; + font-size: 13px; + background-color: #13212d; +} + +.toolbar-component ul { + list-style: none; + margin: 0; + padding: 0; + text-align: center; + font-size: 0px; +} + +.toolbar-component ul li { + padding: 0 10px; + display: inline-block; + font-size: 12px; + cursor: pointer; +} + +.toolbar-component ul li:hover { + background-color: #ffffff; + color: #13212d; +} \ No newline at end of file diff -r c174124d1849 -r 989b9c36b849 cms/app-client/app/templates/application.hbs --- a/cms/app-client/app/templates/application.hbs Sun Jul 03 13:13:10 2016 +0200 +++ b/cms/app-client/app/templates/application.hbs Mon Jul 04 11:15:25 2016 +0200 @@ -1,49 +1,26 @@
- {{player-component action="changeDocument" document=currentItem}} -

{{ currentItem.title }}

-

{{doc-language url=currentItem.language}}

+ {{player-component action="changeDocument" document=currentItem}} +

{{ currentItem.title }}

+

{{doc-language url=currentItem.language}}

-
- + -
- -
+
-
- {{outlet}} -
+ -
- - {{filter-component}} - - {{playlist-component model=model}} +
+ {{ outlet }} +
-
+
+ {{ filter-component }} + {{ playlist-component model=model }} +
-{{#if detail}} - {{#ember-wormhole to='info-modal'}} -
-
-
-

Notice

-
-
-

Titre {{modalItem.title}}

-

Langue {{doc-language url=modalItem.language}}

-

Enregistré le {{modalItem.modified}}

-

Interviewer {{modalItem.publishers}}

-

Description {{modalItem.description}}

-

Type de Discours {{modalItem.type}}

-

Localisation {{modalItem.spatial}}

-
- -
- {{/ember-wormhole}} -{{/if}} +{{toolbar-component}} \ No newline at end of file diff -r c174124d1849 -r 989b9c36b849 cms/app-client/app/templates/components/notice-component.hbs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cms/app-client/app/templates/components/notice-component.hbs Mon Jul 04 11:15:25 2016 +0200 @@ -0,0 +1,48 @@ +

Notice

+

{{ item.title }}

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Editeur(s) +
    + {{#each item.publishers as |publisher|}} +
  • {{ publisher }}
  • + {{/each}} +
+
Langue{{ doc-language url=item.language }}
Enregistré en{{ short-date item.issued }}
Participants +
    + {{#each participants as |participant|}} +
  • {{ participant.name }} ({{ participant.role }})
  • + {{/each}} +
+
Description(s)
Lieu{{ location }}
Durée{{to-minutes item.duration}}
Droits
\ No newline at end of file diff -r c174124d1849 -r 989b9c36b849 cms/app-client/app/templates/components/toolbar-component.hbs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cms/app-client/app/templates/components/toolbar-component.hbs Mon Jul 04 11:15:25 2016 +0200 @@ -0,0 +1,5 @@ + \ No newline at end of file diff -r c174124d1849 -r 989b9c36b849 cms/app-client/tests/integration/components/notice-component-test.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cms/app-client/tests/integration/components/notice-component-test.js Mon Jul 04 11:15:25 2016 +0200 @@ -0,0 +1,24 @@ +import { moduleForComponent, test } from 'ember-qunit'; +import hbs from 'htmlbars-inline-precompile'; + +moduleForComponent('notice-component', 'Integration | Component | notice component', { + integration: true +}); + +test('it renders', function(assert) { + // Set any properties with this.set('myProperty', 'value'); + // Handle any actions with this.on('myAction', function(val) { ... }); + + this.render(hbs`{{notice-component}}`); + + assert.equal(this.$().text().trim(), ''); + + // Template block usage: + this.render(hbs` + {{#notice-component}} + template block text + {{/notice-component}} + `); + + assert.equal(this.$().text().trim(), 'template block text'); +}); diff -r c174124d1849 -r 989b9c36b849 cms/app-client/tests/integration/components/toolbar-component-test.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cms/app-client/tests/integration/components/toolbar-component-test.js Mon Jul 04 11:15:25 2016 +0200 @@ -0,0 +1,24 @@ +import { moduleForComponent, test } from 'ember-qunit'; +import hbs from 'htmlbars-inline-precompile'; + +moduleForComponent('toolbar-component', 'Integration | Component | toolbar component', { + integration: true +}); + +test('it renders', function(assert) { + // Set any properties with this.set('myProperty', 'value'); + // Handle any actions with this.on('myAction', function(val) { ... }); + + this.render(hbs`{{toolbar-component}}`); + + assert.equal(this.$().text().trim(), ''); + + // Template block usage: + this.render(hbs` + {{#toolbar-component}} + template block text + {{/toolbar-component}} + `); + + assert.equal(this.$().text().trim(), 'template block text'); +}); diff -r c174124d1849 -r 989b9c36b849 cms/app-client/tests/unit/helpers/if-or-test.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cms/app-client/tests/unit/helpers/if-or-test.js Mon Jul 04 11:15:25 2016 +0200 @@ -0,0 +1,10 @@ +import { ifOr } from 'app-client/helpers/if-or'; +import { module, test } from 'qunit'; + +module('Unit | Helper | if or'); + +// Replace this with your real tests. +test('it works', function(assert) { + let result = ifOr([42]); + assert.ok(result); +});