diff options
-rw-r--r-- | ishtar/furnitures/models.py | 17 | ||||
-rw-r--r-- | ishtar/furnitures/views.py | 2 | ||||
-rw-r--r-- | static/media/style.css | 2 |
3 files changed, 13 insertions, 8 deletions
diff --git a/ishtar/furnitures/models.py b/ishtar/furnitures/models.py index 5613e6942..0c03463fe 100644 --- a/ishtar/furnitures/models.py +++ b/ishtar/furnitures/models.py @@ -187,7 +187,12 @@ class Person(Address, OwnPerms) : ) def __unicode__(self): - return u"%s %s - %s" % (self.name, self.surname, self.email) + lbl = u"%s %s - " % (self.name, self.surname) + if self.attached_to: + lbl += unicode(self.attached_to) + else: + lbl += self.email + return lbl class IshtarUser(models.Model): user = models.ForeignKey(User, unique=True, related_name='profile', @@ -263,10 +268,12 @@ class File(BaseHistorizedItem, OwnPerms): ("delete_own_file", ugettext(u"Can delete own Archaelogical file")), ) def __unicode__(self): - items = [unicode(getattr(self, k)) for k in ['internal_reference'] + items = [_('Intercommunal')] + if self.towns.count() == 1: + items[0] = unicode(self.towns.all()[0]) + items += [unicode(getattr(self, k))[:12] for k in ['year', + 'numeric_reference', 'internal_reference',] if getattr(self, k)] - if self.year and self.numeric_reference: - items = [u'%d-%d' % (self.year, self.numeric_reference)] + items return u" - ".join(items) @classmethod @@ -606,8 +613,6 @@ class Town(models.Model): verbose_name_plural = _(u"Towns") def __unicode__(self): - if settings.COUNTRY == 'fr': - return u"%s (%s)" % (self.name, unicode(self.canton)) return self.name class TreatmentType(GeneralType): diff --git a/ishtar/furnitures/views.py b/ishtar/furnitures/views.py index 00773bc42..530984092 100644 --- a/ishtar/furnitures/views.py +++ b/ishtar/furnitures/views.py @@ -81,7 +81,7 @@ def autocomplete_person(request, person_type=None): limit = 15 persons = models.Person.objects.filter(query)[:limit] data = json.dumps([{'id':person.pk, 'value':unicode(person)} - for person in persons]) + for person in persons if person]) return HttpResponse(data, mimetype='text/plain') def autocomplete_town(request): diff --git a/static/media/style.css b/static/media/style.css index 221fddebb..0464b53aa 100644 --- a/static/media/style.css +++ b/static/media/style.css @@ -106,7 +106,7 @@ div#main_menu > ul{ div#context_menu fieldset{ right:20px;; position:absolute; - width:380px; + width:420px; background-color:#EEE; border:2px solid #CCC; -moz-border-radius:8px; |