cms/app-client/app/templates/components/notice-component.hbs
author ymh <ymh.work@gmail.com>
Wed, 08 Feb 2017 15:25:24 +0100
changeset 502 74fba571487e
parent 492 acecbffac2c4
child 511 fbf4e1afab01
permissions -rw-r--r--
Complete the notice display. add various fields to document to correctly display the notice. Correct bug #0025746

<h2>{{ item.title }}</h2>
{{#if item.alternativeTitle }}
<h3>{{ item.alternativeTitle }}</h3>
{{/if}}
<div class="notice-links">
  <h5>{{#if item.id }}<a href={{abs-url-for "document" item.id}} class="notice-permalink" target="_blank">permalien</a>{{/if}}</h5>
  <h5>{{#if item.cocoonId }}<a href={{noticeCocoonPurlUrl}} class="notice-permalink" target="_blank">notice sur Cocoon</a>{{/if}}</h5>
</div>
<table>
  <tr>
    <td class="title">Editeur{{#if (if-operator item.publishers.length '>' 1)}}s{{/if}}</td>
    <td>
      <ul>
        {{#each item.publishers as |publisher|}}
        <li>{{ publisher }}</li>
        {{/each}}
      </ul>
    </td>
  </tr>
  <tr>
    <td class="title">Langue</td>
    <td>{{#each item.languages as |lang index|}}{{if index ", "}}{{ component (getLinkType lang) url=lang class="language" onClick=(action 'addLanguageFilter' lang) displayUrlLink=true}}{{/each}}</td>
  </tr>
  <tr>
    <td class="title">Sujet{{#if (if-operator item.subjects.length '>' 1)}}s{{/if}}</td>
    <td>
      <ul>
        {{#each item.subjects as |subject|}}
        <li>
          {{component (getLinkType subject) url=subject onClick=(action "addThemeFilter" subject) displayUrlLink=true}}
        </li>
        {{/each}}
      </ul>
    </td>
  </tr>
  <tr>
    <td class="title">Type{{#if (if-operator item.types.length '>' 1)}}s{{/if}}</td>
    <td>
      <ul>
        {{#each item.types as |type|}}
        <li>
          {{component (getLinkType type) url=type onClick=(action "addThemeFilter" type) displayUrlLink=true}}
        </li>
        {{/each}}
      </ul>
    </td>
  </tr>
  <tr>
    <td class="title">Description</td>
    <td>
      {{#each item.descriptions as |description|}}
      <p>{{ doc-literal url=description }}</p>
      {{/each}}
    </td>
  </tr>
  <tr>
    <td class="title">Enregistré en</td>
    <td>{{ doc-created value=item.created }}</td>
  </tr>
  <tr>
    <td class="title">Participant{{#if (if-operator participants.length '>' 1)}}s{{/if}}</td>
    <td>
      <ul>
        {{#each participants as |participant|}}
        <li>{{component (getLinkType participant.identifier) url=participant.identifier }} ({{#each participant.role as |r index| }}{{if index ", "}}{{r}}{{/each}})</li>
        {{/each}}
      </ul>
    </td>
  </tr>
  <tr>
    <td class="title">Lieu</td>
    <td>{{ notice-location-component geoInfo=item.geoInfo countryCode=item.countryCode }}</td>
  </tr>
  <tr>
    <td class="title">Durée</td>
    <td>{{to-minutes item.duration}}</td>
  </tr>
  <tr>
    <td class="title">Droits</td>
    <td>{{ doc-rights url=item.rights }}</td>
  </tr>
</table>