Skip to content

Commit

Permalink
🍱(edulib) update templates and asset to 1.10.0
Browse files Browse the repository at this point in the history
update templates and asset to 1.10.0 but maintain icon font
  • Loading branch information
2018D committed Jan 6, 2020
1 parent fa480e2 commit fd50c4b
Show file tree
Hide file tree
Showing 10 changed files with 116 additions and 23 deletions.
19 changes: 15 additions & 4 deletions src/backend/funmooc/templates/courses/cms/course_detail.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
{% extends "richie/fullwidth.html" %}
{% load cms_tags i18n extra_tags thumbnail %}

{% block meta %}
{# Make sure course snapshot pages are not indexed by search engines #}
{% if current_page.parent_page.course %}<meta name="robots" content="noindex">{% endif %}
{% endblock meta %}
{% block breadcrumbs %}{% endblock breadcrumbs %}

{% block meta_index_rules %}
{# Make sure course snapshot pages are not indexed by search engines #}
{% if current_page.parent_page.course %}
<meta name="robots" content="noindex">
{% else %}
{{ block.super }}
{% endif %}
{% endblock meta_index_rules %}

{% block meta_opengraph_contextuals %}
<meta property="og:title" content="{{ current_page.get_title|truncatechars:65 }}">
<meta property="og:url" content="{{ SITE.web_url }}{{ current_page.get_absolute_url }}">
{% endblock meta_opengraph_contextuals %}

{% block content %}{% spaceless %}
<div class="course-detail">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
{% load i18n cms_tags extra_tags thumbnail %}
{% comment %}Obviously, the context template variable "organization" is required and must be an Organization page extension{% endcomment %}
{% with organization_page=organization.extended_object %}
<a class="organization-glimpse organization-glimpse--link{% if organization_page.publisher_is_draft is True %} organization-glimpse--draft{% endif %}" href="{{ organization_page.get_absolute_url }}">
<a class="
organization-glimpse organization-glimpse--link
{% if variant %} organization-glimpse--{{ variant }}{% endif %}
{% if organization_page.publisher_is_draft is True %} organization-glimpse--draft{% endif %}
"
href="{{ organization_page.get_absolute_url }}"
>
<div class="organization-glimpse__logo">
{% get_placeholder_plugins "logo" organization_page as plugins or %}
<p class="organization-glimpse__logo__empty">{% trans "Logo" %}</p>
Expand Down
12 changes: 8 additions & 4 deletions src/backend/funmooc/templates/courses/cms/person_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
<img
src="{% thumbnail instance.picture 200x200 crop upscale subject_location=instance.picture.subject_location %}"
srcset="
{% thumbnail instance.picture 200x200 crop upscale subject_location=instance.picture.subject_location %} 200w
{% if instance.picture.width >= 400 %},{% thumbnail instance.picture 400x400 crop upscale subject_location=instance.picture.subject_location %} 400w{% endif %}
{% if instance.picture.width >= 600 %},{% thumbnail instance.picture 600x600 crop upscale subject_location=instance.picture.subject_location %} 600w{% endif %}
{% thumbnail instance.picture 200x200 crop upscale subject_location=instance.picture.subject_location %} 200w,
{% if instance.picture.width >= 400 %}{% thumbnail instance.picture 400x400 crop upscale subject_location=instance.picture.subject_location %} 400w,{% endif %}
{% if instance.picture.width >= 600 %}{% thumbnail instance.picture 600x600 crop upscale subject_location=instance.picture.subject_location %} 600w{% endif %}
"
sizes="200px"
alt="{% if instance.picture.default_alt_text %}{{ instance.picture.default_alt_text }}{% else %}{% blocktrans with title=current_page.get_title %}{{ title }} avatar{% endblocktrans %}{% endif %}"
Expand Down Expand Up @@ -49,7 +49,11 @@ <h1 class="person-detail__card__content__title">{% render_model current_page "ti
{% if current_page.publisher_is_draft or not current_page|is_empty_placeholder:"organizations" %}
<section class="organization-glimpse-list">
<h2 class="organization-glimpse-list__title">{% trans "Organizations" %}</h2>
{% placeholder "organizations" %}
{% placeholder "organizations" or %}
<p class="organization-glimpse-list__empty">
{% trans "No associated organizations" %}
</p>
{% endplaceholder %}
</section>
{% endif %}

Expand Down
49 changes: 43 additions & 6 deletions src/backend/funmooc/templates/richie/base.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,42 @@
{% load i18n cms_tags menu_tags static sekizai_tags %}
<!doctype html>
<html>
<html lang="{{ LANGUAGE_CODE }}">
<head>
{% spaceless %}
<title>{% block title %}{{ SITE.name }}{% endblock title %}</title>
<meta name="viewport" content="width=device-width,initial-scale=1">
{% block meta %}{% endblock meta %}
{% block meta %}
{% block meta_index_rules %}
<meta name="robots" content="index,follow,all">
{% endblock meta_index_rules %}

{% block meta_html %}
{% page_attribute "meta_description" as meta_description %}
{% if meta_description and meta_description != "None" %}<meta name="description" content="{% block meta-description %}{{ meta_description }}{% endblock %}">{% endif %}
{% endblock meta_html %}

{% block meta_opengraph %}
{% block meta_opengraph_locale %}
<meta property="og:locale" content="{{ LANGUAGE_CODE }}">
{% endblock meta_opengraph_locale %}
{% block meta_opengraph_type %}
<meta property="og:type" content="website">
{% endblock meta_opengraph_type %}
{% block meta_opengraph_sitename %}
<meta property="og:site_name" content="{{ SITE.name }}">
{% endblock meta_opengraph_sitename %}
{% comment %}Since we are not able yet to get relevant image contextually for each content kind, we
keep the logo as the ressource image for all{% endcomment %}
{% block meta_opengraph_image %}
<meta property="og:image" content="{{ SITE.web_url }}{% static "richie/images/edulib_bleu.png" %}">
{% endblock meta_opengraph_image %}
{% block meta_opengraph_contextuals %}
<meta property="og:title" content="{{ SITE.name }}">
<meta property="og:url" content="{{ SITE.web_url }}">
{% endblock meta_opengraph_contextuals %}
{% endblock meta_opengraph %}
{% endblock meta %}
{% endspaceless %}

{% render_block "css" %}

Expand All @@ -22,7 +54,7 @@
<button class="topbar__hamburger"
data-target="main-menu" aria-label="menu" aria-expanded="false">&#8801;</button>
<a href="/" class="topbar__brand__link">
<img src="{% static "images/edulib_bleu.png" %}" class="topbar__brand__logo" alt="{{ SITE.name }}">
<img src="{% static "richie/images/edulib_bleu.png" %}" class="topbar__brand__logo" alt="{{ SITE.name }}">
</a>
</div>
<div class="topbar__menu">
Expand All @@ -43,24 +75,29 @@
{% endblock body_header %}

<div class="body-content {% block bodycontent_classes %}{% endblock bodycontent_classes %}">
{% block breadcrumbs %}
<ul class="breadcrumbs">
{% block breadcrumbs_content %}{% show_breadcrumb 0 "menu/breadcrumb_item.html" %}{% endblock breadcrumbs_content %}
</ul>
{% endblock breadcrumbs %}
{% block content %}{% endblock content %}
</div>

{% block body_footer %}
<div class="body-footer">
<div class="body-footer__menu">
<ul class="body-footer__menu__list">
{% show_menu_below_id "annex" 0 100 100 100 "menu/footer_menu.html" %}
{% show_menu_below_id "annex" 0 2 100 100 "menu/footer_menu.html" %}
</ul>
</div>
<div class="body-footer__brand">
<a href="/" class="body-footer__brand__link">
<img src="{% static "images/edulib_blanc.png" %}" class="body-footer__brand__logo" alt="">
<img src="{% static "richie/images/edulib_blanc.png" %}" class="body-footer__brand__logo" alt="">
</a>
{% include "social-networks/footer-badges.html" %}
</div>
<div class="body-footer__mentions">
<p>{% now "Y" %} &copy; EDUlib {% trans "All Rights Reserved." %}</p>
<p>{% now "Y" %} &copy; EDUlib {% blocktrans %}All Rights Reserved.{% endblocktrans %}</p>
</div>
<div class="body-footer__poweredby">
<a href="https://github.com/openfun/richie" class="body-footer__poweredby__link">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,8 @@
{% if instance.logo %}
<img src="{% thumbnail instance.logo 1280x400 crop='smart' %}" class="large-banner__logo" alt="{{ instance.logo_alt_text }}"/>
{% endif %}
{% if instance.content %}
<div class="large-banner__content">{{ instance.content|safe }}</div>
{% endif %}
</div>
</div>
18 changes: 15 additions & 3 deletions src/backend/funmooc/templates/social-networks/blogpost-badges.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,25 @@
{% blocktrans with title=page_title asvar mailto_subject %}EDUlib news: {{ title }}{% endblocktrans %}
{% blocktrans with title=page_title|safe url=full_page_url asvar shared_sentence %}EDUlib news: {{ title }} {{ url }}{% endblocktrans %}
<div class="social-network-badges">
<a href="https://www.facebook.com/share.php?u={{ full_page_url }}" target="_blank" class="social-network-badges__item social-network-badges__item--facebook" title="{% trans "Share on Facebook" %}">
<a href="https://www.facebook.com/share.php?u={{ full_page_url }}"
class="social-network-badges__item social-network-badges__item--facebook"
target="_blank"
title="{% trans "Share on Facebook" %}"
>
<span class="icon-facebook"></span>
</a>
<a href="https://twitter.com/intent/tweet?text={{ shared_sentence|urlencode }}" class="social-network-badges__item social-network-badges__item--twitter" target="_blank" title="{% trans "Share on Twitter" %}">
<a href="https://twitter.com/intent/tweet?text={{ shared_sentence|urlencode }}"
class="social-network-badges__item social-network-badges__item--twitter"
target="_blank"
title="{% trans "Share on Twitter" %}"
>
<span class="icon-twitter"></span>
</a>
<a href="mailto:?subject={{ mailto_subject }}&amp;body={{ full_page_url }}" class="social-network-badges__item social-network-badges__item--email" target="_blank" title="{% trans "Share by Email" %}">
<a href="mailto:?subject={{ mailto_subject }}&amp;body={{ full_page_url }}"
class="social-network-badges__item social-network-badges__item--email"
target="_blank"
title="{% trans "Share by Email" %}"
>
<span class="icon-email"></span>
</a>
</div>
Expand Down
18 changes: 15 additions & 3 deletions src/backend/funmooc/templates/social-networks/course-badges.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,25 @@
{% blocktrans asvar shared_subject %}Follow a course online with EDUlib{% endblocktrans %}
{% blocktrans with title=page_title|safe url=full_page_url asvar shared_sentence %}I just enrolled to the course "{{ title }}" on EDUlib: {{ url }}{% endblocktrans %}
<div class="social-network-badges">
<a href="https://www.facebook.com/EDUlib.org/" target="_blank" class="social-network-badges__item social-network-badges__item--facebook" title="{% trans "Facebook page" %}">
<a href="https://www.facebook.com/share.php?u={{ full_page_url }}"
class="social-network-badges__item social-network-badges__item--facebook"
target="_blank"
title="{% trans "Facebook page" %}"
>
<span class="icon-facebook"></span>
</a>
<a href="https://twitter.com/intent/tweet?text={{ shared_sentence|urlencode }}" class="social-network-badges__item social-network-badges__item--twitter" target="_blank" title="{% trans "Share on Twitter" %}">
<a href="https://twitter.com/intent/tweet?text={{ shared_sentence|urlencode }}"
class="social-network-badges__item social-network-badges__item--twitter"
target="_blank"
title="{% trans "Share on Twitter" %}"
>
<span class="icon-twitter"></span>
</a>
<a href="mailto:?subject={{ shared_subject }}&amp;body={{ shared_sentence }}" class="social-network-badges__item social-network-badges__item--email" target="_blank" title="{% trans "Share by Email" %}">
<a href="mailto:?subject={{ shared_subject }}&amp;body={{ shared_sentence }}"
class="social-network-badges__item social-network-badges__item--email"
target="_blank"
title="{% trans "Share by Email" %}"
>
<span class="icon-email"></span>
</a>
</div>
Expand Down
12 changes: 10 additions & 2 deletions src/backend/funmooc/templates/social-networks/footer-badges.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
{% load i18n %}{% spaceless %}
<a href="https://www.facebook.com/EDUlib.org/" target="_blank" class="body-footer__brand__badge body-footer__brand__badge--facebook" title="{% trans "Facebook page" %}">
<a href="https://www.facebook.com/EDUlib.org/"
class="body-footer__brand__badge body-footer__brand__badge--facebook"
target="_blank"
title="{% trans "Facebook page" %}"
>
<span class="icon-facebook"></span>
</a>
<a href="https://twitter.com/EDUlib_ORG" class="body-footer__brand__badge body-footer__brand__badge--twitter" target="_blank" title="{% trans "Twitter page" %}">
<a href="https://twitter.com/EDUlib_ORG"
class="body-footer__brand__badge body-footer__brand__badge--twitter"
target="_blank"
title="{% trans "Twitter page" %}"
>
<span class="icon-twitter"></span>
</a>
{% endspaceless %}

0 comments on commit fd50c4b

Please sign in to comment.