Skip to content

Commit

Permalink
Final? Changes for AMS elections
Browse files Browse the repository at this point in the history
  • Loading branch information
SamuelmdLow committed Mar 1, 2025
1 parent a215fd9 commit 9b1f2ea
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 16 deletions.
9 changes: 6 additions & 3 deletions home/blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,8 +264,10 @@ def get_context(self, value, parent_context=None):
context['description'] = "Stories on '" + tag.name + "' in " + value['section'].title
else:
context['description'] = None
context['link'] = '/tag/' + value['tag_slug']
context['link'] = '/tag/' + value['tag_slug'] + '/'
context['articles'] = context['articles'].filter(tags__slug=value["tag_slug"])
else:
context['articles'] = []

if not 'gather_title' in context:
context['gather_title'] = "Latest stories"
Expand Down Expand Up @@ -385,7 +387,7 @@ class MidStreamGroupedArticlesTemplates(blocks.ChoiceBlock):
]


class ManualArticleGroup(AbstractArticleGroup):
class ManualArticleLinkGroup(AbstractArticleGroup):
title = blocks.CharBlock(
required=False,
max_length=255,
Expand All @@ -412,7 +414,8 @@ class ManualArticleGroup(AbstractArticleGroup):
('articles', blocks.ListBlock(
blocks.StructBlock([
('alias', blocks.CharBlock(required=False)),
('article', field_block.PageChooserBlock(page_type='article.ArticlePage', required=False))
('article', field_block.PageChooserBlock(page_type='article.ArticlePage', required=False)),
('link', blocks.URLBlock(required=False, help_text="Only use when linking to something outside of site!")),
])
))
])
Expand Down
2 changes: 1 addition & 1 deletion section/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ class SectionPage(RoutablePageMixin, SectionablePage):
('landing', homeblocks.SpecialLandingPageBlock()),
('article_manual', homeblocks.ManualArticles()),
('article_gatherer_with_pinned', homeblocks.ArticleGathererWithPinnedBlock()),
('grouped_articles_manual', homeblocks.ManualArticleGroup()),
('grouped_articles_manual', homeblocks.ManualArticleLinkGroup()),
('header_menu', article_blocks.HeaderMenuBlock()),
],
null=True,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ <h3 class="o-article__headline">
<li class="timeline-dot inverted">
<div class="o-article--bullet">
<h3 class="o-article__seemore">
<a href="{{link}}">{{gather_title}}</a> &nbsp;<a href="{{link}}/rss/" aria-label="Go to rss feed"><ion-icon name="logo-rss"></ion-icon></a>
<a href="{{link}}">{{gather_title}}</a> &nbsp;<a href="{{link}}rss/" aria-label="Go to rss feed"><ion-icon name="logo-rss"></ion-icon></a>
</h3>
</div>
</li>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,25 @@
{% load video_filters %}
{% load articletags %}

<div class="article-timeline landing_stream_block u-container u-container--large">
{% if articles %}
<div class="landing_stream_block u-container u-container--large">

{% include 'article/objects/article_column-pubdate-bottom.html' with style="pubdate-bottom left-right-desktop big" article=articles|first image_size="large" lede="true" byline="true" pubdate="true" %}

{% if articles|slice:"1:" %}
<div class="article-wrap">
{% for article in articles|slice:"1:"%}
{% if articles|length == 2 or articles|length == 3 %}
<div class="article-wrap">
{% for article in articles %}
{% include 'article/objects/article_column-pubdate-bottom.html' with style="pubdate-bottom small" article=article pubdate="true" %}
{% endfor %}
</div>
</div>
{% else %}
{% include 'article/objects/article_column-pubdate-bottom.html' with style="pubdate-bottom left-right-desktop big" article=articles|first image_size="large" lede="true" byline="true" pubdate="true" %}

{% if articles|slice:"1:" %}
<div class="article-wrap">
{% for article in articles|slice:"1:"%}
{% include 'article/objects/article_column-pubdate-bottom.html' with style="pubdate-bottom small" article=article pubdate="true" %}
{% endfor %}
</div>
{% endif %}
{% endif %}
</div>
</div>
{% endif %}
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ <h3 class="grouped_timeline--group-header-label">{{group.description|safe}}</h3>
{% for article in group.articles %}
<li>{% if article.article %}
<a href="{% pageurl article.article %}">{% if article.alias %}{{article.alias}}{% else %}{{article.article.title}}{% endif %}</a>
{% elif article.link %}
<a href="{{article.link}}">{{article.alias}}</a>
{% else %}
{% if article.alias %}{{article.alias}}{% endif %}
{% endif %}
Expand Down
3 changes: 0 additions & 3 deletions section/templates/section/section_page.html
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,6 @@ <h2 class="c-section__info-header">All in {{self.title}}</h1>
{% for category_menu_item in self.category_menu.all %}
{% if category_menu_item.category_page %}
<li><a href="{% pageurl category_menu_item.category_page %}" title="{{ category_menu_item.category_page.title }}">{{ category_menu_item.category_page.title }}</a></li>
{% else %}
comment Failsafe, since wagtail seems to delete empty menu items. Shouldn't ever end up here! endcomment
<li><a href="#">ERROR: EMPTY CATEGORY MENU ITEM! PLEASE CHECK THE SECTION PAGE IN WAGTAIL</a></li>
{% endif %}
{% endfor %}
</ul>
Expand Down
10 changes: 10 additions & 0 deletions ubyssey/static_src/src/styles/objects/_landing_stream_blocks.scss
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,16 @@
border: none;
background: linear-gradient(transparent calc(100% - 0.25em), var(--linkColour) 0);
color: var(--header_color);
a {
margin: auto;
width: fit-content;
border-radius: 0.5em 0.5em 0 0;
background: var(--linkColour);
color: white;
&:hover {
opacity: 0.8;
}
}
}
}
[color-css-theme="light"] {
Expand Down

0 comments on commit 9b1f2ea

Please sign in to comment.