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

Proposed by kaputtnik
Status: Merged
Merged at revision: 387
Proposed branch: lp:~franku/widelands-website/changes_to_admin_wlimages
Merge into: lp:widelands-website
Diff against target: 41 lines (+6/-6)
2 files modified
wlimages/admin.py (+4/-4)
wlimages/models.py (+2/-2)
To merge this branch: bzr merge lp:~franku/widelands-website/changes_to_admin_wlimages
Reviewer Review Type Date Requested Status
SirVer Approve
Review via email: mp+252996@code.launchpad.net

Description of the change

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.

To post a comment you must log in.
Revision history for this message
SirVer (sirver) wrote :

You, Sir, are awesome! Thanks.

review: Approve
Revision history for this message
kaputtnik (franku) wrote :

The merge has no effect on https://wl.widelands.org/admin/wlimages/image/ :-O Pressing F5 doesn't show the changes too...

Revision history for this message
SirVer (sirver) wrote :

I might have forgotten to restart the website. Could you try again now?

Revision history for this message
kaputtnik (franku) wrote :

All fine now :-) Thanks

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'wlimages/admin.py'
2--- wlimages/admin.py 2009-03-05 17:06:08 +0000
3+++ wlimages/admin.py 2015-03-15 18:12:44 +0000
4@@ -15,11 +15,11 @@
5
6 class ImageAdmin(admin.ModelAdmin):
7 fieldsets = (
8- (None, {'fields': ('content_type', 'object_id')}),
9- (_('Content'), {'fields': ('user', 'image', 'revision', 'name')}),
10- (_('Meta'), {'fields': ('date_submitted', 'editor_ip')}),
11+ (None, {'fields': ( ('image', 'name'), 'date_submitted', 'url','revision')}),
12+ (_('Upload data:'), { 'fields': ( 'user', 'editor_ip')}),
13+ (_('Content object:'), { 'fields': ( 'content_type', 'object_id' )}),
14 )
15- list_display = ('user', 'date_submitted', 'content_type', 'get_content_object', '__unicode__')
16+ list_display = ( '__unicode__', 'date_submitted', 'content_type', 'user')
17 list_filter = ('date_submitted',)
18 date_hierarchy = 'date_submitted'
19 search_fields = ('image', 'user__username')
20
21=== modified file 'wlimages/models.py'
22--- wlimages/models.py 2015-02-18 22:30:08 +0000
23+++ wlimages/models.py 2015-03-15 18:12:44 +0000
24@@ -60,7 +60,7 @@
25 """
26 # Generic Foreign Key Fields
27 content_type = models.ForeignKey(ContentType)
28- object_id = models.PositiveIntegerField(_('object ID'))
29+ object_id = models.PositiveIntegerField()
30 content_object = generic.GenericForeignKey()
31
32 name = models.CharField(max_length=100)
33@@ -79,7 +79,7 @@
34 objects = ImageManager()
35
36 def __unicode__(self):
37- return "Image:%s" % self.name
38+ return self.name
39
40 def get_content_object(self):
41 """

Subscribers

People subscribed via source and target branches