Skip to content

Commit

Permalink
Femme final touches, top articles style changes, article list style c…
Browse files Browse the repository at this point in the history
…hanges, slight footer colour change.
  • Loading branch information
SamuelmdLow committed Nov 19, 2024
1 parent 8e3b0c6 commit 2f287dd
Show file tree
Hide file tree
Showing 16 changed files with 215 additions and 133 deletions.
39 changes: 20 additions & 19 deletions article/templates/article/objects/top_article.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,30 @@
{% if article %}
<article class="o-article o-article--top_article{% if padded %} o-article--padded{% endif %}">
<div class="o-article__left">
<a href="{{article|get_section_link}}" class="o-article__section-tag">{{article|get_section_title}}</a>
<div class="o-article__above-headline">
<a href="{{article|get_section_link}}" class="o-article__section-tag">{{article|get_section_title}}</a>
{% if article.title_tag %}
<div class="top_article-title-tag">{{article.title_tag}}//</div>
{% elif article.category %}
<div class="top_article-title-tag">{{article.category.title}}//</div>
{% endif %}
</div>
<h2 class="o-article__headline">
<a href="{% pageurl article %}">{{ article.title|safe }}</a>
</h2>
<div class="o-article__byline">
<span class="o-article__author">{{ article.get_authors_split_out_visual_bylines|safe }}</span>
<span> &nbsp;&nbsp; </span>
<span class="o-article__published">{{ article.explicit_published_at|display_pubdate }}</span>
</div>
</div>

<div class="o-article__right">
<div class="o-article__meta__image">
{% if article.featured_media.first %}
<a class="o-article__image" href="{% pageurl article %}">
{% if article.featured_media.first.image %}
{% image article.featured_media.first.image fill-150x150-c100 format-webp loading='lazy' alt=article.featured_media.first.alt_text %}
{% image article.featured_media.first.image fill-168x168-c100 format-webp loading='lazy' alt=article.featured_media.first.alt_text %}
{% elif article.featured_media.first.video %}
<img src='http://img.youtube.com/vi/{{ article.featured_media.first.video.url|youtube_embed_id|safe }}/0.jpg' alt="{{article.featured_media.first.alt_text}}">
{% endif %}
Expand All @@ -29,22 +47,5 @@

</div>
</div>
<div class="o-article__right">

{% if article.title_tag %}
<div class="top_article-title-tag">{{article.title_tag}}//</div>
{% elif article.category %}
<div class="top_article-title-tag">{{article.category.title}}//</div>
{% endif %}

<h2 class="o-article__headline">
<a href="{% pageurl article %}">{{ article.title|safe }}</a>
</h2>
<div class="o-article__byline">
<span class="o-article__author">{{ article.get_authors_split_out_visual_bylines|safe }}</span>
<span> &nbsp;&nbsp; </span>
<span class="o-article__published">{{ article.explicit_published_at|display_pubdate }}</span>
</div>
</div>
</article>
{% endif %}

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions article/templatetags/articletags.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ def display_pubdate(value):
pubdate = value.astimezone(timezone.get_current_timezone())
today = timezone.now().astimezone(timezone.get_current_timezone())
delta = today - pubdate
print(today.date())
print(pubdate.date())

if delta.total_seconds() > datetime.timedelta(days=365).total_seconds():
return pubdate.strftime("%B xx%d, %Y").replace("xx0","").replace("xx","")
Expand Down
2 changes: 1 addition & 1 deletion home/templates/home/stream_blocks/section_block.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% load wagtailcore_tags %}

<section class="c-homepage__section">
<h1 class="section" style="color: {{section.colour}}">
<h1 class="section">
<a href={% pageurl section %}>{{ section|title }}</a>
</h1>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{% load articletags %}

<div class="article-list blog sidebar-block">
<div class="sidebar-block latest-list">
{% include 'home/objects/home_heading-box.html' with styling='boxLabel-highlight' title=title text='Updated' textBold=articles.0.first_published_at|time_ago %}
<ul class="article-list">
<ul>
{% for article in articles %}
<li>
{% include 'article/objects/blog_column-latest.html' with sameColour=True article=article %}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<div class="article-list blog sidebar-block">
{% load wagtailcore_tags %}

<div class="article-list sidebar-block">
<h2 class="block-title" style="color: {{section.colour}}">
{% if link %}
<a href="{{link}}">{{ title }}</a>
Expand All @@ -9,7 +11,7 @@ <h2 class="block-title" style="color: {{section.colour}}">
<ul class="article-list">
{% for article in articles %}
<li>
{% include 'article/objects/blog_column.html' with article=article %}
<b>{{ article.published_at|date:'N j, Y' }}</b> <a href="{% pageurl article %}">{{ article.title|safe }}</a>
</li>
{% endfor %}
</ul>
Expand Down
2 changes: 1 addition & 1 deletion navigation/templates/navigation/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<div class="about">
<div class="footer-branding">
<img class="logo mobile" src="{% static 'ubyssey/images/ubyssey-logo-blue.svg' %}" alt="The Ubyssey"/>
<img class="logo desktop" src="{% static 'ubyssey/images/ubyssey_logo_dark_classic.svg' %}" alt="The Ubyssey"/>
<img class="logo desktop" src="{% static 'ubyssey/images/logos/ubyssey-logo-blue-dark.svg' %}" alt="The Ubyssey"/>
<img class="funding mobile" src="{% static 'ubyssey/images/canada-funding-dark.png' %}" loading="lazy" alt="Funded by the Government of Canada"/>
<p>
<b><i>The Ubyssey</i></b> has been the definitive source of news on campus since 1918. Published by an independent non-profit society, written and
Expand Down
2 changes: 1 addition & 1 deletion section/templates/section/objects/section_bulleted.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
{% endif %}
</div>
<div>
<ul class="c-homepage__section__bullets" style="color: {{section.colour}}">
<ul class="c-homepage__section__bullets">
{% for article in articles %}
{% if forloop.counter != 1 %}
<li>{% include 'article/objects/bullet.html' with article=article %}</li>
Expand Down
27 changes: 27 additions & 0 deletions ubyssey/static_src/src/styles/components/_infinitefeed.scss
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,33 @@
}
}

.article-list.sidebar-block {
background: #c3e2f0;
padding: 2em 1.5em;
border-radius: 1.5em;

ul.article-list {
padding-inline: 2em;
list-style-type: circle;
li {
padding-bottom: 0.5em;
border-bottom: 1px solid #00000045;
a {
display: contents;
}
b {
margin-right: 1em;
}
}
}
}

.latest-list ul {
list-style-type: none;
padding: 0;
margin: 0;
}

[color-css-theme="dark"] {

h2.block-title {
Expand Down
8 changes: 8 additions & 0 deletions ubyssey/static_src/src/styles/components/_section-page.scss
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,14 @@
}
}
}
.sidebar-block--advertisement, .o-advertisement--ad-page-promo {
display: none;
}

.c-sidebar_container {
min-height: 125vh;
margin-bottom: 25vh;
}
}

.section-error {
Expand Down
2 changes: 1 addition & 1 deletion ubyssey/static_src/src/styles/modules/_footer.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ footer {
right: 0;

h3 {
color: $color-ubyssey-blue-classic;
color: $color-ubyssey-blue;
text-transform: uppercase;
font-size: 1em;
}
Expand Down
29 changes: 27 additions & 2 deletions ubyssey/static_src/src/styles/modules/_homepage.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@import 'fonts';
@import 'modules/variables';

img.featured {
width: 100%;
Expand Down Expand Up @@ -52,11 +53,18 @@ html.hairlines {

[color-css-theme="light"] {

h1.section > a {
h1.section {
color: black;
}
}

[color-css-theme="dark"] {

h1.section {
color: $color-ubyssey-blue
}
}

.o-breaking-news,
.o-subsection-banner {
width: 100%;
Expand Down Expand Up @@ -109,11 +117,18 @@ html.hairlines {
}
}

.home-top-article-list {
.home-featured .home-top-article-list {
background-color: #c3e2f0;
height: fit-content;
padding: 10px;

.boxLabel {
--boxPrimary: #{$color-ubyssey-blue-dark-3};
--boxSecondary: none;
--boxTextLeft: white;
--boxTextRight: #{$color-ubyssey-blue-dark};
}

@media only screen and (min-width: 900px) {
margin-top: -30px;
filter: drop-shadow(-7px 10px 4px #0416201c);
Expand All @@ -123,6 +138,12 @@ html.hairlines {
}
}

[color-css-theme="dark"] {
.home-featured .home-top-article-list .boxLabel {
--boxPrimary: #{$color-ubyssey-blue-dark};
}
}

.linkTitle {
font-size: 1.2rem;
font-weight: 600;
Expand Down Expand Up @@ -186,6 +207,10 @@ html.hairlines {
}
}

.c-homepage__section__bullets {
color: $color-ubyssey-blue;
}

.c-homepage__sections {
width: 100%;
padding-bottom: 3em;
Expand Down
1 change: 1 addition & 0 deletions ubyssey/static_src/src/styles/modules/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ $color-ub-blue-light: #006DCC;
$color-ubyssey-blue:#0071c9;
$color-ubyssey-blue-dark:#041620;
$color-ubyssey-blue-dark-2: #031621;
$color-ubyssey-blue-dark-3: #01283D;
$color-ubyssey-blue-light:#BBE3F1;
$color-ubyssey-blue-classic: #0073A9;

Expand Down
24 changes: 19 additions & 5 deletions ubyssey/static_src/src/styles/objects/_article_top.scss
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,24 @@
margin-right: 0.8em;
}

.o-article__right {
margin-left: auto;
}

.o-article__above-headline {
display: flex;
flex-direction: row;
}

.o-article__section-tag {
display: block;
width: fit-content;
margin-right: 1em;
padding-inline: 0.5em 0.8em;
padding-top: 0.2em;
border-radius: 0 0.8em 0 0;

background-color: #041620;
background-color: $color-ubyssey-blue-dark-3;

text-transform: uppercase;
color: white;
Expand All @@ -50,6 +60,9 @@
bottom: 0px;
height: 100%;
width: auto;

border-radius: 0.5em;
border: 2px solid $color-ubyssey-blue-dark;
}
}

Expand Down Expand Up @@ -82,12 +95,10 @@

.o-article__meta__image {
// Structure
width: 4.5em;
width: 5em;
aspect-ratio: 1;
margin-bottom: 0.65rem;
margin-block: 0.5em 0.2em;
position: relative;
clip-path: inset(0 0 0 0);
border: 2px solid $color-ubyssey-blue-dark;
}

.o-article__meta__image .o-article__headline {
Expand Down Expand Up @@ -139,4 +150,7 @@
.o-article--top_article {
border-color: white;
}
.o-article__section-tag {
background-color: $color-ubyssey-blue-dark;
}
}
Loading

0 comments on commit 2f287dd

Please sign in to comment.