Commit 1786728e authored by Ale's avatar Ale

feat: Add basic structure of layout, styles and content

parent 77f66dcf
......@@ -27,7 +27,9 @@ class TestimonyAdmin(LeafletGeoAdmin):
model = models.Testimony
ordering = ('creation_date',)
list_display = ('name', 'summary', 'owner', 'creation_date', 'update_date')
fields = ( ('name', 'owner'), ('slug', 'published',), 'summary', 'position',)
fields = ( ('name', 'owner'), ('slug', 'published',), 'category', 'summary', 'position',)
inlines = [ model_utils.ImageInline, model_utils.LinkInline ]
admin.site.register(models.Testimony, TestimonyAdmin)
admin.site.register(models.TestimonyCategory, admin.ModelAdmin)
# django
from django import forms
from django.utils.translation import ugettext_lazy as _
# project
from .models import Testimony
from .widgets import GeocodedLeafletWidget
class TestimonyForm(forms.ModelForm):
class Meta:
model = Testimony
fields = [
'name',
'category',
'position',
'video'
]
widgets = {
'position' : GeocodedLeafletWidget(
submit_text=_('Buscar'),
provider="nominatim"
),
}
def __init__(self, *args, **kwargs):
super(TestimonyForm,self).__init__(*args, **kwargs)
self.fields['category'].empty_label = 'Elige una categoría'
......@@ -15,24 +15,61 @@ from adminsortable.models import SortableMixin
# project
from django.conf import settings
from apps.model_utils.models import Category, Image, Link, Publishable
from . import validators
validator_video = validators.VideoTypeValidator()
class TestimonyCategory(Category):
content = RichTextUploadingField(
_('Contenido'),
blank=True,
null=True
)
image = models.ImageField(
_('Imagen'),
help_text = _(
'Introduce opcionalmente una imagen de la categoría'
),
upload_to='categories',
null = True,
blank = True,
)
class Testimony(Publishable):
name = models.CharField(
_('Título'),
_('Nombre'),
max_length = 128,
blank = False,
null = True,
help_text = _(
'Tu nombre o el nombre de tu historia.'
)
)
position = PointField(
_('Coordenadas'),
_('Sitúa tu historia'),
blank = False,
null = True,
help_text = _(
'Usa el localizador para encontrar tu ubicación '
'Si no la encuentras busca una cercana y ajusta la posición '
'moviendo el marcador con el ratón.'
'Usa el localizador para encontrar tu ubicación pulsando en '
'el botón "Buscar" tras escribir una dirección, por ejemplo: '
'"Avenida de Miraflores" o "Plaza de España". '
'Si todo es correcto esta se ubicará en el mapa. '
'Si no la encuentras busca una cercana. Puedes ajustar la posición '
'del marcador moviéndolo con el ratón pulsado.'
)
)
category = models.ForeignKey(
TestimonyCategory,
verbose_name=_('¿De qué va tu historia?'),
related_name='posts',
blank=False,
null=True,
on_delete=models.SET_NULL,
help_text = _(
'¿Has visto nuestro glosario?'
)
)
summary = models.TextField(
......@@ -50,6 +87,15 @@ class Testimony(Publishable):
null = True,
blank = True,
)
video = models.FileField(
_('Sube el vídeo con tu historia'),
help_text = _(
'Sube un video aquí'
),
validators = [ validator_video ],
blank=False,
null=True
)
link = models.URLField(
_('Enlace'),
help_text = _(
......
/**
* Geocode an address
*/
/**
* Builds a GeoJSON string from latitude and longitude coordinates
*/
function coords_to_geojson(lat, lng){
return '{"type":"Point", "coordinates":['+ lng + ',' + lat + ']}';
}
/**
* Make an AJAX GET
*/
function get(url, callback, error_callback)
{
var ajax = new XMLHttpRequest();
var SUCCESS = 200;
ajax.onreadystatechange = function() {
if (ajax.readyState == XMLHttpRequest.DONE) {
if (ajax.status == SUCCESS) {
callback(ajax.response);
} else if(error_callback){
error_callback(ajax.response);
}
}
};
ajax.open("GET", url, true);
ajax.send();
}
/**
* A geocoder object
*/
function Geocoder(map, marker, geometry_field)
{
this.google = {
api : function(params){
var api_url = "https://maps.googleapis.com/maps/api/geocode/json?address=" + encodeURIComponent(params.address);
if(params.key)
api_url += ("&key=" + params.key);
return api_url;
},
callback : function(response){
var data = JSON.parse(response);
var lat = data['results'][0]['geometry']['location']['lat'];
var lng = data['results'][0]['geometry']['location']['lng'];
if(marker){
map.removeLayer(marker);
}
marker = L.marker([lat, lng], { 'draggable' : true });
marker.on('dragend', function(e){
var latlng = e.target.getLatLng();
geometry_field.value = coords_to_geojson(latlng.lat, latlng.lng);
});
map.addLayer(marker).setView([lat, lng], 12);
geometry_field.value = coords_to_geojson(lat, lng);
}
};
this.nominatim = {
api : function(params){
var address = params.address.trim();
address.replace(/ /g, "+");
return "https://nominatim.openstreetmap.org/search?q=" + address + "&format=json";
},
callback : function(response){
var data = JSON.parse(response);
var lat = data[0]['lat'];
var lng = data[0]['lon'];
if(marker){
map.removeLayer(marker);
}
marker = L.marker([lat, lng], { 'draggable' : true });
marker.on('dragend', function(e){
var latlng = e.target.getLatLng();
geometry_field.value = coords_to_geojson(latlng.lat, latlng.lng);
});
map.addLayer(marker).setView([lat, lng], 12);
geometry_field.value = coords_to_geojson(lat, lng);
}
};
}
+(function()
{
document.addEventListener("DOMContentLoaded", function(){
document.querySelectorAll('.geocode-widget').forEach( function(widget)
{
var geometry_field = widget.querySelector('.geocode-widget__geometry');
if(geometry_field.value && geometry_field.value != 'null'){
var data = JSON.parse(geometry_field.value);
var _map_ = L.map('geocode-widget__map');
var marker = L.marker([data.coordinates[1], data.coordinates[0]], { 'draggable' : true });
marker.on('dragend', function(e){
var latlng = e.target.getLatLng();
geometry_field.value = coords_to_geojson(latlng.lat, latlng.lng);
});
_map_.addLayer(marker).setView([data.coordinates[1], data.coordinates[0]], 11);
} else {
var _map_ = L.map('geocode-widget__map').setView([37.3808, -5.9700], 11);
var marker = {};
}
L.tileLayer('https://a.tile.openstreetmap.org/{z}/{x}/{y}.png', {
attribution: '&copy; <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
}).addTo(_map_);
var geocoder = new Geocoder(_map_, marker, geometry_field);
var trigger = widget.querySelector('.geocode-widget__geocode-submit');
trigger.addEventListener('click', function(e)
{
e.stopPropagation();
var address = widget.querySelector('#geocode-widget__input').value;
var provider = geometry_field.dataset.provider;
var key = widget.querySelector("textarea").dataset.key;
get(geocoder[provider].api({
'address' : address + ", Sevilla, Andalucía, España",
'key' : key,
}), geocoder[provider].callback
);
});
});
});
})();
{% load i18n %}
<div class="geocode-widget">
<div class="geocode-widget__search">
<input id="geocode-widget__input" type="text"></input>
<span class="geocode-widget__geocode-submit">{% trans submit_text %}</span>
</div>
{{ parent_widget }}
<div id="geocode-widget__map" class="geocode-widget__map"></div>
</div>
# python
import os
import magic
import datetime
# django
from django.utils.translation import ugettext_lazy as _
from django.core.exceptions import ValidationError
from django.utils.deconstruct import deconstructible
@deconstructible
class VideoTypeValidator(object):
def __init__(self, mime_types=[
'video/x-flv',
'video/mp4',
'application/x-mpegURL',
'video/MP2T',
'video/3gpp',
'video/quicktime',
'video/x-msvideo',
'video/x-ms-wmv',
]):
self.mime_types = mime_types
def __call__(self, value):
try:
mime = magic.from_buffer(value.read(), mime=True)
if mime not in self.mime_types:
raise ValidationError(_(
"El archivo %s tiene formato %s. Revise los formatos permitidos" % (
value.name,
mime.split('/')[1]
)
))
except ValueError:
pass
# django
from django.shortcuts import render
from django.views.generic import TemplateView
# project
from .models import TestimonyCategory
from .forms import TestimonyForm
# Create your views here.
class Map(TemplateView):
template_name = 'pages/map.html'
def get_context_data(self, *args, **kwargs):
context = super(Map, self).get_context_data(*args, **kwargs)
context['categories'] = TestimonyCategory.objects.all()
context['form'] = TestimonyForm()
return context
# django
from django import forms
from django.utils.translation import ugettext_lazy as _
from django.utils.safestring import mark_safe
from django.template.loader import render_to_string
# contrib
from leaflet.forms.widgets import LeafletWidget
class GeocodedLeafletWidget(forms.widgets.Textarea):
"""A custom leaflet widget, that geocodes its geolocation from other fields"""
def __init__(self, attrs=None, submit_text='Localiza los datos introducidos', provider='google', sources=None, key=None):
self.submit_text = submit_text
self.provider = provider
self.key = key
super(GeocodedLeafletWidget, self).__init__(attrs)
class Media:
"""Bind static assets to widget rendering"""
css = {
'all': (
'leaflet/leaflet.css',
)
}
js = ( 'leaflet/leaflet.js', 'map/js/geocode.js')
def render(self, name, value, attrs=None, renderer=None):
"""Render widget"""
attrs['class'] = 'geocode-widget__geometry'
attrs['data-provider'] = self.provider
attrs['data-key'] = self.key
parent_widget = super(GeocodedLeafletWidget, self).render(name, value, attrs )
geocode = render_to_string("geocoded-leaflet-widget.html", {
'parent_widget' : parent_widget,
'submit_text' : self.submit_text,
})
return geocode
# django
from django.contrib import admin
# project
from .models import Textblock
# Register your models here.
admin.site.register(Textblock, admin.ModelAdmin)
from django.apps import AppConfig
class TextblockConfig(AppConfig):
name = 'textblock'
# django
from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils.text import slugify
# contrib
from ckeditor_uploader.fields import RichTextUploadingField
class Textblock(models.Model):
title = models.CharField(
_('Título del bloque'),
max_length=256,
blank=False,
null=True
)
slug = models.SlugField(
_('Identificador'),
blank=True
)
content = RichTextUploadingField(
_('Contenido'),
blank=True,
null=True
)
def save(self, *args, **kwargs):
"""Populate automatically 'slug' field"""
if not self.slug:
self.slug = slugify(self.title)
super(Textblock, self).save(*args, **kwargs)
def __str__(self):
return self.title
# python
import os
# django
from django import template
# project
from ..models import Textblock
register = template.Library()
@register.simple_tag
def textblock(slug):
return Textblock.objects.get(slug=slug)
from django.test import TestCase
# Create your tests here.
from django.shortcuts import render
# Create your views here.
......@@ -48,7 +48,8 @@ PROJECT_APPS = [
'apps.model_utils',
'apps.map',
'apps.connectors',
'apps.api'
'apps.api',
'apps.textblock'
]
INSTALLED_APPS = PROJECT_ADMIN_APPS + DJANGO_APPS + CONTRIB_APPS + PROJECT_APPS
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-x"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="67.732849mm"
height="45.254307mm"
viewBox="0 0 67.732849 45.254307"
version="1.1"
id="svg8"
inkscape:version="0.92.5 (0.92.5+68)"
sodipodi:docname="logo-patio108.svg">
<defs
id="defs2" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="1.979899"
inkscape:cx="184.36253"
inkscape:cy="43.75458"
inkscape:document-units="mm"
inkscape:current-layer="layer1"
showgrid="false"
inkscape:window-width="1920"
inkscape:window-height="1053"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0" />
<metadata
id="metadata5">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Capa 1"
inkscape:groupmode="layer"
id="layer1">
<path
style="fill:#000000;stroke-width:0.26458335"
d=""
id="path31"
inkscape:connector-curvature="0" />
<path
style="fill:#000000;stroke-width:0.26458335"
d=""
id="path27"
inkscape:connector-curvature="0" />
<path
style="fill:#000000;stroke-width:0.26458335"
d=""
id="path23"
inkscape:connector-curvature="0" />
<path
style="fill:#000000;stroke-width:0.26458335"
d=""
id="path21"
inkscape:connector-curvature="0" />
<path
style="fill:#fa4440;fill-opacity:1;stroke-width:0.04125462"
d="m 27.37321,45.21576 c -1.38977,-0.033 -2.02252,-0.10767 -2.97028,-0.35058 -0.70745,-0.18132 -1.24549,-0.38271 -1.83588,-0.68717 -2.1419,-1.10456 -3.41244,-3.09359 -3.73444,-5.84625 -0.0919,-0.78597 -0.091,-14.86741 0.001,-15.66257 0.23572,-2.03626 0.90696,-3.55282 2.10099,-4.74686 1.16603,-1.16603 2.68844,-1.8508 4.76774,-2.1445 0.71461,-0.10094 3.54887,-0.13583 11.03561,-0.13585 8.09986,-3e-5 10.40835,0.0321 11.22126,0.15635 2.48728,0.38005 4.21731,1.33615 5.39573,2.98195 0.48818,0.68179 0.9774,1.826 1.1778,2.75466 0.24221,1.12242 0.23348,0.79086 0.23348,8.86974 0,6.87906 -0.005,7.44331 -0.0736,7.94152 -0.48695,3.54762 -2.32415,5.69717 -5.57505,6.52284 -0.52859,0.13426 -0.93901,0.20803 -1.61215,0.28977 -0.47119,0.0572 -1.65087,0.0664 -9.71547,0.0757 -5.04853,0.006 -9.73609,-0.003 -10.41679,-0.0188 z m 18.56458,-3.83708 c 1.22252,-0.0298 1.50598,-0.0486 1.84872,-0.12227 1.82304,-0.39191 2.93396,-1.49905 3.30765,-3.2964 0.13705,-0.6592 0.14994,-1.43162 0.13393,-8.02976 -0.0173,-7.14902 -0.004,-6.75515 -0.26277,-7.54959 -0.4945,-1.51599 -1.53054,-2.39781 -3.23149,-2.75047 -0.5673,-0.11762 -3.0342,-0.15169 -10.97519,-0.15159 -7.44745,8e-5 -10.363,0.0361 -10.877,0.13441 -1.70549,0.32616 -2.86008,1.30558 -3.31129,2.8089 -0.24363,0.81174 -0.22574,0.23219 -0.24134,7.81775 -0.0151,7.36022 -0.0151,7.36317 0.17897,8.08828 0.3585,1.3396 1.21145,2.26368 2.52471,2.73526 0.64921,0.23313 1.04404,0.28572 2.36115,0.3145 1.84676,0.0404 16.89826,0.0411 18.54395,9.4e-4 z m 15.16108,3.83171 c -1.10935,-0.12641 -2.147,-0.48904 -2.97001,-1.03793 -0.4071,-0.27152 -1.0483,-0.92714 -1.26215,-1.29055 -0.39705,-0.67472 -0.53522,-1.23995 -0.49865,-2.03981 0.013,-0.28363 0.0541,-0.62707 0.0913,-0.76321 0.15181,-0.55464 0.48563,-1.131 0.93054,-1.60661 l 0.24776,-0.26485 -0.21155,-0.26065 c -0.23949,-0.29509 -0.58016,-0.96345 -0.67958,-1.33328 -0.10585,-0.39375 -0.12838,-1.25289 -0.0439,-1.67234 0.15002,-0.74444 0.45408,-1.2918 1.05455,-1.8984 0.62497,-0.63133 1.18701,-0.97343 2.10184,-1.2793 0.72854,-0.24358 1.32277,-0.33436 2.18864,-0.33436 0.5433,0 0.8405,0.0209 1.20095,0.0843 2.10268,0.37006 3.67137,1.60947 4.10538,3.24364 0.10507,0.39564 0.10702,1.40802 0.003,1.78959 -0.15189,0.55952 -0.37658,1.00017 -0.73508,1.44157 l -0.19023,0.23423 0.31399,0.3339 c 0.71522,0.76056 1.03119,1.60829 0.98227,2.63534 -0.0285,0.59846 -0.12855,0.98212 -0.37946,1.45504 -0.62921,1.18597 -1.8318,2.02197 -3.45979,2.40513 -0.8053,0.18953 -1.94836,0.25448 -2.79031,0.15855 z m 1.9152,-2.94634 c 0.74897,-0.20493 1.14795,-0.62027 1.14795,-1.19505 0,-0.80965 -0.78229,-1.29354 -2.09858,-1.29808 -1.20929,-0.004 -1.96063,0.382 -2.11911,1.08919 -0.15724,0.70162 0.43357,1.3096 1.42396,1.46533 0.35673,0.0561 1.35208,0.019 1.64578,-0.0614 z m -0.20945,-5.45229 c 0.47605,-0.14124 0.85848,-0.4413 1.00509,-0.78863 0.10337,-0.24489 0.085,-0.6495 -0.0407,-0.89741 -0.27328,-0.53888 -0.83602,-0.80063 -1.72128,-0.80063 -0.69268,0 -1.11063,0.13077 -1.46658,0.45887 -0.24618,0.22692 -0.36311,0.48198 -0.36472,0.79556 -0.002,0.33885 0.0749,0.5377 0.29974,0.77812 0.28149,0.30093 0.6518,0.46482 1.22216,0.54089 0.2194,0.0293 0.84748,-0.0219 1.0663,-0.0868 z m -49.37547,8.24021 c -0.12679,-0.0524 -0.26579,-0.22111 -0.3104,-0.37663 -0.025,-0.0871 -0.0403,-1.71716 -0.0403,-4.29708 0,-2.28617 -0.009,-4.15668 -0.0193,-4.15668 -0.0106,0 -0.54851,0.39914 -1.19536,0.88698 -1.10584,0.83399 -1.18662,0.88696 -1.35244,0.88675 -0.0971,0 -0.22673,-0.0326 -0.28842,-0.0722 -0.1158,-0.0744 -1.52938,-1.87998 -1.63266,-2.08543 -0.0816,-0.1624 -0.0312,-0.37734 0.12797,-0.54591 0.1882,-0.19924 4.47109,-3.46958 4.67231,-3.56768 0.1571,-0.0766 0.25578,-0.0818 1.55796,-0.0818 h 1.39024 l 0.1541,0.14122 0.1541,0.14122 0.0107,6.37831 c 0.0118,7.05159 0.031,6.53611 -0.24992,6.70742 -0.12429,0.0758 -0.21358,0.0804 -1.5141,0.0781 -0.76012,-10e-4 -1.41916,-0.0178 -1.46454,-0.0366 z M 4.22587,29.23324 c -0.07,-0.0311 -0.16746,-0.10758 -0.21659,-0.17004 l -0.0893,-0.11356 v -5.0275 -5.0275 H 2.15213 0.38428 L 0.24471,18.80054 C 0.00663,18.6401 0.00205,18.61274 0.00155,17.34755 c -4.7e-4,-1.08642 0.005,-1.16325 0.0828,-1.29169 0.16583,-0.272 -0.17191,-0.25738 5.67055,-0.2455 l 5.30075,0.0108 0.15539,0.15533 0.15539,0.15533 0.0122,1.15471 c 0.0135,1.28497 -0.002,1.37491 -0.25638,1.53031 -0.11908,0.0726 -0.23795,0.0775 -1.8907,0.0776 l -1.76364,1.5e-4 -3.1e-4,5.00212 c -3.1e-4,4.797 -0.003,5.00687 -0.0766,5.11785 -0.17093,0.25924 -0.14217,0.25464 -1.65584,0.26534 -1.09699,0.008 -1.40828,-0.002 -1.5093,-0.0467 z m 9.18558,-0.0136 c -0.0778,-0.0403 -0.1799,-0.12565 -0.2269,-0.18971 l -0.0854,-0.11648 v -6.36231 c 0,-6.06286 0.004,-6.36767 0.0744,-6.47592 0.0409,-0.0625 0.13376,-0.14978 0.20627,-0.194 0.1236,-0.0754 0.21654,-0.0804 1.48701,-0.0805 1.50138,-1.6e-4 1.56771,0.01 1.72302,0.26469 0.0749,0.12287 0.0775,0.33689 0.0774,6.48028 -1.2e-4,6.11159 -0.003,6.35761 -0.0764,6.46894 -0.17079,0.25903 -0.1426,0.25449 -1.65585,0.26692 -1.25662,0.0103 -1.39486,0.005 -1.52349,-0.0619 z M 0.16055,13.28847 0,13.12792 0.0107,6.7091496 0.0214,0.29036958 l 0.13489,-0.13486 0.13488,-0.13487 h 3.3305 c 2.53448,0 3.41432,0.0129 3.68117,0.0539 1.82312,0.28018 3.03779,1.08558002 3.65637,2.42441002 0.25216,0.54576 0.35,1.01384 0.3754,1.79599 0.0175,0.5384 0.007,0.77636 -0.049,1.11103 -0.36062,2.15672 -1.93676,3.38284 -4.61073,3.58682 -0.30131,0.023 -1.12798,0.0418 -1.83704,0.0419 l -1.28921,10e-5 -0.001,2.0317904 c -0.002,2.19689 0.003,2.14967 -0.22822,2.30216 -0.11375,0.075 -0.20704,0.0798 -1.55944,0.08 l -1.43845,3.2e-4 z M 6.33811,5.9786596 c 0.69517,-0.0967 1.19712,-0.43114 1.35922,-0.90565 0.10205,-0.29872 0.10402,-0.84815 0.004,-1.14022 -0.10176,-0.2974 -0.3495,-0.56396 -0.65926,-0.70933 -0.46582,-0.21861 -0.59062,-0.23249 -2.09082,-0.23249 H 3.56922 l -0.0109,1.46432 c -0.006,0.80538 -0.002,1.48763 0.009,1.51611 0.0257,0.0669 2.29883,0.0729 2.77065,0.007 z m 4.97125,7.4030804 c -0.0528,-0.037 -0.1227,-0.13105 -0.15526,-0.20899 -0.0562,-0.13451 -0.0504,-0.16733 0.11348,-0.64437 2.30136,-6.6980504 4.17644,-12.03178042 4.2801,-12.17487042 0.0668,-0.0922 0.20053,-0.20949 0.29716,-0.26059 C 16.01929,7.195829e-4 16.03327,1.958289e-5 17.80995,1.958289e-5 c 2.00897,0 1.95295,-0.0080000029 2.22313,0.29938999711 0.15578,0.17698 0.2791,0.51782 2.31934,6.41043002 1.18824,3.4318804 2.15453,6.2850704 2.1542,6.3607504 -4.7e-4,0.0962 -0.0367,0.17335 -0.12119,0.25785 l -0.12059,0.12059 -1.43678,-8e-5 c -1.59962,-9e-5 -1.63078,-0.005 -1.81479,-0.28041 -0.05,-0.0749 -0.21438,-0.50661 -0.36533,-0.95948 l -0.27445,-0.8234 -2.56101,0.0106 -2.561,0.0106 -0.27851,0.83441 c -0.15318,0.45892 -0.31686,0.88826 -0.36373,0.95408 -0.17547,0.24645 -0.22607,0.25364 -1.78565,0.25364 -1.24436,0 -1.42996,-0.008 -1.51423,-0.0673 z m 8.03983,-5.0241604 c 0,-0.0172 -1.46497,-4.36373 -1.50983,-4.47963 -0.0197,-0.051 -1.54301,4.35481 -1.54301,4.46284 0,0.0186 0.68689,0.0339 1.52642,0.0339 0.83953,0 1.52642,-0.008 1.52642,-0.0171 z"
id="path46"
inkscape:connector-curvature="0" />
<path
style="fill:#000000;stroke-width:0.26458335"
d=""
id="path44"
inkscape:connector-curvature="0" />
</g>
</svg>
This diff is collapsed.
/**
* Common scripts
*/
document.addEventListener('DOMContentLoaded', function(){
document.querySelectorAll('[data-show]').forEach( function(i){
var to_hide = document.querySelectorAll(i.dataset.hide);
var to_show = document.querySelector( i.dataset.show );
i.addEventListener('click', function(){
to_hide.forEach( function(i){
i.classList.remove('visible');
});
to_show.classList.add('visible');
})
});
document.querySelectorAll('[data-close]').forEach( function(i){
var to_hide = document.querySelectorAll(i.dataset.close);
i.addEventListener('click', function(){
to_hide.forEach( function(i){
i.classList.remove('visible');
});
})
});
});
......@@ -4,12 +4,38 @@
$m : 1.6rem
// typography
$font_text : monospace
@font-face
font-family: 'rubik'
src: url('../fonts/Rubik-Light.eot?') format('eot'), url('../fonts/Rubik-Light.woff') format('woff'), url('../fonts/Rubik-Light.ttf') format('truetype')
font-weight: normal
font-style: normal
@font-face
font-family: 'rubik'
src: url('../fonts/Rubik-Italic.eot?') format('eot'), url('../fonts/Rubik-Italic.woff') format('woff'), url('../fonts/Rubik-Italic.ttf') format('truetype')
font-weight: normal
font-style: italic
@font-face
font-family: 'rubik'
src: url('../fonts/Rubik-Bold.eot?') format('eot'), url('../fonts/Rubik-Bold.woff') format('woff'), url('../fonts/Rubik-Bold.ttf') format('truetype')
font-weight: bold
font-style: normal
@font-face
font-family: 'rubik'
src: url('../fonts/Rubik-BoldItalic.eot?') format('eot'), url('../fonts/Rubik-BoldItalic.woff') format('woff'), url('../fonts/Rubik-BoldItalic.ttf') format('truetype')
font-weight: bold
font-style: italic
$font_text : 'rubik', sans-serif
$font_headers : $font_text
$font_text_weight : 300
$font_headers_weight : 700
$size_headers : (4.8rem, 3.6rem, 2.4rem, 1.2rem, 1rem, 0.8rem)
$size_small : 1.2rem
// colors
// ...
$green: #43AD36
$red: #FD4741
$height_footer: 0
$height_header: 20vh
......@@ -42,5 +42,4 @@ $breakpoints: ( xs: 480px, sm: 768px, md: 992px, lg: 1200px, xl: 1400px ) !defau
=h($n)
font-family : $font_headers
font-weight : $font_headers_weight
font-size : nth($size_headers, $n)
......@@ -60,3 +60,15 @@ textarea
select
&:hover
cursor: pointer
::-webkit-scrollbar
height: $m
width: $m/3
background: white
::-webkit-scrollbar-thumb
background-color: $green
*
scrollbar-color: $green white
scrollbar-width: thin
......@@ -8,21 +8,60 @@
display: grid
grid-template-columns: 1fr
.page--map .layout__left--twocol
padding: 0 $m $m
+breakpoint('sm')
.page--map .region-content__inner--twocol
grid-template-columns: 2fr 5fr
.page--map .layout__left--twocol
max-height: 100vh
overflow-y: auto
+breakpoint('md')
grid-template-columns: 1fr 3fr
+breakpoint('xl')
.page--map .region-content__inner--twocol
grid-template-columns: 1fr 5fr
grid-template-columns: 1fr 4fr
.region-content__inner--twocol.show-right
grid-template-columns: 1fr 0fr !important
.region-content__inner--twocol.show-left
grid-template-columns: 0fr 1fr !important
.site-header
padding: 0 $m/2
margin: $m/2 0
background: white
height: $height_header
.site-logo
width: 50%
.two-columns