From 5b39d6bf7f34ed52059410f3d0af3799aeff2113 Mon Sep 17 00:00:00 2001 From: Patrick Seeger Date: Sun, 6 May 2012 22:45:08 +0200 Subject: vereinsansicht basis --- css/astaf/layout.css | 2 + css/yaml4/navigation/hlist-blue-small.css | 93 ++++++++++++++++++++++ protected/controllers/VereinController.php | 2 +- protected/models/Angebot.php | 2 +- protected/models/AngebotVerein.php | 2 +- protected/models/Kategorie.php | 2 +- protected/models/Standort.php | 2 +- protected/models/Veranstaltung.php | 2 +- protected/models/Verein.php | 4 +- .../cms/controllers/SitecontentController.php | 5 +- protected/views/verein/_shortangebot.php | 10 +++ protected/views/verein/index.php | 1 + protected/views/verein/view.php | 39 +++++---- themes/astaf/views/layouts/main.php | 19 ++++- 14 files changed, 157 insertions(+), 28 deletions(-) create mode 100644 css/yaml4/navigation/hlist-blue-small.css create mode 100644 protected/views/verein/_shortangebot.php diff --git a/css/astaf/layout.css b/css/astaf/layout.css index 4726978..f7a2762 100644 --- a/css/astaf/layout.css +++ b/css/astaf/layout.css @@ -20,6 +20,8 @@ /* import screen layout | Screen-Layout einbinden */ @import url(../yaml4/navigation/hlist-blue.css); +@import url(../yaml4/navigation/hlist-blue-small.css); + @import url(../yaml4/navigation/vlist.css); @import url(../yaml4/forms/blue-theme.css); diff --git a/css/yaml4/navigation/hlist-blue-small.css b/css/yaml4/navigation/hlist-blue-small.css new file mode 100644 index 0000000..a25ccbf --- /dev/null +++ b/css/yaml4/navigation/hlist-blue-small.css @@ -0,0 +1,93 @@ +/** + * "Yet Another Multicolumn Layout" - YAML CSS Framework + * + * (en) Horizontal list navigation "hlist" + * (de) Horizontale Navigationsliste "hlist" + * + * @copyright Copyright 2005-2012, Dirk Jesse + * @license CC-BY 2.0 (http://creativecommons.org/licenses/by/2.0/), + * YAML-CDL (http://www.yaml.de/license.html) + * @link http://www.yaml.de + * @package yaml + * @version v4.0 + * @revision $Revision: 692 $ + * @lastmodified $Date: 2012-01-25 11:37:31 +0100 (Mi, 25 Jan 2012) $ + */ + +@media all { + + #submenu { + /* (en) containing floats in IE */ + /* (de) Einfassen der Floats im IE */ + width:100%; + overflow:hidden; + /* (en|de) Bugfix:IE - collapsing horizontal margins */ + position:relative; + line-height:0.7em; + background: #090b21; + } + + #submenu { + margin:0; + padding:0; + /* (en|de) Bugfix:IE - Doubled Float Margin Bug */ + display:inline; + float:left; /* LTR */ + } + + #submenu ul li { + /* (en|de) Bugfix:IE - Doubled Float Margin Bug */ + display:inline; + float:left; /* LTR */ + font-size:0.8em; + line-height:0.8em; + list-style-type:none; + margin: 0 .15em 0 0; + padding:0; + } + + #submenu ul li a, + #submenu ul li strong { + background:transparent; + color:#aaa; + display:block; + font-size:1em; + line-height: 2em; + padding: 0 0.3em; + font-weight:normal; + text-decoration:none; + text-shadow: 0 1px 1px rgba(0,0,0,.5); + width:auto; + } + + #submenu ul li a:focus, + #submenu ul li a:hover, + #submenu ul li a:active { + color: #b3b5cc; + background:#666; + background: rgba(255,255,255,.25); + -webkit-border-radius: 0.1em; + -moz-border-radius: 0.1em; + border-radius: 0.1em; + text-decoration:none; + outline: 0 none; + } + + #submenu ul li.active { + background:#666; + background: rgba(255,255,255,.3); + -webkit-border-radius: 0.2em; + -moz-border-radius: 0.2em; + border-radius: 0.2em; + color: #fff; + } + + #submenu ul li.active strong, + #submenu ul li.active a:focus, + #submenu ul li.active a:hover, + #submenu ul li.active a:active { + background:transparent; + color:#fff; + text-decoration:none; + } +} \ No newline at end of file diff --git a/protected/controllers/VereinController.php b/protected/controllers/VereinController.php index 2be85d6..e0a3e68 100644 --- a/protected/controllers/VereinController.php +++ b/protected/controllers/VereinController.php @@ -143,7 +143,7 @@ class VereinController extends Controller */ public function loadModel($id) { - $model=Verein::model()->findByPk($id); + $model=Verein::model()->with('angebote','veranstaltungen')->findByPk($id); if($model===null) throw new CHttpException(404,'The requested page does not exist.'); return $model; diff --git a/protected/models/Angebot.php b/protected/models/Angebot.php index d6ae02a..61e4d54 100644 --- a/protected/models/Angebot.php +++ b/protected/models/Angebot.php @@ -100,7 +100,7 @@ class Angebot extends CActiveRecord public function behaviors() { return array( - 'LoggableBehavior'=>'application.modules.auditTrail.behaviors.LoggableBehavior', + // 'LoggableBehavior'=>'application.modules.auditTrail.behaviors.LoggableBehavior', ); } } \ No newline at end of file diff --git a/protected/models/AngebotVerein.php b/protected/models/AngebotVerein.php index 26c6dab..1031100 100644 --- a/protected/models/AngebotVerein.php +++ b/protected/models/AngebotVerein.php @@ -102,7 +102,7 @@ class AngebotVerein extends CActiveRecord public function behaviors() { return array( - 'LoggableBehavior'=>'application.modules.auditTrail.behaviors.LoggableBehavior', + //'LoggableBehavior'=>'application.modules.auditTrail.behaviors.LoggableBehavior', ); } } \ No newline at end of file diff --git a/protected/models/Kategorie.php b/protected/models/Kategorie.php index 93c799d..294947f 100644 --- a/protected/models/Kategorie.php +++ b/protected/models/Kategorie.php @@ -101,7 +101,7 @@ class Kategorie extends CActiveRecord public function behaviors() { return array( - 'LoggableBehavior'=>'application.modules.auditTrail.behaviors.LoggableBehavior', + // 'LoggableBehavior'=>'application.modules.auditTrail.behaviors.LoggableBehavior', ); } } \ No newline at end of file diff --git a/protected/models/Standort.php b/protected/models/Standort.php index d62a594..6052e1a 100644 --- a/protected/models/Standort.php +++ b/protected/models/Standort.php @@ -106,7 +106,7 @@ class Standort extends CActiveRecord public function behaviors() { return array( - 'LoggableBehavior'=>'application.modules.auditTrail.behaviors.LoggableBehavior', + //'LoggableBehavior'=>'application.modules.auditTrail.behaviors.LoggableBehavior', ); } } \ No newline at end of file diff --git a/protected/models/Veranstaltung.php b/protected/models/Veranstaltung.php index 64c7854..0e4d9b8 100644 --- a/protected/models/Veranstaltung.php +++ b/protected/models/Veranstaltung.php @@ -124,7 +124,7 @@ class Veranstaltung extends CActiveRecord public function behaviors() { return array( - 'LoggableBehavior'=>'application.modules.auditTrail.behaviors.LoggableBehavior', + // 'LoggableBehavior'=>'application.modules.auditTrail.behaviors.LoggableBehavior', ); } } \ No newline at end of file diff --git a/protected/models/Verein.php b/protected/models/Verein.php index f0d30dd..6d84c91 100644 --- a/protected/models/Verein.php +++ b/protected/models/Verein.php @@ -66,7 +66,9 @@ class Verein extends CActiveRecord // NOTE: you may need to adjust the relation name and the related // class name for the relations automatically generated below. return array( - "standort"=>array(self::HAS_ONE, "Standort", array('id'=>'standort_id')) + "standort"=>array(self::HAS_ONE, "Standort", array('id'=>'standort_id')), + "angebote"=>array(self::MANY_MANY, "Angebot", "angebot_verein(verein_id,angebot_id)"), + "veranstaltungen"=>array(self::HAS_MANY, "Veranstaltung","verein_id"), ); } diff --git a/protected/modules/cms/controllers/SitecontentController.php b/protected/modules/cms/controllers/SitecontentController.php index bb18771..a2a3906 100644 --- a/protected/modules/cms/controllers/SitecontentController.php +++ b/protected/modules/cms/controllers/SitecontentController.php @@ -39,8 +39,9 @@ class SitecontentController extends Controller $model = $this->loadContent(); $this->breadcrumbs = array($model->title); - $this->menu = CMS::getMenuPoints($model->id); - + if($model->id > 1) { + $this->menu = CMS::getMenuPoints($model->id); + } $this->render('view', array( 'sitecontent' => $model, )); diff --git a/protected/views/verein/_shortangebot.php b/protected/views/verein/_shortangebot.php new file mode 100644 index 0000000..e90da5b --- /dev/null +++ b/protected/views/verein/_shortangebot.php @@ -0,0 +1,10 @@ +beschreibung))>80) { + $tmp = str_split(strip_tags($data->beschreibung),77); + $myBeschreibung = $tmp[0]."..."; +} else { + $myBeschreibung = strip_tags($data->beschreibung); +}?> + + +".$data->name."

".$myBeschreibung."

" ,array("angebot/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 cfdd6e0..84431e3 100644 --- a/protected/views/verein/index.php +++ b/protected/views/verein/index.php @@ -4,6 +4,7 @@ $this->breadcrumbs=array( ); $this->menu=array( + array('label' => 'Verein suchen', 'url' => array('search')), array('label'=>'Verein erstellen', 'url'=>array('create'),'visible'=>!Yii::app()->user->isGuest), ); ?> diff --git a/protected/views/verein/view.php b/protected/views/verein/view.php index 6efb9e7..7c5bb32 100644 --- a/protected/views/verein/view.php +++ b/protected/views/verein/view.php @@ -12,19 +12,28 @@ $this->menu=array( ); ?> -

name; ?>

+

name; ?>

+bild) { + echo CHtml::image($model->bild,'Vereinslogo '.$model->name, array("class" => "float-left bordered")); +}?> +

beschreibung?>

+
+widget('zii.widgets.CListView', array( + 'dataProvider'=>new CArrayDataProvider($model->angebote, array()), + 'itemView'=>'_shortangebot', // refers to the partial view named '_post' + 'sortableAttributes'=>array( + 'name', + /*'create_time'=>'Post Time',*/ + ), + ));?> + + +
+
Kontaktdaten
kontaktdaten?>
-widget('zii.widgets.CDetailView', array( - 'data'=>$model, - 'attributes'=>array( - 'slug', - /*'name',*/ - array('label'=>'Bild', 'value'=>CHtml::image($model->bild), 'type'=>'raw'), - array('label'=>'Homepage', 'value'=>CHtml::link($model->url, $model->url, array("target"=>"_blank")), 'type'=>'raw'), - 'email', - 'kontaktdaten:html', - 'beschreibung:html', - array('label'=>'Standort', 'value'=>($model->standort) ? $model->standort->name : "-"), - array('label'=>'Öffentlich', 'value'=>CHtml::image($model->published ? "images/ok.png" : "images/nok.png", $model->published ? "ok.png" : "nok.png"), 'type'=>'raw'), - ), -)); ?> diff --git a/themes/astaf/views/layouts/main.php b/themes/astaf/views/layouts/main.php index 3707925..025952f 100644 --- a/themes/astaf/views/layouts/main.php +++ b/themes/astaf/views/layouts/main.php @@ -40,10 +40,12 @@ widget('zii.widgets.CMenu',array( + 'id' => 'mainmenu', 'items'=>array_merge(array( array('activeCssClass' => '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')), ), Cms::getMenuPoints(1), array( @@ -55,12 +57,21 @@ ) )); ?> - widget('cms.components.SearchWidget');?> + 'ym-searchform')); ?> - + + menu) { + echo ""; + } + ?> @@ -142,7 +153,7 @@ */?> widget('application.extensions.wetter.Wetter', array("ort" => "Waiblingen"));?> -
+

-- cgit v1.0-28-g1787