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

Creates "More" drop down in the main nav #1220

Merged
merged 7 commits into from
Aug 17, 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
2 changes: 0 additions & 2 deletions article/templates/article/article_page_visual_essay.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{% extends 'article/article_page.html' %}
{% load static %}
{% load dispatch_tags %}
{% load wagtailimages_tags %}

{% block head_scripts %}
Expand Down Expand Up @@ -92,7 +91,6 @@ <h1 class="headline">{{ self.title|safe }}</h1>
{% block right-column %}
<div class="right-column">
<div class="sidebar">
{% zone 'article-sidebar' %}
{% if explicit is not True %}
{% if self.minutes_to_read >= 3 %}
{% include 'objects/advertisement.html' with size='skyscraper' name='Box_A' id=3 article=article.id %}
Expand Down
8 changes: 8 additions & 0 deletions navigation/templates/navigation/headers/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@
<div class="middle">
<ul class="sections">
{% main_menu %}
<li class="dropdown">
<a class="more-dropdown preventDefault" href="#">MORE <i class="dropdown-hidden fa-solid fa-caret-down"></i><i class="dropdown-show fa-solid fa-caret-up"></i></a>
<div class="more-list dropdown-content">
<ul>
{% flat_menu 'dropdown_menu' max_levels=1 show_menu_heading=False fall_back_to_default_site_menus=True %}
</ul>
</div>
</li>
</ul>
</div>
<div class="right">
Expand Down
10 changes: 9 additions & 1 deletion ubyssey/static_src/src/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ import upcomingEvents from './widgets/upcoming-events';
initializeSearchFormActions();
initializeSocialMediaActions();

initializeAudioQuote()
initializePreventDefault();

initializeAudioQuote();

initializeFilterDropdown();

Expand Down Expand Up @@ -286,6 +288,12 @@ function initializeSocialMediaActions() {

}

function initializePreventDefault() {
$('.preventDefault').click(function (e) {
e.preventDefault();
});
}

function initializeAudioQuote() {
$(document).on('click', 'a.playAudioQuote', function (e) {
e.preventDefault();
Expand Down
25 changes: 25 additions & 0 deletions ubyssey/static_src/src/styles/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,31 @@ a.image {
}
}

.dropdown {
position: relative;
}

.dropdown-content {
display: none;
position: absolute;
}

.dropdown-show {
display: none;
}

.dropdown:focus-within, .dropdown:hover {
.dropdown-content {
display: block;
}
.dropdown-show {
display: inherit;
}
.dropdown-hidden {
display: none;
}
}

.hide {
display: none;
}
Expand Down
2 changes: 1 addition & 1 deletion ubyssey/static_src/src/styles/modules/_core.scss
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ main {
// ROWS AND COLUMNS

.row {
overflow: auto;
//overflow: auto;
> .left {
float: left;
}
Expand Down
44 changes: 34 additions & 10 deletions ubyssey/static_src/src/styles/modules/_header.scss
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ header.main{
height: 50px;
display: grid;
grid-template-columns: 1fr auto 1fr;
overflow: hidden;
//overflow: hidden;

.left, .middle, .right {
display: inline-block;
Expand Down Expand Up @@ -117,13 +117,6 @@ header.main{
}
}

.middle {
ul {
gap: 2px;
background-color: var(--header_color);
}
}

ul {
list-style-type: none;
padding: 0;
Expand All @@ -142,17 +135,48 @@ header.main{
font-weight: $font-weight-semi-bold;
color: var(--header_color);
text-transform: uppercase;
background-color: var(--background);
margin: 0;
padding-left: 10px;
padding-right: 10px;
border-right: 2px solid;
line-height: 2em;
margin: 0;
transition: background 0.5s ease, color 0.5s ease;

&:last-child {
border-right: none;
}

&.elections a {
color: $color-red;
}
}
.dropdown {
border-left: 2px solid;
}
.dropdown:focus-within, .dropdown:hover {
text-decoration: underline;
}
.more-dropdown {
white-space: nowrap;
}
.more-list {
background-color: var(--background);
padding: 2px;
border: 2px solid;
border-top: none;
left: -2px;
text-decoration: underline;
z-index: 100;

ul {
display: block;
li {
display: block;
border: none;
text-align: left;
}
}
}
}

&.sections-more {
Expand Down
1 change: 0 additions & 1 deletion ubyssey/templates/advertise/index.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{% load static %}
{% load dispatch_tags %}
<!DOCTYPE html>
<html>
<head>
Expand Down
1 change: 0 additions & 1 deletion ubyssey/templates/article/food-insecurity.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{% load static %}
{% load dispatch_tags %}
<!DOCTYPE html>
<html>
<head>
Expand Down
1 change: 0 additions & 1 deletion ubyssey/templates/article/isolation-first-article.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{% extends 'article/default.html' %}
{% load static %}
{% load dispatch_tags %}

{% block stylesheet %}
<link rel="stylesheet" href="{% static 'ubyssey/css/isolation.css' %}" type="text/css"/>
Expand Down
1 change: 0 additions & 1 deletion ubyssey/templates/article/isolation-last-article.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{% extends 'article/default.html' %}
{% load static %}
{% load dispatch_tags %}

{% block stylesheet %}
<link rel="stylesheet" href="{% static 'ubyssey/css/isolation.css' %}" type="text/css"/>
Expand Down
1 change: 0 additions & 1 deletion ubyssey/templates/article/isolation.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{% extends 'article/default.html' %}
{% load static %}
{% load dispatch_tags %}

{% block stylesheet %}
<link rel="stylesheet" href="{% static 'ubyssey/css/isolation.css' %}" type="text/css"/>
Expand Down
1 change: 0 additions & 1 deletion ubyssey/templates/article/magazine-poem.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{% extends 'magazine/base.html' %}
{% load dispatch_tags %}

{% block css %}
{% load static %}
Expand Down
Loading