Skip to content

Commit

Permalink
#528 Enable login/logout from the docs page
Browse files Browse the repository at this point in the history
  • Loading branch information
dmcassel committed Jul 24, 2017
1 parent 80df8a9 commit bcc8154
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/apidoc/controller/rewrite.xqm
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,10 @@ declare function m:rewrite()
let $file-uri := concat('/apidoc', $PATH-WITH-VERSION)
return m:get-db-file($file-uri))

(: Login/logout code is in the DMC app, but is called through AJAX. :)
else if ($PATH eq "/login") then "/controller/login.xqy"
else if ($PATH eq "/logout") then "/controller/logout.xqy"

(: redirect /package to /pkg because we changed the prefix :)
else if ($PATH eq "/package") then m:redirect("/pkg")

Expand Down
10 changes: 9 additions & 1 deletion src/view/navigation.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,15 @@
<span class="caret"></span>
</a>
<ul class="dropdown-menu">
<li><a href="/people/profile">Edit Profile</a></li>
<li>
<a>
<xsl:attribute name="href">
<xsl:value-of select="$srv:main-server"/>
<xsl:text>/people/profile</xsl:text>
</xsl:attribute>
<xsl:text>Edit Profile</xsl:text>
</a>
</li>
<li><a href="#" id="logout">Log out</a></li>
</ul>
</li>
Expand Down

0 comments on commit bcc8154

Please sign in to comment.