Skip to content
This repository has been archived by the owner on Oct 13, 2021. It is now read-only.

Commit

Permalink
shortcode for toolbar (#236)
Browse files Browse the repository at this point in the history
Signed-off-by: Christopher Guindon <chris.guindon@eclipse-foundation.org>
  • Loading branch information
chrisguindon committed Jul 14, 2021
1 parent 3004c9f commit 810a994
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 31 deletions.
3 changes: 2 additions & 1 deletion layouts/partials/header.html
@@ -1,4 +1,4 @@
<!--
<!--
Copyright (c) 2018 Eclipse Foundation, Inc.
This program and the accompanying materials are made available under the
Expand All @@ -13,6 +13,7 @@
{{- partial "google_tag_manager_no_script.html" . }}
<a class="sr-only" href="#content">{{ i18n "navigation-content-skip" }}</a>
<header class="header-wrapper{{- with .Params.header_wrapper_class | default .Site.Params.header_wrapper_class }} {{ . }}{{end}}" id="header-wrapper">
{{ partial "toolbar.html" . }}
{{ partial "navbar.html" . }}
{{ partial "jumbotron.html" . }}
</header>
33 changes: 3 additions & 30 deletions layouts/partials/navbar.html
@@ -1,4 +1,4 @@
<!--
<!--
Copyright (c) 2018 Eclipse Foundation, Inc.
This program and the accompanying materials are made available under the
Expand All @@ -10,33 +10,6 @@
SPDX-License-Identifier: EPL-2.0
-->

<div class="clearfix toolbar-container-wrapper">
<div class="container">
<div class="text-right toolbar-row row hidden-print">
<div class="col-md-24 row-toolbar-col">
<ul class="list-inline">
<li><a href="https://accounts.eclipse.org/user/edit" class="" data-tab-destination="tab-profile"><i class="fa fa-edit fa-fw"></i> {{ i18n "navbar-edit-acccount-label" }}</a></li>
<li><a class="toolbar-link toolbar-manage-cookies dropdown-toggle"><i class="fa fa-wrench"></i> {{ i18n "navbar-manage-cookies-label" }}</a></li>
{{ if gt (len .AllTranslations) 1 }}
<li class="language-selector dropdown">
<a href="#" data-toggle="dropdown" class="dropdown-toggle">
<i class="fa fa-globe"></i>
<span> {{ .Language.LanguageName }}</span>
<b class="caret"></b>
</a>
<ul class="dropdown-menu">
{{ range .AllTranslations }}
<li><a href="{{ .Permalink }}">{{ .Language.LanguageName }}</a></li>
{{ end }}
</ul>
</li>
{{ end }}
</ul>
</div>
</div>
</div>
</div>
<div class="{{ $.Site.Params.navbar_wrapper_classes | default "navbar-wrapper" }}">
<div class="container">
<div class="row" id="header-row">
Expand All @@ -57,7 +30,7 @@
{{ $currentPageLogoLink = .logo_url }}
{{ end }}
{{ end }}

<a title="{{ $currentPageLogoTitle }}" href="{{ $currentPageLogoLink | absLangURL }}">
<img width="{{ $.Page.Params.logo_width | default $.Site.Params.logo_width | default "140"}}" class="logo-eclipse-default img-responsive hidden-xs" src="{{ $currentPageLogo | relURL }}" alt="{{ $currentPageLogoTitle }}" />
</a>
Expand All @@ -75,7 +48,7 @@
{{ if (eq (len (findRE `(\.[^\/]{3,4}|\/)$` $normalized_cta_url)) 0) }}
{{ $normalized_cta_url = printf "%s/" $normalized_cta_url }}
{{ end }}

{{ $abs_cfa := printf "%s" ($normalized_cta_url | relURL) }}
{{ $is_cfa_page := 0 }}
{{ if or (eq $normalized_cta_url .Permalink) (eq $abs_cfa .Permalink) }}
Expand Down
39 changes: 39 additions & 0 deletions layouts/partials/toolbar.html
@@ -0,0 +1,39 @@
<!--
Copyright (c) 2018 Eclipse Foundation, Inc.
This program and the accompanying materials are made available under the
terms of the Eclipse Public License v. 2.0 which is available at
http://www.eclipse.org/legal/epl-2.0.
Contributors:
Christopher Guindon <chris.guindon@eclipse-foundation.org>
SPDX-License-Identifier: EPL-2.0
-->

<div class="clearfix toolbar-container-wrapper">
<div class="container">
<div class="text-right toolbar-row row hidden-print">
<div class="col-md-24 row-toolbar-col">
<ul class="list-inline">
<li><a href="https://accounts.eclipse.org/user/edit" class="" data-tab-destination="tab-profile"><i class="fa fa-edit fa-fw"></i> {{ i18n "navbar-edit-acccount-label" }}</a></li>
<li><a class="toolbar-link toolbar-manage-cookies dropdown-toggle"><i class="fa fa-wrench"></i> {{ i18n "navbar-manage-cookies-label" }}</a></li>
{{ if gt (len .AllTranslations) 1 }}
<li class="language-selector dropdown">
<a href="#" data-toggle="dropdown" class="dropdown-toggle">
<i class="fa fa-globe"></i>
<span> {{ .Language.LanguageName }}</span>
<b class="caret"></b>
</a>
<ul class="dropdown-menu">
{{ range .AllTranslations }}
<li><a href="{{ .Permalink }}">{{ .Language.LanguageName }}</a></li>
{{ end }}
</ul>
</li>
{{ end }}
</ul>
</div>
</div>
</div>
</div>

0 comments on commit 810a994

Please sign in to comment.