1
0
mirror of https://github.com/monstra-cms/monstra.git synced 2025-07-31 02:10:37 +02:00

Snippets Plugin: layout fixes.

This commit is contained in:
Awilum
2012-12-15 00:36:24 +02:00
parent 0be14b20db
commit a6baf5aaaa
3 changed files with 16 additions and 11 deletions

View File

@@ -1,4 +1,4 @@
<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')); ?>
@@ -14,7 +14,7 @@
<?php echo (Form::label('name', __('Name', 'snippets'))); ?> <?php echo (Form::label('name', __('Name', 'snippets'))); ?>
<div class="input-append"> <div class="input-append">
<?php echo (Form::input('name', $name, array('class' => (isset($errors['snippets_empty_name']) || isset($errors['snippets_exists'])) ? 'input-xlarge error-field' : 'input-xlarge'))); ?><span class="add-on">.snippet.php</span> <?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>
</div> </div>
<?php <?php
@@ -28,7 +28,7 @@
Form::label('content', __('Snippet content', 'snippets')). Form::label('content', __('Snippet content', 'snippets')).
Form::textarea('content', $content, array('style' => 'width:100%;height:400px;', 'class'=>'source-editor')). Form::textarea('content', $content, array('style' => 'width:100%;height:400px;', 'class'=>'source-editor')).
Html::br(2). Html::br(2).
Form::submit('add_snippets_and_exit', __('Save and exit', 'snippets'), array('class' => 'btn')).Html::nbsp(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,4 +1,4 @@
<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')); ?>
@@ -20,7 +20,7 @@
<?php echo (Form::label('name', __('Name', 'snippets'))); ?> <?php echo (Form::label('name', __('Name', 'snippets'))); ?>
<div class="input-append"> <div class="input-append">
<?php echo (Form::input('name', $name, array('class' => (isset($errors['snippets_empty_name']) || isset($errors['snippets_exists'])) ? 'input-xlarge error-field' : 'input-xlarge'))); ?><span class="add-on">.snippet.php</span> <?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>
</div> </div>
<?php <?php
@@ -35,7 +35,7 @@
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).
Form::submit('edit_snippets_and_exit', __('Save and exit', 'snippets'), array('class' => 'btn default')).Html::nbsp(2). Form::submit('edit_snippets_and_exit', __('Save and Exit', 'snippets'), array('class' => 'btn default')).Html::nbsp(2).
Form::submit('edit_snippets', __('Save', 'snippets'), array('class' => 'btn default')). Html::nbsp(). Form::submit('edit_snippets', __('Save', 'snippets'), array('class' => 'btn default')). Html::nbsp().
Form::close() Form::close()
); );

View File

@@ -5,7 +5,7 @@
<?php <?php
echo ( echo (
Html::anchor(__('Create new snippet', 'snippets'), 'index.php?id=snippets&action=add_snippet', array('title' => __('Create new snippet', 'snippets'), 'class' => 'btn default btn-small')). Html::nbsp(3) 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)
); );
?> ?>
@@ -14,26 +14,31 @@
<!-- Snippets_list --> <!-- Snippets_list -->
<table class="table table-bordered"> <table class="table table-bordered">
<thead> <thead>
<tr><td><?php echo __('Snippets', 'snippets'); ?></td><td width="40%"><?php echo __('Actions', 'snippets'); ?></td></tr> <tr>
<th><?php echo __('Snippets', 'snippets'); ?></th>
<th></th>
</tr>
</thead> </thead>
<tbody> <tbody>
<?php if (count($snippets_list) != 0) foreach ($snippets_list as $snippet) { ?> <?php if (count($snippets_list) != 0) foreach ($snippets_list as $snippet) { ?>
<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="btn-toolbar"> <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')); ?> <?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')); ?>
<a class="btn dropdown-toggle btn-actions" data-toggle="dropdown" href="#" style="font-family:arial;"><span class="caret"></span></a> <a class="btn dropdown-toggle btn-actions btn-small" data-toggle="dropdown" href="#" style="font-family:arial;"><span class="caret"></span></a>
<ul class="dropdown-menu"> <ul class="dropdown-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'), <?php echo Html::anchor(__('Delete', 'snippets'),
'index.php?id=snippets&action=delete_snippet&filename='.basename($snippet, '.snippet.php').'&token='.Security::token(), 'index.php?id=snippets&action=delete_snippet&filename='.basename($snippet, '.snippet.php').'&token='.Security::token(),
array('class' => 'btn btn-actions', 'onclick' => "return confirmDelete('".__('Delete snippet: :snippet', 'snippets', array(':snippet' => basename($snippet, '.snippet.php')))."')")); array('class' => 'btn btn-actions btn-small btn-actions-default', 'onclick' => "return confirmDelete('".__('Delete snippet: :snippet', 'snippets', array(':snippet' => basename($snippet, '.snippet.php')))."')"));
?> ?>
</div> </div>
</div> </div>
</div>
</td> </td>
</tr> </tr>
<?php } ?> <?php } ?>