Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Synchronet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Main
Synchronet
Commits
e36b0b8c
Commit
e36b0b8c
authored
5 years ago
by
echicken
Browse files
Options
Downloads
Patches
Plain Diff
Format and names of things.
parent
1600535c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
web/components/.examples/navbar.xjs
+26
-38
26 additions, 38 deletions
web/components/.examples/navbar.xjs
with
26 additions
and
38 deletions
web/components/.examples/navbar.xjs
+
26
−
38
View file @
e36b0b8c
<?xjs function
_
subMenu(obj, title, path) { ?>
<?xjs function subMenu(obj, title, path) { ?>
<li class="dropdown<?xjs if (path.match(/\//g).length > 1) write('-submenu'); ?>">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
<?
xjs
write(title.replace(/^.*\-/, '')); ?>
<? write(title.replace(/^.*\-/, '')); ?>
<span class="caret"></span>
</a>
<ul class="dropdown-menu">
<?xjs
_
menu(obj.list, path); ?>
<?xjs menu(obj.list, path); ?>
</ul>
</li>
<?xjs } ?>
<?xjs
function
_
menu(obj, path) {
function menu(obj, path) {
Object.keys(obj).forEach(function (e) {
if (obj[e].type == 'list') {
_
subMenu(obj[e], e, (path || '') + e + '/');
subMenu(obj[e], e, (path || '') + e + '/');
} else {
?>
<li>
<?xjs if (obj[e].type == 'link') { ?>
<a class="dropdown-item" href="./?page=<?xjs write(obj[e].page); ?>" target="_blank">
<?xjs } else { ?>
<a class="dropdown-item" href="./?page=<?xjs write((path || '') + obj[e].page); ?>">
<?xjs } ?>
<? write(e); ?>
</a>
<?xjs if (obj[e].type == 'link') { ?>
<a class="dropdown-item" href="./?page=<?xjs write(obj[e].page); ?>" target="_blank">
<?xjs } else { ?>
<a class="dropdown-item" href="./?page=<?xjs write((path || '') + obj[e].page); ?>">
<?xjs } ?>
<? write(e); ?>
</a>
</li>
<?xjs
<?xjs
}
});
}
...
...
@@ -36,67 +36,55 @@
<div class="container<?xjs if (settings.layout_full_width) write('-fluid'); ?>">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">
<?xjs write(locale.strings.main.label_sidebar); ?>
</span>
<span class="sr-only"><? write(locale.strings.main.label_sidebar); ?></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="./">
<?xjs write(settings.brand || system.name); ?>
</a>
<a class="navbar-brand" href="./"><? write(settings.brand || system.name); ?></a>
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<?xjs
_
menu(getPageList(settings.web_pages)); ?>
<?xjs menu(getPageList(settings.web_pages)); ?>
</ul>
<ul class="nav navbar-nav navbar-right">
<?xjs if (user.alias === settings.guest || user.number < 1) { ?>
<?xjs if (settings.user_registration) { ?>
<li>
<a href="./?page=000-register.xjs">
<?xjs write(locale.strings.main.menu_item_register); ?>
</a>
<a href="./?page=000-register.xjs"><? write(locale.strings.main.menu_item_register); ?></a>
</li>
<?xjs } ?>
<li class="nav-item dropdown">
<a href="#" class="nav-link dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
<?
xjs
write(locale.strings.main.menu_item_login); ?>
<? write(locale.strings.main.menu_item_login); ?>
<span class="caret"></span>
</a>
<div id="login-form" class="dropdown-menu" style="padding:15px; padding-bottom:0px;">
<form id="form-login">
<label for="input-username" class="sr-only">
<?xjs write(locale.strings.main.input_username); ?>
</label>
<input id="input-username" title="<?xjs write(locale.strings.main.input_username); ?>" type="text" class="dropdown form-control" placeholder="<?xjs write(locale.strings.main.input_username); ?>">
<label for="input-password" class="sr-only">
<?xjs write(locale.strings.main.input_password); ?>
</label>
<input id="input-password" title="<?xjs write(locale.strings.main.input_password); ?>" type="password" class="dropdown form-control" placeholder="<?xjs write(locale.strings.main.input_password); ?>">
<input id="button-login" class="dropdown btn btn-primary" type="submit" value="<?xjs write(locale.strings.main.button_login); ?>">
<label for="input-username" class="sr-only"><? write(locale.strings.main.input_username); ?></label>
<input id="input-username" title="<? write(locale.strings.main.input_username); ?>" type="text" class="dropdown form-control" placeholder="<? write(locale.strings.main.input_username); ?>">
<label for="input-password" class="sr-only"><? write(locale.strings.main.input_password); ?></label>
<input id="input-password" title="<? write(locale.strings.main.input_password); ?>" type="password" class="dropdown form-control" placeholder="<? write(locale.strings.main.input_password); ?>">
<input id="button-login" class="dropdown btn btn-primary" type="submit" value="<? write(locale.strings.main.button_login); ?>">
</form>
</div>
</li>
<?xjs } else { ?>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
<?
xjs
write(user.alias); ?>
<? write(user.alias); ?>
<span class="badge scanned" title="Unread mail" id="badge-unread-mail"></span>
<span class="caret"></span>
</a>
<ul class="dropdown-menu">
<li>
<a href="./?page=000-mail.xjs">
<?
xjs
write(locale.strings.main.menu_item_mail); ?>
<? write(locale.strings.main.menu_item_mail); ?>
<span class="badge scanned" title="<?xjs write(locale.strings.main.label_unread_mail); ?>" id="badge-unread-mail-inner"></span>
</a>
</li>
<li>
<a id="button-logout" href="#">
<?xjs write(locale.strings.main.menu_item_logout); ?>
</a>
<a id="button-logout" href="#"><? write(locale.strings.main.menu_item_logout); ?></a>
</li>
</ul>
</li>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment