Conflicts:
	src/Hackspace/Bundle/CalciferBundle/Resources/views/Event/event_box.html.twig
This commit is contained in:
Tim Schumacher 2014-07-10 12:46:27 +02:00
commit e54460d0ed
5 changed files with 64 additions and 59 deletions

View file

@ -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

View file

@ -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;
}

View file

@ -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: '&copy; <a href="http://osm.org/copyright">OpenStreetMap</a> 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: '&copy; <a href="http://osm.org/copyright">OpenStreetMap</a> 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');
}
});

View file

@ -4,29 +4,29 @@
</h2>
<p class="edit">
<a href="{{ path('_edit', {'slug' : entity.slug }) }}"><i class="ui icon edit circular green inverted"></i>Bearbeiten</a>
<a href="{{ path('_edit', {'slug' : entity.slug }) }}"><i class="circular icon edit green inverted link"></i>Bearbeiten</a>
</p>
<p class="startdate ">
<i class="ui icon calendar circular green inverted link" title="Wann?" data-content="Wann?"></i>{{ entity.startdate.format('Y-m-d H:i') }}
<i class="circular icon calendar green inverted link" title="Wann?" data-content="Wann?"></i>{{ entity.startdate.format('Y-m-d H:i') }}
</p>
{% if entity.location is not null %}
<p class="location">
<a href="{{ path('location_show', {'slug' : entity.location.slug }) }}"><i class="ui icon map marker circular green inverted link" title="Wo?" data-content="Wo?"></i>{{ entity.location.name }}</a>
<a href="{{ path('location_show', {'slug' : entity.location.slug }) }}"><i class="circular icon map marker green inverted link" title="Wo?" data-content="Wo?"></i>{{ entity.location.name }}</a>
</p>
{% endif %}
{% if entity.tags|length > 0 %}
<ul class="tags">
{% for tag in entity.tags %}
<li class="tag"><a href="{{ path('tag_show',{'slug' : tag.slug }) }}"><i class="circular icon tag green inverted"></i>{{ tag.name }}</a></li>
<li class="tag"><a href="{{ path('tag_show',{'slug' : tag.slug }) }}"><i class="circular icon tag green inverted link"></i>{{ tag.name }}</a></li>
{% endfor %}
</ul>
{% endif %}
{% if entity.url|length > 0 %}
<p class="url">
<a href="{{ entity.url }}"><i class="ui icon globe green circular inverted"></i>{{ entity.url }}</a>
<a href="{{ entity.url }}"><i class="circular icon globe green inverted link"></i>{{ entity.url }}</a>
</p>
{% endif %}

View file

@ -22,12 +22,12 @@
<h1>
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 %}
</h1>
</div>
</div>
<div class="ui three column page grid">
<div class="ui three column page grid stackable">
{% for entity in entities %}
{{ include('CalciferBundle:Event:event_box.html.twig',{'truncate_summary':true}) }}
{% endfor %}