git-annex/templates/page.hamlet
Joey Hess 1f89712e6b add a navbar button that opens the repo in the desktop's native file browser
This should work on linux (xdg-open) and OSX (open). If the program
is not in $PATH, it falls back to opening a browser window/tab with file:///

The only tricky bit is the javascript code, that handles clicking on the
link. This is to avoid unnecessary page refreshes. Until I added the
return false at the end, the <a>'s normal click event also fired, so two
file browsers opened. I have not checked portability extensively.
2012-08-03 10:02:56 -04:00

26 lines
955 B
Text

<div .navbar .navbar-fixed-top>
<div .navbar-inner>
<div .container>
<a .brand>
git-annex
<ul .nav>
$forall (name, route, isactive) <- navbar
<li :isactive:.active>
<a href="@{route}">#{name}</a>
$maybe reldir <- relDir webapp
<ul .nav .pull-right>
<li>
<a href="@{FileBrowserR}" onclick="(function( $ ) { $.post('@{FileBrowserR}'); })( jQuery ); return false;">
<i .icon-folder-open .icon-white></i> Files
<li .dropdown #menu1>
<a .dropdown-toggle data-toggle="dropdown" href="#menu1">
Current Repository: #{reldir}
<b .caret></b>
<ul .dropdown-menu>
<li><a href="#">#{reldir}</a></li>
<li .divider></li>
<li><a href="@{AddRepositoryR}">Add another repository</a></li>
$nothing
<div .container-fluid>
<div .row-fluid>
^{content}