]> git.parisson.com Git - telemeta.git/commitdiff
Merge branch 'dev' into crem2
authorGuillaume Pellerin <yomguy@parisson.com>
Thu, 19 Dec 2013 12:46:07 +0000 (13:46 +0100)
committerGuillaume Pellerin <yomguy@parisson.com>
Thu, 19 Dec 2013 12:46:07 +0000 (13:46 +0100)
1  2 
telemeta/static/telemeta/css/telemeta.css
telemeta/urls.py
telemeta/views/core.py
telemeta/views/instrument.py

index 59bf879110a52f98f6c352c24aa016d5774ed960,bc51cea64113de6faeb879c68953157662887fde..169b12cd26b7993e83f216ec7411ec1acf4d5c61
@@@ -1285,3 -1282,32 +1285,32 @@@ input,textarea
  .related_media {
      border-top: 1px dotted #6a0307;
  }
 -}
+ #chatwindow {
+     min-height: 10em;
+     max-height: 42em;
+     border-bottom: 1px solid;
+     padding: 0.8em;
+     overflow: auto;
+     background-color: white;
+     font-size: 0.8125em;
+     -moz-border-radius: 8px 0px 8px 8px;
+      -webkit-border-radius: 8px 0px 8px 8px;
+      border-radius: 8px 0px 8px 8px;
+ }
+ .msg {
+     font-size: 0.9em;
+     }
+ .msg input {
+     -moz-border-radius: 8px 8px 8px 8px;
+      -webkit-border-radius: 8px 8px 8px 8px;
+      border-radius: 8px 8px 8px 8px;
+     }
+ .mod {
+     width: 66%;
+     float: left;
++}
Simple merge
index 0267dd01b54ff5f293772714a1eb073357a469fc,2db1b7858553bdb8141e0c9ecd0de17cd5e7ec4d..66c80546560f9f5e0ff109842df329c9c8567e75
@@@ -242,24 -217,25 +244,36 @@@ def check_related_media(medias)
              media.title = title.replace('\n', '').strip()
              media.save()
  
 -def auto_code(resources, base_code):
 -    index = 1
 -    while True:
 -        code = base_code + '_' + str(index)
 -        r = resources.filter(code=code)
 -        if not r:
 -            break
 -        index += 1
 -    return code
 +def auto_code(collection):
 +    items = collection.items.all()
 +    suffixes = []
 +
 +    if items:
 +        for item in items:
 +            if '_' in item.public_id:
 +                try:
 +                    split = item.public_id.split('_')
 +                    suffix = int(split[-1])
 +                    prefix = split[:-1]
 +                except:
 +                    suffix = 999
 +
 +                suffixes.append(suffix)
 +
 +    if suffixes:
 +        return collection.code + '_' + str(max(suffixes)+1)
 +    else:
 +        return collection.code + '_'
  
 -    
+ def get_room(content_type=None, id=None, name=None):
+     rooms = jqchat.models.Room.objects.filter(content_type=content_type,
+                                                 object_id=id)
+     if not rooms:
+         room = jqchat.models.Room.objects.create(content_type=content_type,
+                                           object_id=id,
+                                           name=name[:20])
+     else:
+         room = rooms[0]
+     return room
++    
Simple merge