1
0
mirror of https://github.com/monstra-cms/monstra.git synced 2025-08-03 19:57:57 +02:00

Frontend Improvements

This commit is contained in:
Awilum
2013-12-17 11:01:24 +02:00
parent 2fbb4c30c3
commit 2c3d224e62
6 changed files with 53 additions and 44 deletions

View File

@@ -17,6 +17,7 @@
if (isset($errors['blocks_exists'])) echo '&nbsp;&nbsp;&nbsp;<span style="color:red">'.$errors['blocks_exists'].'</span>'; if (isset($errors['blocks_exists'])) echo '&nbsp;&nbsp;&nbsp;<span style="color:red">'.$errors['blocks_exists'].'</span>';
?> ?>
</div> </div>
<br> <br>
<?php <?php

View File

@@ -13,8 +13,6 @@
<div class="clearfix"></div> <div class="clearfix"></div>
</div> </div>
<br>
<?php if(Notification::get('success')) Alert::success(Notification::get('success')); ?> <?php if(Notification::get('success')) Alert::success(Notification::get('success')); ?>
<br> <br>

View File

@@ -15,8 +15,6 @@
<div class="clearfix"></div> <div class="clearfix"></div>
</div> </div>
<br>
<?php if (Notification::get('success')) Alert::success(Notification::get('success')); ?> <?php if (Notification::get('success')) Alert::success(Notification::get('success')); ?>
<br> <br>

View File

@@ -1,5 +1,5 @@
<h2><?php echo __('New Snippet', 'snippets'); ?></h2> <h2><?php echo __('New Snippet', 'snippets'); ?></h2>
<br /> <br>
<?php if (Notification::get('success')) Alert::success(Notification::get('success')); ?> <?php if (Notification::get('success')) Alert::success(Notification::get('success')); ?>
@@ -9,26 +9,30 @@
<?php echo (Form::hidden('csrf', Security::token())); ?> <?php echo (Form::hidden('csrf', Security::token())); ?>
<?php echo (Form::label('name', __('Name', 'snippets'))); ?> <?php echo (Form::label('name', __('Name', 'snippets'))); ?>
<div class="input-group">
<?php echo (Form::input('name', $name, array('class' => (isset($errors['snippets_empty_name']) || isset($errors['snippets_exists'])) ? 'form-control error-field' : 'form-control'))); ?><span class="input-group-addon">.snippet.php</span>
</div>
<div class="input-append"> <?php
<?php echo (Form::input('name', $name, array('class' => (isset($errors['snippets_empty_name']) || isset($errors['snippets_exists'])) ? 'input-xxlarge error-field' : 'input-xxlarge'))); ?><span class="add-on">.snippet.php</span> if (isset($errors['snippets_empty_name'])) echo '&nbsp;&nbsp;&nbsp;<span style="color:red">'.$errors['snippets_empty_name'].'</span>';
</div> if (isset($errors['snippets_exists'])) echo '&nbsp;&nbsp;&nbsp;<span style="color:red">'.$errors['snippets_exists'].'</span>';
?>
<?php <br>
if (isset($errors['snippets_empty_name'])) echo '&nbsp;&nbsp;&nbsp;<span style="color:red">'.$errors['snippets_empty_name'].'</span>';
if (isset($errors['snippets_exists'])) echo '&nbsp;&nbsp;&nbsp;<span style="color:red">'.$errors['snippets_exists'].'</span>'; <?php
?> echo (
Form::label('content', __('Snippet content', 'snippets')).
Form::textarea('content', $content, array('style' => 'width:100%;height:400px;', 'class'=>'source-editor'))
);
?>
<?php <?php
echo ( echo (
Html::br(2). Html::br(2).
Form::label('content', __('Snippet content', 'snippets')). Form::submit('add_snippets_and_exit', __('Save and Exit', 'snippets'), array('class' => 'btn btn-primary')).Html::nbsp(2).
Form::textarea('content', $content, array('style' => 'width:100%;height:400px;', 'class'=>'source-editor')).
Html::br(2).
Form::submit('add_snippets_and_exit', __('Save and Exit', 'snippets'), array('class' => 'btn')).Html::nbsp(2).
Form::submit('add_snippets', __('Save', 'snippets'), array('class' => 'btn')). Form::submit('add_snippets', __('Save', 'snippets'), array('class' => 'btn')).
Form::close() Form::close()
); );
?> ?>

View File

@@ -1,5 +1,5 @@
<h2><?php echo __('Edit Snippet', 'snippets'); ?></h2> <h2><?php echo __('Edit Snippet', 'snippets'); ?></h2>
<br /> <br>
<?php if (Notification::get('success')) Alert::success(Notification::get('success')); ?> <?php if (Notification::get('success')) Alert::success(Notification::get('success')); ?>
@@ -18,8 +18,8 @@
<?php echo (Form::label('name', __('Name', 'snippets'))); ?> <?php echo (Form::label('name', __('Name', 'snippets'))); ?>
<div class="input-append"> <div class="input-group">
<?php echo (Form::input('name', $name, array('class' => (isset($errors['snippets_empty_name']) || isset($errors['snippets_exists'])) ? 'input-xxlarge error-field' : 'input-xxlarge'))); ?><span class="add-on">.snippet.php</span> <?php echo (Form::input('name', $name, array('class' => (isset($errors['snippets_empty_name']) || isset($errors['snippets_exists'])) ? 'form-control error-field' : 'form-control'))); ?><span class="input-group-addon">.snippet.php</span>
</div> </div>
<?php <?php
@@ -27,10 +27,11 @@
if (isset($errors['snippets_exists'])) echo '&nbsp;&nbsp;&nbsp;<span style="color:red">'.$errors['snippets_exists'].'</span>'; if (isset($errors['snippets_exists'])) echo '&nbsp;&nbsp;&nbsp;<span style="color:red">'.$errors['snippets_exists'].'</span>';
?> ?>
<br>
<?php <?php
echo ( echo (
Html::br(2).
Form::label('content', __('Snippet content', 'snippets')). Form::label('content', __('Snippet content', 'snippets')).
Form::textarea('content', Html::toText($content), array('style' => 'width:100%;height:400px;', 'class' => 'source-editor')). Form::textarea('content', Html::toText($content), array('style' => 'width:100%;height:400px;', 'class' => 'source-editor')).
Html::br(2). Html::br(2).
@@ -40,6 +41,6 @@
); );
} else { } else {
echo '<div class="message-error">'.__('This snippet does not exist').'</div>'; echo '<div class="message-error">'.__('This snippet does not exist', 'snippets').'</div>';
} }
?> ?>

View File

@@ -1,16 +1,22 @@
<h2><?php echo __('Snippets', 'snippets'); ?></h2> <div>
<br /> <div class="pull-left">
<h2><?php echo __('Snippets', 'snippets'); ?></h2>
</div>
<div class="pull-right">
<br>
<?php
echo (
Html::anchor(__('Create New Snippet', 'snippets'), 'index.php?id=snippets&action=add_snippet', array('title' => __('Create New Snippet', 'snippets'), 'class' => 'btn btn-primary')). Html::nbsp(3)
);
?>
</div>
<div class="clearfix"></div>
</div>
<br>
<?php if (Notification::get('success')) Alert::success(Notification::get('success')); ?> <?php if (Notification::get('success')) Alert::success(Notification::get('success')); ?>
<?php
echo (
Html::anchor(__('Create New Snippet', 'snippets'), 'index.php?id=snippets&action=add_snippet', array('title' => __('Create New Snippet', 'snippets'), 'class' => 'btn btn-small')). Html::nbsp(3)
);
?>
<br /><br />
<!-- Snippets_list --> <!-- Snippets_list -->
<table class="table table-bordered"> <table class="table table-bordered">
<thead> <thead>
@@ -24,20 +30,21 @@
<tr> <tr>
<td><?php echo basename($snippet, '.snippet.php'); ?></td> <td><?php echo basename($snippet, '.snippet.php'); ?></td>
<td> <td>
<div class="pull-right"> <div class="pull-right">
<div class="btn-toolbar">
<div class="btn-group"> <div class="btn-group">
<?php echo Html::anchor(__('Edit', 'snippets'), 'index.php?id=snippets&action=edit_snippet&filename='.basename($snippet, '.snippet.php'), array('class' => 'btn btn-actions btn-small')); ?> <?php echo Html::anchor(__('Edit', 'snippets'), 'index.php?id=snippets&action=edit_snippet&filename='.basename($snippet, '.snippet.php'), array('class' => 'btn btn-primary')); ?>
<a class="btn dropdown-toggle btn-actions btn-small" data-toggle="dropdown" href="#" style="font-family:arial;"><span class="caret"></span></a> <button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown">
<ul class="dropdown-menu"> <span class="caret"></span>
<span class="sr-only">Toggle Dropdown</span>
</button>
<ul class="dropdown-menu" role="menu">
<li><?php echo Html::anchor(__('View Embed Code', 'snippets'), 'javascript:;', array('title' => __('View Embed Code', 'snippets'), 'onclick' => '$.monstra.snippets.showEmbedCodes("'.basename($snippet, '.snippet.php').'");')); ?></li> <li><?php echo Html::anchor(__('View Embed Code', 'snippets'), 'javascript:;', array('title' => __('View Embed Code', 'snippets'), 'onclick' => '$.monstra.snippets.showEmbedCodes("'.basename($snippet, '.snippet.php').'");')); ?></li>
</ul> </ul>
<?php echo Html::anchor(__('Delete', 'snippets'), </div>
'index.php?id=snippets&action=delete_snippet&filename='.basename($snippet, '.snippet.php').'&token='.Security::token(), <?php echo Html::anchor(__('Delete', 'snippets'),
array('class' => 'btn btn-actions btn-small btn-actions-default', 'onclick' => "return confirmDelete('".__('Delete snippet: :snippet', 'snippets', array(':snippet' => basename($snippet, '.snippet.php')))."')")); 'index.php?id=snippets&action=delete_snippet&filename='.basename($snippet, '.snippet.php').'&token='.Security::token(),
?> array('class' => 'btn btn-danger', 'onclick' => "return confirmDelete('".__('Delete snippet: :snippet', 'snippets', array(':snippet' => basename($snippet, '.snippet.php')))."')"));
</div> ?>
</div>
</div> </div>
</td> </td>
</tr> </tr>