Skip to content

Commit

Permalink
assets: fix header + banner placement
Browse files Browse the repository at this point in the history
* templates: fix community card link
* closes #324
  • Loading branch information
kpsherva authored and jrcastro2 committed Jan 23, 2025
1 parent 3fa8c37 commit 7630444
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 23 deletions.
6 changes: 6 additions & 0 deletions assets/less/cds-rdm/collections/message.overrides
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

.theme.header.frontpage {
.ui.inv-banner {
margin-bottom: calc(-1 * @homePageHeroHeight / 9) !important;
}
}
4 changes: 4 additions & 0 deletions assets/less/cds-rdm/elements/container.overrides
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@
}
}

.invenio-header-container{
z-index: 4 !important;
}

.cern-logo{
display: flex;
align-items: center;
Expand Down
2 changes: 1 addition & 1 deletion assets/less/cds-rdm/globals/site.overrides
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,4 @@
&:focus{
opacity:1;
}
}
}
8 changes: 1 addition & 7 deletions site/cds_rdm/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@


from flask import Blueprint, current_app, g, render_template
from flask_login import current_user
from flask_principal import AnonymousIdentity
from invenio_access.permissions import any_user
from invenio_communities import current_communities
Expand All @@ -37,12 +36,7 @@ def index():
)

featured = featured_communities_search.to_dict()["hits"]["hits"]
if current_user.is_authenticated:
my_comms = current_communities.service.search_user_communities(g.identity)
my_comms = my_comms.to_dict()["hits"]["hits"]
else:
my_comms = None
context = {"featured_communities": featured, "my_communities": my_comms}
context = {"featured_communities": featured}

return render_template(
current_app.config["THEME_FRONTPAGE_TEMPLATE"],
Expand Down
29 changes: 15 additions & 14 deletions templates/semantic-ui/invenio_app_rdm/frontpage.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ <h2 class="ui medium centered header">Browse</h2>
</div>
</div>
{%- block top_banner %}
{% if featured_communities %}
{% if featured_communities | length > 0 %}
<div class="frontpage-main communities rel-pb-3 rel-mt-2">
<div class="ui container rel-pb-2">
<h2 class="ui big header">Discover</h2>
Expand All @@ -65,24 +65,25 @@ <h2 class="ui big header">Discover</h2>
{% for community in featured_communities[:3] %}

<div class="ui card centered">
<div class="image">
<a href={{ community.links.self_html }}>
<a href={{ community.links.self_html }}>
<div class="image">
<img src="{{ community.links.logo }}"
alt="{{ community.metadata.title }} community logo">
</a>
</div>
<div class="content">
<div class="header">{{ community.metadata.title }}</div>
{% if type in community.metadata %}
<div class="meta">
</div>
<div class="content">
<div class="header">{{ community.metadata.title }}</div>
{% if type in community.metadata %}
<div class="meta">

<a href={{ community.links.self_html }}>{{ community.metadata.type.title.en }}</a>
<a href={{ community.links.self_html }}>{{ community.metadata.type.title.en }}</a>
</div>
{% endif %}
<div class="description truncate-lines-2">
{{ community.metadata.description }}
</div>
{% endif %}
<div class="description truncate-lines-2">
{{ community.metadata.description }}
</div>
</div>
</a>

</div>
{% endfor %}
</div>
Expand Down
3 changes: 2 additions & 1 deletion templates/semantic-ui/invenio_app_rdm/header_frontpage.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@
{%- block navbar %}
{{ super() }}
{%- block site_banner %}
{{ super() }}
{% from 'invenio_banners/banner.html' import banner %}
{{ banner(ui_classes="") }}
{%- endblock site_banner %}

{%- block flashmessages %}
Expand Down

0 comments on commit 7630444

Please sign in to comment.