SciPost Code Repository

Skip to content
Snippets Groups Projects
Commit 8e5c7b25 authored by Jorran de Wit's avatar Jorran de Wit
Browse files

alternative homepage

parent 116e86db
No related branches found
No related tags found
1 merge request!38Alternative homepage
<div class="publication">
<h3 class="title"><a href="{{ publication.get_absolute_url }}">{{ publication.title }}</a></h3>
<div class="authors">{{ publication.author_list }}</div>
<div class="specialties">
{% for specialty in publication.specialties.all %}
<span>
<a href="{% url 'journals:publications' %}?specialty={{ specialty.slug }}" class="muted-link p-1">{{ specialty }}</a>
{% if not forloop.last %}&bullet;{% endif %}
</span>
{% endfor %}
</div>
<div class="citation">{{ publication.citation }}</div> <span class="">published {{ publication.publication_date|date:'j F Y' }}</span>
{% for collection in publication.collection_set.all %}
<p class="m-1"><em>Part of the <a href="{{ collection.get_absolute_url }}">{{ collection }}</a> Collection in the <a href="{{ collection.series.get_absolute_url }}">{{ collection.series }}</a> Series.</em></p>
{% endfor %}
</div>
...@@ -14,5 +14,7 @@ class NewsItemFactory(factory.django.DjangoModelFactory): ...@@ -14,5 +14,7 @@ class NewsItemFactory(factory.django.DjangoModelFactory):
date = factory.Faker('date_this_year') date = factory.Faker('date_this_year')
headline = factory.Faker('sentence') headline = factory.Faker('sentence')
blurb = factory.Faker('paragraph', nb_sentences=8) blurb = factory.Faker('paragraph', nb_sentences=8)
blurb_short = factory.Faker('paragraph', nb_sentences=3)
followup_link = factory.Faker('uri') followup_link = factory.Faker('uri')
followup_link_text = factory.Faker('sentence', nb_words=4) followup_link_text = factory.Faker('sentence', nb_words=4)
published = True
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
General style sheet for SciPost General style sheet for SciPost
*/ */
@import url(https://fonts.googleapis.com/css?family=Merriweather+Sans&display=swap); @import url(https://fonts.googleapis.com/css?family=Merriweather+Sans:wght@100,400;500;600&display=swap);
.bi::before { .bi::before {
display: inline-block; display: inline-block;
......
...@@ -55,3 +55,219 @@ ...@@ -55,3 +55,219 @@
} }
} }
} }
.home-alt {
background-color: #fff;
.main-nav .nav-item { padding: 0 5px; }
.main-nav .nav-item .dropdown-toggle::after { content: none; }
.container { max-width: 1440px; }
h2, .h2 { font-size: 1.1rem; }
.publications {
.publication {
margin-bottom: 20px;
}
.authors {
margin-bottom: 4px;
font-weight: 600;
}
.specialties > span:first-child a {
padding-left: 0 !important;
}
}
.domains {
list-style: none;
padding: 0 0 20px 0;
margin: 0;
li {
font-size: 1.0rem;
display: inline-block;
background-color: #d3e3f6;
padding: 5px 15px;
margin-right: 15px;
border-radius: 99px;
cursor: pointer;
transition: 100ms;
}
li.active {
background-color: #496bb6;
color: #fff;
text-decoration: underline;
}
li:hover {
background-color: #b8c8db;
text-decoration: underline;
}
li.active:hover {
background-color: #3e5c9d;
}
}
.subdomains {
list-style: none;
padding: 0;
margin-bottom: 20px;
li {
font-size: 0.825rem;
display: inline-block;
background-color: #eee;
padding: 2px 10px;
margin: 0 5px 10px 0;
border-radius: 99px;
cursor: pointer;
transition: 100ms;
border: 1px solid #dedede;
transition: 200ms;
}
li:hover,
li.active {
background-color: #ccc;
// text-decoration: underline;
}
}
.container {
box-shadow: none;
border: 0;
}
.navbar .nav-link {
font-weight: normal;
}
header .logobox img {
max-height: 45px;
width: auto;
margin: 15px 10px;
}
.publication-list ul {
list-style: none;
padding: 0;
}
.citation {
background-color: #f6a125;
display: inline-block;
padding: 0 10px;
border-radius: 99px;
margin-right: 5px;
margin-top: 3px;
}
.header {
list-style: none;
padding: 0 0 10px;
margin: 0 0 25px;
border-bottom: 1px solid #ccc;
> a {
margin-bottom: 0 !important;
padding: 0 0 0 3px !important;
}
}
ul.header-list {
list-style: none;
padding: 0 0 5px;
margin: 0 0 25px;
border-bottom: 1px solid #ccc;
li {
display: inline-block;
position: relative;
cursor: pointer;
margin-right: 10px;
h2 {
font-weight: 300;
font-size: 1.0rem;
}
}
li.active h2 {
font-weight: normal;
font-size: 1.1rem;
}
li:after {
content: '';
width: 0;
transition: 200ms;
background: #000;
height: 2px;
display: block;
bottom: -5px;
position: absolute;
}
li:hover:after,
li.active:after {
width: 100%;
}
}
.link-cloud {
list-style: none;
padding: 0;
text-align: center;
padding: 15px 0;
border-top: 1px solid #ddd;
margin-top: 5px;
li {
display: inline;
color: #777;
margin: 0 5px;
cursor: pointer;
line-height: 2.0;
white-space: nowrap;
&:hover {
text-decoration: underline;
}
}
}
.news h3 > a { color: initial; }
.news ul {
list-style: none;
padding: 0;
li {
margin-bottom: 30px;
}
}
.news li .date {
color: #aaa;
text-transform: uppercase;
font-size: 2.3em;
width: 60px;
line-height: 0.8;
float: left;
padding: 4px 5px 10px 0;
.month {
display: inline-block;
font-size: 0.7em;
}
}
}
{% extends 'scipost/base.html' %}
{% block headsup %}
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Merriweather+Sans:wght@300;400;500;600&display=swap" rel="stylesheet">
{% endblock headsup %}
{% load render_bundle from webpack_loader %}
{% load static %}
{% block body_class %}{{ block.super }} homepage home-alt{% endblock %}
{% block meta_description %}{{ block.super }} homepage{% endblock meta_description %}
{% block pagetitle %}Homepage{% endblock pagetitle %}
{% block content %}
<div class="row">
<div class="col-12">
<ul class="domains">
<li class="active">Physics</li>
<li>Chemistry</li>
<li>Political Science</li>
<li>Mathematics</li>
<li>Astronomy</li>
</ul>
<ul class="subdomains"> <li value="phys-ae">Atomic, Molecular and Optical Physics - Experiment</li> <li value="phys-at" class="active">Atomic, Molecular and Optical Physics - Theory</li> <li value="phys-bi">Biophysics</li> <li value="phys-ce">Condensed Matter Physics - Experiment</li> <li value="phys-ct">Condensed Matter Physics - Theory</li> <li value="phys-cc">Condensed Matter Physics - Computational</li> <li value="phys-fd">Fluid Dynamics</li> <li value="phys-gr">Gravitation, Cosmology and Astroparticle Physics</li> <li value="phys-he">High-Energy Physics - Experiment</li> <li value="phys-ht">High-Energy Physics - Theory</li> <li value="phys-hp">High-Energy Physics - Phenomenology</li> <li value="phys-mp">Mathematical Physics</li> <li value="phys-ne">Nuclear Physics - Experiment</li> <li value="phys-nt">Nuclear Physics - Theory</li> <li value="phys-qp">Quantum Physics</li> <li value="phys-sm">Statistical and Soft Matter Physics</li>
</ul>
</div>
</div>
<div class="row">
<div class="col-md-8">
<div class="publications">
<ul class="header-list">
<li><h2>Journals</h2></li>
<li class="active"><h2>Publications</h2></li>
<li><h2>Submissions</h2></li>
<li><h2>Reports</h2></li>
<li><h2>Comments</h2></li>
</ul>
<div class="publication-list">
{% for publication in publications %}
{% include 'journals/_publication_li_content-alt.html' with publication=publication %}
{% endfor %}
</div>
</div>
</div>
<div class="col-md-4">
<!-- News -->
<div class="news">
<h2 class="header">News
<a class="btn btn-link btn-sm" href="{% url 'scipost:feeds' %}" aria-label="RSS feeds">{% include 'bi/rss-fill.html' %}</a>
</h2>
<ul>
{% for news in news_items %}
<li>
<div class="date">{{ news.date|date:'d' }}<span class="month">{{ news.date|date:'M' }}</span></div>
<div>
<h3><a href="{% url 'news:news' %}#news_{{ news.id }}">{{ news.headline }}</a></h3>
<p>{{ news.blurb_short }}</p>
</div>
</li>
{% endfor %}
</ul>
</div><!-- End news -->
<div>
<ul class="link-cloud">
<li>About</li>
<li>Contact Us</li>
<li>The Foundation</li>
<li>Careers</li>
<li>FAQ</li>
<li>News</li>
<li>Feeds</li>
<li>Our Business model</li>
<li>Organizations</li>
<li>Sponsors</li>
<li>Finances</li>
</ul>
</div>
</div>
</div>
{% endblock %}
{% block content_footer %}
<div class="row">
<div class="col-12"><h1 class="header">Sponsors</h1></div>
<div class="col-md-8">
<p>
SciPost guarantees free online access to all publications in all its Journals and does not charge any article processing fees for publishing. Sponsors provide operating funds to SciPost through a cost-slashing consortial model.
</p>
<p>
We invite <a href="{% url 'organizations:organizations' %}">organizations benefitting from SciPost's activities</a> to join our growing <a href="{% url 'sponsors:sponsors' %}">list of Sponsors</a>. Look at our <a href="{% static 'sponsors/SciPost_Sponsors_Board_Prospectus.pdf' %}">one-page Prospectus</a> and at our full <a href="{% static 'sponsors/SciPost_Sponsorship_Agreement.pdf' %}">Sponsorship Agreement template</a>.
</p>
<p>
<strong>Scientists, please help us out:</strong> Please petition your local librarian/director/... to consider sponsoring us. You can use this email <a href="mailto:?subject=Petition to support SciPost&body={% autoescape on %}{% include 'sponsors/sponsor_petition_email.html' %}{% endautoescape %}&cc=sponsors@scipost.org">template</a>.
</p>
</div>
<div class="col-md-4">
<a href="{% url 'sponsors:sponsors' %}">See all sponsors</a>
<br>
<ul class="list list-unstyled">
{% for sponsor in current_sponsors %}
{% if sponsor.logo %}
<li class="p-2"><img class="rounded" src="{{ sponsor.logo.url }}" alt="{{ sponsor.name }} logo"></li>
{% endif %}
{% endfor %}
</ul>
</div>
</div>
<div class="row">
<div class="col-12">
<h1 class="header mt-3">SciPost participates in</h1>
<div class="logos text-center">
<a href="//www.crossref.org" target="_blank" rel="noopener"><img src="//assets.crossref.org/logo/crossref-logo-200.svg" width="100" alt="Crossref logo"></a>
<a href="//www.doaj.org" target="_blank" rel="noopener"><img src="{% static 'scipost/images/doaj_logo_200.jpg' %}" width="90" alt="DOAJ logo"></a>
<a href="//www.clockss.org" target="_blank" rel="noopener"><img src="{% static 'scipost/images/clockss_original_logo_boxed_ai-cropped-90.png' %}" width="80" alt="Clockss logo"></a>
<a href="//i4oc.org/" target="_blank" rel="noopener"><img width="100" src="{% static 'scipost/images/I4OC.png' %}" alt="I4OC logo"></a>
<a href="//freejournals.org" target="_blank" rel="noopener"><img width="100" src="{% static 'scipost/images/FJN-logo-long.png' %}" alt="FJN logo"></a>
</div>
</div>
</div>
{% endblock %}
...@@ -56,6 +56,7 @@ urlpatterns = [ ...@@ -56,6 +56,7 @@ urlpatterns = [
name='search' name='search'
), ),
url(r'^$', views.index, name='index'), url(r'^$', views.index, name='index'),
url(r'^home_alt/$', views.index_alt, name='index-alt'),
url(r'^files/secure/(?P<path>.*)$', views.protected_serve, name='secure_file'), url(r'^files/secure/(?P<path>.*)$', views.protected_serve, name='secure_file'),
# General use pages # General use pages
......
...@@ -173,6 +173,21 @@ def index(request): ...@@ -173,6 +173,21 @@ def index(request):
return render(request, 'scipost/index.html', context) return render(request, 'scipost/index.html', context)
def index_alt(request):
"""Homepage view of SciPost."""
if not request.user.is_authenticated or not request.user.is_superuser:
# Only superusers may get to see secure files without an explicit serve method!
raise Http404
context = {
'news_items': NewsItem.objects.homepage().order_by('-date')[:4],
'publications': Publication.objects.published().order_by('-publication_date',
'-paper_nr')[:10],
'current_sponsors': Organization.objects.current_sponsors().order_by('?')[:2]
}
return render(request, 'scipost/index_alt.html', context)
def protected_serve(request, path, show_indexes=False): def protected_serve(request, path, show_indexes=False):
""" """
Serve media files from outside the public MEDIA_ROOT folder. Serve media files from outside the public MEDIA_ROOT folder.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment