Projekt

Obecné

Profil

« Předchozí | Další » 

Revize d70a8d04

Přidáno uživatelem Ondřej Anděl před téměř 4 roky(ů)

Bug #8992: Upravit problémy v záznamech

Zobrazit rozdíly:

application/view/contents/searchContent.php
334 334
                        result += "<td>" + renderTag(item.tag.tag) + "</td>";
335 335
                        result += "<td>" + renderManuscript(item.manuscript) + "</td>";
336 336
                        result += "<td>" + item.position1 + (item.position2 ? ("/" + item.position2 + (item.positiondetail ? "/"  + item.positiondetail :  "")) : "")  + "</td>";
337
                        result += "<td>" + ((item.description2 !== null) ? item.description2 : "-") + "</td>";
337
                        result += "<td>" + ((item.description2 !== null && item.description2.trim().length > 0) ? (normalizeDescription(item.description2)) : "-") + "</td>";
338 338
                        result += "<td class=\"action-td\">" +
339 339
                            "<button class=\"btn mr-1\" title=\"Upravit\"  data-toggle=\"modal\" data-target=\"#edit-modal\" data-pseudo-id='" + id + "' data-title=\"Upravit záznam\"><i class=\"fa fa-pencil\"></i></button>" +
340 340
                            "<button class=\"btn\" title=\"Detail\"  data-toggle=\"modal\" data-target=\"#detail-modal\" data-pseudo-id='" + id + "'><i class=\"fa fa-search\"></i></button>";
application/view/js-scripts/convertors.js
59 59
    "11": "Cr",
60 60
    "12": "Fs",
61 61
    "13": "Z",
62
    "14": "Js",
62
    "14": "Jš",
63 63
    "15": "Pl",
64 64
};
65 65

  
......
208 208
    output += ((codeToVid.hasOwnProperty(tag[11])) ? ("<span title=\""+ codeToVid[tag[11]] +"\">" + tag[11] + "</span>") : ("<span>" + tag[11] + "</span>"));
209 209

  
210 210
    return output;
211
}
212

  
213
function normalizeDescription(text){
214
    console.log(text.toLowerCase());
215
    if(text.toLowerCase().trim().startsWith("\\n")){
216
        console.log("0");
217
        text = text.replace("\\N", "-");
218
        text = text.replace("\\n", "-");
219
    } else {
220
        console.log("1");
221
        text = text.replace("\\N", "; ");
222
        text = text.replace("\\n", "; ");
223
    }
224
    console.log(text);
225
    return text;
211 226
}
application/view/modals/detailModal.html
81 81
                            <i id="namedentity"></i>
82 82
                        </div>
83 83
                    </div>
84
                    <div class="row">
85
                        <div class="col-xs-12 col-sm-4">
86
                            <label>Kontext:</label>
87
                        </div>
88
                        <div class="col-xs-12 col-sm-8">
89
                            <i id="context"></i>
90
                        </div>
91
                    </div>
92 84
                    <div class="row">
93 85
                        <div class="col-xs-12 col-sm-4">
94 86
                            <label>Slovní druh:</label>
......
220 212
        const data_obj = data[pseudo_id];
221 213
        let modal = $(this);
222 214

  
223
        modal.find('#word').text(data_obj.word);
215
        modal.find('#word').text(data_obj.context + " " + data_obj.word);
224 216
        modal.find('#lemma').text(data_obj.lemma.lemma);
225
        modal.find('#description').text(data_obj.description === ""? "-" :  data_obj.description);
226
        modal.find('#description2').text(data_obj.description2 === ""? "-" :  data_obj.description2);
227
        modal.find('#description3').text(data_obj.description3 === ""? "-" :  data_obj.description3);
217
        modal.find('#description').text(data_obj.description === ""? "-" :  normalizeDescription(data_obj.description));
218
        modal.find('#description2').text(data_obj.description2 === ""? "-" :  normalizeDescription(data_obj.description2));
219
        modal.find('#description3').text(data_obj.description3 === ""? "-" :  normalizeDescription(data_obj.description3));
228 220
        modal.find('#date').text(convertDate(data_obj.date));
229 221
        modal.find('#manuscript').text(renderManuscript(data_obj.manuscript, false));
230 222
        modal.find('#position').text(data_obj.position1 + (data_obj.position2 ? ("/" + data_obj.position2 + (data_obj.positiondetail ? "/"  + data_obj.positiondetail :  "")) : ""));
231 223
        modal.find('#namedentity').text(data_obj.namedentity === 1? "ano" :  "ne");
232
        modal.find('#context').text(data_obj.context === ""? "-" :  data_obj.context);
233 224

  
234 225
        const morphem = data_obj.tag.tag;
235 226
        analyzeMorphem(modal, morphem);

Také k dispozici: Unified diff