OSDN Git Service

Character一覧文言修正
[trpgtools-onweb/cake-frame.git] / app / views / characters / index.ctp
1 <div class="characters index">
2 <h2>
3 <?php if (isset($this_system)): ?>
4         <?php echo $html->link($this_system['System']['name'], array('controller' => 'systems', 'action' => 'view', $this_system['System']['id']), array(), false, false) ?>
5 <?php endif; ?>
6 <?php if (!empty($userSet)): ?>
7  <?php
8         echo $html->link(
9                 sprintf(__("%s's", true), $userSet['User']['name']), 
10                 array('controller' => 'users', 'action' => 'view', $userSet['User']['id']), array(), false, false);
11 ?>
12 <?php else: ?>
13         <?php __('All') ?>
14 <?php endif; ?>
15 <?php __('Characters');?></h2>
16 <p>
17 <?php
18 $paginator->options(array('url' => $this->passedArgs));
19
20 echo $paginator->counter(array(
21 'format' => __('Page %page% of %pages%, showing %current% records out of %count% total, starting on record %start%, ending on %end%', true)
22 ));
23 ?></p>
24
25 <div class="paging">
26 <?php echo $paginator->prev('<< '.__('previous', true), array(), null, array('class'=>'disabled'));?>
27  | <?php echo $paginator->numbers();?> | 
28 <?php echo $paginator->next(__('next', true).' >>', array(), null, array('class' => 'disabled'));?>
29 </div>
30
31 <table>
32 <tr>
33         <th><?php echo $paginator->sort('name');?></th>
34         <th><?php __('Picture');?></th>
35 <?php if (!isset($this_system) && !$site_configs['System.singleSystem']['value']): ?>
36         <th><?php echo $paginator->sort('system_id');?></th>
37 <?php endif; ?>
38 <?php if (empty($userSet)): ?>
39         <th><?php echo $paginator->sort(__('User Name', true), 'user_id');?></th>
40 <?php endif; ?>
41         <th><?php echo $paginator->sort('modified');?></th>
42         <th><?php echo $paginator->sort('status');?></th>
43 </th>
44 </tr>
45 <?php
46 $i = 0;
47 foreach ($characters as $character):
48         $class = null;
49         if ($i++ % 2 == 0) {
50                 $class = ' class="altrow"';
51         }
52 ?>
53 <tr<?php echo $class;?>>
54 <td>
55         <?php echo $html->link($text->truncate($character['Character']['name'], 32), array('action' => 'view', $character['Character']['id']), array(), false, false); ?>
56 <?php if ($isOwner_userSet && $character['Character']['public_flag'] != 'public'): ?>
57 <span class="publicFlag"><?php echo $select->get_i18n_unpublic_flag($character['Character']['public_flag'], $public_flags) ?></span>
58 <?php endif; ?>
59 </td>
60 <td class="center">
61 <?php
62         $picture = $this->renderElement('character_picture_image', array(
63                 'basename' => $character['Character']['main_picture'],
64                 'options' => array(
65                         'previewVersion' => 's',
66                         'class' => '',
67                         'url' => array('controller' => 'characters', 'action' => 'view', $character['Character']['id']),
68                         'alternative' => '',
69                         'nodata' => '',
70                 )
71         ));
72
73         echo $html->div('attachments', $picture);
74 ?>
75 </td>
76 <?php 
77         $character_list_url = array(
78                 'controller' => 'characters', 
79                 'action' => 'index'
80         );
81
82         if (!empty($userSet)) {
83                 $character_list_url[] = $userSet['User']['id'];
84         }
85
86  ?>
87 <?php if (!isset($this_system) && !$site_configs['System.singleSystem']['value']): ?>
88 <td>
89 <?php 
90         echo $html->link($character['System']['name'], array_merge($character_list_url, array('system:'.$character['System']['id'])), array(), false, false);
91 ?>
92 </td>
93 <?php endif; ?>
94 <?php if (empty($userSet)): ?>
95 <td>
96 <?php 
97         $character_list_url[] = $character['User']['id'];
98         if (isset($this_system)) {
99                 $character_list_url[] = 'system:'.$this_system['System']['id'];
100         }
101         echo $html->link($text->truncate($character['User']['name'], 16), $character_list_url, array(), false, false); 
102 ?>
103 </td>
104 <?php endif; ?>
105 <td>
106         <?php echo $time->niceShort($character['Character']['modified'], array('format' => 'Y/m/d H:i')); ?>
107 </td>
108 <td>
109         <?php echo $select->get_i18n_status($character['Character']['status'], $status); ?>
110 </td>
111 </tr>
112 <?php endforeach; ?>
113 </table>
114 </div>
115
116 <div class="paging">
117 <?php echo $paginator->prev('<< '.__('previous', true), array(), null, array('class'=>'disabled'));?>
118  | <?php echo $paginator->numbers();?> | 
119 <?php echo $paginator->next(__('next', true).' >>', array(), null, array('class' => 'disabled'));?>
120 </div>
121
122 <div class="actions">
123 <ul>
124 <li><?php echo $html->link(__('New Character', true), array('action' => 'add')); ?></li>
125 </ul>
126 </div>