diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss index 7c5a5007..b4190e2f 100644 --- a/app/assets/stylesheets/application.scss +++ b/app/assets/stylesheets/application.scss @@ -25,6 +25,7 @@ @import 'mixins'; @import 'header'; @import 'footer'; +@import 'overrides/dropdowns'; body { background-color: $masthead-bg; @@ -32,6 +33,8 @@ body { .masthead { margin-bottom: 0px; + /* override from upstream; this was prevening user dropdown from showing up */ + z-index: 0; } #main-content { diff --git a/app/assets/stylesheets/header.scss b/app/assets/stylesheets/header.scss index 40d4c017..afc9a065 100644 --- a/app/assets/stylesheets/header.scss +++ b/app/assets/stylesheets/header.scss @@ -96,6 +96,19 @@ float: right; } + /* insert some button styles so it actually looks like btn-account */ + >li>a { + border-radius: 4px; + cursor: pointer; + display: inline-block; + outline: 0; + overflow: visible; + margin: 0; + text-decoration: none; + vertical-align: top; + font: bold 12px/1.3 "DejaVu", "Arial Unicode MS", "Helvetica Neue", "Helvetica", "Arial", sans-serif; + } + >li>a, .btn-account { color: $gray; @@ -305,4 +318,3 @@ } } } - diff --git a/app/assets/stylesheets/overrides/dropdowns.scss b/app/assets/stylesheets/overrides/dropdowns.scss new file mode 100644 index 00000000..f22b1793 --- /dev/null +++ b/app/assets/stylesheets/overrides/dropdowns.scss @@ -0,0 +1,214 @@ +@import "variables/colors"; +// Dropdown arrow/caret +.caret { + display: inline-block; + width: 0; + height: 0; + margin-left: 2px; + vertical-align: middle; + border-top: 4px dashed; + border-right: 4px solid transparent; + border-left: 4px solid transparent; +} + +// The dropdown wrapper (div) +.dropup, +.dropdown { + position: relative; +} + +// Prevent the focus on the dropdown toggle when closing dropdowns +.dropdown-toggle:focus { + outline: 0; +} + +// The dropdown menu (ul) +.dropdown-menu { + position: absolute; + // top: 100%; + // left: 0; + z-index: 1000; + display: none; // none by default, but block on "open" of the menu + float: left; + // min-width: 160px; + padding: 5px 0; + margin: 2px 0 0; // override default ul + list-style: none; + font-size: 14px; + text-align: left; // Ensures proper alignment if parent has it changed (e.g., modal footer) + background-color: $white; + // border: 1px solid $light-gray; // IE8 fallback + border: 1px solid $gray-lightest; + border-radius: 4px; + background-clip: padding-box; + + // Links within the dropdown menu + > li > a { + display: block; + padding: 3px 20px; + clear: both; + font-weight: normal; + // line-height: $line-height-base; + // color: $dropdown-link-color; + white-space: nowrap; // prevent links from randomly breaking onto new lines + } +} + +// Hover/Focus state +.dropdown-menu > li > a { + &:hover, + &:focus { + text-decoration: none; + color: $white; + background-color: $blue-dark; + } +} + +// Active state +.dropdown-menu > .active > a { + &, + &:hover, + &:focus { + // color: $dropdown-link-active-color; + text-decoration: none; + outline: 0; + // background-color: $dropdown-link-active-bg; + } +} + +// Disabled state +// +// Gray out text and ensure the hover/focus state remains gray + +.dropdown-menu > .disabled > a { + &, + &:hover, + &:focus { + // color: $dropdown-link-disabled-color; + } + + // Nuke hover/focus effects + &:hover, + &:focus { + text-decoration: none; + background-color: transparent; + background-image: none; // Remove CSS gradient + // @include reset-filter; + // cursor: $cursor-disabled; + } +} + +// Open state for the dropdown +.open { + // Show the menu + > .dropdown-menu { + display: block; + } + + // Remove the outline when :focus is triggered + > a { + outline: 0; + } +} + + + + + + +.navbar-form, +.navbar-right { + display: inline-block; +} + +.navbar-right { + float: right; + margin-right: 1em; +} + +#sidebar, +#content { + position: relative; + padding: 0 1em; +} + +.facets-toggle { + display: none; +} + +.facets-heading { + margin: 1em 0 1em; + font-size: 1.2em; +} + +.panel-default { + margin-bottom: 0.5em; + .panel-heading, + .panel-body { + border: 1px solid $gray-light; + padding: 0.7em 1em; + } + + .panel-heading { + cursor: pointer; + background: $gray-lightest; + } + + .panel-title { + font-size: 1em; + margin: 0; + a { + text-decoration: none; + color: $black; + } + } + + .panel-body { + border-top: 0; + } + + .collapse { + display: none; + + &.in { display: block; } + // [converter] extracted tr&.in to tr.collapse.in + // [converter] extracted tbody&.in to tbody.collapse.in + } + + tr.collapse.in { display: table-row; } + + tbody.collapse.in { display: table-row-group; } + + .collapsing { + position: relative; + height: 0; + overflow: hidden; + transition-property: height, visibility; + transition-duration: .35s; + transition-timing-function: ease; + } + + .more_facets_link { + margin-top: 1em; + } +} + +.search-widgets { + .btn-group { + float: left; + font-weight: normal; +} +.btn-group ~ .btn-group { + margin-left: 6px; +} +} + +.twitter-typeahead input { + padding: 5px 10px; + height: 40px; +} + +.search-btn, +.search_field { + height: 40px; +} diff --git a/app/assets/stylesheets/variables/colors.scss b/app/assets/stylesheets/variables/colors.scss index 79619cae..0e2cabbd 100644 --- a/app/assets/stylesheets/variables/colors.scss +++ b/app/assets/stylesheets/variables/colors.scss @@ -9,3 +9,5 @@ $orange: #e87511; $blue: #3072AB; $brand-danger: #a94442; $yellow-light: #fee7ba; +$gray-lightest: #f5f4f1; +$blue-dark: #2762ae; diff --git a/app/views/_user_util_links.html.erb b/app/views/_user_util_links.html.erb index 791e8aa0..74922974 100644 --- a/app/views/_user_util_links.html.erb +++ b/app/views/_user_util_links.html.erb @@ -1,41 +1,34 @@ +<% if current_user %> + +<% else %> +
  • + <%= link_to t('spotlight.header_links.login'), main_app.new_user_session_path %> +
  • +<% end %> +<% if current_exhibit and show_contact_form? %> +
  • + <%= link_to t('spotlight.header_links.contact'), spotlight.new_exhibit_contact_form_path(current_exhibit), data: {behavior: 'contact-link', target: 'report-problem-form' } %> +
  • +<% end %> diff --git a/app/views/shared/_header_navbar.html.erb b/app/views/shared/_header_navbar.html.erb index 017be811..00d7084d 100644 --- a/app/views/shared/_header_navbar.html.erb +++ b/app/views/shared/_header_navbar.html.erb @@ -10,7 +10,9 @@ <% end %>