Changeset 107
- Timestamp:
- 07/18/07 13:50:08 (1 year ago)
- Files:
-
- branch/controllers/events_controller.php (modified) (2 diffs)
- branch/models/event.php (modified) (1 diff)
- branch/views/events/admin_index.ctp (modified) (1 diff)
- branch/views/events/index.ctp (modified) (1 diff)
- branch/webroot/css/accordion.css (deleted)
- branch/webroot/css/cake.generic.css (deleted)
- branch/webroot/css/default.css (modified) (11 diffs)
- branch/webroot/css/jquery.hcal.css (deleted)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branch/controllers/events_controller.php
r106 r107 6 6 7 7 function index() { 8 $this->Event->recursive = 0; 8 $this->Event->recursive = 0; 9 9 $this->set('events', $this->paginate()); 10 $this->set('default', $this->Event->aveLatLng()); 10 11 } 11 12 … … 75 76 function admin_index() { 76 77 $this->Event->recursive = 0; 77 78 $default = $this->Event->aveLatLng();79 78 $this->set('events', $this->paginate()); 80 $this->set('default', $ default);79 $this->set('default', $this->Event->aveLatLng()); 81 80 } 82 81 branch/models/event.php
r88 r107 68 68 $count=0; 69 69 70 $points = $this->findAll(); 71 foreach($points as $n=>$point){ 72 $avg_lat += $point['Venue']['latitude']; 73 $avg_lon += $point['Venue']['longitude']; 74 $count++; 75 } 76 70 if ($points = $this->findAll() ) { 71 foreach($points as $n=>$point){ 72 $avg_lat += $point['Venue']['latitude']; 73 $avg_lon += $point['Venue']['longitude']; 74 $count++; 75 } 77 76 $avg_lat = $avg_lat/$count; 78 77 $avg_lon = $avg_lon/$count; 78 } else { 79 $avg_lat = 0; 80 $avg_lon = 0; 81 } 79 82 $default = $avg_lat . "," . $avg_lon; 80 83 return $default; branch/views/events/admin_index.ctp
r88 r107 2 2 3 3 <div class="events"> 4 <h2><?php __('Events');?></h2>4 <h2><?php __('Events');?></h2> 5 5 6 <div id="gmap" style="width:99%; height: 400px;"></div> 6 <?php if ($events) { ?> 7 <div id="gmap" style="width:99%; height: 400px;"></div> 7 8 8 <table cellpadding="0" cellspacing="0"> 9 <tr> 10 <th><?php echo $paginator->sort('id');?></th> 11 <th><?php echo $paginator->sort('venue_id');?></th> 12 <th><?php echo $paginator->sort('event_type_id');?></th> 13 <th><?php echo $paginator->sort('event_date');?></th> 14 <th><?php echo $paginator->sort('event_time');?></th> 15 <th><?php echo $paginator->sort('event_url');?></th> 16 <th><?php echo $paginator->sort('body');?></th> 17 <th><?php echo $paginator->sort('tags');?></th> 18 <th><?php echo $paginator->sort('user_id');?></th> 19 <th><?php echo $paginator->sort('subject_id');?></th> 20 <th><?php echo $paginator->sort('published');?></th> 21 <th><?php echo $paginator->sort('created');?></th> 22 <th><?php echo $paginator->sort('modified');?></th> 23 <th class="actions"><?php __('Actions');?></th> 24 </tr> 25 <?php 26 $i = 0; 27 foreach ($events as $event): 28 29 e($javascript->codeBlock('$j().ready(function(){$("#gmap").addPoint("' . $event['Venue']['latitude'] . '","' . $event['Venue']['longitude'] . '","' . $event['Venue']['name'] . '<br />' . $event['Venue']['street'] . '<br />' . $event['Venue']['city'] . ',' . $event['Venue']['postcode'] . '");});')); 30 31 $class = null; 32 if ($i++ % 2 == 0) { 33 $class = ' class="altrow"'; 34 } 35 ?> 36 <tr<?php echo $class;?>> 37 <td> 38 <?php echo $event['Event']['id']?> 39 </td> 40 <td> 41 <?php echo $html->link($event['Venue']['name'], array('controller'=> 'venues', 'action'=>'view', $event['Venue']['id'])); ?> 42 </td> 43 <td> 44 <?php echo $html->link($event['EventType']['title'], array('controller'=> 'event_types', 'action'=>'view', $event['EventType']['id'])); ?> 45 </td> 46 <td> 47 <?php echo $event['Event']['event_date']?> 48 </td> 49 <td> 50 <?php echo $event['Event']['event_time']?> 51 </td> 52 <td> 53 <?php echo $event['Event']['event_url']?> 54 </td> 55 <td> 56 <?php echo $event['Event']['body']?> 57 </td> 58 <td> 59 <?php echo $event['Event']['tags']?> 60 </td> 61 <td> 62 <?php echo $html->link($event['User']['name'], array('controller'=> 'users', 'action'=>'view', $event['User']['id'])); ?> 63 </td> 64 <td> 65 <?php echo $html->link($event['Subject']['title'], array('controller'=> 'subjects', 'action'=>'view', $event['Subject']['id'])); ?> 66 </td> 67 <td> 68 <?php echo $event['Event']['published']?> 69 </td> 70 <td> 71 <?php echo $event['Event']['created']?> 72 </td> 73 <td> 74 <?php echo $event['Event']['modified']?> 75 </td> 76 <td class="actions"> 77 <?php echo $html->link(__('View', true), array('action'=>'view', $event['Event']['id'])); ?> 78 <?php echo $html->link(__('Edit', true), array('action'=>'edit', $event['Event']['id'])); ?> 79 <?php echo $html->link(__('Delete', true), array('action'=>'delete', $event['Event']['id']), null, __('Are you sure you want to delete', true).' #' . $event['Event']['id']); ?> 80 </td> 81 </tr> 82 <?php endforeach; ?> 83 </table> 84 </div> 85 <div class="paging"> 86 <?php echo $paginator->prev('<< '.__('previous', true), array(), null, array('class'=>'disabled'));?> 87 | <?php echo $paginator->numbers();?> 88 <?php echo $paginator->next(__('next', true).' >>', array(), null, array('class'=>'disabled'));?> 89 </div> 9 <table cellpadding="0" cellspacing="0"> 10 <thead> 11 <tr> 12 <th><?php echo $paginator->sort('id');?></th> 13 <th><?php echo $paginator->sort('venue_id');?></th> 14 <th><?php echo $paginator->sort('event_type_id');?></th> 15 <th><?php echo $paginator->sort('event_date');?></th> 16 <th><?php echo $paginator->sort('event_time');?></th> 17 <th><?php echo $paginator->sort('event_url');?></th> 18 <th><?php echo $paginator->sort('body');?></th> 19 <th><?php echo $paginator->sort('tags');?></th> 20 <th><?php echo $paginator->sort('user_id');?></th> 21 <th><?php echo $paginator->sort('subject_id');?></th> 22 <th><?php echo $paginator->sort('published');?></th> 23 <th><?php echo $paginator->sort('created');?></th> 24 <th><?php echo $paginator->sort('modified');?></th> 25 <th class="actions"><?php __('Actions');?></th> 26 </tr> 27 </thead> 28 <tbody> 29 <?php 30 $i = 0; 31 foreach ($events as $event): 32 33 e($javascript->codeBlock('$j().ready(function(){$("#gmap").addPoint("' . $event['Venue']['latitude'] . '","' . $event['Venue']['longitude'] . '","' . $event['Venue']['name'] . '<br />' . $event['Venue']['street'] . '<br />' . $event['Venue']['city'] . ',' . $event['Venue']['postcode'] . '");});')); 34 35 $class = null; 36 if ($i++ % 2 == 0) { 37 $class = ' class="odd"'; 38 } 39 ?> 40 <tr<?php echo $class;?>> 41 <td> 42 <?php echo $event['Event']['id']?> 43 </td> 44 <td> 45 <?php echo $html->link($event['Venue']['name'], array('controller'=> 'venues', 'action'=>'view', $event['Venue']['id'])); ?> 46 </td> 47 <td> 48 <?php echo $html->link($event['EventType']['title'], array('controller'=> 'event_types', 'action'=>'view', $event['EventType']['id'])); ?> 49 </td> 50 <td> 51 <?php echo $event['Event']['event_date']?> 52 </td> 53 <td> 54 <?php echo $event['Event']['event_time']?> 55 </td> 56 <td> 57 <?php echo $event['Event']['event_url']?> 58 </td> 59 <td> 60 <?php echo $event['Event']['body']?> 61 </td> 62 <td> 63 <?php echo $event['Event']['tags']?> 64 </td> 65 <td> 66 <?php echo $html->link($event['User']['name'], array('controller'=> 'users', 'action'=>'view', $event['User']['id'])); ?> 67 </td> 68 <td> 69 <?php echo $html->link($event['Subject']['title'], array('controller'=> 'subjects', 'action'=>'view', $event['Subject']['id'])); ?> 70 </td> 71 <td> 72 <?php echo $event['Event']['published']?> 73 </td> 74 <td> 75 <?php echo $event['Event']['created']?> 76 </td> 77 <td> 78 <?php echo $event['Event']['modified']?> 79 </td> 80 <td class="actions"> 81 <?php echo $html->link(__('View', true), array('action'=>'view', $event['Event']['id'])); ?> 82 <?php echo $html->link(__('Edit', true), array('action'=>'edit', $event['Event']['id'])); ?> 83 <?php echo $html->link(__('Delete', true), array('action'=>'delete', $event['Event']['id']), null, __('Are you sure you want to delete', true).' #' . $event['Event']['id']); ?> 84 </td> 85 </tr> 86 <?php endforeach; ?> 87 </tbody> 88 </table> 89 </div> 90 <div class="paging"> 91 <?php echo $paginator->prev('<< '.__('previous', true), array(), null, array('class'=>'disabled'));?> 92 | <?php echo $paginator->numbers();?> 93 <?php echo $paginator->next(__('next', true).' >>', array(), null, array('class'=>'disabled'));?> 94 </div> 95 <?php } else { 96 __('There are currently no events in the system'); 97 e('</div>'); 98 } ?> 90 99 <div class="actions"> 91 100 <ul> 92 101 <li><?php echo $html->link(__('New', true).' '.__('Event', true), array('action'=>'add')); ?></li> 93 <li><?php echo $html->link(__('List', true).' '.__('Venues', true), array('controller'=> 'venues', 'action'=>'index')); ?> </li>94 <li><?php echo $html->link(__('New', true).' '.__('Venue', true), array('controller'=> 'venues', 'action'=>'add')); ?> </li>95 <li><?php echo $html->link(__('List', true).' '.__('Event Types', true), array('controller'=> 'event_types', 'action'=>'index')); ?> </li>96 <li><?php echo $html->link(__('New', true).' '.__('Event Type', true), array('controller'=> 'event_types', 'action'=>'add')); ?> </li>97 <li><?php echo $html->link(__('List', true).' '.__('Users', true), array('controller'=> 'users', 'action'=>'index')); ?> </li>98 <li><?php echo $html->link(__('New', true).' '.__('User', true), array('controller'=> 'users', 'action'=>'add')); ?> </li>99 <li><?php echo $html->link(__('List', true).' '.__('Subjects', true), array('controller'=> 'subjects', 'action'=>'index')); ?> </li>100 <li><?php echo $html->link(__('New', true).' '.__('Subject', true), array('controller'=> 'subjects', 'action'=>'add')); ?> </li>101 <li><?php echo $html->link(__('List', true).' '.__('Tags', true), array('controller'=> 'tags', 'action'=>'index')); ?> </li>102 <li><?php echo $html->link(__('New', true).' '.__('Tag', true), array('controller'=> 'tags', 'action'=>'add')); ?> </li>103 102 </ul> 104 103 </div> branch/views/events/index.ctp
r88 r107 1 1 <?php e($javascript->codeBlock('$j().ready(function(){$j("#gmap").jmap({center: ['. $default .'], zoom: 2});});'));?> 2 2 3 <div id="jhCalendar"></div> 3 <div class="events"> 4 <h2><?php __('Events');?></h2> 4 5 5 <div class="events"> 6 <?php foreach ($events as $event): ?> 7 <div class="vevent" id="hcalendar-<?php echo $event['Event']['id']?>"> 8 <a class="url" href="<?php echo $event['Event']['event_url']?>"> 9 <abbr class="dtstart" title="20080716T0800"><?php echo $event['Event']['event_date']?> <?php echo $event['Event']['event_time']?></abbr>— 10 <span class="summary"><?php e($event['EventType']['title']);?> — <?php e($event['Subject']['title']); ?></span> — at 11 <span class="location"><?php e($event['Venue']['name']);?></span> 12 </a> 13 <div class="description"><?php echo $event['Event']['body']?></div> 6 <?php if ($events) { ?> 7 <div id="gmap" style="width:99%; height: 400px;"></div> 8 9 <table cellpadding="0" cellspacing="0"> 10 <thead> 11 <tr> 12 <th><?php echo $paginator->sort('id');?></th> 13 <th><?php echo $paginator->sort('venue_id');?></th> 14 <th><?php echo $paginator->sort('event_type_id');?></th> 15 <th><?php echo $paginator->sort('event_date');?></th> 16 <th><?php echo $paginator->sort('event_time');?></th> 17 <th><?php echo $paginator->sort('event_url');?></th> 18 <th><?php echo $paginator->sort('body');?></th> 19 <th><?php echo $paginator->sort('tags');?></th> 20 <th><?php echo $paginator->sort('user_id');?></th> 21 <th><?php echo $paginator->sort('subject_id');?></th> 22 <th><?php echo $paginator->sort('published');?></th> 23 <th><?php echo $paginator->sort('created');?></th> 24 <th><?php echo $paginator->sort('modified');?></th> 25 <th class="actions"><?php __('Actions');?></th> 26 </tr> 27 </thead> 28 <tbody> 29 <?php 30 $i = 0; 31 foreach ($events as $event): 32 33 e($javascript->codeBlock('$j().ready(function(){$("#gmap").addPoint("' . $event['Venue']['latitude'] . '","' . $event['Venue']['longitude'] . '","' . $event['Venue']['name'] . '<br />' . $event['Venue']['street'] . '<br />' . $event['Venue']['city'] . ',' . $event['Venue']['postcode'] . '");});')); 34 35 $class = null; 36 if ($i++ % 2 == 0) { 37 $class = ' class="altrow"'; 38 } 39 ?> 40 <tr<?php echo $class;?>> 41 <td> 42 <?php echo $event['Event']['id']?> 43 </td> 44 <td> 45 <?php echo $html->link($event['Venue']['name'], array('controller'=> 'venues', 'action'=>'view', $event['Venue']['id'])); ?> 46 </td> 47 <td> 48 <?php echo $html->link($event['EventType']['title'], array('controller'=> 'event_types', 'action'=>'view', $event['EventType']['id'])); ?> 49 </td> 50 <td> 51 <?php echo $event['Event']['event_date']?> 52 </td> 53 <td> 54 <?php echo $event['Event']['event_time']?> 55 </td> 56 <td> 57 <?php echo $event['Event']['event_url']?> 58 </td> 59 <td> 60 <?php echo $event['Event']['body']?> 61 </td> 62 <td> 63 <?php echo $event['Event']['tags']?> 64 </td> 65 <td> 66 <?php echo $html->link($event['User']['name'], array('controller'=> 'users', 'action'=>'view', $event['User']['id'])); ?> 67 </td> 68 <td> 69 <?php echo $html->link($event['Subject']['title'], array('controller'=> 'subjects', 'action'=>'view', $event['Subject']['id'])); ?> 70 </td> 71 <td> 72 <?php echo $event['Event']['published']?> 73 </td> 74 <td> 75 <?php echo $event['Event']['created']?> 76 </td> 77 <td> 78 <?php echo $event['Event']['modified']?> 79 </td> 80 <td class="actions"> 81 <?php echo $html->link(__('View', true), array('action'=>'view', $event['Event']['id'])); ?> 82 <?php echo $html->link(__('Edit', true), array('action'=>'edit', $event['Event']['id'])); ?> 83 <?php echo $html->link(__('Delete', true), array('action'=>'delete', $event['Event']['id']), null, __('Are you sure you want to delete', true).' #' . $event['Event']['id']); ?> 84 </td> 85 </tr> 86 <?php endforeach; ?> 87 </tbody> 88 </table> 14 89 </div> 15 <?php endforeach;?> 16 </div> 90 <div class="paging"> 91 <?php echo $paginator->prev('<< '.__('previous', true), array(), null, array('class'=>'disabled'));?> 92 | <?php echo $paginator->numbers();?> 93 <?php echo $paginator->next(__('next', true).' >>', array(), null, array('class'=>'disabled'));?> 94 </div> 95 <?php } else { 96 __('There are currently no events in the system'); 97 e('</div>'); 98 } ?> branch/webroot/css/default.css
r98 r107 2 2 3 3 body { 4 background: # 000/*url('../img/bg.png') repeat-x*/;4 background: #36393B /*url('../img/bg.png') repeat-x*/; 5 5 color:#fff; 6 6 } 7 7 8 a {color:# 004dcb; text-decoration:none;}8 a {color:#EEE6AB; text-decoration:none;} 9 9 10 10 div#hd { 11 11 height:130px; 12 background: #45484B; 12 13 /*background: #fff url('../img/NoHalfMeasures.jpg') no-repeat;*/ 13 14 color: #fff; … … 36 37 div.yui-u { 37 38 /*border:1px solid #000;*/ 38 background:# 000;39 background:#45484B; 39 40 } 40 41 41 42 div.yui-u h3 { 42 43 height:20px; 43 background: url('../img/h2_top.png') repeat-x;44 background: #696758; 44 45 font-size:1em; 45 border:2px solid #000;46 color:# 000;46 padding: 5px; 47 color:#fff; 47 48 font-weight:bold; 48 49 } … … 107 108 margin:0; 108 109 padding:0; 109 overflow:auto 110 111 } 110 overflow:auto; 111 } 112 112 113 table { 113 114 border: none; 114 font-family: Garamond, Georgia, "Times New Roman", Times, serif; 115 } 116 117 table caption { 118 background-color: transparent; 119 background-image: url(cap_bg.gif); 120 background-repeat: repeat-x; 121 background-position: bottom left; 122 text-align:left; 123 font-size:150%; 124 text-transform:uppercase; 125 line-height: 30px; 126 letter-spacing:0px; 115 width:99%; 116 margin-top:20px; 127 117 } 128 118 … … 136 126 } 137 127 138 thead t h{139 background: # 2293FF url('../img/h2_top.png') repeat-x;140 color: # FFFFFF;128 thead tr { 129 background: #EEE6AB; 130 color: #000; 141 131 font-size: 125%; 142 132 border-top:1px solid #fff; 143 133 border-right:1px solid #fff; 144 134 padding: 4px 0.4em 4px 0.4em; 135 } 136 137 thead a, a:link, thead a:visited, thead a:active { 138 color: #000; 145 139 } 146 140 … … 154 148 155 149 tbody td, tbody th { 156 background-color: # 222;150 background-color: #36393B; 157 151 border-right:1px solid #fff; 158 152 font-size: 110%; … … 161 155 162 156 tbody tr.odd th, tbody tr.odd td{ 163 background-color: #4 44;157 background-color: #45484B; 164 158 } 165 159 … … 169 163 } 170 164 171 t able a, a:link, table a:visited, tablea:active {165 tbody a, a:link, tbody a:visited, tbody a:active { 172 166 background-color: transparent; 173 } 174 175 table a:hover { 176 text-decoration:none; 177 color: #FFFFFF; 178 } 179 180 /* Navigation Tree */ 181 .treeview, .treeview ul { 182 padding: 0; 183 margin: 0; 184 list-style: none; 185 } 186 187 .treeview li { 188 margin: 0; 189 padding: 4px 0 3px 20px; 190 } 191 192 .treeview li { background: url(../js/treeview/images/black/tv-item.gif) 0 0 no-repeat; } 193 .treeview .collapsable { background-image: url(../js/treeview/images/black/tv-collapsable.gif); } 194 .treeview .expandable { background-image: url(../js/treeview/images/black/tv-expandable.gif); } 195 .treeview .last { background-image: url(../js/treeview/images/black/tv-item-last.gif); } 196 .treeview .lastCollapsable { background-image: url(../js/treeview/images/black/tv-collapsable-last.gif); } 197 .treeview .lastExpandable { background-image: url(../js/treeview/images/black/tv-expandable-last.gif); } 167 color: #fff; 168 } 198 169 199 170 /* Gallery */ … … 213 184 214 185 div.hentry h2, div.event h2 { 215 background: url('../img/h2_top.png') repeat-x;186 background: #696758; 216 187 } 217 188 218 189 div.hentry h2 a { 219 color:# 000;190 color:#fff; 220 191 margin-left:30px; 221 192 } 222 193 223 194 div.hentry div.entry-infobar { 224 background: # 000;195 background: #45484B; 225 196 color: #fff; 226 197 border-bottom: none; … … 228 199 229 200 div.hentry div.entry-content { 230 border-left:2px solid #000; 231 border-right:2px solid #000; 232 border-top:2px solid #444; 233 background: #000; 201 border-top:2px solid #36393B; 202 background: #45484B; 234 203 } 235 204 … … 239 208 div.hentry div.meta { 240 209 clear:both; 241 border-top:2px solid # 444;242 background:# 000;210 border-top:2px solid #36393B; 211 background:#45484B; 243 212 } 244 213 … … 282 251 color: #000; 283 252 } 284 285 /* Panels */286 #content div#wrapper {287 position: relative;288 overflow: hidden;289 width: 100%;290 height: 300px;291 padding: 0;292 margin: 0;293 border: solid 1px #cc9;}294 295 ul#panels {296 display:block;297 position:relative;298 overflow:hidden;299 width:100%;300 height:290px;301 padding:0;302 margin:0;}303 304 ul#panels li {305 display:block;306 position:relative;307 overflow:hidden;308 float: left;309 width:150px;310 height:290px;311 padding:0;312 margin:0;}313 314 ul#panels li.slidingPanelsActivated {315 position:absolute;316 top:0;317 left:0;318 width:375px;}319 320 ul#panels li span.panelContainer {321 display:block;322 float: left;}323 324 ul#panels li span span.col1 {325 display:block;326 float: left;327 padding-top: 10px;328 text-align: right;}329 330 ul#panels li span span.label {331 display: block;332 padding-left:10px;333 text-align: left;}334 335 ul#panels li span span.col2 {336 display:block;337 float: right;338 padding-top: 10px;339 width:220px;}340 341 ul#panels li.hover {background:#fff;}342 ul#panels li.notHover {background:#ccc;}343 /* Color Picker */344 .ColorBlotch {345 border: 1px solid #000000;346 padding: 0 2px 0 2px;347 font-family: monospace;348 cursor: pointer;349 font-size: 1.2em;350 }