OSDN Git Service

キャラ編集画面でdivタグとじ漏れ修正
[trpgtools-onweb/cake-frame.git] / app / views / characters / edit.ctp
index e29feef..34baa1f 100644 (file)
 <div class="characters form edit">
-<h2><?php echo __('Edit Character'); ?></h2>
-<p>
-<?php echo $form->create('Character');?>
+<h3><?php echo sprintf(__('Edit %s', true), $this->data['Character']['name']); ?></h3>
 
-<table class="Character">
+<?php echo $form->create('Character');?>
+<table class="CharacterSheet">
 <tbody>
 <!-- Header -->
-<tr>
+<tr id="CharacterStatusRow">
 <td colspan="2" class="SystemRow">
 <!-- System -->
 <table class="System">
 <tbody>
 <tr>
 <td>
-<lavel><?php __('System') ?></label>
+<label><?php __('System') ?></label>
 <?php
        echo $html->div(
                'SystemName',
                $this->data['System']['name']
        );
+
+       if (!empty($site_configs['System.otherSetting']['value']) && $site_configs['System.otherSetting']['value'] == $this->data['Character']['system_id']) {
+               echo $html->div(
+                       'link',
+                       $html->link(__('Change System', true), array(
+                               'action' => 'change_system',
+                               $this->data['Character']['id'],
+                       ))
+               );
+       }
+
  ?>
 </td>
-<td class="sort_order">
+<td>
 <?php 
-       echo $form->input('sort_order', array(
-                       'label' => __('Order', true),
-                       'class' => 'sortOrder',
-               )
-       );
+       echo $select->create_status_select($status, 'status', array(
+               'label' => __('Status', true)
+       ));
  ?>
 </td>
 <td>
 <?php 
-       echo $select->create_status_select($status, 'status', array(
-                       'label' => __('Status', true)
-               )
-       );
+       echo $select->create_publicflag_select($public_flags, 'public_flag', array(
+               'label' => __('Public Flag', true),
+       ));
  ?>
 </td>
 </tr>
 </table>
 </td>
 <!-- キャラ画像 -->
-<td class="image" rowspan="4">
-<div class="imagefile">
-<?php if ($this->data['Character']['image_filename']): ?>
+<td style="text-align: center;" class="image160" rowspan="3">
+<div id="CharacterMainPicture" class="image150">
 <?php 
-       echo $html->link(
-               $html->image($this->data['Character']['image_filename'], array(
+       echo $this->element('character_picture_image', array(
+               'basename' => $this->data['Character']['main_picture'],
+               'options' => array(
+                       'class' => 'mainImage',
                        'alt' => $this->data['Character']['name'],
-               )),
-               array('action' => 'edit_image', $this->data['Character']['id'])
-       );
- ?>
-<?php else: ?>
-<div class="editImageLink">
-<?php 
-       echo $html->link(__('Edit Image', true), array('action' => 'edit_image', $this->data['Character']['id']));
+               )
+       ));
  ?>
 </div>
-<?php endif; ?>
-</div>
 </td>
 </tr>
 <!-- Characters -->
 <tr>
-<th class="CharacterName">
+<th class="profileName">
 <?php
        __('Charater Name');
-       echo $html->div('required',
-               __(' * required', true)
-       );
 ?>
 </th>
-<td class="CharacterName">
+<td class="CharacterBasicData">
+<div id="CharacterName">
 <?php 
+       echo $html->tag(
+               'div',
+               __(' required', true),
+               array(
+                       'class' => 'required'
+               )
+       );
+
        echo $form->input('name', array(
                        'type' => 'text',
                        'label' => false,
-                       'class' => 'name character',
+                       'class' => 'name character longInput',
                )
        );
 ?>
+</div>
 </td>
 </tr>
 <tr>
-<th class="UserName">
+<th class="profileName">
 <?php
        __('Player Name');
 ?>
 </th>
-<td class="UserName">
+<td class="CharacterBasicData">
+<div id="UserName">
 <?php 
        echo $this->data['User']['name'];
 ?>
-</td>
-</tr>
-<tr>
-<th>
-       <?php __('Public Flag'); ?>
-</th>
-<td>
-<?php 
-       echo $select->create_publicflag_select($public_flags, 'public_flag', array(
-                       'label' => false,
-               )
-       );
- ?>
+</div>
 </td>
 </tr>
 
 <!-- Profiles -->
 <?php
-//if (!empty($this->data['CharactersHasProfile'])) {
-//     $profiles = $this->data['CharactersHasProfile'];
-//} else {
+       // profile設定の表示
        $profiles = $this->data['System']['Profile'];
-//}
 ?>
-<?php foreach($profiles as $profile): ?>
+<?php if (!empty($profiles)): ?>
+<?php foreach($profiles as $key => $profile): ?>
 <?php 
        $profiledisp->set_profile_type4view($profile);
  ?>
 <tr>
-<th>
-       <?php echo $profile['name']; ?>
+<th class="profileName">
+<?php 
+       echo $profile['name'];
+ ?>
 </th>
-<td colspan="3"<?php if ($profiledisp->profile_type['is_table']): ?> class="table"<?php endif; ?>>
+<td colspan="3" class="CharacterProfileData edit<?php if ($profiledisp->profile_type['is_table']): ?> table<?php endif; ?>">
+<div id="<?php echo $key; ?>">
 <?php 
-       $profiledisp->disp_forms4profile_type($profile, false, 2, 0);
+       if (empty($profile['CharactersHasProfile'])) {
+               if ($profile['profile_type'] == 's-table') {
+                       $form_num = count($profile['ProfileTable'][0]['ProfileTableStatic']);
+               } else {
+                       $form_num = 4;
+               }
+               $disp_add_link = false;
+       } else {
+               if ($profile['profile_type'] == 's-table') {
+                       $form_num = count($profile['ProfileTable'][0]['ProfileTableStatic']);
+               } else {
+                       $form_num = 0;
+               }
+               $disp_add_link = true;
+       }
+       $profiledisp->disp_forms4profile_type(
+               $profile, 
+               $form_num, 
+               0, 
+               $disp_add_link, 
+               $this->data['Character']['id'], 
+               true,
+               array(),
+               true
+       );
  ?>
+</div>
 </td>
 </tr>
 <?php endforeach; ?>
+<?php endif; ?>
 
 <!-- Notes -->
 <tr>
-<th>
+<th class="profileName">
        <?php __('Notes'); ?>
 </th>
-<td colspan="3">
+<td colspan="3" class="CharacterProfileData">
+<div id="Notes">
 <?php 
        echo $form->input('notes', array(
                        'label' => false,
                )
        );
  ?>
+</div>
+</td>
+</tr>
+<tr>
+<th class="profileName">
+       <?php __('Secret Notes'); ?>
+</th>
+<td colspan="3" class="CharacterProfileData">
+<div id="Secret Notes">
+<?php 
+       echo $form->input('secret_notes', array(
+               'label' => __('Secret Notes', true),
+                       'after' => $html->tag(
+                               'div',
+                               __('Show only myself', true),
+                               array('class' => 'required')
+                       )
+       ));
+ ?>
+</div>
+</td>
+</tr>
+
+<!-- Archive -->
+<tr>
+<th class="profileName">
+       <?php __('Archives'); ?>
+</th>
+<td colspan="3">
+<div id="SaveArchive">
+<?php 
+       echo $form->input('archive', array(
+                       'type' => 'checkbox',
+                       'label' => __('Save the Profile Archive', true),
+                       'value' => 1,
+               )
+       );
+
+       echo $form->input('CharacterProfileArchive.title');
+       echo $form->input('CharacterProfileArchive.memo');
+
+       if ($this->data['Character']['public_flag'] == 'public') {
+               echo $select->create_publicflag_select($public_flags, 'CharacterProfileArchive.public_flag', array(
+                       'label' => __('Public Flag', true),
+               ));
+       }
+ ?>
+</div>
 </td>
 </tr>
 </tbody>
 </table>
+</p>
 
 <?php
        echo $token->create();
-       ?>
-<?php echo $form->end('Submit');?>
+       echo $form->end(array('label' => __('Submit', true)));
+?>
 </p>
 </div>
+
+<div class="backButton">
+<?php
+echo $form->create('', array('url' => array(
+       'action' => 'view', $this->data['Character']['id']),
+       'type' => 'GET',
+       'id' => 'CancelButton'
+));
+echo $form->end(array('label' => __('Cancel', true)));
+?>
+</div>
+
 <div class="actions">
-       <ul>
-               <li><?php echo $html->link(__('Delete', true), array('action' => 'delete', $form->value('Character.id')), null, sprintf(__('Are you sure you want to delete # %s?', true), $form->value('Character.id'))); ?></li>
-               <li><?php echo $html->link(__('List Characters', true), array('action' => 'index'));?></li>
-               <li><?php echo $html->link(__('List Systems', true), array('controller' => 'systems', 'action' => 'index')); ?> </li>
-       </ul>
+<?php
+echo $form->create('', array(
+       'url' => array(
+               'action' => 'delete',
+       ),
+       'type' => 'GET',
+       'id' => 'CancelButton'
+));
+?>
+<ul>
+<li>
+<?php
+       echo $form->end(__('Delete Character', true));
+?>
+</li>
+</ul>
 </div>