]> git.parisson.com Git - telemeta.git/commitdiff
add profile translations, add user links to revision view, begin instrument list...
authoryomguy <yomguy@parisson.com>
Tue, 29 Mar 2011 22:17:27 +0000 (00:17 +0200)
committeryomguy <yomguy@parisson.com>
Tue, 29 Mar 2011 22:17:27 +0000 (00:17 +0200)
telemeta/locale/fr/LC_MESSAGES/django.mo
telemeta/locale/fr/LC_MESSAGES/django.po
telemeta/templates/telemeta_default/admin_instruments.html
telemeta/templates/telemeta_default/home.html
telemeta/templates/telemeta_default/profile_detail.html
telemeta/templates/telemeta_default/profile_edit.html
telemeta/urls.py
telemeta/web/base.py

index 9f04b7d01900bd3d0056f947f1525e3d3120f815..b4be605cbae1de8feeb48d31c783efd0f7a7add5 100644 (file)
Binary files a/telemeta/locale/fr/LC_MESSAGES/django.mo and b/telemeta/locale/fr/LC_MESSAGES/django.mo differ
index fe0827caf4064c28fe1b091b264b8cd89f05bffd..4a97f5bfa1f515112fce8400735c26cde3f62a77 100644 (file)
@@ -870,12 +870,12 @@ msgid "Expiration date"
 msgstr "Date d'expiration"
 
 #: templates/telemeta_default/profile_detail.html:19
-msgid "Is admin"
-msgstr "Est admin"
+msgid "Is staff"
+msgstr "Statut équipe"
 
 #: templates/telemeta_default/profile_detail.html:20
 msgid "Is superuser"
-msgstr "Est superuser"
+msgstr "Statut super-utilisateur"
 
 #: templates/telemeta_default/profile_detail.html:21
 msgid "Last login"
index 13c30f5eca4d33daf60d288dd85f17068055e412..2794b7bf9227da5bda25c76cd337314e9739fbaf 100644 (file)
@@ -1,17 +1,50 @@
 {% extends "telemeta/admin.html" %}
+{% load telemeta_utils %}
+{% load i18n %}
 
-{% block tab %}
-<div class="tabs">
-{% if instruments %}
-    <ul>
+{% block tabcontents %}
+ <h4>{% trans "Instruments" %}</h4>
+
+ <form class="addnew" id="addenum" method="post"
+        action="{% url telemeta-admin-instruments %}">{% csrf_token %}
+  <fieldset>
+   <legend>{% trans "Add entry" %}</legend>
+   <div class="field">
+    <label>{% trans "Name" %}: <input type="text" name="value"></label>
+
+   </div>
+   <div class="buttons">
+    <input type="submit" name="add" value="{% trans 'Add' %}">
+   </div>
+  </fieldset>
+ </form>
+ {% if instruments %}
+ <form method="POST" action="{% url telemeta-admin-instruments %}">{% csrf_token %}
+  <table class="listing">
+   <thead>
+    <tr><th class="sel">&nbsp;</th><th>{% trans "Name"%}</th>
+
+    </tr>
+   </thead><tbody>
     {% for instrument in instruments %}
-            <li>{{ instrument|capfirst }}</li>
+    <tr>
+     <td><input type="checkbox" name="sel" value="{{instrument.id}}" /></td>
+     <td>
+        {{instrument.name}}</td>
+    </tr>
     {% endfor %}
-    </ul>
-{% else %}
-No intruments
-{% endif %}
-</div>
-{% endblock tab %}
+    </tbody>
+  </table>
+  <div class="buttons">
+   <input type="submit" name="remove" value="{% trans 'Remove selected items' %}" />
+  </div>
+ </form>
+ {% else %}
+    <p class="help">{% trans "No instruments" %}</p>
+ {% endif %}
+
+  <br style="clear: right"/>
+{% endblock %}
+
 
 
index e96b32b3135698b82a2e5438634cca7e6ebc6dbb..881911a56ae5301a01a0f9431e89c8678d1eb56d 100644 (file)
@@ -47,7 +47,7 @@
         {% endif %}
         </td>
         <td>{{ r.revision.element_type }}</td>
-        <td>{% if r.revision.user %}{{ r.revision.user.username }}{% endif %}</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 %}
index 8664ef761fceb8a5949e95f6dca5bb469b5dc3b8..83aea3b0477f3ea8944b874da89d960b67564d54 100644 (file)
@@ -28,7 +28,7 @@
       <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 admin" %}</dt><dd>{{ usr.is_staff }}</dd>
+      <dt>{% trans "Is staff" %}</dt><dd>{{ usr.is_staff }}</dd>
       <dt>{% trans "Is superuser" %}</dt><dd>{{ usr.is_superuser }}</dd>
       <dt>{% trans "Last login" %}</dt><dd>{{ usr.last_login }}</dd>
      </dl>
index d94e0f542905fc1cf7cfb0031b7c9cf9a1e5ac3f..59c40bfbc7d602319c43cfdaf66d4f544164b092 100644 (file)
@@ -17,7 +17,7 @@
         {% if not field.html_name in hidden_fields %}
         <tr>
             <tr><td class="error">{{ field.errors }}</td></tr>
-            <td>{% trans field.label_tag %}:</td><td>{{ field }}</td>
+            <td>{% trans field.label_tag %} : </td><td>{{ field }}</td>
         </tr>
         {% else %}
         <tr>
index aad6e6f23db2db82da5a92a65b48a414d0bf4565..cbeaf87e8a1ca1eac22a465d0b45a1bf964ccccd 100644 (file)
@@ -134,6 +134,9 @@ urlpatterns = patterns('',
     url(r'^admin/enumerations/$', web_view.admin_enumerations, name="telemeta-admin-enumerations"),        
     url(r'^admin/instruments/$', web_view.admin_instruments, name="telemeta-admin-instruments"),        
     
+    # instruments administration
+    url(r'^admin/instruments/(?P<instrument_id>[0-9]+)/edit/$', web_view.admin_instrument_edit, name="telemeta-admin-instruments-edit"), 
+    
     # enumerations administration
     url(r'^admin/enumerations/(?P<enumeration_id>[0-9a-z]+)/$', 
         web_view.edit_enumeration ,
index 25bd6533b027de1b8a0c71d3fb13a24fbfda8fc5..97d75dffa8240a68dbc342df8af45b6c32b4a4bd 100644 (file)
@@ -636,13 +636,15 @@ class WebView(object):
 
     @method_decorator(permission_required('sites.change_site'))
     def admin_instruments(self, request):
-        objects = Instrument.objects.all()
-        instruments = []
-        for instrument in objects:
-            instruments.append(instrument.name)
-        instruments.sort()
+        instruments = Instrument.objects.all().order_by('name')
         return render(request, 'telemeta/admin_instruments.html', {'instruments': instruments})
 
+    @method_decorator(permission_required('telemeta.change_instrument'))
+    def admin_instrument_edit(self, request, instrument_id):
+        instrument = Instrument.objects.get(pk=instrument_id)
+        vars = self.__get_admin_context_vars()
+        render(request, 'telemeta/enumeration_edit_value.html', vars)
+        
     def __get_enumeration(self, id):
         from django.db.models import get_models
         models = get_models(telemeta.models)
@@ -1038,7 +1040,6 @@ class WebView(object):
             profile = user.get_profile()
         except:
             profile = UserProfile(user=user)
-#            profile.save()
             
         if request.method == 'POST':
             user_form = UserChangeForm(request.POST, instance=user, prefix='user')