From d7f3ac205ced0e1f1c26599b277cbfb988e48900 Mon Sep 17 00:00:00 2001 From: Patrick Seeger Date: Tue, 26 Jun 2012 16:59:26 +0200 Subject: =?UTF-8?q?Anzeige=20optimiert,=20Vereine=20und=20Veranstaltungen?= =?UTF-8?q?=20ver=C3=B6ffentlicht?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- css/yaml4/screen/typography-blue.css | 5 +++++ protected/controllers/SearchController.php | 20 ++++++++------------ protected/controllers/VereinController.php | 2 +- protected/models/Veranstaltung.php | 14 ++++++++++++++ protected/models/Verein.php | 8 ++++++++ protected/modules/cms/models/Sitecontent.php | 8 ++++++++ protected/views/search/results.php | 6 ++++-- protected/views/veranstaltung/index.php | 13 +++++++++++-- protected/views/veranstaltung/now.php | 2 +- protected/views/veranstaltung/view.php | 2 +- protected/views/verein/_short.php | 8 ++++++-- protected/views/verein/index.php | 4 ++-- protected/views/verein/view.php | 6 +++--- themes/astaf/views/layouts/main.php | 5 +++-- 14 files changed, 75 insertions(+), 28 deletions(-) diff --git a/css/yaml4/screen/typography-blue.css b/css/yaml4/screen/typography-blue.css index 5582090..fff5fb2 100644 --- a/css/yaml4/screen/typography-blue.css +++ b/css/yaml4/screen/typography-blue.css @@ -465,4 +465,9 @@ tbody tr:hover td { background:#f8f8f8; } + .items a:hover, a:focus { + background-color: #FFFFFF; + color: #4D87C7; + text-decoration: none; +} } \ No newline at end of file diff --git a/protected/controllers/SearchController.php b/protected/controllers/SearchController.php index 1dd2414..603ad7c 100644 --- a/protected/controllers/SearchController.php +++ b/protected/controllers/SearchController.php @@ -2,44 +2,40 @@ class SearchController extends Controller { - public static $Searchables = array('Verein' => array('beschreibung'),'Sitecontent'=>array('content','title')); + public static $Searchables = array('Veranstaltung'=>array('titel','beschreibung'),'Verein' => array('beschreibung','name'),'Sitecontent'=>array('content','title')); public function actionIndex() { $this->render('index'); } - public function actionSearch() + public function actionSearch($search) { foreach (SearchController::$Searchables as $searchable => $columns) { $q = new CDbCriteria(); foreach ($columns as $col) { - $q->addSearchCondition($col,$_POST['search'],true,'OR'); + $q->addSearchCondition($col,$search,true,'OR'); } - $results[$searchable]=CActiveRecord::model($searchable)->findAll($q); + $results[$searchable]=CActiveRecord::model($searchable)->published()->findAll($q); } $this->render('results', array( 'results' => $results, - 'search' => $_POST['search'])); + 'search' => $search)); } // Uncomment the following methods and override them if needed - /* + public function filters() { // return the filter configuration for this controller, e.g.: return array( - 'inlineFilterName', - array( - 'class'=>'path.to.FilterClass', - 'propertyName'=>'propertyValue', - ), + array('COutputCache','duration'=>3600,'varyByParam'=>array('search')), ); } - + /* public function actions() { // return external action classes, e.g.: diff --git a/protected/controllers/VereinController.php b/protected/controllers/VereinController.php index 407a9e7..2056d6d 100644 --- a/protected/controllers/VereinController.php +++ b/protected/controllers/VereinController.php @@ -15,7 +15,7 @@ class VereinController extends Controller { return array( 'accessControl', // perform access control for CRUD operations - array('COutputCache','duration'=>3600,'varyByParam'=>array('id','slug')), + //array('COutputCache','duration'=>3600,'varyByParam'=>array('id','slug')), ); } diff --git a/protected/models/Veranstaltung.php b/protected/models/Veranstaltung.php index 0117033..60536cf 100644 --- a/protected/models/Veranstaltung.php +++ b/protected/models/Veranstaltung.php @@ -108,8 +108,10 @@ class Veranstaltung extends CActiveRecord $criteria->compare('standort_id',$this->standort_id); $criteria->compare('published',true); + return new CActiveDataProvider($this, array( 'criteria'=>$criteria, + )); } @@ -145,4 +147,16 @@ class Veranstaltung extends CActiveRecord // 'LoggableBehavior'=>'application.modules.auditTrail.behaviors.LoggableBehavior', ); } + public function scopes() + { + return array( + 'published'=>array( + 'condition'=>'published=1', + ), + 'sorted'=>array( + 'order'=>'startzeit ASC', + + ), + ); + } } \ No newline at end of file diff --git a/protected/models/Verein.php b/protected/models/Verein.php index 78117e0..242bd95 100644 --- a/protected/models/Verein.php +++ b/protected/models/Verein.php @@ -133,4 +133,12 @@ class Verein extends CActiveRecord // 'LoggableBehavior'=>'application.modules.auditTrail.behaviors.LoggableBehavior', ); } + public function scopes() + { + return array( + 'published'=>array( + 'condition'=>'published=1', + ), + ); + } } \ No newline at end of file diff --git a/protected/modules/cms/models/Sitecontent.php b/protected/modules/cms/models/Sitecontent.php index bcd1385..e63ace2 100644 --- a/protected/modules/cms/models/Sitecontent.php +++ b/protected/modules/cms/models/Sitecontent.php @@ -89,4 +89,12 @@ class Sitecontent extends CActiveRecord } return parent::beforeSave(); } + public function scopes() + { + return array( + 'published'=>array( + 'condition'=>'1=1', + ), + ); + } } diff --git a/protected/views/search/results.php b/protected/views/search/results.php index 05d2b57..e72cc51 100644 --- a/protected/views/search/results.php +++ b/protected/views/search/results.php @@ -5,12 +5,14 @@ $this->breadcrumbs=array( );?>

Suchergebnisse für ""

$res) {?> + getItemCount()>0) {?>
widget('zii.widgets.CListView', array( 'dataProvider'=>$dataProvider, 'itemView'=>'/'.lcfirst($mod).'/_short', // refers to the partial view named '_post' ));?> - + diff --git a/protected/views/veranstaltung/index.php b/protected/views/veranstaltung/index.php index e8a5ceb..3703092 100644 --- a/protected/views/veranstaltung/index.php +++ b/protected/views/veranstaltung/index.php @@ -5,13 +5,22 @@ $this->breadcrumbs=array( $this->menu=array( array('label'=>'Jetzt auf dem Fest', 'url'=>array('now')), - array('label'=>'Veranstaltung suchen', 'url'=>array('search')), + //array('label'=>'Veranstaltung suchen', 'url'=>array('search')), );?>

Veranstaltungen

-widget('zii.widgets.grid.CGridView', array( +widget('zii.widgets.CListView', array( + 'dataProvider'=>$model->published()->sorted()->search(), + 'itemView'=>'_short_all', // refers to the partial view named '_post' + 'sortableAttributes'=>array( + 'startzeit', 'titel' + /*'create_time'=>'Post Time',*/ + ), + )); + + $this->widget('zii.widgets.grid.CGridView', array( 'id'=>'veranstaltung-grid', 'dataProvider'=>$model->search(), 'filter'=>$model, diff --git a/protected/views/veranstaltung/now.php b/protected/views/veranstaltung/now.php index 12202ba..24354f2 100644 --- a/protected/views/veranstaltung/now.php +++ b/protected/views/veranstaltung/now.php @@ -7,7 +7,7 @@ $this->menu=array( array('label'=>'Alle Veranstaltungen', 'url'=>array('index')), array('label'=>'Jetzt auf dem Fest', 'url'=>array('now')), - array('label'=>'Veranstaltung suchen', 'url'=>array('search')), + //array('label'=>'Veranstaltung suchen', 'url'=>array('search')), );?> diff --git a/protected/views/veranstaltung/view.php b/protected/views/veranstaltung/view.php index e942aee..edf3ca2 100644 --- a/protected/views/veranstaltung/view.php +++ b/protected/views/veranstaltung/view.php @@ -7,7 +7,7 @@ $this->breadcrumbs=array( $this->menu=array( array('label'=>'Alle Veranstaltungen', 'url'=>array('index')), array('label'=>'Jetzt auf dem Fest', 'url'=>array('now')), - array('label'=>'Veranstaltung suchen', 'url'=>array('search')), + // array('label'=>'Veranstaltung suchen', 'url'=>array('search')), ); ?> diff --git a/protected/views/verein/_short.php b/protected/views/verein/_short.php index c6e42de..c282b6a 100644 --- a/protected/views/verein/_short.php +++ b/protected/views/verein/_short.php @@ -7,8 +7,12 @@ if(strlen(strip_tags($data->beschreibung))>300) { $myBeschreibung = $tmp[0]."..."; } else { $myBeschreibung = strip_tags($data->beschreibung); -}?> +} +if(strlen($myBeschreibung)> 0) { + $myBeschreibung="

".$myBeschreibung."

"; +} +?> $data->id)); ?>

*/?> -".$data->name." (".$data->standort->name.")

".$myBeschreibung."

" ,array("verein/view","id"=>$data->id)); ?> \ No newline at end of file +
".$data->name."".$data->standort->name."".$myBeschreibung ,array("verein/view","id"=>$data->id)); ?>
\ No newline at end of file diff --git a/protected/views/verein/index.php b/protected/views/verein/index.php index 1e447a0..bfb20a8 100644 --- a/protected/views/verein/index.php +++ b/protected/views/verein/index.php @@ -2,11 +2,11 @@ $this->breadcrumbs=array( 'Vereine', ); - +/* $this->menu=array( array('label' => 'Verein suchen', 'url' => array('search')), -); +);*/ ?>

Vereine

diff --git a/protected/views/verein/view.php b/protected/views/verein/view.php index eb57968..2e0d0e5 100644 --- a/protected/views/verein/view.php +++ b/protected/views/verein/view.php @@ -36,9 +36,9 @@ $dataProvider=new CActiveDataProvider('AngebotVerein', array( $this->widget('zii.widgets.CListView', array( 'dataProvider'=>$dataProvider, 'itemView'=>'_shortangebotverein', - 'sortableAttributes'=>array( - 'preis','menge', - ), + //'sortableAttributes'=>array( + // 'preis','menge', + //), ));?>

Veranstaltungen

'active'), //array('label'=>'Home', 'url'=>array('/site/index')), array('label'=>'Home', 'url'=>array('/cms/sitecontent/view', 'page'=>'home')), - //array('label'=>'Stände', 'url'=>array('/verein/index')), + array('label'=>'Vereine', 'url'=>array('/verein/index')), + array('label'=>'Programm', 'url'=>array('/veranstaltung/index')), ), Cms::getMenuPoints(1), array( @@ -72,7 +73,7 @@ )); ?> - 'ym-searchform')); ?> + 'ym-searchform')); ?> -- cgit v1.0-28-g1787