From 11286f36fbc8231bf495da4705a91eb9dc1d75d3 Mon Sep 17 00:00:00 2001 From: Cake Date: Thu, 11 Mar 2010 00:57:28 +0900 Subject: [PATCH] =?utf8?q?=E3=82=AD=E3=83=A3=E3=83=A9=E3=82=AF=E3=82=BF?= =?utf8?q?=E3=83=BCview=E3=81=A7=E7=94=BB=E5=83=8F=E4=B8=80=E8=A6=A7?= =?utf8?q?=E8=A1=A8=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- app/controllers/characters_controller.php | 4 ++- app/views/elements/character_picture.ctp | 7 +++- app/views/elements/character_view.ctp | 59 +++++++++++++++++++++++++++---- app/webroot/css/base.css | 4 +++ 4 files changed, 65 insertions(+), 9 deletions(-) diff --git a/app/controllers/characters_controller.php b/app/controllers/characters_controller.php index 317c73c..1b8be09 100644 --- a/app/controllers/characters_controller.php +++ b/app/controllers/characters_controller.php @@ -343,7 +343,9 @@ class CharactersController extends AppController { 'ProfileTable', ), ), - 'CharacterPicture', + 'CharacterPicture' => array( + 'Attachment', + ), ), 'recursive' => 3, )); diff --git a/app/views/elements/character_picture.ctp b/app/views/elements/character_picture.ctp index d4bd851..97245ec 100644 --- a/app/views/elements/character_picture.ctp +++ b/app/views/elements/character_picture.ctp @@ -18,6 +18,9 @@ if (!isset($assocAlias)) { $model = 'CharacterPicture'; $modelId = $form->value($form->model().'.id'); +if (!isset($item['CharacterPicture'])) { + $item['CharacterPicture'] = $item; +} if (isset($this->data[$assocAlias][0]['basename'])) { array_unshift($this->data[$assocAlias], array()); } @@ -42,7 +45,7 @@ if (!isset($isAdmin)) { ?> -
+
file( @@ -110,3 +113,5 @@ if (!isset($isAdmin)) {
+ +
diff --git a/app/views/elements/character_view.ctp b/app/views/elements/character_view.ctp index edb6a14..a7ec97a 100644 --- a/app/views/elements/character_view.ctp +++ b/app/views/elements/character_view.ctp @@ -43,22 +43,49 @@ ?> + + +div( + 'CharacterSheetHeader date', + $time->niceshort( + $character['Character']['modified'], + array( + 'format' => 'Y/m/d H:i', + ) + ) + ); +?> +
- link( - $html->image($character['Character']['image_filename'], array( + $file = $upfile->file( + 'filter/l', + CorePlus::get_value($character, 'image_filename'), + array( + 'model_name' => 'CharacterPicture', + 'mime_type' => 'original', + 'nodata' => 'image', + ) + ); + $url = array('controller' => 'character_pictures', 'action' => 'index', $character['Character']['id']); + echo $upfile->embed( + $file, + array( + 'linkTo' => $url, 'alt' => $character['Character']['name'], - )), - array('action' => 'show_images', $character['Character']['id']) + 'class' => 'mainImage', + 'restrict' => array('image'), + 'htmlAttributes' => array( + ), + ) ); ?> -
@@ -97,13 +124,31 @@ ?> + $v) { + if ($k > 5) { + break; + } + echo $this->element('character_picture', array( + 'item' => $v, + 'label' => __('Picture', true), + 'i' => 0, + 'isOwner' => $isOwner, + 'mode' => 'view', + 'plugin' => 'media', + 'previewVersion' => 's', + )); + } + echo $html->link( + __(' ...More', true), + $url = array('controller' => 'character_pictures', 'action' => 'index', $character['Character']['id']) + ); ?> diff --git a/app/webroot/css/base.css b/app/webroot/css/base.css index 871bc07..d86676a 100644 --- a/app/webroot/css/base.css +++ b/app/webroot/css/base.css @@ -640,6 +640,10 @@ div.imagefile { div.editImageLink { text-align: center; } +div.view div.attachments { + display: inline-block; + padding: 5px; +} /* 管理画面:サイト設定 */ div.siteConfigs table -- 2.11.0