Skip to content

Commit

Permalink
feat(frontend): sandwich main content with sidebar on narrow screens
Browse files Browse the repository at this point in the history
- adjust styling so that some parts of sidebar can go above the main
page content and some below on pages
- get rid of independent main-content margins
- introduce a new base template "base_page_with_side_cards.html" from
which templates using this sandwiching behaviour can inherit
- adjust existing pages to use this template
  • Loading branch information
dchiller committed Jun 17, 2024
1 parent 5cee181 commit 2e06934
Show file tree
Hide file tree
Showing 13 changed files with 2,188 additions and 2,159 deletions.
17 changes: 10 additions & 7 deletions django/cantusdb_project/articles/templates/article_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,14 @@
{% block content %}
<div class="container">
<title>{{ article.title }} | Cantus Database</title>
<div class="row">
<div class="p-3 col-lg-8 bg-white rounded main-content">
<div class="row d-lg-block">
<div class="col-lg-4 pl-0 pl-lg-3 pr-0 sidebar float-right">
<div class="search-bar mb-3">
{% include "global_search_bar.html" %}
</div>
</div>

<div class="p-3 col-lg-8 bg-white rounded main-content float-left mb-3">
<h3>
{{ article.title }}
</h3>
Expand All @@ -21,11 +27,8 @@ <h3>
</div>
</div>
</div>
<div class="col p-0 sidebar">
<div class="search-bar mb-3">
{% include "global_search_bar.html" %}
</div>
<div class="card mt-3 w-100">
<div class="col-lg-4 pl-0 pl-lg-3 pr-0 sidebar float-right">
<div class="card">
<div class="card-header">
What's New
</div>
Expand Down
17 changes: 9 additions & 8 deletions django/cantusdb_project/articles/templates/article_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,13 @@
{% block content %}
<div class="container">
<title>What's New | Cantus Database</title>
<div class="row">
<div class="p-3 col-lg-8 bg-white rounded main-content">
<div class="row d-lg-block">
<div class="col-lg-4 p-0 pl-lg-3 sidebar float-right">
<div class="search-bar mb-3">
{% include "global_search_bar.html" %}
</div>
</div>
<div class="p-3 col-lg-8 bg-white rounded main-content float-left mb-3">
<h3>What's New</h3>
{% for article in articles %}
<div class="row">
Expand All @@ -24,12 +29,8 @@ <h4>
{% include "pagination.html" %}
<br>
</div>
<div class="col p-0 sidebar">
<div class="search-bar mb-3">
{% include "global_search_bar.html" %}
</div>

<div class="card mt-3 w-100">
<div class="col-lg-4 p-0 pl-lg-3 sidebar float-right">
<div class="card">
<div class="card-header">
What's New
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{% extends "base.html" %}
{% block content %}
{% block title %}
{% endblock %}
{% block script %}
{% endblock %}

<div class="container">
<div class="row d-lg-block">
<div class="col-lg-4 p-0 pl-lg-3 sidebar float-right">
{% block uppersidebar %}
{# Cards in this section will jump above the main content on small screens #}
{% endblock %}
</div>
<div class="p-3 col-lg-8 bg-white rounded main-content float-left mb-3">
{% block maincontent %}
{% endblock %}
</div>

<div class="col-lg-4 p-0 pl-lg-3 sidebar float-right">
{% block lowersidebar %}
{# Cards in this section will jump below the main content on small screens #}
{% endblock %}
</div>
</div>
</div>
{% endblock %}
348 changes: 174 additions & 174 deletions django/cantusdb_project/main_app/templates/browse_chants.html

Large diffs are not rendered by default.

Loading

0 comments on commit 2e06934

Please sign in to comment.