Skip to content

Commit

Permalink
adds lux
Browse files Browse the repository at this point in the history
  • Loading branch information
sdellis committed Oct 1, 2018
1 parent 883dff1 commit 099df9e
Show file tree
Hide file tree
Showing 24 changed files with 6,292 additions and 215 deletions.
18 changes: 18 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"presets": [
["env", {
"modules": false,
"targets": {
"browsers": "> 1%",
"uglify": true
},
"useBuiltIns": true
}]
],

"plugins": [
"syntax-dynamic-import",
"transform-object-rest-spread",
["transform-class-properties", { "spec": true }]
]
}
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,8 @@
/coverage/*
/public/uploads

/public/packs
/public/packs-test
/node_modules
yarn-debug.log*
.yarn-integrity
3 changes: 3 additions & 0 deletions .postcssrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
plugins:
postcss-import: {}
postcss-cssnext: {}
3 changes: 3 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,6 @@ gem 'dalli'
gem 'ruby-prof', require: false
gem 'honeybadger', '~> 2.0'
gem 'nokogiri', '~> 1.8.1'

# lux dependency
gem 'webpacker', '~> 3.5'
7 changes: 7 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,8 @@ GEM
rack (2.0.5)
rack-protection (1.5.5)
rack
rack-proxy (0.6.5)
rack
rack-test (0.6.3)
rack (>= 1.0)
rails (5.0.7)
Expand Down Expand Up @@ -566,6 +568,10 @@ GEM
addressable (>= 2.3.6)
crack (>= 0.3.2)
hashdiff
webpacker (3.5.5)
activesupport (>= 4.2)
rack-proxy (>= 0.6.1)
railties (>= 4.2)
websocket-driver (0.6.5)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.3)
Expand Down Expand Up @@ -639,6 +645,7 @@ DEPENDENCIES
vcr
web-console (~> 2.0)
webmock
webpacker (~> 3.5)

BUNDLED WITH
1.16.2
3 changes: 3 additions & 0 deletions Procfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Procfile
backend: bin/rails s -p 3000
frontend: bin/webpack-dev-server
2 changes: 1 addition & 1 deletion app/assets/javascripts/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

//= require jquery
//= require jquery_ujs
//= require turbolinks//

// Required by Blacklight
//= require blacklight/blacklight
//= require pul-assets
Expand Down
22 changes: 22 additions & 0 deletions app/javascript/packs/application.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/* eslint no-console:0 */
// To reference this file, add <%= javascript_pack_tag 'application' %> to the appropriate
// layout file, like app/views/layouts/application.html.erb

import Vue from 'vue/dist/vue.esm'
import system from 'lux-design-system'
import 'lux-design-system/lib/system/system.css'
// import TurbolinksAdapter from 'vue-turbolinks'

Vue.use(system)
// Vue.use(TurbolinksAdapter)

// create the LUX app and mount it to wrappers with class="lux"
// document.addEventListener('turbolinks:load', () => {
document.addEventListener('DOMContentLoaded', () => {
var elements = document.getElementsByClassName('lux')
for(var i = 0; i < elements.length; i++){
new Vue({
el: elements[i]
})
}
})
3 changes: 2 additions & 1 deletion app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
<%= description %>
<%= twitter_card %>
<%= opengraph %>

<%= javascript_pack_tag 'application' %>
<%= stylesheet_pack_tag 'application' %>
<!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="//html5shim.googlecode.com/svn/trunk/html5.js"></script>
Expand Down
4 changes: 3 additions & 1 deletion app/views/layouts/spotlight/spotlight.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
<%= description %>
<%= twitter_card %>
<%= opengraph %>

<%= javascript_pack_tag 'application' %>
<%= stylesheet_pack_tag 'application' %>
<!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="//html5shim.googlecode.com/svn/trunk/html5.js"></script>
Expand All @@ -48,6 +49,7 @@
</div>

</div>

</main>

<%= render partial: 'shared/matomo_noscript' %>
Expand Down
196 changes: 2 additions & 194 deletions app/views/shared/_footer.html.erb
Original file line number Diff line number Diff line change
@@ -1,195 +1,3 @@
<footer class="l-footer row" role="contentinfo">
<div class="l-region l-region--footer pul-processed container">
<nav class="block block--menu block--menu-menu-find block--menu-menu-find col-sm-3" id="block-menu-menu-find">
<h2 class="block__title block__title"><a class="footer-link" href="http://library.princeton.edu/research">Research Tools</a></h2>
<ul class="menu">
<li class="first leaf">
<a class="footer-link" href=
"http://dss.princeton.edu">Data and Statistics</a>
</li>

<li class="leaf">
<a class="footer-link" href="https://library.princeton.edu/research/databases"
title="Browse Research Databases by Title or Subject">Databases</a>
</li>

<li class="leaf">
<a class="footer-link" href=
"http://getit.princeton.edu/" title=
"Browse Electronic Journal Titles">E-journals</a>
</li>

<li class="leaf">
<a class="footer-link" href="https://library.princeton.edu/library-guides" title=
"Library Research Guides">Research Guides</a>
</li>

<li class="leaf">
<a class="footer-link" href="https://catalog.princeton.edu" title=
"Access the library's main catalog">Main Catalog</a>
</li>

<li class="leaf">
<a class="footer-link" href=
"https://pulsearch.princeton.edu" title=
"Access the library's new catalog">New Catalog</a>
</li>

<li class="leaf">
<a class="footer-link" href="http://library.princeton.edu/find/all">Search</a>
</li>

<li class="last leaf">
<a class="footer-link" href=
"https://library.princeton.edu/databases/subject/special-collections" title=
"Finding Aids for the Princeton University Archives and Special Collections">
Special Collections</a>
</li>
</ul>
</nav>

<nav class="block block--menu block--menu-menu-information-for block--menu-menu-information-for col-sm-3" id="block-menu-menu-information-for">
<h2 class="block__title block__title"><a class="footer-link"
href="http://library.princeton.edu/services">Library Services</a></h2>

<ul class="menu">
<li class="first leaf">
<a class="footer-link" href="https://library.princeton.edu/services/article-express"
title=
"Use our Interlibrary Loan and Article Express Services">
Article Express</a>
</li>

<li class="leaf">
<a class="footer-link" href=
"https://library.princeton.edu/services/borrowdirect">Borrow Direct</a>
</li>

<li class="leaf">
<a class="footer-link" href=
"https://library.princeton.edu/services/access/circulation-policies">Circulation</a>
</li>

<li class="leaf">
<a class="footer-link" href="https://library.princeton.edu/services/reserves">Course
Reserves</a>
</li>

<li class="leaf">
<a class="footer-link" href=
"https://library.princeton.edu/services/interlibrary-services" title=
"Interlibrary Loan Services, Article Express">Interlibrary
Loan (ILL)</a>
</li>

<li class="leaf">
<a class="footer-link" href=
"https://library.princeton.edu/services/access">Library Access</a>
</li>

<li class="leaf">
<a class="footer-link" href=
"https://library.princeton.edu/services/study-spaces">Study Spaces and Lockers</a>
</li>

<li class="leaf">
<a class="footer-link" href="https://library.princeton.edu/help/trace-materials" title="Trace an item not found on shelf">Trace a Book</a>
</li>

<li class="last leaf">
<a class="footer-link" href="https://library.princeton.edu/accounts">Your
Accounts</a>
</li>

</ul>
</nav>

<nav class="block block--menu block--menu-menu-about block--menu-menu-about col-sm-3" id="block-menu-menu-about">
<h2 class="block__title block__title"><a class="footer-link"
href="http://library.princeton.edu/about">About the Library</a></h2>

<ul class="menu">
<li class="first leaf">
<a class="footer-link" href=
"https://library.princeton.edu/collections-and-collection-development">Collections
and Collecting</a>
</li>

<li class="leaf">
<a class="footer-link" href=
"https://rbsc.princeton.edu/exhibitions">Exhibitions</a>
</li>

<li class="leaf">
<a class="footer-link" href="https://library.princeton.edu/about/locations">Library
Locations</a>
</li>

<li class="leaf">
<a class="footer-link" href="https://library.princeton.edu/alumni">For Alumni</a>
</li>

<li class="leaf">
<a class="footer-link" href="https://library.princeton.edu/staff">For Library
Staff</a>
</li>

<li class="leaf">
<a class="footer-link" href="https://library.princeton.edu/staff/directory">Staff
Directory</a>
</li>

<li class="leaf">
<a class="footer-link" href="https://library.princeton.edu/about/friends">Friends of
the Library</a>
</li>

<li class="last leaf">
<a class="footer-link" href=
"https://library.princeton.edu/services/technology/off-campus-access">Using the
Library Off-Campus</a>
</li>
</ul>
</nav>

<div class="block block--block block--block-1 block--block-1 col-sm-3" id="block-block-1">
<div class="block__content block__content">
<h2>Princeton University Library</h2>

<div class="footer--icons">
<a class="facebook-logo" href=
"https://www.facebook.com/PULibrary" title=
"Friend us on Facebook">
<%= image_tag 'facebook.png' %></a>
<a class="twitter-logo" href=
"https://twitter.com/PULibrary" title=
"Follow us on Twitter">
<%= image_tag 'twitter.png' %></a>
<a class="govdocs-logo" href=
"http://libguides.princeton.edu/govdocs" title=
"Government Documents Depository">
<%= image_tag 'govdocs.png' %></a>
<a class="friends-logo" href="http://library.princeton.edu/about/friends" title=
"Friends of the Library">
<%= image_tag 'friends.png' %></a>
</div>

<address>
One Washington Road<br>
Princeton, NJ 08544-2098 USA<br>
(609) 258-1470 Phone
</address>

<div class="pu">
<a class="pu-logo" href=
"https://www.princeton.edu" title="Princeton University">
<%= image_tag 'pu.png', width: '200' %></a>
</div>

<p class="footer--copyright">© <%= current_year %> The Trustees of
Princeton University. All rights reserved.</p>
</div>
</div>
</div>
<a href="#" class="back-to-top">Top</a>
<footer class="lux">
<library-footer></library-footer>
</footer>
43 changes: 25 additions & 18 deletions app/views/shared/_header_navbar.html.erb
Original file line number Diff line number Diff line change
@@ -1,19 +1,26 @@
<header role="banner">
<div class="l-branding__pul">
<div class="container">
<div class="logo__pul col-xs-12 col-sm-6">
<a href="https://library.princeton.edu" title="Princeton University Library">
<%= image_tag("pul-logo-new.svg") %>
</a>
<% unless current_page?(root_path) %>
<%=link_to header_title, root_path, :class => "site-title" %>
<% end %>
</div>
<div class="pull-right menu--level-1 col-xs-12 col-sm-6">
<ul>
<%= render partial: '/user_util_links' %>
</ul>
</div>
</div>
</div>
<header class="lux">
<library-header
<% unless current_page?(root_path) %>
app-name="<%= t('blacklight.application_name') %>"
<% end %>
app-url="<%= root_path %>">
<% if current_user %>
<dropdown-menu type="links" button-label="<%= current_user %>" :menu-items="[
<% if current_exhibit and can? :curate, current_exhibit %>
{name: '<%= t('spotlight.dashboards.show.header') %>', component: '<%= t('spotlight.dashboards.show.header') %>', href: '<%= spotlight.exhibit_dashboard_path(current_exhibit) %>'},
<% end %>
<% if can? :create, Spotlight::Exhibit %>
{name: '<%= t(:'helpers.action.spotlight/exhibit.create') %>', component: '<%= t(:'helpers.action.spotlight/exhibit.create') %>', href: '<%= spotlight.new_exhibit_path %>'},
<% end %>
{name: '<%= t('spotlight.header_links.logout') %>', component: '<%= t('spotlight.header_links.logout') %>', href: '<%= main_app.destroy_user_session_path %>'}
]" />
<% else %>
<menu-bar type="links" :menu-items="[
{name: '<%= t('spotlight.header_links.login') %>', component: '<%= t('spotlight.header_links.login') %>', href: '<%= new_user_session_path %>'},
<% if current_exhibit and show_contact_form? %>
{name: '<%= t('spotlight.header_links.contact') %>', component: '<%= t('spotlight.header_links.contact') %>', href: '<%= spotlight.new_exhibit_contact_form_path(current_exhibit) %>'}
<% end %>
]"/>
<% end %>
</library-header>
</header>
15 changes: 15 additions & 0 deletions bin/webpack
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env ruby

ENV["RAILS_ENV"] ||= ENV["RACK_ENV"] || "development"
ENV["NODE_ENV"] ||= "development"

require "pathname"
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
Pathname.new(__FILE__).realpath)

require "rubygems"
require "bundler/setup"

require "webpacker"
require "webpacker/webpack_runner"
Webpacker::WebpackRunner.run(ARGV)
Loading

0 comments on commit 099df9e

Please sign in to comment.