]> git.parisson.com Git - teleforma.git/commitdiff
fix profile view
authoryomguy <yomguy@parisson.com>
Thu, 12 Apr 2012 13:39:33 +0000 (15:39 +0200)
committeryomguy <yomguy@parisson.com>
Thu, 12 Apr 2012 13:39:33 +0000 (15:39 +0200)
teleforma/htdocs/css/teleforma_black.css
teleforma/templates/teleforma/inc/conference_list.html
teleforma/templates/teleforma/inc/document_list.html
teleforma/templates/teleforma/inc/media_list.html
teleforma/templates/telemeta/base.html
teleforma/templates/telemeta/inc/module_revisions.html [new file with mode: 0644]
teleforma/templates/telemeta/inc/module_searches.html [new file with mode: 0644]
teleforma/templates/telemeta/inc/module_user_revisions.html [new file with mode: 0644]
teleforma/templates/telemeta/profile_detail.html [new file with mode: 0644]
teleforma/templates/telemeta/search_criteria.html [new file with mode: 0644]

index cfdee9e2abe57ed1902766e30452d81f75326a1b..02f888294e67959b89ebf8f791477c2e2e9aa650 100644 (file)
@@ -385,11 +385,10 @@ form.login .submit {
     margin: 15px 0;
 }
 #searchform fieldset {
-    padding: 0;
-    padding: .5em;
+    background-color: #FFF;
+    padding: .8em;
     width: 650px;
     border: none;
-    border: 1px solid #000000;
     margin-bottom: 1em;
     -moz-border-radius: 8px 0px 8px 8px;
     -webkit-border-radius: 8px 0px 8px 8px;
@@ -697,7 +696,9 @@ dl.dublincore dd.caption {
 
 /* infos item/collection */
 .infos, .extraInfos {
+
     margin-bottom: 15px;
+    padding: 0.8em;
 }
 
 .infos dl, .infos table {
@@ -1169,6 +1170,12 @@ a.image-link {
     padding:0.8em 0.8em 0.8em 0.8em;
    }
 
+#action_yellow {
+    background-color: #f3ad17;
+    color: #FFF;
+    padding:0.8em 0.8em 0.8em 0.8em;
+   }
+
 
 .list_item, .list_item:visited, .list_item:hover{
     display:block;
@@ -1406,12 +1413,18 @@ input,textarea{
     -moz-border-radius: 8px 0px 8px 8px;
     -webkit-border-radius: 8px 0px 8px 8px;
     border-radius: 8px 0px 8px 8px;
-    padding: 0em 0em 0.1em 0em;
+    padding: 0em 0em 0em 0em;
+    margin-top: 0.8em;
 }
 
 
 .course_content h2 {
-    padding: 0.5em 0.8em 0em 0.8em;
+    padding: 0.5em 0.8em 0.8em 0.8em;
+    }
+
+.course_content h3 {
+    padding: 0.5em 0.8em 0.8em 0.8em;
+    margin-top: 0.8em;
     }
 
 .course_media {
index f3f840c1fa5fe22e7de48eee174b6e1d1762c91a..62e2bf2bd00e1c0c92c2128462ea9a14e5fc3c45 100644 (file)
@@ -2,7 +2,7 @@
 
 {% if course.conference.all %}
 <div class="course_content">
-    <h2><img src="{% url telemeta-images "item_title.png" %}" style="vertical-align:middle" /> {% trans "Conferences"%}</h2>
+    <h3><img src="{% url telemeta-images "item_title.png" %}" style="vertical-align:middle" /> {% trans "Conferences"%}</h3>
     <table class="listing" width="100%">
     <thead>
         <tr>
index 971667d37c17b0ffba1c176ecef0d79ccc9f488f..3a289a18414534db3cfdfa2fb53a9449cb18920b 100644 (file)
@@ -2,7 +2,7 @@
 
 {% if course.document.all %}
 <div class="course_content">
-<h2><img src="{% url telemeta-images "item_title.png" %}" style="vertical-align:middle" /> {% trans "Documents"%}</h2>
+<h3><img src="{% url telemeta-images "item_title.png" %}" style="vertical-align:middle" /> {% trans "Documents"%}</h3>
 <table class="listing" width="100%">
     <thead>
         <tr>
index 35cd4cc7e44b90d875fba3c3309843e5c1ba1fba..d3f4a993d35f1e02d2e57bc61485c7f002d4a5e9 100644 (file)
@@ -2,7 +2,7 @@
 
 {% if course.media.all %}
 <div class="course_content">
-    <h2><img src="{% url telemeta-images "item_title.png" %}" style="vertical-align:middle" /> {% trans "Medias"%}</h2>
+    <h3><img src="{% url telemeta-images "item_title.png" %}" style="vertical-align:middle" /> {% trans "Medias"%}</h3>
     <table class="listing" width="100%">
     <thead>
         <tr>
index 4511e7f5a7cec0754d82495faf7d768b01cfb8ac..9c6846919b99b59e3f7a4c8d058f7a511c46125a 100644 (file)
@@ -96,7 +96,7 @@ alt="Telemeta Powered"/>-->
  </li>
  {% endif %}
 
- <li><a href="#profil#" class="blue"><img src="{% url telemeta-images "user_tr.png" %}" alt="user" style="vertical-align:middle" width="13px" />{% if user.first_name and user.last_name %}
+ <li><a href="#accounts#" class="blue"><img src="{% url telemeta-images "user_tr.png" %}" alt="user" style="vertical-align:middle" width="13px" />{% if user.first_name and user.last_name %}
  {{ user.first_name }} {{ user.last_name }}
  {% else %}
  {{ user.username }}
diff --git a/teleforma/templates/telemeta/inc/module_revisions.html b/teleforma/templates/telemeta/inc/module_revisions.html
new file mode 100644 (file)
index 0000000..2f3c81c
--- /dev/null
@@ -0,0 +1,49 @@
+{% load telemeta_utils %}
+{% load i18n %}
+
+   <div class="module">
+
+    {% block rss_title %}
+      <a href="{% url telemeta-rss %}">
+      <img src="{% url telemeta-images "rss.png" %}" alt="rss" style="vertical-align:middle" />
+      <h3>{% trans title %}</h3></a>
+      <a href="{% url telemeta-rss %}" style="float:right" class="icon_rss">&nbsp;&nbsp;</a>
+    {% endblock rss_title %}
+
+    <div class="vscroll">
+    <table class="listing" bgcolor="#FFFFFF" style="width: 100%">
+      <tr>
+        <th class="highlight">{% trans "Date" %}</th>
+        <th>{% trans "Title" %}</th>
+        <th>{% trans "Type" %}</th>
+        <th>{% trans "User" %}</th>
+      </tr>
+    {% for r in revisions %}
+     <tr {% if not forloop.counter0|divisibleby:"2" %}class="odd"{% endif %}>
+        <td>{{ r.revision.time }}</td>
+        <td>
+        {% if r.element %}
+            {% if r.revision.element_type == "corpus" or r.revision.element_type == "fonds"%}
+            <a href="{% url telemeta-resource-detail r.revision.element_type r.element.public_id %}">{{ r.element.title }}</a>
+            {% endif %}
+            {% if r.revision.element_type == "collection" %}
+            <a href="{% url telemeta-collection-detail r.element.public_id %}">{{ r.element.title }}</a>
+            {% endif %}
+            {% if r.revision.element_type == "item" %}
+            <a href="{% url telemeta-item-detail r.element.public_id %}">
+            {% if r.element.title != '' %}{{ r.element.title }}{% else %}{{ r.element.collection.title }} - {{ r.element.track }}{% endif %}</a>
+            {% endif %}
+            {% if r.revision.element_type == "marker" %}
+            <a href="{% url telemeta-item-detail-marker r.element.public_id %}">{{ r.element.title }}</a>
+            {% endif %}
+        {% else %}
+            {% trans "deleted" %}
+        {% endif %}
+        </td>
+        <td>{{ r.revision.element_type }}</td>
+        <td>{% if r.revision.user %}<a href="{% url telemeta-profile-detail r.revision.user.username %}">{{ r.revision.user.username }}</a>{% endif %}</td>
+      </tr>
+    {% endfor %}
+    </table>
+    </div>
+   </div>
\ No newline at end of file
diff --git a/teleforma/templates/telemeta/inc/module_searches.html b/teleforma/templates/telemeta/inc/module_searches.html
new file mode 100644 (file)
index 0000000..b389647
--- /dev/null
@@ -0,0 +1,27 @@
+{% load telemeta_utils %}
+{% load i18n %}
+
+   <div class="module">
+    <h3>
+      <img src="{% url telemeta-images "search_wh2.png" %}" alt="rss" style="vertical-align:middle" />
+      {% trans title %}</h3>
+
+    <div class="vscroll">
+    <table class="listing" bgcolor="#FFFFFF" style="width: 100%">
+      <tr>
+        <th>{% trans "Criteria" %}</th>
+      </tr>
+    {% for s in searches %}
+     <tr {% if not forloop.counter0|divisibleby:"2" %}class="odd"{% endif %}>
+        <td><a href="{% url telemeta-search-items %}?{{s.criteria.all|build_pattern_string|build_query_string}}">
+            {% for c in s.criteria.all %}
+                <li>{% trans c.key %} : {{ c.value}}</li>
+            {% endfor %}
+          </a>
+        </td>
+      </tr>
+    {% endfor %}
+    </table>
+    </div>
+   </div>
+
diff --git a/teleforma/templates/telemeta/inc/module_user_revisions.html b/teleforma/templates/telemeta/inc/module_user_revisions.html
new file mode 100644 (file)
index 0000000..9c01705
--- /dev/null
@@ -0,0 +1,11 @@
+{% extends "telemeta/inc/module_revisions.html" %}
+{% load telemeta_utils %}
+{% load i18n %}
+
+{% block rss_title %}
+<a href="{% url telemeta-user-rss user.username %}">
+<img src="{% url telemeta-images "rss.png" %}" alt="rss" style="vertical-align:middle" />
+<h3>{% trans title %}</h3></a>
+<a href="{% url telemeta-user-rss user.username %}" style="float:right" class="icon_rss">&nbsp;&nbsp;</a>
+{% endblock rss_title %}
+
diff --git a/teleforma/templates/telemeta/profile_detail.html b/teleforma/templates/telemeta/profile_detail.html
new file mode 100644 (file)
index 0000000..90dba8a
--- /dev/null
@@ -0,0 +1,84 @@
+{% extends "telemeta/base.html" %}
+{% load i18n %}
+{% load telemeta_utils %}
+
+{% block head_title %}{% trans "User Profile" %} : {{ usr.username }}{% endblock %}
+
+{% block title %}
+{% endblock %}
+
+{% block content %}
+  <div id="module-set-left" style="width: 25%">
+  {% block modules %}
+
+    {% block module_user_revisions %}
+    {% with user_revisions as revisions and "My last changes" as title %}
+    {% include "telemeta/inc/module_user_revisions.html" %}
+    {% endwith %}
+    {% endblock %}
+
+  {% endblock %}
+
+  {% if user.is_authenticated and user.username == usr.username or user.is_staff %}
+   <div class="module_action">
+    <a href="{% url telemeta-profile-edit usr.username %}" class="component_icon button" id="action_blue">{% trans "Edit" %}</a>
+   </div>
+  {%  endif %}
+
+ </div>
+
+<div class="desk_media">
+<div class="course">
+
+    <h1>{% trans "User profile" %} : {{ usr.username }}
+    </h1>
+
+    {% if user.is_authenticated and user.username == usr.username %}
+    <div id="password" style="float: right;">
+    <a href="{% url telemeta-password-change %}" class="component_icon button icon_login">{% trans "Change password" %}</a>
+    </div>
+    {%  endif %}
+
+   <div class="course_content">
+
+   <div class="infos" style="width: 55%">
+     <dl class="listing">
+      <dt>{% trans "First Name" %}</dt><dd>{{ usr.first_name }}</dd>
+      <dt>{% trans "Last Name" %}</dt><dd>{{ usr.last_name }}</dd>
+      <dt>{% trans "Email" %}</dt><dd>{{ usr.email }}</dd>
+
+      <dt>{% trans "Institution" %}</dt><dd>{% if profile %}{{ profile.institution }}{% endif %}</dd>
+      <dt>{% trans "Department" %}</dt><dd>{% if profile %}{{ profile.department }}{% endif %}</dd>
+      <dt>{% trans "Function" %}</dt><dd>{% if profile %}{{ profile.function }}{% endif %}</dd>
+      <dt>{% trans "Attachment" %}</dt><dd>{% if profile %}{{ profile.attachment }}{% endif %}</dd>
+      <dt>{% trans "Address" %}</dt><dd>{% if profile %}{{ profile.address }}{% endif %}</dd>
+      <dt>{% trans "Telephone" %}</dt><dd>{% if profile %}{{ profile.telephone }}{% endif %}</dd>
+      <dt>{% trans "Expiration date" %}</dt><dd>{% if profile %}{{ profile.expiration_date }}{% endif %}</dd>
+
+      <dt>{% trans "Is staff" %}</dt><dd>{{ usr.is_staff }}</dd>
+      <dt>{% trans "Is superuser" %}</dt><dd>{{ usr.is_superuser }}</dd>
+      <dt>{% blocktrans count user.groups.all.count as counter %}Group{% plural %}Groups{% endblocktrans %}</dt><dd>{% for group in usr.groups.all %}{{ group }} {% endfor %}</dd>
+      <dt>{% trans "Last login" %}</dt><dd>{{ usr.last_login }}</dd>
+      {% if user.is_authenticated and user.username == usr.username %}
+      <dt>{% trans "Language" %}</dt><dd><form id="setlang" action="/i18n/setlang/" method="post">{% csrf_token %}
+        <input name="next" type="hidden" value="" />
+          <select name="language">
+            {% for lang in LANGUAGES %}
+             <option {% if lang.0 == LANGUAGE_CODE %}selected{% endif %} value="{{ lang.0 }}">{{ lang.1 }}</option>
+            {% endfor %}
+          </select><br /><br />
+          <a href="#" class="component_icon button icon_ok"
+            onclick="document.getElementById('setlang').submit(); return false;">{% trans "Apply" %}</a>
+         </form>
+        </dd>
+      {%  endif %}
+     </dl>
+    </div>
+
+  </div>
+
+
+</div>
+</div>
+{% endblock content %}
+
diff --git a/teleforma/templates/telemeta/search_criteria.html b/teleforma/templates/telemeta/search_criteria.html
new file mode 100644 (file)
index 0000000..d560631
--- /dev/null
@@ -0,0 +1,156 @@
+{% extends "telemeta/base.html" %}
+{% load telemeta_utils %}
+{% load i18n %}
+
+{% block head_title %}{% trans "Advanced Search" %} - {{ block.super }}{% endblock %}
+
+{% block stylesheets %}
+{{ block.super }}
+<link rel="stylesheet" type="text/css" href="{% url telemeta-css "jquery.autocomplete.css" %}" />
+{% endblock %}
+
+{% block extra_javascript %}
+<script src="{% url telemeta-js "jquery.bgiframe.js" %}" type="text/javascript"></script>
+<script src="{% url telemeta-js "jquery.autocomplete.js" %}" type="text/javascript"></script>
+<script type="text/javascript">
+function update_period(source, from_field, to_field) {
+    var from_year = $(from_field);
+    var to_year = $(to_field);
+
+    if (from_year.val() == "0") {
+        to_year.attr('disabled', '1');
+        to_year.val('0');
+    } else {
+        to_year.removeAttr('disabled');
+        if ($(source).is(to_field)) {
+            if (parseInt(from_year.val()) > parseInt(to_year.val()))
+                from_year.val(to_year.val());
+        } else if (parseInt(from_year.val()) > parseInt(to_year.val())) {
+            to_year.val(from_year.val());
+        }
+    }
+}
+
+$(document).ready(function () {
+    $('#location').autocomplete('{% url telemeta-complete-location %}', {
+        max: 20,
+        formatResult: function(data) {
+            return data[0].replace(/ *\([0-9]+.*\) *$/, '');
+        }
+    });
+    update_period('#rec_year_from', '#rec_year_to');
+    $('#rec_year_from, #rec_year_to').change(function () {
+        update_period(this, '#rec_year_from', '#rec_year_to');
+    });
+    update_period('#pub_year_from', '#pub_year_to');
+    $('#pub_year_from, #pub_year_to').change(function () {
+        update_period(this, '#pub_year_from', '#pub_year_to');
+    });
+});
+
+</script>
+{% endblock %}
+
+{% block title %}
+{% endblock %}
+
+{% block content %}
+
+<div id="module-set-left" style="width: 20%">
+
+    {% block module_searches %}
+    {% with searches as searches and "My searches" as title %}
+    {% include "telemeta/inc/module_searches.html" %}
+    {% endwith %}
+    {% endblock %}
+
+    <div class="module_action">
+    <a href="#" class="component_icon button" id="action_yellow"
+      onclick="document.getElementById('searchform').submit(); return false;">{% trans 'Search' %}</a>
+    </div>
+</div>
+
+<div class="desk_course">
+<div class="course">
+<h1>{% trans "Advanced Search" %}</h1>
+<form action="{% url telemeta-search %}" id="searchform">{% csrf_token %}
+<fieldset>
+
+    <p>
+    <label for="location">{% field_label "Location" %}</label>
+    <input type="text" name="location" id="location" value="{{ criteria.location }}" />
+    </p>
+
+    <p>
+    <label for="ethnic_group">{% field_label "EthnicGroup" %}</label>
+    <select id="ethnic_group" name="ethnic_group">
+        <option value="">All ethnic groups</option>
+    {% for group in ethnic_groups %}
+        <option value="{{group.id}}" {% ifequal criteria.ethnic_group.id group.id %}selected {% endifequal %}>{{group|escape}}</option>
+    {% endfor %}
+    </select>
+    </p>
+
+    <p>
+    <label for="title">{% trans "Title" %}</label>
+    <input type="text" id="title" name="title" />
+    </p>
+
+    <p>
+    <label for="creator">{% field_label "MediaCollection" "creator" %}</label>
+    <input type="text" id="creator" name="creator" />
+    </p>
+
+    <p>
+    <label for="collector">{% field_label "MediaCollection" "collector" %}</label>
+    <input type="text" id="collector" name="collector" />
+    </p>
+
+    {% if rec_years %}
+    <p>
+    <label for="rec_date_from">{% trans "Year of recording" %}</label>
+    <select id="rec_year_from" name="rec_year_from" class="tiny">
+        <option value="0"></option>
+        {% for year in rec_years %}
+        <option value="{{ year }}" {% ifequal criteria.rec_year_from year %}selected {% endifequal %}>{{year}}</option>
+        {% endfor %}
+    </select>
+    {% trans "to" %}
+    <select id="rec_year_to" name="rec_year_to" class="tiny">
+        <option value="0"></option>
+        {% for year in rec_years %}
+        <option value="{{ year }}" {% ifequal criteria.rec_year_to year %}selected {% endifequal %}>{{year}}</option>
+        {% endfor %}
+    </select>
+    </p>
+    {% endif %}
+
+    {% if pub_years %}
+    <p>
+    <label for="pub_date_from">{% trans "Year of publication" %}</label>
+    <select id="pub_year_from" name="pub_year_from" class="tiny">
+        <option value="0"></option>
+        {% for year in pub_years %}
+        <option value="{{ year }}" {% ifequal criteria.pub_year_from year %}selected {% endifequal %}>{{year}}</option>
+        {% endfor %}
+    </select>
+    {% trans "to" %}
+    <select id="pub_year_to" name="pub_year_to" class="tiny">
+        <option value="0"></option>
+        {% for year in pub_years %}
+        <option value="{{ year }}" {% ifequal criteria.pub_year_to year %}selected {% endifequal %}>{{year}}</option>
+        {% endfor %}
+    </select>
+    </p>
+    {% endif %}
+
+    <p><label for="sound">{% trans "Sound" %}</label>
+    <input type="checkbox" name="sound" value="True" align="left" />
+    </p>
+
+</fieldset>
+
+</form>
+</div>
+</div>
+{% endblock %}