Skip to content

Commit

Permalink
Merge branch 'master' of github.com:OpenUpSA/pmg-cms-2
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmwatson committed Apr 30, 2024
2 parents e358fd0 + 4fe7a4b commit 9de2f40
Show file tree
Hide file tree
Showing 3 changed files with 102 additions and 65 deletions.
46 changes: 45 additions & 1 deletion pmg/static/resources/css/pr6.css
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,10 @@
text-transform: uppercase;
}

.full-article .article-title {
display: none;
}


.full-article .article-intro {
font-size: 20px;
Expand All @@ -118,9 +122,49 @@
text-align: justify;
}

.full-article .article-extra {
.full-article .article-content blockquote {
float: left;
width: 300px;
color: #f05532;
position: relative;
font-size: 1.4em;
padding-left: 2em;
margin: 1em;
line-height: 1.3em;
}


.full-article .article-content blockquote.right {
float: right;
border-left: none;
border-right: 5px solid #eee;
}

.full-article .article-content blockquote.full {
float: none;
width: 100%;
margin: 2em 0;
}



.full-article .article-content h3 {
font-size: 1.2em;
font-weight: bold;
}

.full-article .article-content h4 {
font-size: 1.1em;
font-weight: bold;
}



.full-article .article-extra, .full-article .article-footnotes {
font-size: 14px;
margin: 2em 0;
border-top: 1px solid #ccc;
padding-top: 2em;
}


Expand Down
107 changes: 44 additions & 63 deletions pmg/templates/pr6/landing.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,29 +34,23 @@ <h2>A comprehensive overview with commentary, data and interviews</h2>

<h2 class="pr6-section-title">ARTICLES</h2>



<section class="pr6-articles">
<div class="pr6-row">
<div class="col-4">
<article>
<h3><a href="/6th-parliament-review/articles/article">Lorem ipsum dolor sit amet, consectetur adipiscing elit.</a></h3>
<span class="article-meta">By Author Name</span>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam interdum magna a purus ultricies varius.</p>
</article>
</div>
<div class="col-4">
<article>
<h3><a href="#">Lorem ipsum dolor sit amet, consectetur adipiscing elit.</a></h3>
<span class="article-meta">By Author Name</span>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam interdum magna a purus ultricies varius.</p>
</article>
</div>
<div class="col-4">
<article>
<h3><a href="#">Lorem ipsum dolor sit amet, consectetur adipiscing elit.</a></h3>
<span class="article-meta">By Author Name</span>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam interdum magna a purus ultricies varius.</p>
</article>
</div>
{% for article in articles %}
<div class="col-4">
<article>
<h3><a href="/6th-parliament-review/articles/{{article.slug}}">{{article.title}}</a></h3>
{{article.body|
replace('<div class="article-content">','<div style="display: none">')|
replace('<div class="article-footnotes">','<div style="display: none">')|
replace('<div class="article-title">','<div style="display: none">')|
replace('<div class="article-extra">','<div style="display: none">')|
safe|truncate}}
</article>
</div>
{% endfor %}
</div>
</section>

Expand All @@ -68,57 +62,44 @@ <h2 class="pr6-section-title">INTERVIEWS</h2>

<section class="pr6-interviews">
<div class="pr6-row">
<div class="col-4">
<article>
<h3><a href="#">Lorem ipsum dolor sit amet, consectetur adipiscing elit.</a></h3>
<span class="article-meta">By Author Name</span>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam interdum magna a purus ultricies varius.</p>
</article>
</div>
<div class="col-4">
<article>
<h3><a href="#">Lorem ipsum dolor sit amet, consectetur adipiscing elit.</a></h3>
<span class="article-meta">By Author Name</span>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam interdum magna a purus ultricies varius.</p>
</article>
</div>
<div class="col-4">
<article>
<h3><a href="#">Lorem ipsum dolor sit amet, consectetur adipiscing elit.</a></h3>
<span class="article-meta">By Author Name</span>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam interdum magna a purus ultricies varius.</p>
</article>
</div>
{% for interview in interviews %}
<div class="col-4">
<article>
<h3><a href="/6th-parliament-review/interviews/{{interview.slug}}">{{interview.title}}</a></h3>
{{interview.body|
replace('<div class="article-content">','<div style="display: none">')|
replace('<div class="article-footnotes">','<div style="display: none">')|
replace('<div class="article-title">','<div style="display: none">')|
replace('<div class="article-extra">','<div style="display: none">')|
safe|truncate}}
</article>
</div>
{% endfor %}
</div>
</section>


<!-- STATISTICS -->

<h2 class="pr6-section-title">STATISTICS</h2>



<section class="pr6-statistics">
<div class="pr6-row">
<div class="col-4">
<article>
<h3><a href="#">Lorem ipsum dolor sit amet, consectetur adipiscing elit.</a></h3>
<span class="article-meta">By Author Name</span>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam interdum magna a purus ultricies varius.</p>
</article>
</div>
<div class="col-4">
<article>
<h3><a href="#">Lorem ipsum dolor sit amet, consectetur adipiscing elit.</a></h3>
<span class="article-meta">By Author Name</span>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam interdum magna a purus ultricies varius.</p>
</article>
</div>
<div class="col-4">
<article>
<h3><a href="#">Lorem ipsum dolor sit amet, consectetur adipiscing elit.</a></h3>
<span class="article-meta">By Author Name</span>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam interdum magna a purus ultricies varius.</p>
</article>
</div>
{% for stat in stats %}
<div class="col-4">
<article>
<h3><a href="/6th-parliament-review/interviews/{{interview.slug}}">{{stat.title}}</a></h3>
{{stat.body|
replace('<div class="article-content">','<div style="display: none">')|
replace('<div class="article-footnotes">','<div style="display: none">')|
replace('<div class="article-title">','<div style="display: none">')|
replace('<div class="article-extra">','<div style="display: none">')|
safe|truncate}}
</article>
</div>
{% endfor %}
</div>
</section>

Expand Down
14 changes: 13 additions & 1 deletion pmg/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1999,7 +1999,19 @@ def stats_review(stat):

@app.route("/6th-parliament-review", methods=["GET"])
def pr6():
return render_template("pr6/landing.html")
articles = Page.query.filter(Page.slug.like('%pr6-articles-%'))
interviews = Page.query.filter(Page.slug.like('%pr6-interviews-%'))
stats = Page.query.filter(Page.slug.like('%pr6-statistics-%'))

articles = articles.all()
interviews = interviews.all()
stats = stats.all()

return render_template("pr6/landing.html",
articles=articles,
interviews=interviews,
stats=stats
)

@app.route("/6th-parliament-review/articles/<slug>", methods=["GET"])
def pr6_articles(slug):
Expand Down

0 comments on commit 9de2f40

Please sign in to comment.