Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add starter button to navbar #1680

Merged
merged 7 commits into from
Jun 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion config/_default/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ enableInlineShortcodes = true
# hide_cfa_same_page = "true"
featured_content_publish_target = "jakarta_ee"
logo_width = "200"
call_for_action_classes = "btn btn-warning btn-call-for-action"
call_for_action_classes = "btn btn-warning margin-0"
call_for_action_wrapper_classes = "float-right hidden-xs display-flex gap-10"
jumbotron_class = "col-md-24 col-sm-18 "
jumbotron_tagline_class = "col-sm-24"
footer_section_eclipse_foundation_class = "col-sm-5th padding-top-20"
Expand Down
78 changes: 78 additions & 0 deletions layouts/partials/navbar.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
{{/*
oliviergoulet5 marked this conversation as resolved.
Show resolved Hide resolved
Copyright (c) 2023 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:
Olivier Goulet <[email protected]>

SPDX-License-Identifier: EPL-2.0
*/}}

<div class="{{ $.Site.Params.navbar_wrapper_classes | default "navbar-wrapper" }}">
<div class="container">
<div class="row" id="header-row">
<div class="{{ $.Site.Params.header_left_classes | default "col-sm-5 col-md-4" }}" id="header-left">
<div class="wrapper-logo-default">

{{ with .Page.Params.logo | default .Site.Params.logo | default "https://www.eclipse.org/eclipse.org-common/themes/solstice/public/images/logo/eclipse-foundation-white-orange.svg" }}

{{ $currentPageLogo := . }}
{{ $currentPageLogoTitle := $.Site.Title }}
{{ $currentPageLogoLink := "" }}

{{ range $.Site.Data.subsites_custom_logo.items }}
{{ $section := $.Site.GetPage (.page_url) }}
{{ if or (eq ($.Section) ($section)) ( $.Page.IsDescendant $section ) }}
{{ $currentPageLogo = .logo }}
{{ $currentPageLogoTitle = .logo_title }}
{{ $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>
{{ end }}

</div>
</div>
{{ $has_cfa := 0 }}
{{ if (and (isset .Site.Params "call_for_action_text") (isset .Site.Params "call_for_action_url") (isset .Site.Params "call_for_action_icon")) }}
{{ $has_cfa = 1 }}
{{ end }}
<div class="{{ $.Site.Params.main_menu_wrapper_classes | default "col-sm-19 col-md-20 margin-top-10" }}{{ if eq $has_cfa 0}} reset{{ end }}" id="main-menu-wrapper">
{{ $normalized_cta_url := .Site.Params.call_for_action_url }}
{{ $hide_call_for_action := .Page.Params.hide_call_for_action }}
{{ 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) }}
{{ $is_cfa_page = 1 }}
{{ end }}
{{ if and (eq $has_cfa 1) (not (or (eq .Site.Params.hide_cfa_same_page "true") (eq $is_cfa_page 1) (eq $hide_call_for_action true))) }}
<div class="{{ $.Site.Params.call_for_action_wrapper_classes | default "float-right hidden-xs" }}" id="btn-call-for-action">
<div class="btn-starter">
<a class="btn btn-secondary margin-0" href="https://start.jakarta.ee/">Starter</a>
</div>
<div id="btn-call-for-action"><a href="{{ .Site.Params.call_for_action_url }}" class="{{ .Site.Params.call_for_action_classes | default "btn btn-huge btn-warning" }}"><i class="fa {{ .Site.Params.call_for_action_icon }}"></i> {{ .Site.Params.call_for_action_text }}</a></div>
</div>
{{ end }}
<div class="{{ $.Site.Params.main_menu_classes | default "navbar float-sm-right yamm" }}" id="main-menu">
<div class="navbar-collapse collapse reset float-right" id="navbar-main-menu">
<ul class="nav navbar-nav">
{{ partial "nav.html" . }}
</ul>
</div>
{{ partial "nav_toggle.html" . }}
</div>
</div>
</div>
</div>
</div>

31 changes: 31 additions & 0 deletions less/layout/_header.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
* Copyright (c) 2022, 2023 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:
* Olivier Goulet <[email protected]>
*
* SPDX-License-Identifier: EPL-2.0
*/

// Expand container size for navbar and toolbar
.navbar-wrapper,
.toolbar-container-wrapper {
& > .container {
width: 100%;
max-width: 1920px;
}
}

@media (max-width: @screen-md-max) {
#btn-call-for-action {
margin-top: 0;
}
}

.navbar-wrapper .btn {
padding: 0.8rem 1.5rem;
}
5 changes: 3 additions & 2 deletions less/styles.less
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
* SPDX-License-Identifier: EPL-2.0
*/


@import '~eclipsefdn-solstice-assets/less/quicksilver/jakarta/styles.less';

@import '_variables.less';
Expand All @@ -28,6 +27,8 @@
@import 'components/video-modal.less';
@import 'components/_eclipsefdn-meeting-minutes.less';

@import 'layout/_header.less';

@import 'transient.less';
@import 'release-8.less';
@import 'release-9.less';
Expand Down Expand Up @@ -305,4 +306,4 @@ div.card-panel.panel div.panel-body.panel-body-with-img {
color: @white;
}
}
}
}