OSDN Git Service

SystemにCharacterSheet設定表示追加
authorCake <cake_67@users.sourceforge.jp>
Sun, 4 Apr 2010 14:15:10 +0000 (23:15 +0900)
committerCake <cake_67@users.sourceforge.jp>
Sun, 4 Apr 2010 14:15:10 +0000 (23:15 +0900)
app/controllers/systems_controller.php
app/models/system.php
app/views/systems/admin_view.ctp
app/webroot/css/base.css
app/webroot/css/box.css

index 5b2d3b3..8d12c4a 100644 (file)
@@ -72,6 +72,7 @@ class SystemsController extends AppController {
 
        function admin_view($id = null) {
                $this->System->hasMany['Character']['limit'] = 30;
+               unset($this->System->hasMany['CharacterSheet']['conditions']['CharacterSheet.public_flag']);
                unset($this->System->hasMany['Character']['conditions']['Character.public_flag']);
                $this->_view($id);
        }
@@ -195,6 +196,7 @@ class SystemsController extends AppController {
                        $this->System->hasMany['Profile']['fields'] = '';
                        $contain = array(
                                'Character',
+                               'CharacterSheet',
                                'Profile' => array(
                                        'ProfileSelect',
                                        'ProfileTable' => array(
index d0d399e..021c550 100644 (file)
@@ -89,6 +89,7 @@ class System extends AppModel {
                        'foreignKey' => 'system_id',
                        'dependent' => false,
                        'conditions' => array(
+                               'CharacterSheet.public_flag' => 'public'
                        ),
                        'fields' => array(
                        ),
index e8242d9..44a18e2 100644 (file)
 ?>
 </div>
 
+<div class="character_sheets">
+<?php 
+       $header =  __('CharacterSheet Skins', true).
+               $html->tag(
+                       'span',
+                       $html->link(
+                               __(' ...More', true),
+                               array(
+                                       'controller' => 'character_sheets',
+                                       'action' => 'index',
+                                       $system['System']['id'],
+                               )
+                       ),
+                       array(
+                               'class' => 'link',
+                       )
+               );
+
+
+       $body = '';
+       if (isset($system['CharacterSheet'])) {
+               foreach($system['CharacterSheet'] as $characterSheet) {
+                       $sheet = $html->link(
+                               $characterSheet['name'],
+                               array(
+                                       'controller' => 'character_sheets',
+'action' => 'view',
+$characterSheet['id'],
+                               )
+                       );
+                       $body .= $html->tag(
+                               'span',
+                               $sheet,
+                               array(
+                                       'class' => 'characterSheet',
+                               )
+                       );
+               }
+       }
+       $footer = '<div class="actions"><ul>'.
+               
+               '</ul></div>';
+
+       echo $this->renderElement('box', array(
+               'header' =>$header,
+               'body' => $body,
+               'footer' => $footer,
+       ));
+ ?>
+</div>
+
 <div class="profiles">
 <div class="box">
 <div class="boxHeader"><h3>
index f58b3fc..5fa4eef 100644 (file)
@@ -267,6 +267,7 @@ ul#navAdmin li {
        width: 100%;
        height: 20px;
        clear: both;
+       margin-bottom: 5px;
 }
 #subNavi ul {
 }
@@ -312,6 +313,7 @@ ul#navAdmin li {
 #content div.index,
 #content div.add,
 #content div.edit,
+#content div.delete,
 #content div.listview,
 #content div.admin_listview
  {
index ee377ee..66e2097 100644 (file)
@@ -238,6 +238,16 @@ div.systems .system_data .boxFooter {
 div.systems .characters .box {
        margin-bottom: 20px;
 }
+div.systems .character_sheets .box {
+       margin-bottom: 20px;
+}
+div.systems .character_sheets .box .boxBody {
+       padding: 5px 10px;
+}
+span.characterSheet {
+       font-size: 120%;
+       padding-right: 15px;
+}
 div.systems .profiles .box table {
        margin-top: 5px;
 }