[Isocial-svn] SF.net SVN: isocial: [205] timesheet
Status: Pre-Alpha
Brought to you by:
aguidrevitch
From: <fsn...@us...> - 2008-05-15 16:42:29
|
Revision: 205 http://isocial.svn.sourceforge.net/isocial/?rev=205&view=rev Author: fsnobody Date: 2008-05-15 09:42:23 -0700 (Thu, 15 May 2008) Log Message: ----------- edit photo Modified Paths: -------------- app/controllers/photoapp/album_controller.php app/views/photoapp/album/_edit_menu.tpl app/views/photoapp/album/edit_photo.tpl public/stylesheets/photoapp/Album.css timesheet/eerunov.txt Modified: app/controllers/photoapp/album_controller.php =================================================================== --- app/controllers/photoapp/album_controller.php 2008-05-15 14:38:24 UTC (rev 204) +++ app/controllers/photoapp/album_controller.php 2008-05-15 16:42:23 UTC (rev 205) @@ -22,7 +22,20 @@ } function edit_photo () { - if (!empty($this->params['id']) && $this->PhotoappPhoto->find($this->params['id'])) { + if (!empty($this->params['photo']) && $this->params['photo']['action_edit'] == 'do_edit'){ + $photo = $this->PhotoappPhoto->findFirst(array('id' => $this->params['id'])); + if ($photo) { + $album = $this->PhotoappAlbum->findFirst(array('id' => $photo->album_id)); + if ($album->owner == $this->current_user->getId()) { + $photo->setAttributes($this->params['photo']); + if ($this->Request->isPost() && $photo->save()){ + $this->redirectTo(array('action' => 'view', 'id' => $album->id)); + } + } + } else { + $this->importErrors( $this->PhotoappPhoto->getErrors() ); + } + } else if (!empty($this->params['id']) && $this->PhotoappPhoto->find($this->params['id'])) { $this->photo = $this->PhotoappPhoto->find($this->params['id']); $this->album = $this->PhotoappAlbum->find($this->photo->album_id); $this->albums = $this->PhotoappAlbum->find('all', array('conditions' => array('owner = ' . $this->current_user->getId()))); Modified: app/views/photoapp/album/_edit_menu.tpl =================================================================== --- app/views/photoapp/album/_edit_menu.tpl 2008-05-15 14:38:24 UTC (rev 204) +++ app/views/photoapp/album/_edit_menu.tpl 2008-05-15 16:42:23 UTC (rev 205) @@ -1,11 +1,11 @@ <div class="tabs"> <div class="left"> <ul class="toggle_tabs"> - <li class="first"><a href="/photoapp/album/add_photo/{id}" class="<?= $controller->getActionName() == 'add_photo' ? 'selected' : '' ?>">_{Add Photos}</a></li><? - ?><li class="first"><a href="/photoapp/album/view/{id}" class="<?= $controller->getActionName() == 'view' ? 'selected' : '' ?>">_{View}</a></li><? - ?><li class="first"><a href="/photoapp/album/uploaded/{id}" class="<?= $controller->getActionName() == 'uploaded' ? 'selected' : '' ?>">_{Edit uploaded}</a></li><? - ?><li><a href="/photoapp/album/edit/{id}" class="last <?= $controller->getActionName() == 'edit' ? 'selected' : '' ?>">_{Edit Info}</a></li><? - ?><li><a href="/photoapp/album/delete/{id}" class="last <?= $controller->getActionName() == 'delete' ? 'selected' : '' ?>">_{Delete}</a></li> + <li class="first"><a href="/photoapp/album/add_photo/<?= $album->get('id')?>" class="<?= $controller->getActionName() == 'add_photo' ? 'selected' : '' ?>">_{Add Photos}</a></li><? + ?><li class="first"><a href="/photoapp/album/view/<?= $album->get('id')?>" class="<?= in_array($controller->getActionName(),array( 'edit_photo', 'view')) ? 'selected' : '' ?>">_{View}</a></li><? + ?><li class="first"><a href="/photoapp/album/uploaded/<?= $album->get('id')?>" class="<?= $controller->getActionName() == 'uploaded' ? 'selected' : '' ?>">_{Edit uploaded}</a></li><? + ?><li><a href="/photoapp/album/edit/<?= $album->get('id')?>" class="last <?= $controller->getActionName() == 'edit' ? 'selected' : '' ?>">_{Edit Info}</a></li><? + ?><li><a href="/photoapp/album/delete/<?= $album->get('id')?>" class="last <?= $controller->getActionName() == 'delete' ? 'selected' : '' ?>">_{Delete}</a></li> </ul> </div> <div class="right"> Modified: app/views/photoapp/album/edit_photo.tpl =================================================================== --- app/views/photoapp/album/edit_photo.tpl 2008-05-15 14:38:24 UTC (rev 204) +++ app/views/photoapp/album/edit_photo.tpl 2008-05-15 16:42:23 UTC (rev 205) @@ -5,12 +5,12 @@ <?= $controller->renderErrors() ?> <div class="uploaded_container"> - <?= $form_tag_helper->start_form_tag(array('action'=>'edit_photo', 'id' => $photo->get('get'))) ?> + <?= $form_tag_helper->start_form_tag(array('action'=>'edit_photo', 'id' => $photo->get('id'))) ?> <?= $form_helper->hidden_field('photo', 'action_edit', array('value' => 'do_edit'))?> <div class="edit_container"> <div class="photo_comment"> - <div class="img_medium"><img src="/preview/index/300x270/<?= $photo->get('img')?>" /></div> + <div class="img_medium"><img src="/preview/index/620x500/<?= $photo->get('img')?>" /></div> <div class="data_medium"> <div class="form_create_row"> Modified: public/stylesheets/photoapp/Album.css =================================================================== --- public/stylesheets/photoapp/Album.css 2008-05-15 14:38:24 UTC (rev 204) +++ public/stylesheets/photoapp/Album.css 2008-05-15 16:42:23 UTC (rev 205) @@ -191,16 +191,16 @@ .photo_comment .img_medium { float: left; - width: 320px; - height: 270px; + width: 620px; text-align: center; - padding-top: 10px; + padding: 10px 0px; } .photo_comment .data_medium { float: left; - width: 300px; + width: 320px; height: 270px; + padding: 0px 100px; } .photo_view .img { Modified: timesheet/eerunov.txt =================================================================== --- timesheet/eerunov.txt 2008-05-15 14:38:24 UTC (rev 204) +++ timesheet/eerunov.txt 2008-05-15 16:42:23 UTC (rev 205) @@ -12,3 +12,4 @@ 2008-05-12,09:00,11:00,photoapp,RT:2,"comment uploaded + cover onoad" 2008-05-13,07:00,09:10,photoapp,RT:2,"photo list + delete" 2008-05-14,09:00,11:00.photoapp,RT:2,"change img storage + design edit photo v1" +2008-05-15,10:00,11:00,photoapp,RT:2,"edit photo" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |