Permalink
Browse files

fix bug with basic item web page and add type attribute to auto-disco…

…very statement links

git-svn-id: http://sword-app.svn.sourceforge.net/svnroot/sword-app/sss/branches/sss-2@464 2bf6ea0f-123d-0410-b71a-f1a21eb24612
  • Loading branch information...
1 parent 24ea417 commit 526951dcc30024ca23b7e3a19213c1eb671da49e richard-jones committed Feb 7, 2012
Showing with 7 additions and 7 deletions.
  1. +7 −7 sss/repository.py
View
@@ -1222,12 +1222,12 @@ def get_item_page(self, oid):
file_frag = self._layout_files(statement)
frag = "<h1>Item: " + id + "</h1>"
- frag += "<strong>State</strong>: " + state_frag
+ frag += "<strong>State(s)</strong>: " + state_frag
frag += self._layout_sections(md_frag, file_frag)
head_frag = "<link rel=\"http://purl.org/net/sword/terms/edit\" href=\"" + self.um.edit_uri(collection, id) + "\"/>"
- head_frag += "<link rel=\"http://purl.org/net/sword/terms/statement\" href=\"" + self.um.state_uri(collection, id, "atom") + "\"/>"
- head_frag += "<link rel=\"http://purl.org/net/sword/terms/statement\" href=\"" + self.um.state_uri(collection, id, "ore") + "\"/>"
+ head_frag += "<link rel=\"http://purl.org/net/sword/terms/statement\" type=\"application/atom+xml\" href=\"" + self.um.state_uri(collection, id, "atom") + "\"/>"
+ head_frag += "<link rel=\"http://purl.org/net/sword/terms/statement\" type=\"application/rdf+xml\" href=\"" + self.um.state_uri(collection, id, "ore") + "\"/>"
return self._wrap_html("Item: " + id, frag, head_frag)
@@ -1249,10 +1249,10 @@ def _layout_files(self, statement):
return frag
def _get_state_frag(self, statement):
- if statement.in_progress:
- return statement.in_progress_uri
- else:
- return statement.archived_uri
+ frag = ""
+ for state, desc in statement.states:
+ frag += state + " (" + desc + ") "
+ return frag
def _layout_sections(self, metadata, files):
return "<table border=\"0\"><tr><td valign=\"top\">" + metadata + "</td><td valign=\"top\">" + files + "</td></tr></table>"

0 comments on commit 526951d

Please sign in to comment.