Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

fix #367 - display and search more columns #450

Merged
merged 1 commit into from

2 participants

@groovecoder
Collaborator

My first PR to the project ... be nice! :)

@philipn
Owner

Looks great, thanks!

@philipn philipn merged commit 2aaf6f6 into localwiki:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 20, 2013
  1. @groovecoder
This page is out of date. Refresh to see the latest.
Showing with 16 additions and 1 deletion.
  1. +16 −1 sapling/pages/admin.py
View
17 sapling/pages/admin.py
@@ -1,11 +1,26 @@
from django.contrib import admin
from guardian.admin import GuardedModelAdmin
-from models import Page
+from models import Page, PageFile
+
+
+def page_link(page):
+ """Public link to the page"""
+ link = page.get_absolute_url()
+ return ('<a target="_blank" href="%s">'
+ '<img src="/media/img/icons/link_external.png"> View</a><br/>' %
+ link)
+
+page_link.allow_tags = True
+page_link.short_description = "Public"
class PageAdmin(GuardedModelAdmin):
readonly_fields = ('name', 'content')
+ list_display = ('id', 'name', 'slug', page_link)
+ list_display_links = ('name', 'slug')
+ search_fields = ('name', 'slug')
admin.site.register(Page, PageAdmin)
+admin.site.register(PageFile, GuardedModelAdmin)
Something went wrong with that request. Please try again.