File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11from django .core .urlresolvers import reverse as urlreverse
22from django .contrib import admin
3+ from django .utils .safestring import mark_safe
4+
35from ietf .submit .models import *
46
57class IdSubmissionStatusAdmin (admin .ModelAdmin ):
@@ -19,6 +21,13 @@ def status_link(self, instance):
1921 return '<a href="%s">%s</a>' % (url , instance .status )
2022 status_link .allow_tags = True
2123
24+ def draft_link (self , instance ):
25+ if instance .status_id in (- 1 , - 2 ):
26+ return '<a href="http://www.ietf.org/id/%s-%s.txt">%s</a>' % (instance .filename , instance .revision , instance .filename )
27+ else :
28+ return instance .filename
29+ draft_link .allow_tags = True
30+
2231admin .site .register (IdSubmissionDetail , IdSubmissionDetailAdmin )
2332
2433class PreapprovalAdmin (admin .ModelAdmin ):
Original file line number Diff line number Diff line change @@ -57,15 +57,6 @@ def get_hash(self):
5757 self .create_hash ()
5858 self .save ()
5959 return self .submission_hash
60- def draft_link (self ):
61- if self .status_id == - 1 :
62- return '<a href="http://www.ietf.org/id/%s-%s.txt">%s</a>' % (self .filename , self .revision , self .filename )
63- else :
64- return self .filename
65- draft_link .allow_tags = True
66- def status_link (self ):
67- return '<a href="http://datatracker.ietf.org/submit/status/%s/%s/">%s</a>' % (self .submission_id , self .submission_hash , self .status )
68- status_link .allow_tags = True
6960
7061def create_submission_hash (sender , instance , ** kwargs ):
7162 instance .create_hash ()
You can’t perform that action at this time.
0 commit comments