Skip to content

Commit

Permalink
frontpage: rewrite communities carousel to python and jinja
Browse files Browse the repository at this point in the history
  • Loading branch information
jennur committed Jul 4, 2023
1 parent 69e5b98 commit 061a97b
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,7 @@
text-shadow: 0 1px 2px rgba(0,0,0,.4);
cursor: pointer;
width: auto;
position: relative;
z-index: 1;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,41 +27,41 @@
@keyframes carouselSlideInLeft {
0% {
opacity: 0;
transform: translate3d(100%, 0, 0);
transform: translateX(100vw);
}
100% {
transform: none;
transform: translateX(0);
}
}

@keyframes carouselSlideOutLeft {
0% {
opacity: 1;
transform: translate3d(-100%, 0, 0);
transform: translateX(0);
}
100% {
opacity: 0;
transform: translate3d(-200%, 0, 0);
transform: translateX(-100vw);
}
}

@keyframes carouselSlideInRight {
0% {
opacity: 0;
transform: translate3d(-100%, 0, 0);
transform: translateX(-100vw);
}
100% {
transform: none;
transform: translateX(0);
}
}

@keyframes carouselSlideOutRight {
0% {
opacity: 1;
transform: translate3d(-100%, 0, 0);
transform: translateX(0);
}
100% {
opacity: 0;
transform: translate3d(0%, 0, 0);
transform: translateX(100vw);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -102,18 +102,19 @@
.item {
&.community-item {
.ui.grid {
margin-left: 0.5em !important;
width: 100% !important;
}
.content{
margin-left: 0.5em !important;
width: 100% !important;
}

.content {
width: 100% !important;

&.flex.right-column{
flex-direction: column;
align-items: end;
};
}
.extra{
.extra {
@media all and (min-width: @tabletBreakpoint) {
position: absolute;
bottom: 0.7em !important;
Expand Down
20 changes: 16 additions & 4 deletions invenio_app_rdm/theme/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,18 @@
from invenio_i18n import lazy_gettext as _
from invenio_users_resources.forms import NotificationsForm

# Generate rule from string or tuple
def create_url_rule(rule, default_view_func):
if isinstance(rule, tuple):
path, view_func = rule

if view_func == None:
view_func = default_view_func

return { "rule": path, "view_func": view_func }
else:
return { "rule": rule, "view_func": default_view_func }


#
# Registration
Expand All @@ -33,10 +45,10 @@ def create_blueprint(app):
static_folder="static",
)

blueprint.add_url_rule(routes["index"], view_func=index)
blueprint.add_url_rule(routes["robots"], view_func=robots)
blueprint.add_url_rule(routes["help_search"], view_func=help_search)
blueprint.add_url_rule(routes["help_statistics"], view_func=help_statistics)
blueprint.add_url_rule(**create_url_rule(routes["index"], default_view_func=index))
blueprint.add_url_rule(**create_url_rule(routes["robots"], default_view_func=robots))
blueprint.add_url_rule(**create_url_rule(routes["help_search"], default_view_func=help_search))
blueprint.add_url_rule(**create_url_rule(routes["help_statistics"], default_view_func=help_statistics))

@blueprint.before_app_first_request
def init_menu():
Expand Down

0 comments on commit 061a97b

Please sign in to comment.