From d2601e19d766fc1593ef3c8ca421f5dc9ead12d0 Mon Sep 17 00:00:00 2001 From: Tim Schumacher Date: Thu, 10 Jul 2014 09:17:15 +0200 Subject: [PATCH 1/8] Make the event grid on the startpage responsive. --- .../Bundle/CalciferBundle/Resources/views/Event/index.html.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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..18f3c17 100755 --- a/src/Hackspace/Bundle/CalciferBundle/Resources/views/Event/index.html.twig +++ b/src/Hackspace/Bundle/CalciferBundle/Resources/views/Event/index.html.twig @@ -27,7 +27,7 @@ -
+
{% for entity in entities %} {{ include('CalciferBundle:Event:event_box.html.twig',{'truncate_summary':true}) }} {% endfor %} From 8b2a6bdd925c6970fe9919291a7f93d8b44bf702 Mon Sep 17 00:00:00 2001 From: Tim Schumacher Date: Thu, 10 Jul 2014 11:41:16 +0200 Subject: [PATCH 2/8] Cleaned up the source. --- .../Bundle/CalciferBundle/Resources/assets/css/events.scss | 3 --- 1 file changed, 3 deletions(-) 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; } From d64f78dc5ee89080183adf4a03b6c90efada5141 Mon Sep 17 00:00:00 2001 From: Tim Schumacher Date: Thu, 10 Jul 2014 11:44:12 +0200 Subject: [PATCH 3/8] formated the icon classes uniformingly --- .../Resources/views/Event/event_box.html.twig | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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 1ce6bad..7740ff8 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 %} From 509a4f501be15d1059ad16a107c21bc70a7f27cd Mon Sep 17 00:00:00 2001 From: Tim Schumacher Date: Thu, 10 Jul 2014 11:48:00 +0200 Subject: [PATCH 4/8] Only initialize the various elements if they are in the dom. --- .../Resources/assets/js/events.js | 103 ++++++++++-------- 1 file changed, 55 insertions(+), 48 deletions(-) diff --git a/src/Hackspace/Bundle/CalciferBundle/Resources/assets/js/events.js b/src/Hackspace/Bundle/CalciferBundle/Resources/assets/js/events.js index fc39c19..bc722d8 100755 --- a/src/Hackspace/Bundle/CalciferBundle/Resources/assets/js/events.js +++ b/src/Hackspace/Bundle/CalciferBundle/Resources/assets/js/events.js @@ -9,57 +9,64 @@ function addGeoCoordinates(ev) { } 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); + if ($('.icon.link').length > 0) { + $('.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) { + $('.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); + + $('.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 () { + + }, + 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}); + } + } + }).modal('attach events', '.add_geo', 'show'); + } }); From e46c36b19b16ef12123fa96187efd65eefebc106 Mon Sep 17 00:00:00 2001 From: Tim Schumacher Date: Thu, 10 Jul 2014 11:49:27 +0200 Subject: [PATCH 5/8] Use uniformingly jQuery instead of $ --- .../Resources/assets/js/events.js | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/Hackspace/Bundle/CalciferBundle/Resources/assets/js/events.js b/src/Hackspace/Bundle/CalciferBundle/Resources/assets/js/events.js index bc722d8..b7a1dcc 100755 --- a/src/Hackspace/Bundle/CalciferBundle/Resources/assets/js/events.js +++ b/src/Hackspace/Bundle/CalciferBundle/Resources/assets/js/events.js @@ -8,9 +8,9 @@ function addGeoCoordinates(ev) { return false; } var map = null; -$(document).ready(function () { - if ($('.icon.link').length > 0) { - $('.icon.link').popup(); +jQuery(document).ready(function () { + if (jQuery('.icon.link').length > 0) { + jQuery('.icon.link').popup(); } if (jQuery('input[type=datetime]').length > 0) { @@ -18,7 +18,7 @@ $(document).ready(function () { } if (jQuery('#map').length == 1) { - $('.add_geo').click(addGeoCoordinates); + jQuery('.add_geo').click(addGeoCoordinates); map = L.map('map'); // add an OpenStreetMap tile layer @@ -42,22 +42,22 @@ $(document).ready(function () { map.on('click', onMapClick); - $('.geo.chooser').modal('setting', { + jQuery('.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); + 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($('input[name=location_lat]').val()); - var lon = parseFloat($('input[name=location_lon]').val()); + 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); From 182826cda14b3249a71f494ebd52c37cf44213c7 Mon Sep 17 00:00:00 2001 From: Tim Schumacher Date: Thu, 10 Jul 2014 11:53:41 +0200 Subject: [PATCH 6/8] Add the link class to the icon so that the popup works. --- .../CalciferBundle/Resources/views/Event/event_box.html.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 7740ff8..6b433d1 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 @@ -8,7 +8,7 @@

- {{ entity.startdate.format('Y-m-d H:i') }} + {{ entity.startdate.format('Y-m-d H:i') }}

{% if entity.location is not null %} From 4f0a34aba0351b0925575ae60179b9a8a3eb145f Mon Sep 17 00:00:00 2001 From: Tim Schumacher Date: Thu, 10 Jul 2014 12:07:01 +0200 Subject: [PATCH 7/8] Added closing quotation mark. --- .../Bundle/CalciferBundle/Resources/views/Event/index.html.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 18f3c17..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,7 +22,7 @@

Termine {% if tag|default(false) %} für Tag „{{ tag.name }}“{% endif %} - {% if location|default(false) %} für Ort „{{ location.name }}{% endif %} + {% if location|default(false) %} für Ort „{{ location.name }}“{% endif %}

From b737d292ded826438b4463feb214d156ff1accfd Mon Sep 17 00:00:00 2001 From: Tim Schumacher Date: Thu, 10 Jul 2014 17:51:11 +0200 Subject: [PATCH 8/8] Added a todo item. --- TODO.md | 1 + 1 file changed, 1 insertion(+) 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