Binary file src/jocondelab/locale/fr/LC_MESSAGES/django.mo has changed
--- a/src/jocondelab/locale/fr/LC_MESSAGES/django.po Sun Sep 15 21:02:48 2013 +0200
+++ b/src/jocondelab/locale/fr/LC_MESSAGES/django.po Mon Sep 16 10:44:50 2013 +0200
@@ -7,7 +7,7 @@
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2013-09-03 08:42-0500\n"
+"POT-Creation-Date: 2013-09-12 09:30-0500\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -115,106 +115,126 @@
msgstr "Portugais"
#: settings.py:48
+msgid "Arabic"
+msgstr "Arabe"
+
+#: settings.py:49
msgid "Chinese"
msgstr "Chinois"
-#: settings.py:49
+#: settings.py:50
msgid "Japanese"
msgstr "Japonais"
-#: settings.py:50
+#: settings.py:51
msgid "Catalan"
msgstr "Catalan"
-#: settings.py:51
+#: settings.py:52
msgid "Basque"
msgstr "Basque"
-#: settings.py:52
+#: settings.py:53
msgid "Breton"
msgstr "Breton"
-#: templates/jocondelab/front_base.html:55
+#: templates/jocondelab/front_base.html:50
+msgid "Search in contents"
+msgstr "Rechercher dans les notices"
+
+#: templates/jocondelab/front_base.html:54
msgid "Menu"
msgstr "Menu"
-#: templates/jocondelab/front_base.html:58
-#: templates/jocondelab/front_search.html:15
-#: templates/jocondelab/front_search.html:17
-msgid "Multilingual search"
-msgstr "Recherche multilingue"
+#: templates/jocondelab/front_base.html:55
+msgid "Changer de langue"
+msgstr "Changer de langue"
+
+#: templates/jocondelab/front_base.html:67
+#: templates/jocondelab/front_home.html:4
+#: templates/jocondelab/front_home.html:6
+msgid "Accueil"
+msgstr "Accueil"
-#: templates/jocondelab/front_base.html:61
-#: templates/jocondelab/front_timeline.html:27
-#: templates/jocondelab/front_timeline.html:29
-msgid "Timeline"
+#: templates/jocondelab/front_base.html:70
+#: templates/jocondelab/front_home.html:14
+#: templates/jocondelab/front_search.html:18
+#: templates/jocondelab/front_search.html:20
+msgid "Recherche"
+msgstr "Recherche"
+
+#: templates/jocondelab/front_base.html:73
+#: templates/jocondelab/front_home.html:17
+#: templates/jocondelab/front_timeline.html:22
+#: templates/jocondelab/front_timeline.html:24
+msgid "Frise chronologique"
msgstr "Frise chronologique"
-#: templates/jocondelab/front_base.html:64
+#: templates/jocondelab/front_base.html:76
+#: templates/jocondelab/front_geo.html:31
#: templates/jocondelab/front_geo.html:33
-#: templates/jocondelab/front_geo.html:35
-msgid "World map"
+#: templates/jocondelab/front_home.html:20
+msgid "Mappemonde"
msgstr "Mappemonde"
-#: templates/jocondelab/front_base.html:71
-msgid "Search in contents"
-msgstr "Rechercher dans les notices"
-
-#: templates/jocondelab/front_base.html:92
+#: templates/jocondelab/front_base.html:103
#, fuzzy
msgid "Source: Wikipedia"
msgstr "Source : Wikipédia"
-#: templates/jocondelab/front_geo.html:42
-msgid "Search for a place"
+#: templates/jocondelab/front_geo.html:39
+msgid "Rechercher un lieu"
msgstr "Rechercher un lieu"
-#: templates/jocondelab/front_notice.html:50
-#: templates/jocondelab/partial/notice_list.html:13
-msgid "Title:"
-msgstr "Titre :"
+#: templates/jocondelab/front_geo.html:46
+#: templates/jocondelab/front_search.html:43
+#: templates/jocondelab/front_timeline.html:36
+msgid "Afficher plus de résultats"
+msgstr "Afficher plus de résultats"
+
+#: templates/jocondelab/front_home.html:10
+msgid "Bienvenue sur JocondeLab"
+msgstr "Bienvenue sur JocondeLab"
+
+#: templates/jocondelab/front_home.html:23
+msgid "Liste des termes"
+msgstr "Liste des termes"
+
+#: templates/jocondelab/front_home.html:26
+msgid "À propos"
+msgstr "À propos"
-#: templates/jocondelab/front_notice.html:56
-#: templates/jocondelab/partial/notice_list.html:14
-msgid "Denomination:"
-msgstr "Dénomination :"
+#: templates/jocondelab/front_notice.html:52
+msgid "Désignation"
+msgstr "Désignation"
+
+#: templates/jocondelab/front_notice.html:59
+msgid "Sujet représenté"
+msgstr "Sujet représenté"
+
+#: templates/jocondelab/front_notice.html:66
+msgid "Datation"
+msgstr "Datation"
-#: templates/jocondelab/front_notice.html:62
-#: templates/jocondelab/front_notice.html:110
-#: templates/jocondelab/front_notice.html:121
-#: templates/jocondelab/partial/notice_list.html:28
+#: templates/jocondelab/front_notice.html:76
+msgid "Provenance"
+msgstr "Provenance"
+
+#: templates/jocondelab/front_notice.html:88
+msgid "Visiter sur le portail Joconde"
+msgstr "Visiter sur le portail Joconde"
+
+#: templates/jocondelab/front_notice.html:95
+#: templates/jocondelab/partial/datasheet_row.html:5
+#: templates/jocondelab/partial/datasheet_row.html:20
+#: templates/jocondelab/partial/notice_list.html:25
msgid ":"
msgstr " :"
-#: templates/jocondelab/front_notice.html:76
-#, fuzzy
-msgid "Description:"
-msgstr "Description :"
-
-#: templates/jocondelab/front_notice.html:82
-msgid "History:"
-msgstr "Histoire :"
-
-#: templates/jocondelab/front_notice.html:88
-msgid "Conservation location:"
-msgstr "Lieu de conservation :"
-
-#: templates/jocondelab/front_notice.html:94
-msgid "Datasheet rights:"
-msgstr "Copyright notice :"
-
-#: templates/jocondelab/front_notice.html:100
-msgid "Images rights:"
-msgstr "Droits photographiques :"
-
-#: templates/jocondelab/front_notice.html:112
+#: templates/jocondelab/front_notice.html:97
msgid "What do you see in this work?"
msgstr "Que voyez-vous dans cette œuvre ?"
-#: templates/jocondelab/front_notice.html:123
-msgid "Which other work is a source for this work?"
-msgstr "Quelle autre œuvre est une source de la représentation ?"
-
#: templates/jocondelab/term_edit.html:73
msgid "prev"
msgstr "préc."
@@ -289,18 +309,6 @@
msgid "Search"
msgstr "Rech."
-#: templates/jocondelab/partial/notice_list.html:3
-msgid "results for:"
-msgstr "résultats pour :"
-
-#: templates/jocondelab/partial/notice_list.html:3
-msgid "results"
-msgstr "résultats"
-
-#: templates/jocondelab/partial/notice_list.html:18
-msgid "Author(s):"
-msgstr "Auteur(s) :"
-
#: templates/jocondelab/partial/pagination.html:6
#, python-format
msgid "Total number of term in the request : %(total_count)s"
@@ -311,6 +319,14 @@
msgid "previous"
msgstr "préc."
+#: templates/jocondelab/partial/wrapped_notice_list.html:3
+msgid "results for:"
+msgstr "résultats pour :"
+
+#: templates/jocondelab/partial/wrapped_notice_list.html:3
+msgid "results"
+msgstr "résultats"
+
#: templates/registration/login.html:6
msgid "Sorry, that's not a valid username or password."
msgstr ""
@@ -320,33 +336,30 @@
msgid "login"
msgstr "connex."
-#~ msgid "language"
-#~ msgstr "langue"
-
# Thesaurus Identifiers
msgctxt "Thesaurus label"
msgid "AUTR"
msgstr "Auteur(s)"
msgctxt "Thesaurus label"
+msgid "ECOL"
+msgstr "École"
+
+msgctxt "Thesaurus label"
msgid "DOMN"
msgstr "Domaine(s)"
msgctxt "Thesaurus label"
-msgid "ECOL"
-msgstr "École"
+msgid "DENO"
+msgstr "Dénomination"
msgctxt "Thesaurus label"
-msgid "EPOQ"
-msgstr "Époque, style, mouvement"
+msgid "APPL"
+msgstr "Appellation"
msgctxt "Thesaurus label"
-msgid "LIEUX"
-msgstr "Lieu"
-
-msgctxt "Thesaurus label"
-msgid "PERI"
-msgstr "Période de création ou exécution"
+msgid "TITR"
+msgstr "Titre"
msgctxt "Thesaurus label"
msgid "REPR"
@@ -354,4 +367,48 @@
msgctxt "Thesaurus label"
msgid "SREP"
-msgstr "Source de la représentation"
+msgstr "Sources de la représentation"
+
+msgctxt "Thesaurus label"
+msgid "PERI"
+msgstr "Période de création ou d'exécution"
+
+msgctxt "Thesaurus label"
+msgid "MILL"
+msgstr "Millésime de création ou d'exécution"
+
+msgctxt "Thesaurus label"
+msgid "EPOQ"
+msgstr "Époque, style, mouvement"
+
+msgctxt "Thesaurus label"
+msgid "TECH"
+msgstr "Matériaux, techniques"
+
+msgctxt "Thesaurus label"
+msgid "DIMS"
+msgstr "Mesures"
+
+msgctxt "Thesaurus label"
+msgid "LIEUX"
+msgstr "Lieu"
+
+msgctxt "Thesaurus label"
+msgid "DECV"
+msgstr "Découverte"
+
+msgctxt "Thesaurus label"
+msgid "HIST"
+msgstr "Historique"
+
+msgctxt "Thesaurus label"
+msgid "LOCA"
+msgstr "Lieu de conservation"
+
+msgctxt "Thesaurus label"
+msgid "COPY"
+msgstr "Copyright notice"
+
+msgctxt "Thesaurus label"
+msgid "PHOT"
+msgstr "Crédits photographiques"
--- a/src/jocondelab/models/contribution.py Sun Sep 15 21:02:48 2013 +0200
+++ b/src/jocondelab/models/contribution.py Mon Sep 16 10:44:50 2013 +0200
@@ -31,7 +31,7 @@
class Contribution(models.Model):
term = models.ForeignKey(ContributedTerm, blank=False, null=False, db_index=True, related_name="contributions")
- thesaurus = models.ForeignKey(Thesaurus, blank=False, null=False, db_index=True)
+ thesaurus = models.ForeignKey(Thesaurus, blank=True, null=True, db_index=True)
notice = models.ForeignKey(Notice, blank=False, null=False, db_index=True)
contribution_count = models.IntegerField(blank=False, null=False, default=0, db_index=True, editable=False)
--- a/src/jocondelab/static/jocondelab/css/front-notice.css Sun Sep 15 21:02:48 2013 +0200
+++ b/src/jocondelab/static/jocondelab/css/front-notice.css Mon Sep 16 10:44:50 2013 +0200
@@ -1,5 +1,5 @@
.notice-images {
- float: left; width: 33%; margin-top: 10px; text-align: center;
+ float: left; width: 33%; margin-top: 15px; text-align: center;
}
.notice-images li {
@@ -10,9 +10,26 @@
max-width: 100%;
}
+.notice-colright-wrapper {
+ float: left; width: 67%; margin-top: 10px;
+}
+
+.notice-colright {
+ margin-left: 20px;
+}
+
+@media screen and (max-width: 520px) {
+ .notice-images, .notice-colright {
+ width: 100%;
+ }
+}
+
+.notice-termgroup {
+ margin: 10px 0 5px; font-size: 16px; font-weight: 800;
+}
+
.notice-datasheet {
- font-size: 13px; padding-top: 10px; padding-left: 20px;
- float: left; width: 66%;
+ font-size: 13px;
}
.notice-title {
@@ -20,15 +37,19 @@
}
.notice-datasheet tr {
- line-height: 1.1em;
+ line-height: 1em;
}
.notice-datasheet th {
- width: 130px; font-weight: 700; text-align: left; padding: 5px 0;
+ width: 130px; font-weight: 700; text-align: left; padding-right: 2px;
}
-.notice-datasheet td {
- padding: 5px 0;
+.notice-datasheet th, .notice-datasheet td {
+ padding-top: 3px;
+}
+
+.notice-marginabove th, .notice-marginabove td {
+ padding-top: 10px;
}
.notice-term {
@@ -39,7 +60,7 @@
background: transparent; color: #333333; font-style: italic;
}
-.datasheet-small {
+.notice-small {
font-size: 11px;
}
@@ -47,3 +68,39 @@
font-size: 12px; line-height: 20px; height: 20px; padding: 0 4px; border: 1px solid #999999; margin-bottom: 8px;
border-radius: 4px; width: 90%;
}
+
+.notice-jocondelink {
+ margin: 10px 0; font-size: 16px; color: #0000C0;
+}
+
+.contribution-frame {
+ margin: 10px 10px 0 0; background: #ffe0c0; padding: 10px;
+}
+
+.contribution-frame h2 {
+ font-size: 18px;
+}
+
+.contribution-frame .notice-term-list {
+ font-size: 14px; line-height: 16px;
+}
+
+.contribution-vote {
+ float: right; height: 16px; width: 13px; margin-left: 3px;
+}
+
+.contribution-upvote, .contribution-downvote {
+ display: block; background: url(../img/vote-sprite.png); width: 11px; height: 6px;
+}
+
+.contribution-downvote {
+ background-position: 0 -6px; margin-top: 2px;
+}
+
+.contribution-upvote:hover {
+ background-position: -11px 0;
+}
+
+.contribution-downvote:hover {
+ background-position: -11px -6px;
+}
--- a/src/jocondelab/static/jocondelab/js/front-notice.js Sun Sep 15 21:02:48 2013 +0200
+++ b/src/jocondelab/static/jocondelab/js/front-notice.js Mon Sep 16 10:44:50 2013 +0200
@@ -242,8 +242,7 @@
notice_id: notice_id,
dbpedia_language: termdata.dbpedia_language,
dbpedia_uri: termdata.dbpedia_uri,
- translations: JSON.stringify(termdata.translations),
- thesaurus_label: $this.attr("data-thesaurus")
+ translations: JSON.stringify(termdata.translations)
},
success: function() {
$newItem.find(".term-link").text(termdata.label);
--- a/src/jocondelab/templates/jocondelab/front_base.html Sun Sep 15 21:02:48 2013 +0200
+++ b/src/jocondelab/templates/jocondelab/front_base.html Mon Sep 16 10:44:50 2013 +0200
@@ -52,7 +52,7 @@
{% endblock %}
<ul class="menu-links">
<li class="menu-link"><a href="#main-menu">{% trans 'Menu' %}</a></li>
- <li class="menu-link"><a href="#language-menu">{% trans 'Change language' %}</a></li>
+ <li class="menu-link"><a href="#language-menu">{% trans 'Changer de langue' %}</a></li>
</ul>
{% endblock %}
</header>
@@ -64,13 +64,16 @@
<div class="menus-wrapper">
<ul class="menu-list" id="main-menu">
<li class="menu-item">
- <a href="{% url 'front_search' %}">{% trans 'Multilingual search' %}</a>
+ <a href="{% url 'front_home' %}">{% trans 'Accueil' %}</a>
</li>
<li class="menu-item">
- <a href="{% url 'front_timeline' %}">{% trans 'Timeline' %}</a>
+ <a href="{% url 'front_search' %}">{% trans 'Recherche' %}</a>
</li>
<li class="menu-item">
- <a href="{% url 'front_geo' %}">{% trans 'World map' %}</a>
+ <a href="{% url 'front_timeline' %}">{% trans 'Frise chronologique' %}</a>
+ </li>
+ <li class="menu-item">
+ <a href="{% url 'front_geo' %}">{% trans 'Mappemonde' %}</a>
</li>
</ul>
<ul class="menu-list" id="language-menu">
--- a/src/jocondelab/templates/jocondelab/front_geo.html Sun Sep 15 21:02:48 2013 +0200
+++ b/src/jocondelab/templates/jocondelab/front_geo.html Mon Sep 16 10:44:50 2013 +0200
@@ -1,6 +1,5 @@
{% extends "jocondelab/front_base.html" %}
{% load i18n %}
-{% load l10n %}
{% block js_import %}
{{block.super}}
@@ -29,21 +28,21 @@
<link rel="stylesheet" type="text/css" href="{{STATIC_URL}}jocondelab/css/front-geo.css"></script>
{% endblock %}
-{% block title %}JocondeLab » {% trans 'World map' %}{% endblock %}
+{% block title %}JocondeLab » {% trans 'Mappemonde' %}{% endblock %}
-{% block breadcrumbs %}<a href="{% url 'front_geo' %}">{% trans 'World map' %}</a>{% endblock %}
+{% block breadcrumbs %}<a href="{% url 'front_geo' %}">{% trans 'Mappemonde' %}</a>{% endblock %}
{% block main %}
<div class="map-container">
<div id="map"></div>
<form class="map-search" action="#">
- <input class="map-search-input" type="search" placeholder="{% trans 'Search for a place' %}" />
+ <input class="map-search-input" type="search" placeholder="{% trans 'Rechercher un lieu' %}" />
</form>
</div>
<div class="results"></div>
<div class="loading-please-wait"><img src="{{STATIC_URL}}jocondelab/img/loader.gif" /></div>
- <p class="load-more"><a href="#">{% trans 'Show more results' %}</a></p>
+ <p class="load-more"><a href="#">{% trans 'Afficher plus de résultats' %}</a></p>
{% endblock %}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/jocondelab/templates/jocondelab/front_home.html Mon Sep 16 10:44:50 2013 +0200
@@ -0,0 +1,32 @@
+{% extends "jocondelab/front_search.html" %}
+{% load i18n %}
+
+{% block title %}JocondeLab » {% trans 'Accueil' %}{% endblock %}
+
+{% block breadcrumbs %}<a href="{% url 'front_home' %}">{% trans 'Accueil' %}</a>{% endblock %}
+
+{% block main %}
+
+ <p class="about-jl">{% trans 'Bienvenue sur JocondeLab' %}</p>
+
+ <ul class="module-list">
+ <li class="module-item">
+ <h2><a href="{% url 'front_search' %}">{% trans 'Recherche' %}</a></h2>
+ </li>
+ <li class="module-item">
+ <h2><a href="{% url 'front_timeline' %}">{% trans 'Frise chronologique' %}</a></h2>
+ </li>
+ <li class="module-item">
+ <h2><a href="{% url 'front_geo' %}">{% trans 'Mappemonde' %}</a></h2>
+ </li>
+ <li class="module-item">
+ <h2><a href="{% url 'front_search' %}">{% trans 'Liste des termes' %}</a></h2>
+ </li>
+ <li class="module-item">
+ <h2><a href="{% url 'front_search' %}">{% trans 'À propos' %}</a></h2>
+ </li>
+ </ul>
+
+ <div class="results"></div>
+{{block.super}}
+{% endblock %}
--- a/src/jocondelab/templates/jocondelab/front_notice.html Sun Sep 15 21:02:48 2013 +0200
+++ b/src/jocondelab/templates/jocondelab/front_notice.html Mon Sep 16 10:44:50 2013 +0200
@@ -33,7 +33,6 @@
{% block breadcrumbs %}<a href="{% url 'front_notice' object.id %}">{{title|truncatechars:30}}</a>{% endblock %}
{% block main %}
-
<ul class="notice-images">
{% for img in images %}
<li>
@@ -43,66 +42,68 @@
</li>
{% endfor %}
</ul>
-
- <table class="notice-datasheet">
-
- {% show_datasheet_row 'AUTR' rowclass='notice-title' %}
-
- {% show_datasheet_row 'ECOL' %}
-
- {% show_datasheet_row 'DOMN' %}
-
- {% show_datasheet_row 'TITR' rowclass='notice-title' %}
- {% show_datasheet_row 'APPL' rowclass='notice-title' %}
- {% show_datasheet_row 'DENO' rowclass='notice-title' %}
-
- {% show_datasheet_row 'REPR' %}
- {% show_datasheet_row 'SREP' %}
-
- {% show_datasheet_row 'PERI' %}
- {% show_datasheet_row 'MILL' %}
- {% show_datasheet_row 'EPOQ' %}
-
- {% show_datasheet_row 'TECH' %}
-
- {% show_datasheet_row 'DIMS' %}
-
- {% show_datasheet_row 'LIEUX' %}
-
- {% show_datasheet_row 'DECV' %}
-
- {% show_datasheet_row 'HIST' %}
-
- {% show_datasheet_row 'LOCA' %}
-
- {% show_datasheet_row 'COPY' %}
- {% show_datasheet_row 'PHOT' %}
-
- </table>
-
- <h2 style="float: left; padding: 20px 20px 0; font-size: 18px; font-weight : 800;">Contribuer</h2>
-
- <table class="notice-datasheet">
- <tr>
- <th>{% trans 'REPR' context 'Thesaurus label' %}{% trans ':' %}</th>
- <td>
- <input class="notice-contribution-field" data-thesaurus="REPR" type="text" size="60" placeholder="{% trans 'What do you see in this work?' %}" />
+ <div class="notice-colright-wrapper">
+ <div class="notice-colright">
+ <table class="notice-datasheet">
+ {% show_datasheet_row 'AUTR' row_class='notice-title' %}
+ {% show_datasheet_row 'ECOL' row_class='notice-marginabove' %}
+ {% show_datasheet_row 'DOMN' row_class='notice-marginabove' %}
+ </table>
+ <h3 class="notice-termgroup">{% trans 'Désignation' %}</h3>
+ <table class="notice-datasheet">
+ {% show_datasheet_row 'TITR' row_class='notice-title' %}
+ {% show_datasheet_row 'APPL' row_class='notice-title' %}
+ {% show_datasheet_row 'DENO' row_class='notice-title' %}
+ {% if object.repr or object.srep %}
+ </table>
+ <h3 class="notice-termgroup">{% trans 'Sujet représenté' %}</h3>
+ <table class="notice-datasheet">
+ {% show_datasheet_row 'REPR' %}
+ {% show_datasheet_row 'SREP' %}
+ {% endif %}
+ {% if object.peri or object.mill or object.epoq %}
+ </table>
+ <h3 class="notice-termgroup">{% trans 'Datation' %}</h3>
+ <table class="notice-datasheet">
+ {% show_datasheet_row 'PERI' %}
+ {% show_datasheet_row 'MILL' %}
+ {% show_datasheet_row 'EPOQ' %}
+ {% endif %}
+ {% show_datasheet_row 'TECH' row_class='notice-marginabove' %}
+ {% show_datasheet_row 'DIMS' row_class='notice-marginabove' %}
+ {% if object.lieux or object.decv %}
+ </table>
+ <h3 class="notice-termgroup">{% trans 'Provenance' %}</h3>
+ <table class="notice-datasheet">
+ {% show_datasheet_row 'LIEUX' %}
+ {% show_datasheet_row 'DECV' %}
+ {% endif %}
+ {% show_datasheet_row 'HIST' row_class='notice-marginabove' %}
+ {% show_datasheet_row 'LOCA' row_class='notice-marginabove' %}
+ {% show_datasheet_row 'COPY' row_class='notice-small notice-marginabove' %}
+ {% show_datasheet_row 'PHOT' row_class='notice-small' %}
+ </table>
+
+ <p class="notice-jocondelink">
+ <a href="{{JOCONDE_NOTICE_BASE_URL}}{{ notice.ref }}" target="_blank">{% trans 'Visiter sur le portail Joconde' %}</a>
+ </p>
+
+ <div class="contribution-frame">
+ <h2>Contribution (Folksonomie)</h2>
+ <input class="notice-contribution-field" type="text" size="60" placeholder="{% trans 'Complétez les mots-clés de la fiche' %}" />
<ul class="notice-term-list">
- {% for term in contributions.REPR %}
- <li class="notice-term term-translated"><a href="{% url 'front_search' %}?q={{term.label|urlencode}}" data-dbpedia-uri="{{term.dbpedia_uri}}">{{term.label}}</a></li>
+ {% for term in contributions %}
+ <li class="notice-term term-translated" data-contribution-id="{{term.contribution_id}}">
+ <div class="contribution-vote">
+ <a href="#" class="contribution-upvote" title="{% trans 'Votez pour ce terme' %}"></a>
+ <a href="#" class="contribution-downvote" title="{% trans 'Votez contre ce terme' %}"></a>
+ </div>
+ <a href="{% url 'front_search' %}?q={{term.label|urlencode}}" data-dbpedia-uri="{{term.dbpedia_uri}}">{{term.label}}</a>
+ </li>
{% endfor %}
</ul>
- </td>
- </tr>
- <tr>
- <th>{% trans 'SREP' context 'Thesaurus label' %}{% trans ':' %}</th>
- <td>
- <input class="notice-contribution-field" data-thesaurus="SREP" type="text" size="60" placeholder="{% trans 'Which other work is a source for this work?' %}" />
- <ul class="notice-term-list">
- {% for term in contributions.SREP %}
- <li class="notice-term term-translated"><a href="{% url 'front_search' %}?q={{term.label|urlencode}}" data-dbpedia-uri="{{term.dbpedia_uri}}">{{term.label}}</a></li>
- {% endfor %}</ul>
- </td>
- </tr>
- </table>
+ </div>
+
+ </div>
+ </div>
{% endblock %}
--- a/src/jocondelab/templates/jocondelab/front_search.html Sun Sep 15 21:02:48 2013 +0200
+++ b/src/jocondelab/templates/jocondelab/front_search.html Mon Sep 16 10:44:50 2013 +0200
@@ -15,9 +15,9 @@
<link rel="stylesheet" type="text/css" href="{{STATIC_URL}}jocondelab/css/front-search.css"></script>
{% endblock %}
-{% block title %}JocondeLab » {% trans 'Multilingual search' %}{% endblock %}
+{% block title %}JocondeLab » {% trans 'Recherche' %}{% endblock %}
-{% block breadcrumbs %}<a href="{% url 'front_search' %}">{% trans 'Multilingual search' %}</a>{% endblock %}
+{% block breadcrumbs %}<a href="{% url 'front_search' %}">{% trans 'Recherche' %}</a>{% endblock %}
{% block header_search %}{% endblock %}
@@ -40,6 +40,6 @@
{% include 'jocondelab/partial/wrapped_notice_list.html' %}
<div class="loading-please-wait"><img src="{{STATIC_URL}}jocondelab/img/loader.gif" /></div>
- <p class="load-more"><a href="#">{% trans 'Show more results' %}</a></p>
+ <p class="load-more"><a href="#">{% trans 'Afficher plus de résultats' %}</a></p>
{% endblock %}
--- a/src/jocondelab/templates/jocondelab/front_timeline.html Sun Sep 15 21:02:48 2013 +0200
+++ b/src/jocondelab/templates/jocondelab/front_timeline.html Mon Sep 16 10:44:50 2013 +0200
@@ -1,6 +1,5 @@
{% extends "jocondelab/front_base.html" %}
{% load i18n %}
-{% load l10n %}
{% block js_import %}
{{block.super}}
@@ -20,9 +19,9 @@
<link rel="stylesheet" type="text/css" href="{{STATIC_URL}}jocondelab/css/front-timeline.css"></script>
{% endblock %}
-{% block title %}JocondeLab » {% trans 'Timeline' %}{% endblock %}
+{% block title %}JocondeLab » {% trans 'Frise chronologique' %}{% endblock %}
-{% block breadcrumbs %}<a href="{% url 'front_timeline' %}">{% trans 'Timeline' %}</a>{% endblock %}
+{% block breadcrumbs %}<a href="{% url 'front_timeline' %}">{% trans 'Frise chronologique' %}</a>{% endblock %}
{% block main %}
@@ -34,6 +33,6 @@
<div class="results"></div>
<div class="loading-please-wait"><img src="{{STATIC_URL}}jocondelab/img/loader.gif" /></div>
- <p class="load-more"><a href="#">{% trans 'Show more results' %}</a></p>
+ <p class="load-more"><a href="#">{% trans 'Afficher plus de résultats' %}</a></p>
{% endblock %}
--- a/src/jocondelab/templates/jocondelab/partial/datasheet_row.html Sun Sep 15 21:02:48 2013 +0200
+++ b/src/jocondelab/templates/jocondelab/partial/datasheet_row.html Mon Sep 16 10:44:50 2013 +0200
@@ -8,7 +8,7 @@
{% for termtype, terms in linked_terms.items %}
{% for term in terms %}
<li class="notice-term term-{{termtype}}">
- <a href="{% url 'front_search' %}?q={{term.locale_label|urlencode}}" data-dbpedia-uri="{{term.dbpedia_uri}}">{{term.locale_label}}</a>
+ <a href="{% url 'front_search' %}?q={{term.label|urlencode}}" data-dbpedia-uri="{{term.dbpedia_uri}}">{{term.label}}</a>
</li>
{% endfor %}
{% endfor %}
@@ -16,7 +16,7 @@
</td>
</tr>
{% elif base_field %}
-<tr{% if rowclass %} class="{{row_class}}"{% endif %}>
+<tr{% if row_class %} class="{{row_class}}"{% endif %}>
<th>{% trans fieldname context 'Thesaurus label' %}{% trans ':' %}</th>
<td>{{base_field}}</td>
</tr>
--- a/src/jocondelab/templates/jocondelab/partial/notice_list.html Sun Sep 15 21:02:48 2013 +0200
+++ b/src/jocondelab/templates/jocondelab/partial/notice_list.html Mon Sep 16 10:44:50 2013 +0200
@@ -7,12 +7,12 @@
<img class="notice-image" alt="{{notice.imagetitle}}" src="{{ notice.image }}" />
</a>
<div class="notice-metadata">
- {% if notice.title %}<h2><a href="{% url 'front_notice' notice.id %}">{% trans 'Title:' %} <span class="notice-title">{{notice.title}}</span></a></h2>{% endif %}
- {% if not notice.title and notice.denomination %}<h2><a href="{% url 'front_notice' notice.id %}">{% trans 'Denomination:' %} <span class="notice-title">{{notice.denomination}}</span></a></h2>{% endif %}
+ {% if notice.title %}<h2><a href="{% url 'front_notice' notice.id %}">{% trans thesaurus 'TITR' 'Thesaurus label' %}{% trans ':' %} <span class="notice-title">{{notice.title}}</span></a></h2>{% endif %}
+ {% if not notice.title and notice.denomination %}<h2><a href="{% url 'front_notice' notice.id %}">{{% trans thesaurus 'DENO' 'Thesaurus label' %}{% trans ':' %} <span class="notice-title">{{notice.denomination}}</span></a></h2>{% endif %}
<ul>
{% if not notice.terms_by_thesaurus.AUTR and notice.authors %}
<li class="notice-thesaurus">
- <h3 class="notice-thesaurus-title">{% trans 'Author(s):' %}</h3>
+ <h3 class="notice-thesaurus-title">{% trans 'AUTR' context 'Thesaurus label' %}{% trans ':' %}</h3>
<ul class="notice-terms-list">
{% for author in notice.authors %}
<li class="notice-term"><a href="{% url 'front_search' %}?q={{author|urlencode}}">{{author}}</a></li>
--- a/src/jocondelab/urls.py Sun Sep 15 21:02:48 2013 +0200
+++ b/src/jocondelab/urls.py Mon Sep 16 10:44:50 2013 +0200
@@ -22,7 +22,6 @@
url(r'^admin/', include(admin.site.urls)),
url(r'^i18n/', include('django.conf.urls.i18n')),
url(r'^jsi18n/$', 'django.views.i18n.javascript_catalog', js_info_dict),
- url(r'^$', login_required(TermListView.as_view()), name='home'),
url(r'^bo/$', login_required(TermListView.as_view()), name='bo_home'),
url(r'^bo/term/list/table$', login_required(TermListTableView.as_view()), name='term_list_table'),
url(r'^bo/term/(?P<term_id>\d+)/$', login_required(TermEditView.as_view()), name='term'),
@@ -32,10 +31,12 @@
url(r'^bo/term/edition-link-level/$', login_required(TermLinkSemanticLevelEdition.as_view()), name='editon_link_semantic_level'),
url(r'^bo/term/validate/$', login_required(TermValidate.as_view()), name='validate_term'),
url(r'^bo/tree/(?P<thes_id>\d+)/$', login_required(ThesaurusTree.as_view()), name='term_tree'),
+ url(r'^$', SearchView.as_view(template_name="jocondelab/front_home.html"), name='front_home'),
url(r'^search/$', SearchView.as_view(), name='front_search'),
url(r'^geo/$', GeoView.as_view(), name='front_geo'),
url(r'^timeline/$', TemplateView.as_view(template_name="jocondelab/front_timeline.html"), name='front_timeline'),
url(r'^notice/(?P<pk>\d+)/$', NoticeView.as_view(), name='front_notice'),
+ url(r'^notice/$', NoticeView.as_view(), name='front_notice'),
url(r'^ajax/terms/$', 'jocondelab.views.ajax.terms', name='ajax_terms'),
url(r'^ajax/years/$', 'jocondelab.views.ajax.years', name='ajax_years'),
url(r'^ajax/geocoords/$', 'jocondelab.views.ajax.geo_coords', name='ajax_geo_coords'),
--- a/src/jocondelab/views/ajax.py Sun Sep 15 21:02:48 2013 +0200
+++ b/src/jocondelab/views/ajax.py Mon Sep 16 10:44:50 2013 +0200
@@ -19,7 +19,7 @@
lang = request.GET.get('lang', request.LANGUAGE_CODE)[:2]
q = request.GET.get('term', None)
count = request.GET.get('count', 20)
- qs = DbpediaFields.objects.filter(language_code=lang,label__istartswith=q).values('dbpedia_uri','label').distinct().order_by('label')[:count]
+ qs = DbpediaFields.objects.filter(language_code=lang,label__icontains=q).values('dbpedia_uri','label').distinct().order_by('label')[:count]
res = [{"dbpedia_uri": r['dbpedia_uri'], "label": r['label']} for r in qs]
return HttpResponse(content=json.dumps(res), mimetype='application/json')
@@ -91,7 +91,7 @@
q = request.GET.get('term', None)
count = request.GET.get('count', 20)
- qs = DbpediaGeo.objects.filter(term__dbpedia_fields__language_code=lang, term__dbpedia_fields__label__istartswith=q)
+ qs = DbpediaGeo.objects.filter(term__dbpedia_fields__language_code=lang, term__dbpedia_fields__label__icontains=q)
qs = qs.values('latitude','longitude','term__dbpedia_fields__label','term__dbpedia_uri')
qs = qs.annotate(sum_notices=Sum('term__nb_notice')).order_by('-sum_notices')[:count]
@@ -114,7 +114,7 @@
thesaurus_label = request.POST.get('thesaurus_label', None)
translations = json.loads(request.POST.get('translations', '[]'))
- thobj = Thesaurus.objects.get(label=thesaurus_label)
+ thobj = Thesaurus.objects.get(label=thesaurus_label) if thesaurus_label else None
notobj = Notice.objects.get(id=notice_id)
termobj, created = ContributedTerm.objects.get_or_create(dbpedia_uri=dbpedia_uri, dbpedia_language=dbpedia_language)
controbj, created = Contribution.objects.get_or_create(term=termobj, thesaurus=thobj, notice=notobj, defaults={'contribution_count': 1})
@@ -129,5 +129,22 @@
fieldsobj.label = t['label']
fieldsobj.save()
- return HttpResponse(content=json.dumps(translations), mimetype='application/json')
+ return HttpResponse(content=json.dumps({ "contribution_id": controbj.id, "contribution_count": controbj.contribution_count }), mimetype='application/json')
+
+def contribution_vote(request, grade):
+
+ contribution_id = request.POST.get('contribution_id', None)
+ controbj = ContributedTerm.objects.get(id=contribution_id)
+ controbj.contribution_count += grade
+ controbj.save()
+
+ return HttpResponse(content=json.dumps({ "contribution_id": controbj.id, "contribution_count": controbj.contribution_count }), mimetype='application/json')
+
+def upvote(request):
+
+ return contribution_vote(1)
+
+def downvote(request):
+
+ return contribution_vote(-1)
\ No newline at end of file
--- a/src/jocondelab/views/front_office.py Sun Sep 15 21:02:48 2013 +0200
+++ b/src/jocondelab/views/front_office.py Mon Sep 16 10:44:50 2013 +0200
@@ -33,13 +33,15 @@
wpp = 50
context["current_page"] = page
context["lang"] = lang
- if is_ajax and page > 1:
- self.template_name = "jocondelab/partial/notice_list.html"
- else:
- if is_ajax:
- self.template_name = "jocondelab/partial/wrapped_notice_list.html"
+
+ if self.template_name is None:
+ if is_ajax and page > 1:
+ self.template_name = "jocondelab/partial/notice_list.html"
else:
- self.template_name = "jocondelab/front_search.html"
+ if is_ajax:
+ self.template_name = "jocondelab/partial/wrapped_notice_list.html"
+ else:
+ self.template_name = "jocondelab/front_search.html"
qs = Notice.objects.filter(image=True)
if emptysearch:
@@ -65,13 +67,13 @@
context["page_count"] = paginator.num_pages
notices = []
- thesauruscache = {t.id: t.label for t in Thesaurus.objects.all()}
+ thesauruscache = {th.id: th.label for th in Thesaurus.objects.all()}
for n in ns:
terms = [{
- "locale_label": ts.term.dbpedia_fields.get(language_code=lang).label,
- "thesaurus": thesauruscache[ts.term.thesaurus_id],
- "dbpedia_uri": ts.term.dbpedia_uri
- } for ts in n.noticeterm_set.filter(term__dbpedia_fields__language_code=lang)]
+ "locale_label": t.dbpedia_fields.get(language_code=lang).label,
+ "thesaurus": thesauruscache[t.thesaurus_id],
+ "dbpedia_uri": t.dbpedia_uri
+ } for t in Term.objects.filter(noticeterm__notice=n,dbpedia_fields__language_code=lang).distinct()]
termsbythesaurus = {}
for term in terms:
if not term["thesaurus"] in termsbythesaurus:
@@ -132,14 +134,13 @@
context["title"] = self.object.titr if self.object.titr else self.object.deno
termsbythesaurus = {}
- for nt in self.object.noticeterm_set.select_related('thesaurus,term__dbpedia_fields').all():
- translated_term = nt.term.dbpedia_fields.filter(language_code = lang)
+ for nt in Term.objects.filter(noticeterm__notice=self.object).select_related('thesaurus,dbpedia_fields').distinct():
+ translated_term = nt.dbpedia_fields.filter(language_code = lang)
term = {
- "label": nt.term.label,
- "thesaurus": nt.term.thesaurus.label,
- "dbpedia_uri": nt.term.dbpedia_uri,
+ "thesaurus": nt.thesaurus.label,
+ "dbpedia_uri": nt.dbpedia_uri,
"translated": True if translated_term else False,
- "locale_label": translated_term[0].label if translated_term else nt.term.label
+ "label": translated_term[0].label if translated_term else nt.label
}
if not term["thesaurus"] in termsbythesaurus:
termsbythesaurus[term["thesaurus"]] = {
@@ -148,21 +149,24 @@
}
termsbythesaurus[term["thesaurus"]]["translated" if term["translated"] else "untranslated"].append(term)
- contributions = {}
- for ct in self.object.contribution_set.select_related('thesaurus,term__dbpedia_fields').filter(term__dbpedia_fields__language_code=lang):
- thesauruslabel = ct.thesaurus.label
- contribution = {
+ cqs = self.object.contribution_set.select_related('term__dbpedia_fields')
+ contributions = [{
"label": ct.term.dbpedia_fields.get(language_code=lang).label,
- "dbpedia_uri": ct.term.dbpedia_uri
- }
- if not thesauruslabel in contributions:
- contributions[thesauruslabel] = []
- contributions[thesauruslabel].append(contribution)
+ "dbpedia_uri": ct.term.dbpedia_uri,
+ "contribution_id": ct.id
+ } for ct in cqs.filter(thesaurus=None,term__dbpedia_fields__language_code=lang).order_by('-contribution_count')]
context["terms_by_thesaurus"] = termsbythesaurus
context["contributions"] = contributions
context['wikipedia_urls'] = json.dumps(settings.WIKIPEDIA_URLS)
+ context['JOCONDE_NOTICE_BASE_URL'] = settings.JOCONDE_NOTICE_BASE_URL
return context
-
+
+ def get_object(self):
+ if self.pk_url_kwarg in self.kwargs:
+ return super(NoticeView, self).get_object()
+ else:
+ queryset = self.get_queryset().filter(image=True, repr='')
+ return queryset.order_by('?')[0]
\ No newline at end of file