-
Notifications
You must be signed in to change notification settings - Fork 0
/
std_header.vm
executable file
·78 lines (75 loc) · 3.06 KB
/
std_header.vm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<div class="visible-xs">
<form id="searchForm" method="get" action="$url.search" class="form-inline" onsubmit="return validateSearch(this)">
<input type="text" class="form-control input-sm" id="q" name="q" maxlength="255" placeholder="Search..." value="">
<button type="submit" id="search-btn" class="btn"><i class="icon-search"></i></button>
</form>
</div>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse navbar-ex1-collapse">
<ul class="nav navbar-nav">
<li><a href="$url.home">Home</a></li>
#foreach($iPage in $weblog.pages)
#if (!$iPage.hidden && $iPage.navbar && $iPage.link != "Weblog")
#set($isSelected = false)
#if ($model.weblogPage && $iPage.Id == $model.weblogPage.Id) #set($isSelected = true) #end
#if (!$isSelected)
<li><a href="$url.page($iPage.link)">$iPage.name</a></li>
#else
<li class="active"><a href="$url.page($iPage.link)">$iPage.name</a></li>
#end
#end
#end
#if ($utils.isUserAuthorizedToAuthor($weblog))
<li>
<a href="$url.createEntry">$text.get("navigationBar.newEntry")</a>
</li>
#if($utils.isUserAuthorizedToAdmin($weblog))
<li>
<a href="$url.editSettings">$text.get("navigationBar.settings")</a>
</li>
#end
<li>
<a href="$url.logout">$text.get("navigationBar.logout")</a>
</li>
#else
#if ($utils.isUserAuthenticated())
<li>
<a href="$url.logout">$text.get("navigationBar.logout")</a>
</li>
#else
<li>
<a href="$url.login">$text.get("navigationBar.login")</a>
</li>
#end
#end
</ul>
<ul class="nav navbar-nav navbar-right hidden-xs">
<li>
<form id="searchForm" method="get" action="$url.search" class="form-inline" onsubmit="return validateSearch(this)">
<input type="text" class="form-control input-sm" id="q" name="q" maxlength="255" placeholder="Search..." value=""> <button type="submit" id="search-btn" class="btn"><i class="icon-search"></i></button>
</form>
<script type="text/javascript">
function validateSearch(form) {
if (form.q.value == "") {
alert("$text.get("macro.weblog.searchalert")");
form.q.focus();
return false;
}
return true;
}
</script>
</li>
</ul>
</div><!-- /.navbar-collapse -->
</div><!-- /.container -->
</nav>