Added latest changes to repo (from older debug session)

This commit is contained in:
Christian Wolf 2019-08-07 17:40:48 +02:00
parent 2bdf581ba1
commit e112b8ee6c
3 changed files with 17 additions and 6 deletions

View File

@ -36,4 +36,16 @@ jQuery(function($){
$('a.clubs-save', this).click();
});
$('#clubs_add_place').click(function(ev){
ev.preventDefault();
var last = $('.clubs_place:last');
var newElement = last.clone();
$('*', newElement).remove();
newElement.insertAfter(last);
$.get('index.php?option=com_clubs&view=part&mode=edit&type=club.place&id=new', function(data){
newElement.html(data);
});
});
});

View File

@ -19,7 +19,9 @@ class ClubsPartClubPlace extends ClubsHelperParts
protected function getEditMarkup()
{
$factory = new CommonClubsModelFactoryPlace();
$place = $factory->loadById($this->id);
$place = $factory->loadById($this->id, false);
if($place === null)
$place = $factory->createNew();
$content = ob_get_contents();
ob_clean();

View File

@ -105,20 +105,17 @@ $clubid = $this->club->getId();
<div class='clubs_row'>
<div class='clubs_title_row'>R&auml;umlichkeiten</div>
<?php if(count($this->club->getPlaces()) > 0): ?>
<?php
foreach($this->club->getPlaces() as $p)
{
$partHandler = new ClubsPartClubPlace($p->getId());
echo "<div class='clubs_content_row'>";
echo "<div class='clubs_content_row clubs_place'>";
echo $partHandler->getViewPart();
echo '</div>';
}
?>
<?php else: ?>
<div class='message-empty <?php echo count($this->club->getPlaces()) == 0 ? '' : 'clubs-hidden'; ?>'>Der Verein hat keine Angebote festgelegt.</div>
<?php endif; ?>
<div class='clubs_content_row'><a href='<?php echo ""; ?>'><span class='icon-new'></span>&nbsp; Neue Assoziation anlegen</a></div>
<div class='clubs_content_row'><a id='clubs_add_place' href='<?php echo ""; ?>'><span class='icon-new'></span>&nbsp; Neue Assoziation anlegen</a></div>
</div>
<div class='clubs_row'>