Skip to content

Commit

Permalink
Expanded support for lists of organizations.
Browse files Browse the repository at this point in the history
Bug fixed in label translation.
  • Loading branch information
ChiaraDipi committed Jul 31, 2016
1 parent 41581dd commit 1bccb28
Show file tree
Hide file tree
Showing 8 changed files with 129 additions and 23 deletions.
93 changes: 82 additions & 11 deletions builder_pack/modules/elements/evt_builder-interp-core.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -582,13 +582,14 @@
</xsl:if>
<span class="toggle_list_element"><i class="fa fa-angle-right"></i></span>
<xsl:if test="current()/tei:note and current()/tei:note != ''">
<span class='small-note'>[<xsl:apply-templates select="tei:note" mode="interp"/>]</span>
<span class='small-note'><xsl:apply-templates select="tei:note" mode="interp"/></span>
</xsl:if>
</xsl:when>
<xsl:otherwise>
<xsl:element name="span">
<xsl:attribute name="class">display-block</xsl:attribute>
Nessuna informazione.
<span lang="def">NO_INFO</span>
<xsl:text>.</xsl:text>
</xsl:element>
</xsl:otherwise>
</xsl:choose>
Expand Down Expand Up @@ -696,26 +697,95 @@

<xsl:template name="org">
<xsl:choose>
<xsl:when test="current()//tei:orgName or current()//tei:desc">
<xsl:when test="current()[@type] or current()[@subtype] or current()[@role] or current()/tei:orgName or current()/tei:desc">
<xsl:if test="current()/tei:orgName">
<xsl:element name="span">
<xsl:attribute name="class">entity_name <xsl:if test="$list_org=true()"> link_active</xsl:if></xsl:attribute>
<xsl:attribute name="data-ref" select="@xml:id" />
<xsl:value-of select="tei:orgName"/>
<xsl:for-each select="current()/tei:orgName">
<xsl:value-of select="current()"/>
<xsl:if test="@type or @subtype or @notAfter or @notBefore or @from or @to">
<xsl:text>&#xA0;(</xsl:text>
<xsl:if test="@type">
<xsl:value-of select="replace(@type, '-', '/')"/>
<xsl:text>&#xA0;</xsl:text>
</xsl:if>
<xsl:if test="@subtype">
<xsl:value-of select="replace(@subtype, '-', '/')"/>
<xsl:text>&#xA0;</xsl:text>
</xsl:if>
<xsl:if test="@notAfter">
<span lang="def">AFTER</span>
<xsl:text>&#xA0;</xsl:text>
<xsl:value-of select="@notAfter"/>
</xsl:if>
<xsl:if test="@notBefore">
<span lang="def">BEFORE</span>
<xsl:text>&#xA0;</xsl:text>
<xsl:value-of select="@notBefore"/>
</xsl:if>
<xsl:if test="@from">
<span lang="def">FROM</span>
<xsl:text>&#xA0;</xsl:text>
<xsl:value-of select="@from"/>
</xsl:if>
<xsl:if test="@to">
<xsl:text>&#xA0;</xsl:text>
<span lang="def">TO</span>
<xsl:text>&#xA0;</xsl:text>
<xsl:value-of select="@to"/>
</xsl:if>
<xsl:text>). </xsl:text>
</xsl:if>

</xsl:for-each>
</xsl:element>
<xsl:if test="tei:orgName/@type">
<xsl:text> (</xsl:text><xsl:value-of select="replace(tei:orgName/@type, '-', '/')"/><xsl:text>). </xsl:text>
</xsl:if>
</xsl:if>
<span class="toggle_list_element"><i class="fa fa-angle-right"></i></span>
<xsl:if test="current()/tei:desc and current()/tei:desc != ''">
<span class='small-note'>[<xsl:apply-templates select="current()/tei:desc" mode="interp"/>]</span>
<span class='small-note'><xsl:apply-templates select="current()/tei:desc" mode="interp"/></span>
</xsl:if>
<xsl:if test="current()/tei:state">
<xsl:for-each select="current()/tei:state">
<span class='small-note orgName-state'>
<xsl:if test="current()/@type">
<span lang="def"><xsl:value-of select="replace(current()/@type, '-', '/')"/></span>
<xsl:text>&#xA0;</xsl:text>
</xsl:if>
<xsl:if test="current()/@notAfter">
<span lang="def">AFTER</span>
<xsl:text>&#xA0;</xsl:text>
<xsl:value-of select="current()/@notAfter"/>
</xsl:if>
<xsl:if test="current()/@notBefore">
<span lang="def">BEFORE</span>
<xsl:text>&#xA0;</xsl:text>
<xsl:value-of select="current()/@notBefore"/>
</xsl:if>
<xsl:if test="current()/@from">
<span lang="def">FROM</span>
<xsl:text>&#xA0;</xsl:text>
<xsl:value-of select="current()/@from"/>
</xsl:if>
<xsl:if test="current()/@to">
<xsl:text>&#xA0;</xsl:text>
<span lang="def">TO</span>
<xsl:text>&#xA0;</xsl:text>
<xsl:value-of select="current()/@to"/>
</xsl:if>
<xsl:text>:&#xA0;</xsl:text>
<xsl:apply-templates mode="interp" />
<xsl:text>.</xsl:text>
</span>

</xsl:for-each>
</xsl:if>
</xsl:when>
<xsl:otherwise>
<xsl:element name="span">
<xsl:attribute name="class" select="'display-block'"/>
<xsl:text>Nessuna informazione.</xsl:text>
<span lang="def">NO_INFO</span>
<xsl:text>.</xsl:text>
</xsl:element>
</xsl:otherwise>
</xsl:choose>
Expand Down Expand Up @@ -803,13 +873,14 @@
</xsl:if>
<span class="toggle_list_element"><i class="fa fa-angle-right"></i></span>
<xsl:if test="current()/tei:note and current()/tei:note != ''">
<span class='small-note'>[<xsl:apply-templates select="tei:note" mode="interp"/>]</span>
<span class='small-note'><xsl:apply-templates select="tei:note" mode="interp"/></span>
</xsl:if>
</xsl:when>
<xsl:otherwise>
<xsl:element name="span">
<xsl:attribute name="class">display-block</xsl:attribute>
Nessuna informazione.
<span lang="def">NO_INFO</span>
<xsl:text>.</xsl:text>
</xsl:element>
</xsl:otherwise>
</xsl:choose>
Expand Down
6 changes: 2 additions & 4 deletions config/evt_builder-config.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -303,12 +303,10 @@
<xsl:param name="list_org" select="true()"/>

<!-- EN: It is possibile to personalize the elements in the filter select element that will select and highlight particular (groups of) words.
In order to change the label it is necessary to change the text inside the corresponding element.
In order to remove an elemento from the list in the application it is possibile both to remove the element itself or to delete the text inside it.
In order to remove an element from the list in the application just remove the element itself.
In order to add a new element to the list you simply need to know that the tag corresponds to the class name that has be given to the html element referring to the particular words to be selected. -->
<!-- IT: E' possibile personalizzare gli elementi che compariranno nell'elenco dei filtri che selezionano particolari paroli o gruppi di parole.
Per cambiare l'etichetta basta cambiare il testo dentro l'elemento corrispondente.
Per rimuovere un elemento basta eliminare o tutto l'elemento di interesse o anche solo il testo al suo interno.
Per rimuovere un elemento basta eliminare tutto l'elemento di interesse.
Per aggiungere un elemento alla lista basta sapere che il tag fa riferimento alla classe data all'elemento html con il quale sono state marcate le parole "particolari" da selezionare. -->
<xsl:variable name="lists" as="element()*">
<persName/>
Expand Down
12 changes: 10 additions & 2 deletions config/langpack/de.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ jquery_lang_js.prototype.lang.de = {
"LIST_PERSON": "Personenliste",
"LIST_PLACE": "Ortliste",
"LIST_ORG": "Liste der Institutionen",
"NO_ELEMENTS": "Keine Elemente.",
"NO_ELEMENTS": "Keine elemente",
"PAGE_MISSING": "(miss)",
"PAGE_MISSING_RIGHT": " - (miss)",
"PAGE_MISSING_LEFT": "(miss) - ",
Expand Down Expand Up @@ -184,6 +184,14 @@ jquery_lang_js.prototype.lang.de = {

"ERROR_LOADING_TEXT": "Fehler beim Laden des Textes.",
"ERROR_LOADING_IMAGE": "Fehler beim Laden des Bildes. Das Transkript f&uuml;r diese Seite steht m&ouml;glicherweise noch nicht zur Verf&uuml;gung. Für weitere Informationen kontaktieren Sie bitte die Kuratoren.",
"ERROR_LOADING_HI_IMAGE": "Es gab ein Problem beim Laden des hochaufl&ouml;senden Bildes."
"ERROR_LOADING_HI_IMAGE": "Es gab ein Problem beim Laden des hochaufl&ouml;senden Bildes.",

"NO_INFO": "Keine information",

"AFTER": "nach",
"BEFORE": "vor",
"FROM": "von",
"TO": "bis",
"membership": "Mitgliedschaft"
}

12 changes: 10 additions & 2 deletions config/langpack/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ jquery_lang_js.prototype.lang.en = {
"LIST_PERSON": "List of persons",
"LIST_PLACE": "List of places",
"LIST_ORG": "List of organizations",
"NO_ELEMENTS": "No elements.",
"NO_ELEMENTS": "No elements",
"PAGE_MISSING": "(miss)",
"PAGE_MISSING_RIGHT": " - (miss)",
"PAGE_MISSING_LEFT": "(miss) - ",
Expand Down Expand Up @@ -184,6 +184,14 @@ jquery_lang_js.prototype.lang.en = {

"ERROR_LOADING_TEXT": "There was an error in loading the text. The transcript for this page may not yet be available. ",
"ERROR_LOADING_IMAGE": "There was an error in loading the image. For more informations, please contact the curators.",
"ERROR_LOADING_HI_IMAGE": "There was a problem while loading the hi-res image."
"ERROR_LOADING_HI_IMAGE": "There was a problem while loading the hi-res image.",

"NO_INFO": "No information",

"AFTER": "after",
"BEFORE": "before",
"FROM": "from",
"TO": "to",
"membership": "Membership"
}

10 changes: 9 additions & 1 deletion config/langpack/fr.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,5 +182,13 @@ jquery_lang_js.prototype.lang.fr = {

"ERROR_LOADING_TEXT": "Il y avait une erreur dans le chargement du texte. La transcription de cette page n'est pas encore disponible. Pour plus d'information contacter les conservateurs de l'edition.",
"ERROR_LOADING_IMAGE": "Il y avait un problème lors du chargement de l'image.",
"ERROR_LOADING_HI_IMAGE": "Il y avait un problème lors du chargement de l'image de salut-res."
"ERROR_LOADING_HI_IMAGE": "Il y avait un problème lors du chargement de l'image de salut-res.",

"NO_INFO": "Aucune information",

"AFTER": "après",
"BEFORE": "avant",
"FROM": "à partir de",
"TO": "à",
"membership": "Composition"
}
12 changes: 10 additions & 2 deletions config/langpack/it.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ jquery_lang_js.prototype.lang.it = {
"LIST_PERSON": "Lista delle persone",
"LIST_PLACE": "Lista dei luoghi",
"LIST_ORG": "Lista di enti",
"NO_ELEMENTS": "Nessun elemento.",
"NO_ELEMENTS": "Nessun elemento",
"PAGE_MISSING": "(miss)",
"PAGE_MISSING_RIGHT": " - (miss)",
"PAGE_MISSING_LEFT": "(miss) - ",
Expand Down Expand Up @@ -183,6 +183,14 @@ jquery_lang_js.prototype.lang.it = {

"ERROR_LOADING_TEXT": "Si è verificato un errore nel caricamento del testo. La trascrizione per questa pagina potrebbe non essere disponibile. Per ulteriori informazioni contattare i curatori dell'edizione.",
"ERROR_LOADING_IMAGE": "Si è verificato un errore durante il caricamento dell'immagine.",
"ERROR_LOADING_HI_IMAGE": "Si è verificato un errore durante il caricamento dell'immagine ad alta risoluzione."
"ERROR_LOADING_HI_IMAGE": "Si è verificato un errore durante il caricamento dell'immagine ad alta risoluzione.",

"NO_INFO": "Nessuna informazione",

"AFTER": "dopo il",
"BEFORE": "prima del",
"FROM": "dal",
"TO": "al",
"membership": "Membri"
}

4 changes: 4 additions & 0 deletions css/page_data-include.css
Original file line number Diff line number Diff line change
Expand Up @@ -626,6 +626,10 @@ div[id*='regesto'] span.trigger:hover, div[id*='regesto'] .popup.opened span.tri
color: #ffb74d;
}

.orgName-state {
display: block;
}

.doc.current span.roleName.list_active,
.doc.current span.roleName.list_active span.trigger,
.doc.current span.roleName.over > span.trigger,
Expand Down
3 changes: 2 additions & 1 deletion js/main/interface_control/ic_lists.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,9 @@ function filterListElements(filter){
$('<li />')
.addClass('list_element')
.addClass('no_elements')
.append("<span lang='"+window.lang.currentLang+"'>"+window.lang.convert('NO_ELEMENTS', window.lang.currentLang)+"</span>")
.append("<span lang='def'>NO_ELEMENTS</span>")
.appendTo('.ul_list:visible');
window.lang.run();
}
}

Expand Down

0 comments on commit 1bccb28

Please sign in to comment.