summaryrefslogtreecommitdiff
path: root/protected/views
diff options
context:
space:
mode:
authorPatrick Seeger <pseeger@ccwn.org>2012-05-15 21:30:11 +0200
committerPatrick Seeger <pseeger@ccwn.org>2012-05-15 21:30:11 +0200
commit5759435f4da8ec800ba9af0fbbf7d6691e9ed56c (patch)
treea3e6f6c676743e89b11804a03bd4f1e837983be9 /protected/views
parent94bdb31c204cdae3ca820828d4731f11f6ffeeae (diff)
diverse Layoutings
Diffstat (limited to 'protected/views')
-rw-r--r--protected/views/search/results.php14
-rw-r--r--protected/views/sitecontent/_short.php9
-rw-r--r--protected/views/standort/_buehne.php18
-rw-r--r--protected/views/standort/_standort.php18
-rw-r--r--protected/views/standort/index.php65
-rw-r--r--protected/views/standort/view.php27
-rw-r--r--protected/views/veranstaltung/_search.php54
-rw-r--r--protected/views/veranstaltung/_short.php2
-rw-r--r--protected/views/veranstaltung/_view.php38
-rw-r--r--protected/views/veranstaltung/index.php35
-rw-r--r--protected/views/veranstaltung/now.php18
-rw-r--r--protected/views/veranstaltung/view.php21
-rw-r--r--protected/views/verein/_short.php2
-rw-r--r--protected/views/verein/_shortangebotverein.php9
-rw-r--r--protected/views/verein/view.php32
15 files changed, 266 insertions, 96 deletions
diff --git a/protected/views/search/results.php b/protected/views/search/results.php
index c1d80e2..05d2b57 100644
--- a/protected/views/search/results.php
+++ b/protected/views/search/results.php
@@ -3,20 +3,14 @@ $this->breadcrumbs=array(
'Search'=>array('/search'),
'Results',
);?>
-<h3><?php echo $this->id . '/' . $this->action->id; ?></h3>
+<h3>Suchergebnisse für "<?php echo CHtml::encode($search) ?>"</h3>
<?php foreach ($results as $mod => $res) {?>
- <h6><?php echo $mod ?></h6>
+ <h5><?php echo $mod ?></h5>
<?php
$dataProvider = new CArrayDataProvider($res);
$this->widget('zii.widgets.CListView', array(
'dataProvider'=>$dataProvider,
- 'itemView'=>'/cms/'.lcfirst($mod).'/_short', // refers to the partial view named '_post'
- 'sortableAttributes'=>array(
- 'name',
- /*'create_time'=>'Post Time',*/
- ),
+ 'itemView'=>'/'.lcfirst($mod).'/_short', // refers to the partial view named '_post'
+
));?>
<?php }?>
-<p>
- <pre><?php print_r($results)?></pre>
-</p>
diff --git a/protected/views/sitecontent/_short.php b/protected/views/sitecontent/_short.php
new file mode 100644
index 0000000..bff61cf
--- /dev/null
+++ b/protected/views/sitecontent/_short.php
@@ -0,0 +1,9 @@
+
+<?php
+if(strlen(strip_tags($data->content))>300) {
+ $tmp = str_split(strip_tags($data->content),297);
+ $myBeschreibung = $tmp[0]."...";
+} else {
+ $myBeschreibung = strip_tags($data->content);
+}?>
+<?php echo CHTML::link("<h6>".$data->title."</h6><p>".$myBeschreibung."</p>" ,array("/cms/sitecontent/view","id"=>$data->id)); ?> \ No newline at end of file
diff --git a/protected/views/standort/_buehne.php b/protected/views/standort/_buehne.php
new file mode 100644
index 0000000..bfaa34a
--- /dev/null
+++ b/protected/views/standort/_buehne.php
@@ -0,0 +1,18 @@
+<h6>Folgende Veranstaltungen finden <?php echo $data->name?> statt</h6>
+<?php
+$dataProvider=new CActiveDataProvider('Veranstaltung', array(
+ 'criteria'=>array(
+ 'condition'=>'standort_id='.$data->id." and published=1",
+ ),
+ 'pagination'=>array(
+ 'pageSize'=>20,
+ ),
+
+));
+$this->widget('zii.widgets.CListView', array(
+ 'dataProvider'=>$dataProvider,
+ 'itemView'=>'/veranstaltung/_short',
+ 'sortableAttributes'=>array(
+ 'name'
+ )
+ ));?> \ No newline at end of file
diff --git a/protected/views/standort/_standort.php b/protected/views/standort/_standort.php
new file mode 100644
index 0000000..9c12fbe
--- /dev/null
+++ b/protected/views/standort/_standort.php
@@ -0,0 +1,18 @@
+<h6>Folgende Vereine finden sich <?php echo $data->name?></h6>
+<?php
+$dataProvider=new CActiveDataProvider('Verein', array(
+ 'criteria'=>array(
+ 'condition'=>'standort_id='.$data->id,
+ ),
+ 'pagination'=>array(
+ 'pageSize'=>20,
+ ),
+
+));
+$this->widget('zii.widgets.CListView', array(
+ 'dataProvider'=>$dataProvider,
+ 'itemView'=>'/verein/_short',
+ 'sortableAttributes'=>array(
+ 'name'
+ )
+ ));?> \ No newline at end of file
diff --git a/protected/views/standort/index.php b/protected/views/standort/index.php
index 9a88a74..ca84d35 100644
--- a/protected/views/standort/index.php
+++ b/protected/views/standort/index.php
@@ -8,70 +8,37 @@ $this->menu=array(
);
?>
-<h1>Standorte</h1>
-
-<?php $this->renderPartial('/common/_comparison_text'); ?>
-
-<?php $this->renderPartial('/common/_advanced_search',array(
- 'model'=>$model,
-)); ?>
-
+<h3>Standorte</h3>
+<p class="box info">Mit einem Click auf den Standortmarker erhalten Sie eine Übersicht der Vereine am Standort</p>
+<p>
<?php
$map = new Map();
foreach ($standorte as $standort) {
- $infoWindow = new EGMapInfoWindow("<div class='gmaps-label' style='color: #000; font-weight:bold'>".$standort->name."<br/>".CHtml::link("Bearbeiten", array("standort/update", "id"=>$standort->id), array("update"=>"#edit"))."</div>");
- $dragendfunction = "function (event) {
- var save = confirm('Neue Koordinaten wirklich speichern?');
- if (save) {
- $.ajax({
- 'type':'POST',
- 'url':'".$this->createUrl('standort/savecoords', array('id'=>$standort->id))."',
- 'data':({'lat': event.latLng.lat(), 'lng': event.latLng.lng()}),
- 'cache':false,
- 'statusCode': {
- 404: function() {
- alert('Der Standort existiert nicht.');
- },
- 500: function() {
- alert('Fehler beim Speichern.');
- },
- 400: function() {
- alert('Fehlende Parameter');
- },
- 200: function() {
- alert('Neue Koordinaten erfolgreich gespeichert');
- }
- }
- });
+ $infostring = "<div class='gmaps-label' style='color: #000;'><strong>".$standort->name."</strong><br/>";
+ foreach ($standort->vereine as $verein) {
+ $infostring .=CHtml::link($verein->name,array("verein/view","id"=>$verein->id))."<br />";
}
- console.info(event)
- }
- ";
+ $infostring .="</div>";
+ $infoWindow = new EGMapInfoWindow($infostring);
// Saving coordinates after user dragged our marker.
- $dragevent = new EGMapEvent('dragend', $dragendfunction, false, EGMapEvent::TYPE_EVENT_DEFAULT);
- $marker = new EGMapMarker($standort->pos_lat, $standort->pos_long, array('title' => $model->name, 'draggable'=>true), 'marker', array('dragevent'=>$dragevent));
+ $marker = new EGMapMarker($standort->pos_lat, $standort->pos_long, array('title' => $model->name, 'draggable'=>false), 'marker');
$marker->addHtmlInfoWindow($infoWindow);
$map->addMarker($marker, $standort->published);
}
$map->render();
?>
-<?php $this->widget('zii.widgets.grid.CGridView', array(
+<?php /*
+Listenanzeige der Standorte, gerade Schwachsinnig
+$this->widget('zii.widgets.grid.CGridView', array(
'id'=>'standort-grid',
'dataProvider'=>$model->search(),
- 'filter'=>$model,
+
'columns'=>array(
'type',
'name',
- 'pos_lat',
- 'pos_long',
- array('header'=>'Öffentlich',
- 'value'=>'CHtml::image($data->published ? "images/ok.png" : "images/nok.png", $data->published ? "ok.png" : "nok.png")', 'type'=>'raw'),
- array(
- 'class'=>'CButtonColumn',
- 'template'=>'{update} {delete}'
- ),
- ),
-)); ?>
+ ),
+));*/ ?>
+</p>
diff --git a/protected/views/standort/view.php b/protected/views/standort/view.php
index 0674ce9..53d5440 100644
--- a/protected/views/standort/view.php
+++ b/protected/views/standort/view.php
@@ -12,7 +12,7 @@ $this->menu=array(
);
?>
-<h3>Standort "<?php echo $model->name ?>"</h3>
+<h3><?php echo ($model->type == "Bühne") ? "Bühne": "Standort" ?> "<?php echo $model->name ?>"</h3>
<p>
<?php Yii::import('ext.egmap.*');
@@ -48,21 +48,14 @@ $gMap->enableMarkerClusterer(new EGMapMarkerClusterer());
$gMap->renderMap();
?>
</p>
-<h6>Folgende Vereine finden sich <?php echo $model->name?></h6>
<?php
-$dataProvider=new CActiveDataProvider('Verein', array(
- 'criteria'=>array(
- 'condition'=>'standort_id='.$model->id,
- ),
- 'pagination'=>array(
- 'pageSize'=>20,
- ),
-
+if("Stand" == $model->type) {
+ $this->renderPartial('_standort',array(
+ 'data'=>$model,
+ ));
+} elseif ("Bühne" == $model->type) {
+ $this->renderPartial('_buehne',array(
+ 'data'=>$model,
));
-$this->widget('zii.widgets.CListView', array(
- 'dataProvider'=>$dataProvider,
- 'itemView'=>'/verein/_short',
- 'sortableAttributes'=>array(
- 'name'
- )
- ));?>
+}
+?>
diff --git a/protected/views/veranstaltung/_search.php b/protected/views/veranstaltung/_search.php
new file mode 100644
index 0000000..099603c
--- /dev/null
+++ b/protected/views/veranstaltung/_search.php
@@ -0,0 +1,54 @@
+<div class="wide form">
+
+<?php $form=$this->beginWidget('CActiveForm', array(
+ 'action'=>Yii::app()->createUrl($this->route),
+ 'method'=>'get',
+)); ?>
+
+ <div class="row">
+ <?php echo $form->label($model,'id'); ?>
+ <?php echo $form->textField($model,'id'); ?>
+ </div>
+
+ <div class="row">
+ <?php echo $form->label($model,'verein_id'); ?>
+ <?php echo $form->dropDownList($model, 'verein_id', CHtml::listData(Verein::model()->findAll(), 'id', 'name'), array("empty"=>"")); ?>
+ </div>
+
+ <div class="row">
+ <?php echo $form->label($model,'titel'); ?>
+ <?php echo $form->textField($model,'titel',array('size'=>60,'maxlength'=>100)); ?>
+ </div>
+
+ <div class="row">
+ <?php echo $form->label($model,'startzeit'); ?>
+ <?php echo $form->textField($model,'startzeit'); ?>
+ </div>
+
+ <div class="row">
+ <?php echo $form->label($model,'endzeit'); ?>
+ <?php echo $form->textField($model,'endzeit'); ?>
+ </div>
+
+ <div class="row">
+ <?php echo $form->label($model,'beschreibung'); ?>
+ <?php echo $form->textArea($model,'beschreibung',array('rows'=>6, 'cols'=>50)); ?>
+ </div>
+
+ <div class="row">
+ <?php echo $form->label($model,'standort_id'); ?>
+ <?php echo $form->dropDownList($model, 'standort_id', CHtml::listData(Standort::model()->findAll(array('condition'=>'type="Bühne"')), 'id', 'name'), array("empty"=>"")); ?>
+ </div>
+
+ <div class="row">
+ <?php echo $form->label($model,'published'); ?>
+ <?php echo $form->checkbox($model,'published'); ?>
+ </div>
+
+ <div class="row buttons">
+ <?php echo CHtml::submitButton('Search'); ?>
+ </div>
+
+<?php $this->endWidget(); ?>
+
+</div><!-- search-form --> \ No newline at end of file
diff --git a/protected/views/veranstaltung/_short.php b/protected/views/veranstaltung/_short.php
new file mode 100644
index 0000000..56c474b
--- /dev/null
+++ b/protected/views/veranstaltung/_short.php
@@ -0,0 +1,2 @@
+<?php
+echo CHTML::link("<strong>".$data->titel."</strong> ".Yii::app()->dateFormatter->format('EEEE hh:mm',$data->startzeit)." Uhr bis ".Yii::app()->dateFormatter->format('EEEE hh:mm',$data->endzeit),array("veranstaltung/view","id"=>$data->id)); ?><br /> \ No newline at end of file
diff --git a/protected/views/veranstaltung/_view.php b/protected/views/veranstaltung/_view.php
new file mode 100644
index 0000000..daa818a
--- /dev/null
+++ b/protected/views/veranstaltung/_view.php
@@ -0,0 +1,38 @@
+<div class="view">
+
+ <b><?php echo CHtml::encode($data->getAttributeLabel('id')); ?>:</b>
+ <?php echo CHtml::link(CHtml::encode($data->id), array('view', 'id'=>$data->id)); ?>
+ <br />
+
+ <b><?php echo CHtml::encode($data->getAttributeLabel('verein_id')); ?>:</b>
+ <?php echo CHtml::encode($data->verein_id); ?>
+ <br />
+
+ <b><?php echo CHtml::encode($data->getAttributeLabel('titel')); ?>:</b>
+ <?php echo CHtml::encode($data->titel); ?>
+ <br />
+
+ <b><?php echo CHtml::encode($data->getAttributeLabel('startzeit')); ?>:</b>
+ <?php echo CHtml::encode($data->startzeit); ?>
+ <br />
+
+ <b><?php echo CHtml::encode($data->getAttributeLabel('endzeit')); ?>:</b>
+ <?php echo CHtml::encode($data->endzeit); ?>
+ <br />
+
+ <b><?php echo CHtml::encode($data->getAttributeLabel('beschreibung')); ?>:</b>
+ <?php echo CHtml::encode($data->beschreibung); ?>
+ <br />
+
+ <b><?php echo CHtml::encode($data->getAttributeLabel('standort_id')); ?>:</b>
+ <?php echo CHtml::encode($data->standort_id); ?>
+ <br />
+
+ <?php /*
+ <b><?php echo CHtml::encode($data->getAttributeLabel('published')); ?>:</b>
+ <?php echo CHtml::encode($data->published); ?>
+ <br />
+
+ */ ?>
+
+</div> \ No newline at end of file
diff --git a/protected/views/veranstaltung/index.php b/protected/views/veranstaltung/index.php
new file mode 100644
index 0000000..13f1dcf
--- /dev/null
+++ b/protected/views/veranstaltung/index.php
@@ -0,0 +1,35 @@
+<?php
+$this->breadcrumbs=array(
+ 'Veranstaltungen',
+);
+
+$this->menu=array(
+ array('label'=>'Veranstaltung erstellen', 'url'=>array('create')),
+);?>
+
+<h3>Veranstaltungen</h3>
+
+
+<?php $this->widget('zii.widgets.grid.CGridView', array(
+ 'id'=>'veranstaltung-grid',
+ 'dataProvider'=>$model->search(),
+ 'filter'=>$model,
+ 'columns'=>array(
+ array('header'=>'Verein',
+ 'name'=>'verein_id',
+ 'filter'=>CHtml::listData(Verein::model()->findAll(), 'id', 'name'),
+ 'value'=>'$data->verein->name'),
+ 'titel',
+ array('header'=>'Startzeit', 'value'=>'Format::displayDateTime($data->startzeit)'),
+ array('header'=>'Endzeit', 'value'=>'Format::displayDateTime($data->endzeit)'),
+ array('header'=>'Standort',
+ 'name'=>'standort_id',
+ 'filter'=>CHtml::listData(Standort::model()->findAll(array('condition'=>'type="Bühne"')), 'id', 'name'),
+ 'value'=>'($data->standort) ? $data->standort->name : "Kein Standort"'),
+ array('header'=>'Öffentlich',
+ 'value'=>'CHtml::image($data->published ? "images/ok.png" : "images/nok.png", $data->published ? "ok.png" : "nok.png")', 'type'=>'raw'),
+ array(
+ 'class'=>'CButtonColumn',
+ ),
+ ),
+)); ?>
diff --git a/protected/views/veranstaltung/now.php b/protected/views/veranstaltung/now.php
new file mode 100644
index 0000000..ca5e5dc
--- /dev/null
+++ b/protected/views/veranstaltung/now.php
@@ -0,0 +1,18 @@
+<?php
+$this->breadcrumbs=array(
+ 'Veranstaltungen'=>array('index'),'Jetzt'
+);
+
+$this->menu=array(
+ array('label'=>'Veranstaltung erstellen', 'url'=>array('create')),
+);?>
+
+<h3>Veranstaltungen heute um <?php echo date("H:i");?></h3>
+
+
+<?php $this->widget('zii.widgets.grid.CGridView', array(
+ 'id'=>'veranstaltung-grid',
+ 'dataProvider'=>$model->now()
+
+
+)); ?>
diff --git a/protected/views/veranstaltung/view.php b/protected/views/veranstaltung/view.php
new file mode 100644
index 0000000..55dbff8
--- /dev/null
+++ b/protected/views/veranstaltung/view.php
@@ -0,0 +1,21 @@
+<?php
+$this->breadcrumbs=array(
+ 'Veranstaltungen'=>array('index'),
+ $model->titel,
+);
+
+$this->menu=array(
+ array('label'=>'Veranstaltungen', 'url'=>array('index')),
+ );
+?>
+
+<h3><?php echo $model->titel; ?></h3>
+<p>von <?php echo Yii::app()->dateFormatter->format('EEEE hh:mm',$model->startzeit)." Uhr"?> bis <?php
+echo Yii::app()->dateFormatter->format('EEEE hh:mm',$model->endzeit)." Uhr"?>
+auf der Bühne <?php echo CHtml::link($model->standort->name,array("standort/view","id"=>$model->standort_id))?></p>
+<p>
+<?php
+echo $model->beschreibung;
+?>
+</p>
+<div class="box info"><p>Veranstalter ist der Verein <?php echo CHtml::link($model->verein->name,array("verein/view","id"=>$model->verein_id))?></p><?php echo $model->verein->kontaktdaten?></div> \ No newline at end of file
diff --git a/protected/views/verein/_short.php b/protected/views/verein/_short.php
index 0ff6284..c6e42de 100644
--- a/protected/views/verein/_short.php
+++ b/protected/views/verein/_short.php
@@ -11,4 +11,4 @@ if(strlen(strip_tags($data->beschreibung))>300) {
<?php /*
<p><?php echo CHTML::link(CHTML::decode($myBeschreibung),array("verein/view","id"=>$data->id)); ?></p>
*/?>
-<?php echo CHTML::link("<h6>".$data->name."</h6><p>".$myBeschreibung."</p>" ,array("verein/view","id"=>$data->id)); ?> \ No newline at end of file
+<?php echo CHTML::link("<h6>".$data->name." (".$data->standort->name.")</h6><p>".$myBeschreibung."</p>" ,array("verein/view","id"=>$data->id)); ?> \ No newline at end of file
diff --git a/protected/views/verein/_shortangebotverein.php b/protected/views/verein/_shortangebotverein.php
index e49580e..bc845ca 100644
--- a/protected/views/verein/_shortangebotverein.php
+++ b/protected/views/verein/_shortangebotverein.php
@@ -1,8 +1,3 @@
<?php
-if(strlen(strip_tags($data->angebot->beschreibung))>80) {
- $tmp = str_split(strip_tags($data->angebot->beschreibung),77);
- $myBeschreibung = $tmp[0]."...";
-} else {
- $myBeschreibung = strip_tags($data->angebot->beschreibung);
-}
-echo CHTML::link("<strong>".$data->angebot->name."</strong> (".$data->menge." ".$data->einheit.") für ".$data->preis."€ ".$myBeschreibung ,array("speisTrank/view","id"=>$data->angebot_id)); ?><br /> \ No newline at end of file
+
+echo CHTML::link("<strong>".$data->angebot->name."</strong> (".$data->menge." ".$data->einheit.") für ".Format::currency($data->preis) ,array("speisTrank/view","id"=>$data->angebot_id)); ?><br /> \ No newline at end of file
diff --git a/protected/views/verein/view.php b/protected/views/verein/view.php
index 95e1cf2..188238a 100644
--- a/protected/views/verein/view.php
+++ b/protected/views/verein/view.php
@@ -20,12 +20,11 @@ $this->menu=array(
<div class="box info float-right"><?php echo $model->kontaktdaten ?></div>
<p><?php echo $model->beschreibung?></p>
-<div class="float-left" >
<?php /*$this->widget('zii.widgets.CListView', array(
'dataProvider'=>new CArrayDataProvider($model->angebote, array()),
'itemView'=>'_shortangebot', // refers to the partial view named '_post'
));*/?>
-
+<h4>Kulinarische Angebote</h4>
<?php
$dataProvider=new CActiveDataProvider('AngebotVerein', array(
'criteria'=>array(
@@ -41,16 +40,25 @@ $this->widget('zii.widgets.CListView', array(
'itemView'=>'_shortangebotverein',
'sortableAttributes'=>array(
'preis','menge',
- ), // refers to the partial view named '_post'
+ ),
+ ));?>
+<h4>Veranstaltungen</h4>
+<?php
+$dataProvider=new CActiveDataProvider('Veranstaltung', array(
+ 'criteria'=>array(
+ 'condition'=>'verein_id='.$model->id." and published=1",
+ ),
+ 'pagination'=>array(
+ 'pageSize'=>20,
+ ),
+));
+$this->widget('zii.widgets.CListView', array(
+ 'dataProvider'=>$dataProvider,
+ 'itemView'=>'/veranstaltung/_short',
+ 'sortableAttributes'=>array(
+ 'titel','startzeit','endzeit',
+ ),
+ 'htmlOptions' => array('style' => 'width:100%'),
));?>
-
-<ul><?php
-foreach ($model->veranstaltungen as $value) {
- echo "<li>".CHTML::link($value->titel,array("veranstaltung/view","id"=>$value->id))."</li>";
-}
-
-?>
-</ul>
-</div>