-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
824 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
@import 'bootstrap/scss/bootstrap'; | ||
@import 'blacklight-frontend/app/assets/stylesheets/blacklight/blacklight'; | ||
@import '@geoblacklight/frontend/app/assets/stylesheets/geoblacklight/geoblacklight'; | ||
@import '@geoblacklight/frontend/dist/stylesheets/geoblacklight/geoblacklight'; | ||
|
||
.palo-alto-base { | ||
background-color: #175E54!important; | ||
} |
172 changes: 172 additions & 0 deletions
172
app/components/blacklight/top_navbar_component.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,172 @@ | ||
<div class="container"> | ||
<a class="su-brand-bar__logo" href="https://www.stanford.edu" | ||
>Stanford University</a | ||
> | ||
</div> | ||
<nav | ||
class="navbar navbar-expand-md bg-dark palo-alto-base" | ||
role="navigation" | ||
> | ||
<div class="container"> | ||
<a | ||
class="mb-0 navbar-brand navbar-logo" | ||
href="https://library.stanford.edu" | ||
>Stanford Libraries</a | ||
> | ||
<button | ||
class="navbar-toggler navbar-toggler-right" | ||
type="button" | ||
data-toggle="collapse" | ||
data-bs-toggle="collapse" | ||
data-target="#user-util-collapse" | ||
data-bs-target="#user-util-collapse" | ||
aria-controls="user-util-collapse" | ||
aria-expanded="false" | ||
aria-label="Toggle navigation" | ||
> | ||
<span class="navbar-toggler-icon"></span> | ||
</button> | ||
|
||
<div | ||
class="collapse navbar-collapse justify-content-md-end" | ||
id="user-util-collapse" | ||
> | ||
<ul class="navbar-nav"> | ||
<li class="nav-item"> | ||
<a id="bookmarks_nav" class="nav-link" href="/bookmarks"> | ||
Bookmarks | ||
<span | ||
class="badge badge-secondary bg-secondary" | ||
data-role="bookmark-counter" | ||
>0</span | ||
> | ||
</a> | ||
</li> | ||
<li class="nav-item"> | ||
<a class="nav-link" href="/search_history">History</a> | ||
</li> | ||
<li class="nav-item"> | ||
<a | ||
href="#feedback" | ||
class="nav-link" | ||
data-bs-toggle="collapse" | ||
data-bs-target="#feedback" | ||
>Feedback</a | ||
> | ||
</li> | ||
<li class="nav-item"> | ||
<% if helpers.current_user && !helpers.current_user.sunet.blank? %> | ||
<%= link_to "#{helpers.current_user.sunet}: Logout", destroy_user_session_path, class: "nav-link" %> | ||
<% else %> | ||
<%= link_to 'Login', new_user_session_path(referrer: request.original_url), class: "nav-link" %> | ||
<% end %> | ||
</li> | ||
</ul> | ||
</div> | ||
</div> | ||
</nav> | ||
|
||
<div id="feedback" class="collapse"> | ||
<div class="container pt-3"> | ||
<div class="row justify-content-center"> | ||
<form | ||
class="col-md-8" | ||
action="/feedback" | ||
accept-charset="UTF-8" | ||
method="post" | ||
> | ||
<div class="alert alert-info" role="alert"> | ||
Reporting from: | ||
<%= root_url %> | ||
</div> | ||
<div class="mb-3 row"> | ||
<label class="col-md-3 col-form-label" for="message" | ||
>Message</label | ||
> | ||
<div class="col-md-9"> | ||
<textarea | ||
class="form-control" | ||
rows="5" | ||
required="required" | ||
data-form-type="other" | ||
name="message" | ||
id="message" | ||
></textarea> | ||
</div> | ||
</div> | ||
<div class="mb-3 row"> | ||
<label class="col-md-3 col-form-label" for="name" | ||
>Your name</label | ||
> | ||
<div class="col-md-9"> | ||
<input | ||
class="form-control" | ||
required="required" | ||
data-form-type="other" | ||
autocomplete="name" | ||
type="text" | ||
name="name" | ||
id="name" | ||
/> | ||
</div> | ||
</div> | ||
<div class="mb-3 row"> | ||
<label class="col-md-3 col-form-label" for="email" | ||
>Your email</label | ||
> | ||
<div class="col-md-9"> | ||
<input | ||
class="form-control" | ||
required="required" | ||
data-form-type="other" | ||
autocomplete="email" | ||
type="email" | ||
name="email" | ||
id="email" | ||
/> | ||
</div> | ||
</div> | ||
<div class="mb-3 row"> | ||
<div class="col-md-9 offset-md-3"> | ||
<% if helpers.current_user.blank? %> | ||
<%= recaptcha_tags %> | ||
|
||
<p>(Stanford users can avoid this Captcha by logging in.)</p> | ||
<% end %> | ||
</div> | ||
</div> | ||
<div class="mb-3 row"> | ||
<div class="col-md-9 offset-md-3"> | ||
<input | ||
type="submit" | ||
name="commit" | ||
value="Send" | ||
class="btn btn-secondary" | ||
data-disable-with="Send" | ||
/> | ||
<button | ||
name="button" | ||
type="button" | ||
data-action="feedback#cancel" | ||
class="btn btn-outline-secondary" | ||
> | ||
Cancel | ||
</button> | ||
</div> | ||
</div> | ||
</form> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="masthead bg-dark palo-alto-base"> | ||
<div class="container"> | ||
<div class="row align-items-center"> | ||
<div | ||
class="col-md-8 d-flex justify-content-center justify-content-md-start" | ||
> | ||
<div class="h1 my-4"><a href="/">Earthworks</a></div> | ||
</div> | ||
|
||
</div> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# frozen_string_literal: true | ||
module Blacklight | ||
class TopNavbarComponent < Blacklight::Component | ||
def initialize(blacklight_config:) | ||
@blacklight_config = blacklight_config | ||
end | ||
|
||
attr_reader :blacklight_config | ||
|
||
delegate :application_name, :container_classes, to: :helpers | ||
|
||
def logo_link(title: application_name) | ||
link_to title, blacklight_config.logo_link, class: 'mb-0 navbar-brand navbar-logo' | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<!DOCTYPE html> | ||
<%= content_tag :html, class: 'no-js', **html_tag_attributes do %> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> | ||
|
||
<title><%= render_page_title %></title> | ||
<script> | ||
document.querySelector('html').classList.remove('no-js'); | ||
</script> | ||
<%= opensearch_description_tag application_name, opensearch_catalog_url(format: 'xml') %> | ||
<%= favicon_link_tag %> | ||
<%= stylesheet_link_tag "application", media: "all", "data-turbo-track": "reload" %> | ||
<% if defined? Importmap %> | ||
<%= javascript_importmap_tags %> | ||
<% elsif defined? Propshaft %> | ||
<%= javascript_include_tag "application", "data-turbo-track": "reload", defer: true %> | ||
<% else %> | ||
<%= javascript_include_tag "application", "data-turbo-track": "reload", defer: true %> | ||
<%= javascript_include_tag "blacklight/blacklight", type: 'module' %> | ||
<script type="module"> | ||
import githubAutoCompleteElement from 'https://cdn.skypack.dev/@github/auto-complete-element'; | ||
</script> | ||
<% end %> | ||
|
||
<link rel="stylesheet" href="/sul-components/v2024-08-01/styles/sul.css" /> | ||
|
||
<%= csrf_meta_tags %> | ||
<%= content_for(:head) %> | ||
</head> | ||
<body class="<%= render_body_class %>"> | ||
<nav id="skip-link" role="navigation" class="visually-hidden-focusable sr-only sr-only-focusable" aria-label="<%= t('blacklight.skip_links.label') %>"> | ||
<div class="container-xl"> | ||
<%= link_to t('blacklight.skip_links.search_field'), '#search_field', class: 'd-inline-flex p-2 m-1', data: { turbolinks: 'false' } %> | ||
<%= link_to t('blacklight.skip_links.main_content'), '#main-container', class: 'd-inline-flex p-2 m-1', data: { turbolinks: 'false' } %> | ||
<%= content_for(:skip_links) %> | ||
</div> | ||
</nav> | ||
<%= render partial: 'shared/header_navbar' %> | ||
|
||
<main id="main-container" class="<%= container_classes %>" role="main" aria-label="<%= t('blacklight.main.aria.main_container') %>"> | ||
<%= content_for(:container_header) %> | ||
|
||
<%= render partial: 'shared/flash_msg', layout: 'shared/flash_messages' %> | ||
|
||
<div class="row"> | ||
<%= content_for?(:content) ? yield(:content) : yield %> | ||
</div> | ||
</main> | ||
|
||
<%= render partial: 'shared/footer' %> | ||
<%= render partial: 'shared/modal' %> | ||
</body> | ||
<% end %> |
Binary file not shown.
Oops, something went wrong.