|
From: SVN c. m. f. t. SWORD-A. p. <swo...@li...> - 2012-02-07 10:54:02
|
Revision: 464
http://sword-app.svn.sourceforge.net/sword-app/?rev=464&view=rev
Author: richard-jones
Date: 2012-02-07 10:53:52 +0000 (Tue, 07 Feb 2012)
Log Message:
-----------
fix bug with basic item web page and add type attribute to auto-discovery statement links
Modified Paths:
--------------
sss/branches/sss-2/sss/repository.py
Modified: sss/branches/sss-2/sss/repository.py
===================================================================
--- sss/branches/sss-2/sss/repository.py 2012-01-26 14:18:36 UTC (rev 463)
+++ sss/branches/sss-2/sss/repository.py 2012-02-07 10:53:52 UTC (rev 464)
@@ -1222,12 +1222,12 @@
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 @@
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>"
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|