Skip to content

Commit

Permalink
Use relative links in indices
Browse files Browse the repository at this point in the history
  • Loading branch information
kthoden committed Apr 29, 2020
1 parent edce7aa commit 1ac00ca
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions eoapublications/management/commands/publicationimport.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,7 @@ def process_index_entries(self, xmlIndex, xmlElement, xmlChapter, Newelement, Ne
if xmlIndexLink.get("chapterorder") == current_chapter_order and xmlIndexLink.get('elementorder') == current_element_order:
strHtml = strHtml + "<span>" + str(intLinkNumber) + "</span> "
else:
strHtml = strHtml + "<a href='/" + Newpublication.Serie.lower() + "/" + \
Newpublication.Number + "/" + xmlIndexLink.get("chapterorder") + "/index.html#"\
strHtml = strHtml + "<a href='../" + xmlIndexLink.get("chapterorder") + "/index.html#"\
+ xmlIndexLink.get('elementorder') + "'>"
strHtml = strHtml + str(intLinkNumber)
strHtml = strHtml + "</a> "
Expand Down Expand Up @@ -213,9 +212,10 @@ def process_indexsection(self, xmlIndexsection, intObjectOrder, intIndexEntry, p
# Process Links of the main entry
intMainIndexLinkNumber = 1
for xmlIndexlink in xmlIndexEntry.findall("./EOAindexlink"):
strIndexLink = "<a href=\"/" + Newpublication.Serie.lower() + \
"/"+ publication_number \
+ "/" + xmlIndexlink.get('chapterorder') + "/index.html#" + xmlIndexlink.get('elementorder') + "\">"
# strIndexLink = "<a href=\"/" + Newpublication.Serie.lower() + \
# "/"+ publication_number \
# + "/" + xmlIndexlink.get('chapterorder') + "/index.html#" + xmlIndexlink.get('elementorder') + "\">"
strIndexLink = "<a href='./" + xmlIndexlink.get('chapterorder') + "/index.html#" + xmlIndexlink.get('elementorder') + "'>"
strIndexLink = strIndexLink + str(intMainIndexLinkNumber) + "</a> "
if xmlIndexlink.get('bold') == "True":
strIndexLink = "<strong>" + strIndexLink + "</strong>"
Expand All @@ -229,9 +229,10 @@ def process_indexsection(self, xmlIndexsection, intObjectOrder, intIndexEntry, p
strIndexHtml = strIndexHtml + "<p>" + xmlIndexSubEntry.get('secondary') + "<br/>"
intSubIndexLinkNumber = 1
for xmlIndexSublink in xmlIndexSubEntry.findall("EOAindexlink"):
strIndexSubLink = "<a href=\"/" + Newpublication.Serie.lower() + \
"/"+ publication_number \
+ "/" + xmlIndexSublink.get('chapterorder') + "/index.html#" + xmlIndexSublink.get('elementorder') + "\">"
# strIndexSubLink = "<a href=\"/" + Newpublication.Serie.lower() + \
# "/"+ publication_number \
# + "/" + xmlIndexSublink.get('chapterorder') + "/index.html#" + xmlIndexSublink.get('elementorder') + "\">"
strIndexSubLink = "<a href='./" + xmlIndexSublink.get('chapterorder') + "/index.html#" + xmlIndexSublink.get('elementorder') + "'>"
strIndexSubLink = strIndexSubLink + str(intSubIndexLinkNumber) + "</a> "
if xmlIndexSublink.get("bold") == "True":
strIndexSubLink = "<b>" + strIndexSubLink + "</b>"
Expand Down

0 comments on commit 1ac00ca

Please sign in to comment.