← Back to team overview

widelands-dev team mailing list archive

[Merge] lp:~franku/widelands-website/changes_to_admin_wlimages into lp:widelands-website

 

kaputtnik has proposed merging lp:~franku/widelands-website/changes_to_admin_wlimages into lp:widelands-website.

Requested reviews:
  Widelands Developers (widelands-dev)

For more details, see:
https://code.launchpad.net/~franku/widelands-website/changes_to_admin_wlimages/+merge/252996

This branch sort the contents of https://wl.widelands.org/admin/wlimages/image/ and the details page for an image.

Currently you have to click on a username to get the details of an image, which is not logical. The proposed branch fixes this and make some other sortings. See the picture http://home.arcor.de/frank.ue/admin_wlimages.jpg for a comparison to the current state.
-- 
Your team Widelands Developers is requested to review the proposed merge of lp:~franku/widelands-website/changes_to_admin_wlimages into lp:widelands-website.
=== modified file 'wlimages/admin.py'
--- wlimages/admin.py	2009-03-05 17:06:08 +0000
+++ wlimages/admin.py	2015-03-15 18:12:44 +0000
@@ -15,11 +15,11 @@
 
 class ImageAdmin(admin.ModelAdmin):
     fieldsets = (
-        (None, {'fields': ('content_type', 'object_id')}),
-        (_('Content'), {'fields': ('user', 'image', 'revision', 'name')}),
-        (_('Meta'), {'fields': ('date_submitted', 'editor_ip')}),
+        (None, {'fields': ( ('image', 'name'), 'date_submitted', 'url','revision')}),
+        (_('Upload data:'), { 'fields': ( 'user', 'editor_ip')}),
+        (_('Content object:'), { 'fields': ( 'content_type', 'object_id' )}),
     )
-    list_display = ('user', 'date_submitted', 'content_type', 'get_content_object', '__unicode__')
+    list_display = ( '__unicode__', 'date_submitted', 'content_type', 'user')
     list_filter = ('date_submitted',)
     date_hierarchy = 'date_submitted'
     search_fields = ('image', 'user__username')

=== modified file 'wlimages/models.py'
--- wlimages/models.py	2015-02-18 22:30:08 +0000
+++ wlimages/models.py	2015-03-15 18:12:44 +0000
@@ -60,7 +60,7 @@
     """
     # Generic Foreign Key Fields
     content_type = models.ForeignKey(ContentType)
-    object_id = models.PositiveIntegerField(_('object ID'))
+    object_id = models.PositiveIntegerField()
     content_object = generic.GenericForeignKey()
     
     name = models.CharField(max_length=100)
@@ -79,7 +79,7 @@
     objects = ImageManager()
    
     def __unicode__(self):
-        return "Image:%s" % self.name
+        return self.name
 
     def get_content_object(self):
         """


Follow ups