editDico.html 8.72 KB
Newer Older
1
{% extends "base.html" %}
Sylvain Coulange's avatar
Sylvain Coulange committed
2
{% load static %}
3
{% load humanize %}
4

5
{% block content %}
Sylvain Coulange's avatar
Sylvain Coulange committed
6
    <div class="editDico">
7
8
9
10
11
12
13
        {% if data.dicoLang == 'fr' %}
        <h2>Rechercher une entrée du dictionnaire français</h2>
        {% elif data.dicoLang == 'en' %}
        <h2>Search words in the English dictionary</h2>
        {% elif data.dicoLang == 'zh' %}
        <h2>中文詞典中搜索詞語</h2>
        {% endif %}
14
        <input hidden id="dicoLang" value="{{ data.dicoLang }}">
15
        
16
17
18
19
        <div class="searchWindow">
            <div class="input">
                Mot :<br/>
                <div class="searchWindow">
20
                    <select class="dropdown-toggle searchCondition" id="condition-mot">
21
22
23
24
25
26
                        <option  selected>contient</option>
                        <option>commence par</option>
                        <option>finit par</option>
                        <option>est égal à</option>
                    </select>
                    <input class="searchField" id="inMot" type="text" value=""/>
Sylvain Coulange's avatar
Sylvain Coulange committed
27
28
                </div>
            </div>
29
30
31
            <div class="input">
                Transcription (API) : <br/>
                <div class="searchWindow">
32
                    <select class="dropdown-toggle searchCondition" id="condition-trans">
33
34
35
36
37
38
                        <option selected>contient</option>
                        <option>commence par</option>
                        <option>finit par</option>
                        <option>est égal à</option>
                    </select>
                    <input id="inTrans" class="searchField api-kb" type="text" value=""/>
Sylvain Coulange's avatar
Sylvain Coulange committed
39
                </div>
40
            </div>
Sylvain Coulange's avatar
Sylvain Coulange committed
41
        </div>
42
43
        <button id="rechercher" title="Rechercher dans le dictionnaire">Rechercher</button>

44
        <div class="info">Le dictionnaire fait actuellement <span id="dicoNbEntr">{{ data.lenDic|intcomma }}</span> entrées.<br/>{{ data.logStat.cptEdit }} modifications enregistrées par les utilisateurs ({{ data.logStat.cptAdd }} ajouts ; {{ data.logStat.cptModif }} éditions ; {{ data.logStat.cptDel }} suppressions)<br/><a style="cursor:pointer" onclick="getLogOfAll()">Historique complet des modifications du dictionnaire</a></div>
Sylvain Coulange's avatar
Sylvain Coulange committed
45
        <!-- <div class="info warning">La modification du dictionnaire n'est pas encore possible.</div> -->
46
        <div class="result">
Sylvain Coulange's avatar
Sylvain Coulange committed
47
            <h3>Résultats de la recherche <span id="nbres"></span></h3>
48
49
50
51
52
53
54
55
56
57
58
59
60
61
            <table id="resultTable">
                <colgroup>
                    <col width="40%" />
                    <col width="40%" />
                    <col width="20%" />
                </colgroup>
                
                <tr>
                    <th>Mot</th>
                    <th>Transcription (API)</th>
                    <th>Actions</th>
                </tr>
            </table>
            <center><div id="loader" class="loader" style="display: none;"></div></center>
62
            <button id="btnShowMore" class="btn btn-success" style="margin: 10px;display: none; color:white" title="afficher plus de résultats"><svg xmlns="http://www.w3.org/2000/svg" width="30" height="30" fill="white" class="bi bi-plus-circle" viewBox="0 0 16 16">  <path d="M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z"/>  <path d="M8 4a.5.5 0 0 1 .5.5v3h3a.5.5 0 0 1 0 1h-3v3a.5.5 0 0 1-1 0v-3h-3a.5.5 0 0 1 0-1h3v-3A.5.5 0 0 1 8 4z"/></svg></button>
63
            <!-- <button id="btnAddEntry" class="btn btn-primary" style="margin: 10px;" title="Ajouter une entrée">Ajouter une entrée</button> -->
Sylvain Coulange's avatar
Sylvain Coulange committed
64
            <div id="actionBlock" style="display: none;"><div class="loader mainLoad"></div></div>
65
66
67
68
69
70
            <div class="divAddEntree">
                <h3>Ajouter une nouvelle entrée dans le dictionnaire</h3>
                <p><i>(Vous pouvez saisir plusieurs transcriptions différentes en les séparant par une virgule)</i></p>
                Mot : <input type="text" id="newWord" class="searchField" value=""> Transcription (API): <input id="newTrans" class="searchField api-kb" type="text" value=""/>
                <button title="Ajouter cette entrée dans le dictionnaire" class="btn btn-success btnAddNew" onclick="ajouter()">Ajouter</button>
            </div>
71
        </div>
Sylvain Coulange's avatar
Sylvain Coulange committed
72
73
74
    </div>
    <div>
        <form action="/app/" method="POST">{% csrf_token %}
75
            <button formaction="/app/dico/">Retour aux dictionnaires</button>
Sylvain Coulange's avatar
Sylvain Coulange committed
76
77
78
            <button formaction="/app/">Retour au coloriseur</button>
        </form>
    </div>
79
    <br>
80

81
    <!-- Fenêtre d'historique des modifications -->
82
    <div id="myModal" class="modal2">
83
84
85
86
87
88
        <!-- Modal content -->
        <div class="modal-content2">
        <div class="modal-header2">
            <span class="close">&times;</span>
            <h2>Historique des modifications</h2>
        </div>
89
90
91
        <div id="modalBody" class="modal-body">
            <h2 id="popLogH2" class="popLogH2"></h2>
            <div id="popLogInner" class="popLogInner"></div>
92
93
94
95
96
97
        </div>
        <div class="modal-footer2">
            <h3>WikiColor</h3>
        </div>
        </div>
    </div>
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160

    <!-- Modal qui apparaît pour afficher/modifier un mot au dictionnaire anglais -->
    <div id="modalEditWord" class="modal">
        <div class="popAddw-content" style="min-width:600px;">
            <div class="popAddw-header d-flex justify-content-between align-items-center">
                Edit an entry of the dictionary
                <span class="close" id="closeEditWord">&times;</span>
            </div>
            <div class="popAddw-body">
                <b>Word : </b>« <span id="popwMot"></span> »<br/>
                <table id="transTable" style="width:100%">
                    <tr>
                        <th>Transcription (IPA)</th>
                        <th>Region(s)/Variety</th>
                    </tr>
                </table>
                <div id="modalEditWordBtnDiv"></div>
            </div>
        </div>
    </div>

    <!-- Modal qui apparaît pour afficher/modifier la/les régions d'un mot du dictionnaire anglais -->
    <div id="modalEditWordRegion" class="modal" style="padding-top: 200px;">
        <div class="popAddw-content" style="min-width:500px;">
            <div class="popAddw-header d-flex justify-content-between align-items-center">
                Select one or more regions for this pronunciation
                <span class="close" id="closeEditWordRegion">&times;</span>
            </div>
            <div class="popAddw-body">
                <b>Word: </b>« <span id="modalEditWordRegionWord"></span> »<br/>
                <b>Pronunciation: </b>/<span id="modalEditWordRegionTrans" class="inputTrans"></span>/<br/>
                <input hidden id="modalEditWordRegionCptEntr" value="">
                <br/>
                <div class="form-check form-check-inline">
                    <input class="form-check-input wordRegionCheckbox" type="checkbox" id="wordRegionUK" value="UK">
                    <label class="form-check-label" for="wordRegionUK" title="United Kingdom - Received Pronunciation">UK</label>
                </div>
                <div class="form-check form-check-inline">
                    <input class="form-check-input wordRegionCheckbox" type="checkbox" id="wordRegionUS" value="US">
                    <label class="form-check-label" for="wordRegionUS" title="USA - General American">US</label>
                </div>
                <div class="form-check form-check-inline">
                    <input class="form-check-input wordRegionCheckbox" type="checkbox" id="wordRegionCA" value="CA">
                    <label class="form-check-label" for="wordRegionCA" title="Canada">CA</label>
                </div>
                <div class="form-check form-check-inline">
                    <input class="form-check-input wordRegionCheckbox" type="checkbox" id="wordRegionAU" value="AU">
                    <label class="form-check-label" for="wordRegionAU" title="Australia">AU</label>
                </div>
                <div class="form-check form-check-inline">
                    <input class="form-check-input wordRegionCheckbox" type="checkbox" id="wordRegionNZ" value="NZ">
                    <label class="form-check-label" for="wordRegionNZ" title="New Zealand">NZ</label>
                </div>
                <br/><br/>
                <b>Comment: </b><br/>
                <textarea id="modalEditWordRegionComment" placeholder="Type any comment you want on this pronunciation."></textarea>

                <div id="modalEditWordRegionBtnDiv">
                    <button class="btn btn-success" onclick="validRegions()">Save</button>
                </div>
            </div>
        </div>
    </div>
161
{% endblock %}
162

163
{% block javascript %}
164
    <script src="{% static 'scripts/loc2stand.js' %}"></script>
165
    <script src="{% static 'scripts/editDico.js' %}"></script>
166
{% endblock %}