Skip to content

Commit

Permalink
Merge pull request #2122 from samvera/hyrax-5-fix-css
Browse files Browse the repository at this point in the history
Hyrax 5 fix css
  • Loading branch information
kirkkwang authored Jan 3, 2024
2 parents 0133b09 + 8e4c93f commit 3c71cb3
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 14 deletions.
8 changes: 4 additions & 4 deletions app/assets/javascripts/hyrax/app.js.erb
Original file line number Diff line number Diff line change
Expand Up @@ -167,25 +167,25 @@ Hyrax = {
sidebar: function () {
$('.sidebar-toggle').on('click', function() {
$('.sidebar').toggleClass('maximized');
if ($(window).width() >= 768) {
if ($(window).width() >= 992) {
$('.main-content').toggleClass('maximized');
}
});

$('.sidebar').on('mouseenter', function() {
if ($(window).width() < 768) {
if ($(window).width() < 992) {
$('.sidebar').addClass('maximized');
}
});

$('.sidebar').on('mouseleave', function() {
if ($(window).width() < 768) {
if ($(window).width() < 992) {
$('.sidebar').removeClass('maximized');
}
});

$(window).on('resize', function() {
if ($(window).width() >= 768) {
if ($(window).width() >= 992) {
$('.sidebar, .main-content').addClass('maximized');
} else {
$('.sidebar, .main-content').removeClass('maximized');
Expand Down
11 changes: 11 additions & 0 deletions app/assets/stylesheets/hyku.scss
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,7 @@ nav.navbar.navbar-default.navbar-static-top .container-fluid .row {
body.public-facing {
.btn {
&.btn-primary,
&.btn-secondary,
&.btn-danger {
color: #fff;
}
Expand Down Expand Up @@ -487,3 +488,13 @@ body.public-facing {
.mt-20 {
margin-top: 20px;
}

.navbar-toggler-icon {
background: no-repeat center center;
background-size: 100% 100%;
content: "";
display: inline-block;
height: 1.5em;
vertical-align: middle;
width: 1.5em;
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</td>
<td>
<div class="media">
<%= link_to [main_app, document], "class" => "media-left", "aria-hidden" => "true" do %>
<%= link_to [main_app, document], "class" => "mr-2", "aria-hidden" => "true" do %>
<%= document_presenter(document)&.thumbnail&.thumbnail_tag(
{ class: "d-none d-md-block file_listing_thumbnail", alt: document.title_or_label }, { suppress_link: true }
) %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/hyrax/dashboard/works/_list_works.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</td>
<td>
<div class='media'>
<%= link_to [main_app, document], class: 'media-left' do %>
<%= link_to [main_app, document], class: 'mr-2' do %>
<%# OVERRIDE begin %>
<%= document_presenter(document)&.thumbnail&.thumbnail_tag(
{ class: 'd-none d-md-block file_listing_thumbnail', alt: block_for(name: 'default_work_image_text') || "#{document.title_or_label} #{t('hyrax.homepage.admin_sets.thumbnail')}" },
Expand Down
8 changes: 4 additions & 4 deletions app/views/hyrax/homepage/_home_content.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
also, to render featured collections
%>

<div class="<%= @presenter.display_featured_works? || @presenter.display_recently_uploaded? ? 'home-tabs-left col-md-6' : '' %>">
<div class="<%= @presenter.display_featured_works? || @presenter.display_recently_uploaded? ? 'col-md-6' : '' %>">
<ul id="homeTabs" class="nav nav-tabs" role="list">
<%# add check for featured works %>
<% if @presenter.display_featured_works? %>
Expand Down Expand Up @@ -41,10 +41,10 @@
</div>
</div><!-- /.col-md-6 -->

<div class="home-tabs-right col-md-6">
<div class="col-md-6">
<ul class="nav nav-tabs" role="list">
<li class="nav-item active">
<a class="nav-link" aria-expanded="true" href="#tab-col2-first" data-toggle="tab">
<li class="nav-item">
<a class="nav-link active" aria-expanded="true" href="#tab-col2-first" data-toggle="tab">
<%= t('hyrax.homepage.admin_sets.title') %>
</a>
</li>
Expand Down
4 changes: 2 additions & 2 deletions app/views/hyrax/my/works/_list_works.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
<td>
<div class='media'>
<%# OVERRIDE begin %>
<%= link_to [main_app, document], class: 'media-left' do %>
<%= render_thumbnail_tag document, { class: 'hidden-xs file_listing_thumbnail', alt: block_for(name: 'default_work_image_text') || "#{document.title_or_label} #{t('hyrax.homepage.admin_sets.thumbnail')}" }, { suppress_link: true } %>
<%= link_to [main_app, document], class: 'mr-2' do %>
<%= render_thumbnail_tag document, { class: 'd-none d-md-block file_listing_thumbnail', alt: block_for(name: 'default_work_image_text') || "#{document.title_or_label} #{t('hyrax.homepage.admin_sets.thumbnail')}" }, { suppress_link: true } %>
<% end %>
<%# OVERRIDE end %>

Expand Down
6 changes: 4 additions & 2 deletions spec/rails_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
options = Selenium::WebDriver::Options.chrome(args: ["disable-gpu",
"no-sandbox",
"whitelisted-ips",
"window-size=1400,1400"])
"window-size=1920,1080"])

Capybara.register_driver :chrome do |app|
d = Capybara::Selenium::Driver.new(app,
Expand All @@ -83,7 +83,9 @@
Capybara.server_port = 3001
Capybara.app_host = "http://#{ENV['WEB_HOST']}:#{Capybara.server_port}"
else
options = Selenium::WebDriver::Options.chrome(args: ["headless", "disable-gpu"])
options = Selenium::WebDriver::Options.chrome(args: ["headless",
"disable-gpu",
"window-size=1920,1080"])

Capybara.register_driver :chrome do |app|
Capybara::Selenium::Driver.new(
Expand Down

0 comments on commit 3c71cb3

Please sign in to comment.