From 1efcbb4d528bb1891525484824f2bd1c41226c3e Mon Sep 17 00:00:00 2001 From: yomguy Date: Wed, 30 Mar 2011 00:17:27 +0200 Subject: [PATCH] add profile translations, add user links to revision view, begin instrument list edit --- telemeta/locale/fr/LC_MESSAGES/django.mo | Bin 11022 -> 11038 bytes telemeta/locale/fr/LC_MESSAGES/django.po | 6 +- .../telemeta_default/admin_instruments.html | 55 ++++++++++++++---- telemeta/templates/telemeta_default/home.html | 2 +- .../telemeta_default/profile_detail.html | 2 +- .../telemeta_default/profile_edit.html | 2 +- telemeta/urls.py | 3 + telemeta/web/base.py | 13 +++-- 8 files changed, 60 insertions(+), 23 deletions(-) diff --git a/telemeta/locale/fr/LC_MESSAGES/django.mo b/telemeta/locale/fr/LC_MESSAGES/django.mo index 9f04b7d01900bd3d0056f947f1525e3d3120f815..b4be605cbae1de8feeb48d31c783efd0f7a7add5 100644 GIT binary patch delta 1403 zcmXZbTS!zv9LMq5)>T(sThmOlV%KY0Dp64&25nSCR8$~IhzYH@Wu)!yLq(h?>A@6Z zLy9CSNH8qJ4Ihdk3bKSEM52A@LKhR;8Ul0jght z>}Q#J8VVdjE!>F<@c=4d2kO$rP#O23PI4J_XGWd=B&O4UgY%_E-JMU4v#2}p6BXCP zdrV`0lSe}*C`2U?od3a?I@E@1Q5D*ZO0)?zzZLarj-cMRKUV&yAoAcOn)7&z}*g=?JP4w;k`|0{Zuy-yfhhdW?$q z5*6nID$ZBbE0}Z4UX_^2IaOT8P%}?2&l;W(kN(DzExs)-*KqP$uH|yoCW8JFmq|48 z|7o(>f86bf#@gE3lP~hUzRLZvwpctCcrwx*k938N(~ZWv!Y69uu}Ehm+7=7PlivfS GS^ojlWt)%y delta 1386 zcmXZbOGs2v9LMo9%{b1aW7=qDnls}gOHokhMO0)Ifru?qv~nT3k+2peL1ot{q);Ln z3JNo_a8Xp!EUXq0643;vq!eKbp&&QaLR|EMzCZ5~uAg(x-1Gnc&*Kg?U2YnkNp*t8 zm=957LO6#${DCRBfLrhvda)*E%xc_(VQj!GY)8G{jhcVj_IpwB`!Ef!*zrMBzTud0 zmI974u!eyo=HpjX0#js6DrBP)72tBL!d18xGjTsEK^x{^7iQpjEWxX&`D3^ilc)l| z6*=z2Mf-xM*zJc=fg+fT8&Qetu?(A0342j196-Hy-S!_@pJF=WesYGidu`=%@b%y*P=wJJZ%#)E)SOio1wD@*58a zsulQA1!SRCR)|VijM|}URH1uO?>C^1<{;`UJJF9lsQDLAgyouW35mdZq=q0~- zM?(|eBiF!uLM8r(`Wn*KyJuF0T0tc$;7(M6I@C@aMjg#b)ck9hig!^7A7B7qqT(dc zQRTBV^f~=R1@v!lcOn<_=$Bw2?!YLvTF)XMj=7E6k#Xdh%>?oVn+4Qe$|-jXu0UPN z%^1Xna`s=176w#NyM3`6wIk -{% if instruments %} -
    +{% block tabcontents %} +

    {% trans "Instruments" %}

    + +
    {% csrf_token %} +
    + {% trans "Add entry" %} +
    + + +
    +
    + +
    +
    +
    + {% if instruments %} +
    {% csrf_token %} + + + + + + {% for instrument in instruments %} -
  • {{ instrument|capfirst }}
  • + + + + {% endfor %} - -{% else %} -No intruments -{% endif %} - -{% endblock tab %} + +
     {% trans "Name"%}
    + {{instrument.name}}
    +
    + +
    +
    + {% else %} +

    {% trans "No instruments" %}

    + {% endif %} + +
    +{% endblock %} + diff --git a/telemeta/templates/telemeta_default/home.html b/telemeta/templates/telemeta_default/home.html index e96b32b3..881911a5 100644 --- a/telemeta/templates/telemeta_default/home.html +++ b/telemeta/templates/telemeta_default/home.html @@ -47,7 +47,7 @@ {% endif %} {{ r.revision.element_type }} - {% if r.revision.user %}{{ r.revision.user.username }}{% endif %} + {% if r.revision.user %}{{ r.revision.user.username }}{% endif %} {% endfor %} diff --git a/telemeta/templates/telemeta_default/profile_detail.html b/telemeta/templates/telemeta_default/profile_detail.html index 8664ef76..83aea3b0 100644 --- a/telemeta/templates/telemeta_default/profile_detail.html +++ b/telemeta/templates/telemeta_default/profile_detail.html @@ -28,7 +28,7 @@
    {% trans "Telephone" %}
    {% if profile %}{{ profile.telephone }}{% endif %}
    {% trans "Expiration date" %}
    {% if profile %}{{ profile.expiration_date }}{% endif %}
    -
    {% trans "Is admin" %}
    {{ usr.is_staff }}
    +
    {% trans "Is staff" %}
    {{ usr.is_staff }}
    {% trans "Is superuser" %}
    {{ usr.is_superuser }}
    {% trans "Last login" %}
    {{ usr.last_login }}
    diff --git a/telemeta/templates/telemeta_default/profile_edit.html b/telemeta/templates/telemeta_default/profile_edit.html index d94e0f54..59c40bfb 100644 --- a/telemeta/templates/telemeta_default/profile_edit.html +++ b/telemeta/templates/telemeta_default/profile_edit.html @@ -17,7 +17,7 @@ {% if not field.html_name in hidden_fields %} {{ field.errors }} - {% trans field.label_tag %}:{{ field }} + {% trans field.label_tag %} : {{ field }} {% else %} diff --git a/telemeta/urls.py b/telemeta/urls.py index aad6e6f2..cbeaf87e 100644 --- a/telemeta/urls.py +++ b/telemeta/urls.py @@ -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[0-9]+)/edit/$', web_view.admin_instrument_edit, name="telemeta-admin-instruments-edit"), + # enumerations administration url(r'^admin/enumerations/(?P[0-9a-z]+)/$', web_view.edit_enumeration , diff --git a/telemeta/web/base.py b/telemeta/web/base.py index 25bd6533..97d75dff 100644 --- a/telemeta/web/base.py +++ b/telemeta/web/base.py @@ -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') -- 2.39.5