diff --git a/scipost_django/journals/templates/journals/_publication_li_content-alt.html b/scipost_django/journals/templates/journals/_publication_li_content-alt.html new file mode 100644 index 0000000000000000000000000000000000000000..4d112e20a18f226eeea21e0784560b7d724442e8 --- /dev/null +++ b/scipost_django/journals/templates/journals/_publication_li_content-alt.html @@ -0,0 +1,20 @@ +<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 %}•{% 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> diff --git a/scipost_django/news/factories.py b/scipost_django/news/factories.py index 9288aaaeb895cc06aa456b26b4257689673a3ab2..de646e94da3d4abe6c7d074ae4949b2ff1654cb6 100644 --- a/scipost_django/news/factories.py +++ b/scipost_django/news/factories.py @@ -14,5 +14,7 @@ class NewsItemFactory(factory.django.DjangoModelFactory): date = factory.Faker('date_this_year') headline = factory.Faker('sentence') blurb = factory.Faker('paragraph', nb_sentences=8) + blurb_short = factory.Faker('paragraph', nb_sentences=3) followup_link = factory.Faker('uri') followup_link_text = factory.Faker('sentence', nb_words=4) + published = True diff --git a/scipost_django/scipost/static/scipost/assets/css/_general.scss b/scipost_django/scipost/static/scipost/assets/css/_general.scss index b6899bd72492ec0a1ddfb815e059f60f3f64705b..0a515cf10e58f4494ae7a0bfb12edf98a3353f64 100644 --- a/scipost_django/scipost/static/scipost/assets/css/_general.scss +++ b/scipost_django/scipost/static/scipost/assets/css/_general.scss @@ -2,7 +2,7 @@ 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 { display: inline-block; diff --git a/scipost_django/scipost/static/scipost/assets/css/_homepage.scss b/scipost_django/scipost/static/scipost/assets/css/_homepage.scss index e192129d7ed8bdc8074c4efd2ed6266918a94d92..5caa2963ff44346ffa5aec47a67f7e9ca60f9dfe 100644 --- a/scipost_django/scipost/static/scipost/assets/css/_homepage.scss +++ b/scipost_django/scipost/static/scipost/assets/css/_homepage.scss @@ -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; + } + } + +} diff --git a/scipost_django/scipost/templates/scipost/index_alt.html b/scipost_django/scipost/templates/scipost/index_alt.html new file mode 100644 index 0000000000000000000000000000000000000000..2ccc70bf0c6445f455d5152ef1e04eacfd4f67c6 --- /dev/null +++ b/scipost_django/scipost/templates/scipost/index_alt.html @@ -0,0 +1,138 @@ +{% 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 %} diff --git a/scipost_django/scipost/urls.py b/scipost_django/scipost/urls.py index b58cf497f7401f1c001fe327f213885d896e0c13..b04286927580cbf80b1b2829044afbf99e67f93f 100644 --- a/scipost_django/scipost/urls.py +++ b/scipost_django/scipost/urls.py @@ -56,6 +56,7 @@ urlpatterns = [ name='search' ), 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'), # General use pages diff --git a/scipost_django/scipost/views.py b/scipost_django/scipost/views.py index c6b1c0e75210c4aca9e1072c7ec294122a056022..7381026013bb2f2a3c46b18e2b1fce5b6274dd86 100644 --- a/scipost_django/scipost/views.py +++ b/scipost_django/scipost/views.py @@ -173,6 +173,21 @@ def index(request): 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): """ Serve media files from outside the public MEDIA_ROOT folder.