Layout improvements

pull/61/head
Christophe Vandeplas 2012-03-20 15:11:02 +01:00
parent ce0c0aba0e
commit c5954b081b
9 changed files with 19 additions and 76 deletions

View File

@ -7,7 +7,6 @@
echo $this->Form->input('date');
echo $this->Form->input('risk');
echo $this->Form->input('info');
?>
</fieldset>
<?php echo $this->Form->end(__('Submit', true));?>

View File

@ -15,16 +15,16 @@
foreach ($events as $event):
?>
<tr>
<td onclick="document.location ='<?php echo $this->Html->url(array('action' => 'view', $event['Event']['id']), true) ;?>';">
<td class="short" onclick="document.location ='<?php echo $this->Html->url(array('action' => 'view', $event['Event']['id']), true) ;?>';">
<?php echo $this->Html->link($event['Event']['id'], array('controller' => 'events', 'action' => 'view', $event['Event']['id'])); ?>
&nbsp;</td>
<?php if ('true' == Configure::read('CyDefSIG.showorg') || $isAdmin): ?>
<td onclick="document.location ='<?php echo $this->Html->url(array('action' => 'view', $event['Event']['id']), true) ;?>';">
<td class="short" onclick="document.location ='<?php echo $this->Html->url(array('action' => 'view', $event['Event']['id']), true) ;?>';">
<?php echo Sanitize::html($event['Event']['org']); ?>&nbsp;</td>
<?php endif; ?>
<td onclick="document.location ='<?php echo $this->Html->url(array('action' => 'view', $event['Event']['id']), true) ;?>';">
<td class="short" onclick="document.location ='<?php echo $this->Html->url(array('action' => 'view', $event['Event']['id']), true) ;?>';">
<?php echo $event['Event']['date']; ?>&nbsp;</td>
<td onclick="document.location ='<?php echo $this->Html->url(array('action' => 'view', $event['Event']['id']), true) ;?>';">
<td class="short" onclick="document.location ='<?php echo $this->Html->url(array('action' => 'view', $event['Event']['id']), true) ;?>';">
<?php echo $event['Event']['risk']; ?>&nbsp;</td>
<td onclick="document.location ='<?php echo $this->Html->url(array('action' => 'view', $event['Event']['id']), true) ;?>';">
<?php echo nl2br(Sanitize::html($event['Event']['info'])); ?>&nbsp;</td>

View File

@ -73,15 +73,15 @@
<th>Value</th>
<th>Related Events</th>
<th>To IDS</th>
<th class="actions" style="text-align:right;">Actions</th>
<th class="actions">Actions</th>
</tr>
<?php
foreach ($event['Signature'] as $signature):
?>
<tr>
<td><?php echo $signature['type'];?></td>
<td class="short"><?php echo $signature['type'];?></td>
<td><?php echo nl2br(Sanitize::html($signature['value']));?></td>
<td>
<td class="short" style="text-align: center;">
<?php
if (null != $relatedSignatures[$signature['id']]) {
foreach ($relatedSignatures[$signature['id']] as $relatedSignature) {
@ -91,8 +91,8 @@
}
?>
</td>
<td><?php echo $signature['to_ids'] ? 'Yes' : 'No';?></td>
<td class="actions" style="text-align:right;">
<td class="short"><?php echo $signature['to_ids'] ? 'Yes' : 'No';?></td>
<td class="actions">
<?php
if ($isAdmin || $event['Event']['org'] == $me['org']) {
echo $this->Html->link(__('Edit', true), array('controller' => 'signatures', 'action' => 'edit', $signature['id']));

View File

@ -11,14 +11,14 @@
<?php
foreach ($signatures as $signature): ?>
<tr>
<td onclick="document.location ='<?php echo $this->Html->url(array('controller' => 'events', 'action' => 'view', $signature['Signature']['event_id']), true) ;?>';">
<td class="short" onclick="document.location ='<?php echo $this->Html->url(array('controller' => 'events', 'action' => 'view', $signature['Signature']['event_id']), true) ;?>';">
<?php echo $this->Html->link($signature['Event']['id'], array('controller' => 'events', 'action' => 'view', $signature['Event']['id'])); ?>
</td>
<td onclick="document.location ='<?php echo $this->Html->url(array('controller' => 'events', 'action' => 'view', $signature['Signature']['event_id']), true) ;?>';">
<td class="short" onclick="document.location ='<?php echo $this->Html->url(array('controller' => 'events', 'action' => 'view', $signature['Signature']['event_id']), true) ;?>';">
<?php echo h($signature['Signature']['type']); ?>&nbsp;</td>
<td onclick="document.location ='<?php echo $this->Html->url(array('controller' => 'events', 'action' => 'view', $signature['Signature']['event_id']), true) ;?>';">
<?php echo nl2br(Sanitize::html($signature['Signature']['value'])); ?>&nbsp;</td>
<td onclick="document.location ='<?php echo $this->Html->url(array('controller' => 'events', 'action' => 'view', $signature['Signature']['event_id']), true) ;?>';">
<td class="short" onclick="document.location ='<?php echo $this->Html->url(array('controller' => 'events', 'action' => 'view', $signature['Signature']['event_id']), true) ;?>';">
<?php echo $signature['Signature']['to_ids'] ? 'Yes' : 'No'; ?>&nbsp;</td>
<td class="actions"><?php
if ($isAdmin || $signature['Event']['org'] == $me['org']) {

View File

@ -3,7 +3,6 @@
<table cellpadding="0" cellspacing="0">
<tr>
<th><?php echo $this->Paginator->sort('id');?></th>
<th><?php echo $this->Paginator->sort('password');?></th>
<th><?php echo $this->Paginator->sort('org');?></th>
<th><?php echo $this->Paginator->sort('email');?></th>
<th><?php echo $this->Paginator->sort('autoalert');?></th>
@ -19,13 +18,12 @@
foreach ($users as $user): ?>
<tr>
<td><?php echo h($user['User']['id']); ?>&nbsp;</td>
<td><?php echo h($user['User']['password']); ?>&nbsp;</td>
<td><?php echo h($user['User']['org']); ?>&nbsp;</td>
<td><?php echo h($user['User']['email']); ?>&nbsp;</td>
<td><?php echo h($user['User']['autoalert']); ?>&nbsp;</td>
<td><?php echo h($user['User']['authkey']); ?>&nbsp;</td>
<td><?php echo h($user['User']['invited_by']); ?>&nbsp;</td>
<td><?php echo h($user['User']['gpgkey']); ?>&nbsp;</td>
<td><?php echo $user['User']['gpgkey']? 'Yes' : 'No'; ?>&nbsp;</td>
<td><?php echo h($user['User']['nids_sid']); ?>&nbsp;</td>
<td><?php echo h($user['User']['termsaccepted']); ?>&nbsp;</td>
<td><?php echo h($user['User']['newsread']); ?>&nbsp;</td>

View File

@ -1,58 +0,0 @@
<div class="users index">
<h2><?php __('Users');?></h2>
<table cellpadding="0" cellspacing="0">
<tr>
<th><?php echo $this->Paginator->sort('id');?></th>
<th><?php echo $this->Paginator->sort('group_id');?></th>
<th><?php echo $this->Paginator->sort('email');?></th>
<th><?php echo $this->Paginator->sort('org');?></th>
<th><?php echo $this->Paginator->sort('autoalert');?></th>
<th><?php echo $this->Paginator->sort('authkey');?></th>
<th class="actions"><?php echo __('Actions');?></th>
</tr>
<?php
$i = 0;
foreach ($users as $user):
$class = null;
if ($i++ % 2 == 0) {
$class = ' class="altrow"';
}
?>
<tr<?php echo $class;?>>
<td><?php echo $user['User']['id']; ?>&nbsp;</td>
<td>
<?php echo $this->Html->link($user['Group']['name'], array('controller' => 'groups', 'action' => 'view', $user['Group']['id'])); ?>
</td>
<td><?php echo $user['User']['email']; ?>&nbsp;</td>
<td><?php echo $user['User']['org']; ?>&nbsp;</td>
<td><?php echo $user['User']['autoalert']; ?>&nbsp;</td>
<td><?php echo $user['User']['authkey']; ?>&nbsp;</td>
<td class="actions">
<?php echo $this->Html->link(__('View', true), array('action' => 'view', $user['User']['id'])); ?>
<?php echo $this->Html->link(__('Edit', true), array('action' => 'edit', $user['User']['id'])); ?>
<?php echo $this->Html->link(__('Delete', true), array('action' => 'delete', $user['User']['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $user['User']['id'])); ?>
</td>
</tr>
<?php endforeach; ?>
</table>
<p>
<?php
echo $this->Paginator->counter(array(
'format' => __('Page %page% of %pages%, showing %current% records out of %count% total, starting on record %start%, ending on %end%', true)
));
?> </p>
<div class="paging">
<?php echo $this->Paginator->prev('<< ' . __('previous', true), array(), null, array('class'=>'disabled'));?>
| <?php echo $this->Paginator->numbers();?>
|
<?php echo $this->Paginator->next(__('next', true) . ' >>', array(), null, array('class' => 'disabled'));?>
</div>
</div>
<div class="actions">
<ul>
<?php echo $this->element('actions_menu'); ?>
</ul>
</div>

View File

@ -6,7 +6,6 @@ echo $this->Form->inputs(array(
'email',
'password'
));
//echo $this->Recaptcha->display();
echo $this->Form->end('Login');
?>

View File

@ -4,7 +4,7 @@
<p><b>Backend rewrite + security</b><br/>
Complete rewrite of the backend code to migrate to CakePHP 2.x (from CakePHP 1.3). <br/>
During this rewrite the code was cleaned up, CSRF protection should now be present on all the important actions.<br/>
Password strength validation has been implemented.<br/>
Password strength validation and better security has been implemented.<br/>
Some intermittent bugs might have slipped in during the (manual) conversion. Please contact me <a href="mailto:user1088@qet.be">user1088@qet.be</a> to report any issues.
</p>
<p><b>Terms and News</b><br/>

View File

@ -171,6 +171,7 @@ table tr:nth-child(even) {
td.actions {
text-align: right;
white-space: nowrap;
width:5%;
}
table td.actions a {
margin: 0px 6px;
@ -179,6 +180,10 @@ table td.actions a {
th.actions {
text-align:center;
}
td.short {
width:5%;
white-space: nowrap;
}
/* added */
div .events table tr:hover, div .events table tr.altrow:hover, div .signatures table tr:hover, div .signatures table tr.altrow:hover{