Commit 2aa87462 authored by Émeline's avatar Émeline
Browse files

Corrections plugins ead avec i18n + templates et js sans baseuri

parent 1fb14277
Loading
Loading
Loading
Loading
+14 −15
Original line number Diff line number Diff line
@@ -4,6 +4,7 @@ import module namespace max.util = 'pddn/max/util' at '../../rxq/util.xqm';
import module namespace rest = "http://exquery.org/ns/restxq";
import module namespace max.html = 'pddn/max/html' at '../../rxq/html.xqm';
import module namespace max.api = 'pddn/max/max_api' at '../../rxq/max_api.xqm';
import module namespace max.i18n = 'pddn/max/i18n' at '../../rxq/i18n.xqm';

declare variable $max.plugin.ead_basket:PLUGIN_ID := "ead_basket";

@@ -86,16 +87,14 @@ declare
%rest:path("/{$projectId}/porte-documents.html")
function max.plugin.ead_basket:basket($projectId){
    max.html:render($projectId, "porte-documents", <section class="porte-documents">
        <h2>Porte-documents</h2>
        <p>
            Votre porte-documents regroupe tous les documents que vous avez mis de côté pendant votre visite.
            Vous pouvez retirer des documents, les consulter ou faire une sortie PDF.
        </p>
    <h3>{max.i18n:getText($projectId,'basket.title')}</h3>
    <p>{max.i18n:getText($projectId,'basket.label1')}</p>
    <p>{max.i18n:getText($projectId,'basket.label2')}</p>
    <div id="porte-document-contenu">
    </div>
    <p>
            <button class="btnClearBasket">Vider le porte-documents</button>
            <!--<button id="btnDlAllPDF">Télécharger tous les PDF</button>-->
        <button class="btnClearBasket">{max.i18n:getText($projectId,'basket.label3')}</button>
        <!--<button id="btnDlAllPDF">{max.i18n:getText($projectId,'basket.label4')}</button>-->
    </p>
</section>
    )
@@ -133,7 +132,7 @@ function max.plugin.ead_basket:basketData($projectId, $itemsList){
    		return max.plugin.ead_basket:itemPorteDocuments($projectId, $item)
    		}
    		<p>
    			<button class="btnMakePDF">Faire une sortie PDF</button>
    			<button class="btnMakePDF">{max.i18n:getText($projectId,'basket.label5')}</button>
    		</p>
    	</div>
    return $result
+32 −25
Original line number Diff line number Diff line
@@ -21,12 +21,18 @@ function max.plugin.ead_search:searchPage($project){
    let $dbPath := max.config:getProjectDBPath($project)
    let $simpleSearch :=
    <section>
    <p>La recherche peut se faire de deux manières indépendantes : </p><ul><li>soit par une recherche en plein texte,</li> <li>soit par une recherche multicritère<span style="display:none"> (dont fait partie la recherche par année de production)</span>.</li></ul>
    <p>On ne peut pas croiser ces deux types de recherche.</p>
       <h3>{max.i18n:getText($project,'search.title')}</h3>
       <p>{max.i18n:getText($project,'search.label1')}</p>
       <ul>
        <li>{max.i18n:getText($project,'search.label2')}</li>
        <li>{max.i18n:getText($project,'search.label3')}</li>
       </ul>
       <p>{max.i18n:getText($project,'search.label4')}</p>

    <div id="ead-search-simple">
            <label>Recherche plein texte </label>
        <label>{max.i18n:getText($project,'search.fulltext')}</label>
        <input id="searchInput" type="text" placeholder="Texte..."/>
            <button id="boutonChercher" class="btn btn-secondary" onclick="window.eadSearch.runEadSimpleSearch();">Rechercher</button>
        <button id="boutonChercher" class="btn btn-secondary" onclick="window.eadSearch.runEadSimpleSearch();">{max.i18n:getText($project,'search.label5')}</button>
    </div>
    </section>
    let $datalists := <section id="ead-search-section" class="ead-search">
@@ -104,7 +110,7 @@ function max.plugin.ead_search:searchPage($project){
                    <input type="number" id="ead-search-date-to" value="2000" disabled="disabled"/>
                </div>
            </div>
            <div class="boutonSearch"><button onclick="window.eadSearch.runEadSearch()">Rechercher</button></div>
            <div class="boutonSearch"><button onclick="window.eadSearch.runEadSearch()">{max.i18n:getText($project,'search.label5')}</button></div>
            <div id='searchLoading'>{max.i18n:getText($project,'search.loading')}</div>
            <div id="ead-search-results"></div>
            <script type="text/javascript" src="{max.util:getRelativeRootPath($project) ||'plugins/ead_search/ead_search_page.js'}"></script>
@@ -157,10 +163,11 @@ function max.plugin.ead_search:runSearch($project as xs:string, $indexes as xs:s
    }
    </ol>

    return <section>
            
    return
    <section>
        <div id='searchLoading'>{max.i18n:getText($project,'search.loading')}</div>
        <h3>Résultats - {count($html/li/@id)}</h3>
            <!-- <h4>XQuery = {$matches} - (db = {$dbPath})</h4> -->
        <!--<h4>XQuery = {$search} - (db = {$dbPath})</h4>-->
        {$html}
    </section>
    }
+18 −2
Original line number Diff line number Diff line
@@ -13,4 +13,20 @@
  <entry key="pb">Page breaks</entry>
  <entry key="reading-options">Reading options</entry>

  <!-- Recherche -->
  <entry key="search.title">Advanced search</entry>
  <entry key="search.label1">The search can be done in two independent ways:</entry>
  <entry key="search.label2">by a full text search,</entry>
  <entry key="search.label3">by a multi-criteria search.</entry>
  <entry key="search.label4">(These two types of research cannot be crossed.)</entry>
  <entry key="search.label5">Search</entry>
  <entry key="search.fulltext">Full text search</entry>

  <!-- Porte-documents -->
  <entry key="basket.title">Basket</entry>
  <entry key="basket.label1">Your basket contains all the documents you put aside during your visit.</entry>
  <entry key="basket.label2">You can remove documents, view them or make a PDF output.</entry>
  <entry key="basket.label3">Empty basket</entry>
  <entry key="basket.label4">Download all the PDF</entry>
  <entry key="basket.label5">Create a PDF output</entry>
</properties>
+18 −1
Original line number Diff line number Diff line
@@ -18,4 +18,21 @@

  <entry key="pb">Afficher les sauts de page</entry>
  <entry key="reading-options">Options de lecture</entry>

  <!-- Recherche -->
  <entry key="search.title">Recherche avancée</entry>
  <entry key="search.label1">La recherche peut se faire de deux manières indépendantes :</entry>
  <entry key="search.label2">soit par une recherche en plein texte,</entry>
  <entry key="search.label3">soit par une recherche multicritère.</entry>
  <entry key="search.label4">(On ne peut pas croiser ces deux types de recherche.)</entry>
  <entry key="search.label5">Rechercher</entry>
  <entry key="search.fulltext">Recherche plein texte</entry>

  <!-- Porte-documents -->
  <entry key="basket.title">Porte-documents</entry>
  <entry key="basket.label1">Votre porte-documents regroupe tous les documents que vous avez mis de côté pendant votre visite.</entry>
  <entry key="basket.label2">Vous pouvez retirer des documents, les consulter ou faire une sortie PDF.</entry>
  <entry key="basket.label3">Vider le porte-documents</entry>
  <entry key="basket.label4">Télécharger tous les PDF</entry>
  <entry key="basket.label5">Faire une sortie PDF</entry>
</properties>
+8 −8
Original line number Diff line number Diff line
@@ -152,7 +152,7 @@ async function initPorteDocumentsPage(project_id) {
                	let noticeId = notice.dataset.node_id
                	docItems.push(noticeId)
                });
                window.open(baseURI + project_id + "/ead/basket.pdf?items=" + (docItems.join()), '_blank');
                window.open("/" + project_id + "/ead/basket.pdf?items=" + (docItems.join()), '_blank');
            });
        }

Loading