diff --git a/TODO.md b/TODO.md index d027fee..5b7ac1b 100755 --- a/TODO.md +++ b/TODO.md @@ -2,4 +2,5 @@ * Sich wiederholende Termine * Mehr Dokumentation im Interface. Also beschreiben was das eigentlich ist und so. +* Schöne URLs für Termine/Orte/Tags * Irgendwoher ein k3wles Logo auftreiben diff --git a/src/Hackspace/Bundle/CalciferBundle/Resources/assets/css/events.scss b/src/Hackspace/Bundle/CalciferBundle/Resources/assets/css/events.scss index 16890e1..867884c 100755 --- a/src/Hackspace/Bundle/CalciferBundle/Resources/assets/css/events.scss +++ b/src/Hackspace/Bundle/CalciferBundle/Resources/assets/css/events.scss @@ -7,7 +7,6 @@ } .startdate,.location,.url,.edit { - /*float: left;*/ display: inline; margin: 0; margin-right: 0.5rem; @@ -16,14 +15,12 @@ ul.tags { padding-left: 0; - /*float: left;*/ margin: 0; margin-right: 0.5rem; margin-bottom: 0.5rem; display: inline; li { list-style-type: none; - /*float: left;*/ display: inline; margin-right: 0.5rem; } diff --git a/src/Hackspace/Bundle/CalciferBundle/Resources/assets/js/events.js b/src/Hackspace/Bundle/CalciferBundle/Resources/assets/js/events.js index fc39c19..b7a1dcc 100755 --- a/src/Hackspace/Bundle/CalciferBundle/Resources/assets/js/events.js +++ b/src/Hackspace/Bundle/CalciferBundle/Resources/assets/js/events.js @@ -8,58 +8,65 @@ function addGeoCoordinates(ev) { return false; } var map = null; -$(document).ready(function () { - $('.icon.link').popup(); - jQuery('input[type=datetime]').datetimepicker({lang: 'de', format: 'Y-m-d H:i'}); - - $('.add_geo').click(addGeoCoordinates); - map = L.map('map'); - - // add an OpenStreetMap tile layer - L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', { - attribution: '© OpenStreetMap contributors' - }).addTo(map); - - map.setView([51.505, -0.09], 0); - - L.Icon.Default.imagePath = '/css/images'; - var popup = L.popup(); - - var marker = L.marker(); - - function onMapClick(e) { - marker - .setLatLng(e.latlng) - //.setContent("You clicked the map at " + e.latlng.toString()) - .addTo(map); +jQuery(document).ready(function () { + if (jQuery('.icon.link').length > 0) { + jQuery('.icon.link').popup(); } - map.on('click', onMapClick); + if (jQuery('input[type=datetime]').length > 0) { + jQuery('input[type=datetime]').datetimepicker({lang: 'de', format: 'Y-m-d H:i'}); + } - $('.geo.chooser').modal('setting', { - closable: false, - onApprove: function () { - var coords = marker.getLatLng(); - $('input[name=location_lat]').val(coords.lat); - $('input[name=location_lon]').val(coords.lng); - $('input[name=location]').css('margin-bottom', '3.2rem'); - $('span.coords').text('Folgende Koordinaten sind angegeben: lat:' + coords.lat + ', lon:' + coords.lng); - }, - onDeny: function () { + if (jQuery('#map').length == 1) { + jQuery('.add_geo').click(addGeoCoordinates); + map = L.map('map'); - }, - onVisible: function () { - map.invalidateSize(true); - var lat = parseFloat($('input[name=location_lat]').val()); - var lon = parseFloat($('input[name=location_lon]').val()); - if ((lat > 0) && (lon > 0)) { - map.setView([lat,lon],16); - var latlng = new L.LatLng(lat,lon); - marker.setLatLng(latlng); - marker.addTo(map); - } else { - map.locate({setView: true}); - } + // add an OpenStreetMap tile layer + L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', { + attribution: '© OpenStreetMap contributors' + }).addTo(map); + + map.setView([51.505, -0.09], 0); + + L.Icon.Default.imagePath = '/css/images'; + var popup = L.popup(); + + var marker = L.marker(); + + function onMapClick(e) { + marker + .setLatLng(e.latlng) + //.setContent("You clicked the map at " + e.latlng.toString()) + .addTo(map); } - }).modal('attach events', '.add_geo', 'show'); + + map.on('click', onMapClick); + + jQuery('.geo.chooser').modal('setting', { + closable: false, + onApprove: function () { + var coords = marker.getLatLng(); + jQuery('input[name=location_lat]').val(coords.lat); + jQuery('input[name=location_lon]').val(coords.lng); + jQuery('input[name=location]').css('margin-bottom', '3.2rem'); + jQuery('span.coords').text('Folgende Koordinaten sind angegeben: lat:' + coords.lat + ', lon:' + coords.lng); + }, + onDeny: function () { + + }, + onVisible: function () { + map.invalidateSize(true); + var lat = parseFloat(jQuery('input[name=location_lat]').val()); + var lon = parseFloat(jQuery('input[name=location_lon]').val()); + if ((lat > 0) && (lon > 0)) { + map.setView([lat, lon], 16); + var latlng = new L.LatLng(lat, lon); + marker.setLatLng(latlng); + marker.addTo(map); + } else { + map.locate({setView: true}); + } + } + }).modal('attach events', '.add_geo', 'show'); + } }); diff --git a/src/Hackspace/Bundle/CalciferBundle/Resources/views/Event/event_box.html.twig b/src/Hackspace/Bundle/CalciferBundle/Resources/views/Event/event_box.html.twig index 5b67deb..1bcb28d 100755 --- a/src/Hackspace/Bundle/CalciferBundle/Resources/views/Event/event_box.html.twig +++ b/src/Hackspace/Bundle/CalciferBundle/Resources/views/Event/event_box.html.twig @@ -4,29 +4,29 @@
- Bearbeiten + Bearbeiten
- {{ entity.startdate.format('Y-m-d H:i') }} + {{ entity.startdate.format('Y-m-d H:i') }}
{% if entity.location is not null %}- {{ entity.location.name }} + {{ entity.location.name }}
{% endif %} {% if entity.tags|length > 0 %} {% endif %} {% if entity.url|length > 0 %}- {{ entity.url }} + {{ entity.url }}
{% endif %} diff --git a/src/Hackspace/Bundle/CalciferBundle/Resources/views/Event/index.html.twig b/src/Hackspace/Bundle/CalciferBundle/Resources/views/Event/index.html.twig index 3cd3bdf..e820215 100755 --- a/src/Hackspace/Bundle/CalciferBundle/Resources/views/Event/index.html.twig +++ b/src/Hackspace/Bundle/CalciferBundle/Resources/views/Event/index.html.twig @@ -22,12 +22,12 @@