Merge remote-tracking branch 'origin/master'

This commit is contained in:
Weblate 2018-10-13 00:25:28 +00:00
commit 185a2a5d13
7 changed files with 163 additions and 84 deletions

View File

@ -3,7 +3,7 @@ from django import forms
from dal import autocomplete
from leaflet.admin import LeafletGeoAdmin
from .models import CaseStudy, CaseStudyDraft, SpatialRefSys
from .models import CaseStudy, CaseStudyDraft, SpatialRefSys, PointOfInterest
class CaseStudyDraftAdmin(admin.ModelAdmin):
@ -51,3 +51,4 @@ class CaseStudyAdmin(LeafletGeoAdmin):
admin.site.register(CaseStudy, CaseStudyAdmin)
admin.site.register(SpatialRefSys)
admin.site.register(CaseStudyDraft, CaseStudyDraftAdmin)
admin.site.register(PointOfInterest)

View File

@ -1016,6 +1016,12 @@ class CaseStudy(models.Model):
class PointOfInterest(models.Model):
class Meta:
verbose_name_plural = 'points of interest'
def __str__(self):
return self.title
author = models.ForeignKey(
User,
models.SET_NULL,
@ -1026,7 +1032,7 @@ class PointOfInterest(models.Model):
date_created = models.DateTimeField(auto_now_add=True, null=False)
slug = AutoSlugField(populate_from=['entry_name'], editable=False)
slug = AutoSlugField(populate_from=['title'], editable=False)
approved = models.BooleanField(default=False)

View File

@ -1,4 +1,4 @@
{% extends "base_page.html" %}
{% extends "base.html" %}
{% load bootstrap3 %}
{% load compress %}
{% load i18n %}
@ -7,41 +7,94 @@
{% block stylesheets %}
{{ block.super }}
<style>
a.btn-jumbo {
color: navy;
width:320px;
height:240px;
border: 1px solid black;
border-radius: 5px;
white-space: normal;
line-height:55px;
padding:80px 20px;
margin: 20px;
}
a.btn-jumbo > * {
vertical-align: middle;
display: inline-block;
line-height:20px;
}
div.btn-jumbo-group {
text-align: center;
}
.form-selector {
max-width: 50em;
margin: auto;
margin-top: 2em;
}
.subhead {
font-size: 120%;
margin-bottom: 2em;
}
.entry {
display: flex;
align-items: center;
margin-bottom: 1em;
color: black;
background-color: #eee;
border-radius: 10px;
}
.entry:hover {
text-decoration: none;
background-color: #ddd;
}
.entry-title {
font-size: 120%;
font-weight: 900;
margin-top: 1.4rem;
}
.entry-desc {
margin-bottom: 1em;
}
.entry-icon {
font-size: 2em;
width: 2em;
display: block;
text-align: center;
}
</style>
{% endblock %}
{% block title %}{% trans "How much time do you have?" %}{% endblock %}
{% block description %}
{% trans "A complete picture is always more helpful but sometimes you don't have the time" %}
{% endblock %}
{% block inner %}
<div class="btn-jumbo-group">
<a class="btn btn-block btn-warning" href="{% url 'long-form' %}" role="button">
<h2>20+ Minutes</h2>
<p>Full Form (Preferred)</p>
{% block content %}
<div class="container">
<div class="col-sm-12">
<div class="form-selector">
<h1>{% trans "Create a new entry" %}</h1>
<p class="subhead">{% trans "What kind of entry do you want to create?" %}</p>
<a class="entry" href="{% url 'long-form' %}">
<i class="entry-icon ojuso-green fa fa-file-text-o"></i>
<div>
<h3 class="entry-title">{% trans "Case study" %}</h3>
<p class="entry-desc">
{% trans "A collection of data about a particular land-based project" %}
</p>
</div>
</a>
<a class="btn btn-block btn-info" href="{% url 'short-form' %}" role="button">
<h2>5-10 Minutes</h2>
<p>Express Form</p>
<a class="entry" href="{% url 'short-form' %}">
<i class="entry-icon ojuso-red fa fa-bolt"></i>
<div>
<h3 class="entry-title">{% trans "Case study (short)" %}</h3>
<p class="entry-desc">
{% trans "For when you have less information or less time" %}
</p>
</div>
</a>
<a class="entry" href="/">
<i class="entry-icon ojuso-blue fa fa-thumb-tack"></i>
<div>
<h3 class="entry-title">{% trans "Point of interest" %}</h3>
<p class="entry-desc">
{% trans "Marking somewhere as being of interest to the renewable energy transition" %}
</p>
</div>
</a>
</div>
{% endblock %}
</div>
</div>
{% endblock %}

49
assets/css/ojuso.css Normal file
View File

@ -0,0 +1,49 @@
/* Make sure that the footer doesn't have space after it */
.container { min-height: 60vh; }
/* Get the header working OK */
.navbar-brand { padding: 5px 15px; }
.navbar-brand > img { height: 40px; }
.navbar-collapse {
z-index: 9999;
position: relative;
}
.dropdown-menu > li > a.no-hover:hover, .dropdown-menu > li > a.no-hover:focus {
background: red;
}
/* Page footer */
.footer {
background-color: #444;
color: #ddd;
padding-top: 1em;
margin-top: 5em;
}
.footer-list {
list-style-type: none;
text-align: right;
margin-left: 0;
padding-left: 0;
}
.footer-list-item {
color: #ddd;
text-decoration: underline;
}
.footer-list-item:hover {
color: #bbb;
}
.footer-list-item--spacer {
margin-top: 1em;
}
/* Colour utility classes */
.ojuso-red { color: #ea4639; }
.ojuso-green { color: #4ac95d; }
.ojuso-yellow { color: #f9db3c; }
.ojuso-blue { color: #008ad5; }

BIN
assets/img/navicon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

View File

@ -206,6 +206,9 @@ AWS_SECRET_ACCESS_KEY = "pTZAnmtvGzFBdI/jwtwRoFW5eK7eJ8FLFxr1/Jb+Yq4"
STATIC_ROOT = os.path.join(BASE_DIR, 'static/')
STATIC_URL = os.getenv("STATIC_URL", '/static/')
STATICFILES_DIRS = [
os.path.join(BASE_DIR, "assets")
]
STATICFILES_FINDERS = [
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',

View File

@ -7,54 +7,17 @@
<!DOCTYPE html>
<html>
<meta charset="utf-8">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Noto+Sans" />
<link rel="stylesheet" href="{% static 'map/bootstrap/css/bootstrap.min.css' %}" />
<link rel="stylesheet" href="{% static 'map/bootstrap/css/bootstrap-theme.min.css' %}" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" crossorigin="anonymous"/>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Noto+Sans">
<link rel="stylesheet" href="{% static 'map/bootstrap/css/bootstrap.min.css' %}">
<link rel="stylesheet" href="{% static 'css/ojuso.css' %}">
<link rel="stylesheet" href="{% static 'map/bootstrap/css/bootstrap-theme.min.css' %}">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" crossorigin="anonymous">
<title>{% block page_title %}Ojuso{% endblock %}</title>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
{# Additional Stylesheets #}
{% block stylesheets %}
<style>
.navbar-brand { padding: 5px 15px; }
.navbar-brand > img { height: 40px; }
.navbar-collapse {z-index: 9999; position: relative; background: white;}
.dropdown-menu > li > a.no-hover:hover, .dropdown-menu > li > a.no-hover:focus {
background: red;
}
.footer {
background-color: #444;
color: #ddd;
padding-top: 1em;
margin-top: 5em;
}
.linklist {
list-style-type: none;
text-align: right;
margin-left: 0;
padding-left: 0;
}
.linklist a {
color: #ddd;
text-decoration: underline;
}
.linklist a:hover {
color: #bbb;
}
.linklist-item--spacer {
margin-top: 1em;
}
}
</style>
{% endblock %}
{% block stylesheets %}{% endblock %}
</head>
<body>
<nav class="navbar navbar-default">
@ -67,7 +30,7 @@
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="{% url 'index' %}">
<img src="{% static 'map/images/ojuso-logo-black.png' %}" height="15px"/>
<img src="{% static 'img/navicon.png' %}" height="40">
</a>
</div>
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
@ -102,7 +65,11 @@
</form>
</li>
{% if user.is_authenticated %}
<a class="btn btn-primary navbar-btn" href="{% url 'create' %}"><i class="fa fa-plus" aria-hidden="true"></i> New Case Study</a>
<a class="btn btn-primary navbar-btn" href="{% url 'create' %}">
<i class="fa fa-plus" aria-hidden="true"></i> Contribute
</a>
<li class="dropdown">
<a style="margin:-10px 0 -10px 0" class="dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<img src="{% avatar_url user %}" class="img-circle" width="40" height="40" style="position:relative;margin-right:5px"/><span>{{user}}</span>
@ -143,13 +110,13 @@
<div class="container-fluid">
<div class="row">
<div class="col-md-12">
<ul class="linklist">
<li><a href="{% url 'index' %}">Map of all case studies</a>
<ul class="footer-list">
<li><a class="footer-list-item" href="{% url 'index' %}">Map of all case studies</a>
{% get_flatpages '/about/' as all_pages %}
{% for page in all_pages %}
<li><a href="{{ page.url }}">{{ page.title }}</a></li>
<li><a class="footer-list-item" href="{{ page.url }}">{{ page.title }}</a></li>
{% endfor %}
<li class="linklist-item--spacer">&copy; Ojuso 2018
<li class="footer-list-item--spacer">&copy; Ojuso 2018
</ul>
</div>
</div>