Skip to content

Commit

Permalink
fix: added scss styling for cms
Browse files Browse the repository at this point in the history
  • Loading branch information
Talha-Rizwan committed Feb 20, 2024
1 parent 188cb63 commit 7460cd1
Show file tree
Hide file tree
Showing 7 changed files with 199 additions and 3 deletions.
2 changes: 2 additions & 0 deletions changelog.d/20240220_174954_talharizwan667_indigo_cms_scss.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- [Bugfix] *.scss files in cms directory were not rendered in the tutor environment because they are stored in a "partials" subdirectory. (by @Talha-Rizwan)
- [Improvement] added a customizable footer with styling as no custom footer was there for cms but for lms. (by @Talha-Rizwan)
9 changes: 6 additions & 3 deletions tutorindigo/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,12 @@
)

# Force the rendering of scss files, even though they are included in a "partials" directory
hooks.Filters.ENV_PATTERNS_INCLUDE.add_item(
r"indigo/lms/static/sass/partials/lms/theme/"
)
hooks.Filters.ENV_PATTERNS_INCLUDE.add_items([
r"indigo/lms/static/sass/partials/lms/theme/",
r"indigo/cms/static/sass/partials/cms/theme/"
])



# init script: set theme automatically
with open(
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/////////////////// General

@import './fonts';
@import './footer';
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@import url('https://fonts.googleapis.com/css2?family=Source+Sans+Pro:wght@400;600;700&family=Ubuntu:wght@400;500;700&display=swap');
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
.wrapper-view {
background: #fff;
padding-bottom: 340px;
position: relative;
min-height: 100vh;

@include media-breakpoint-up(sm) {
padding-bottom: 280px;
}
}

.wrapper-footer {
background: $footer-bg;
box-sizing: border-box;
padding: 0;
color: #fff;
position: absolute;
left: 0;
bottom: 0;
width: 100%;

.footer-main {
padding: 25px $baseline 30px;
}

footer {
.wrapper-logo {

a {

img {
height: 42px;
}
}
}

.nav-colophon {
a {
color: #fff;

&:hover {
color: $primary;
}
}
}
}

.nav-colophon {
line-height: 1.5;

h3 {
font-size: 20px;
font-weight: bold;
margin-bottom: 0.5rem;
}

ul {
padding-left: 40px;
list-style: disc;
}
}

.footer-copyright {
background: #fff;
padding: 16px 10px;
color: $primary;

p {
margin: 0;
}
}

*,
*:before,
*:after { box-sizing: border-box; }

a,
h3 {
color: #fff;
}

a {
&:hover {
color: $primary;
}
}

.description {
max-width: 550px;
line-height: 1.5;
}
}

.footer-container {
max-width: 1600px;
margin: 0 auto;
overflow: hidden;


.footer-col {
float: left;
width: 50%;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
$primary: #109dc2;
$footer-bg: #333;
$blue: $primary;

// Theme fonts
$font-family-title: Plex;
$serif: Crimson;
$f-sans-serif: Crimson, 'Open Sans','Helvetica Neue', Helvetica, Arial, sans-serif;

$content_padding_top: 24px;
$content-padding-bottom: 10px;
$header-height: 75px;
$footer-height: 125.5px;

// Initialize the Open edX Bootstrap theme
@import 'edx-bootstrap/sass/open-edx/theme';
66 changes: 66 additions & 0 deletions tutorindigo/templates/indigo/cms/templates/widgets/footer.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
## mako
<%page expression_filter="h"/>
<%!
from django.utils.translation import gettext as _
from django.urls import reverse
from datetime import datetime
from django.conf import settings
import pytz
from cms.djangoapps.contentstore.config.waffle import ENABLE_ACCESSIBILITY_POLICY_PAGE
from openedx.core.djangolib.markup import HTML, Text
%>
<% icp_license_info = getattr(settings, 'ICP_LICENSE_INFO', {})%>
<%namespace name='static' file='../static_content.html'/>

<div class="wrapper-footer wrapper">
<footer role="contentinfo">
<div class="footer-container footer-main">
<div class="footer-col">
<div class="wrapper-logo">
<p>
<a href="https://docs.tutor.edly.io" rel="noopener" target="_blank">
<img src="${static.url('images/studio-logo.png')}" alt="Runs on Tutor" width="140" />
</a>
</p>
</div>
<div class="description">
<p>studio footer text</p>
</div>
</div>
<div class="footer-col">
{% if INDIGO_FOOTER_NAV_LINKS %}
<nav class="nav-colophon" aria-label="${_('About')}">
<h3>Discover us</h3>
<ul>
<!-- uncomment this to add custom footer links
{% for link in INDIGO_FOOTER_NAV_LINKS %}
<li>
<a href="{{ link['url'] }}">{{ link['title'] }}</a>
</li>
{% endfor %} -->
<li>
<a id="lms-link" href="${settings.LMS_ROOT_URL}">${_("LMS")}</a>
</li>
</ul>
</nav>
{% endif %}
</div>
</div>
<div class="footer-copyright">
<div class="footer-container">
<p>&copy; copyright</p>
</div>
</div>
</footer>
</div>
% if include_dependencies:
<%static:js group='base_vendor'/>
<%static:css group='style-vendor'/>
<%include file="widgets/segment-io.html" />
<%include file="widgets/segment-io-footer.html" />
% endif
% if footer_css_urls:
% for url in footer_css_urls:
<link rel="stylesheet" type="text/css" href="${url}"></link>
% endfor
% endif

0 comments on commit 7460cd1

Please sign in to comment.