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

Themes component of Box plugin not updated to support the new UI #203

This commit is contained in:
Awilum
2014-03-15 22:23:14 +04:00
parent 9981219800
commit ab69a6128b
4 changed files with 86 additions and 72 deletions

View File

@@ -27,7 +27,7 @@
<div class="pull-right">
<div class="btn-group">
<?php echo Html::anchor(__('Edit', 'blocks'), 'index.php?id=blocks&action=edit_block&filename='.basename($block, '.block.html'), array('class' => 'btn btn-primary')); ?>
<button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown">
<button type="button" class="btn dropdown-toggle btn-primary" data-toggle="dropdown">
<span class="caret"></span>
<span class="sr-only">Toggle Dropdown</span>
</button>

View File

@@ -1,7 +1,7 @@
<?php if ($action == 'chunk') { ?><h2><?php echo __('New Chunk', 'themes'); ?></h2><?php } ?>
<?php if ($action == 'template') { ?><h2><?php echo __('New Template', 'themes'); ?></h2><?php } ?>
<?php if ($action == 'styles') { ?><h2><?php echo __('New Styles', 'themes'); ?></h2><?php } ?>
<?php if ($action == 'script') { ?><h2><?php echo __('New Script', 'themes'); ?></h2><?php } ?>
<?php if ($action == 'chunk') { ?><h2 class="margin-bottom-1"><?php echo __('New Chunk', 'themes'); ?></h2><?php } ?>
<?php if ($action == 'template') { ?><h2 class="margin-bottom-1"><?php echo __('New Template', 'themes'); ?></h2><?php } ?>
<?php if ($action == 'styles') { ?><h2 class="margin-bottom-1"><?php echo __('New Styles', 'themes'); ?></h2><?php } ?>
<?php if ($action == 'script') { ?><h2 class="margin-bottom-1"><?php echo __('New Script', 'themes'); ?></h2><?php } ?>
<br>
<?php if (isset($errors['file_empty_name']) || isset($errors['file_exists'])) $error_class = 'error'; else $error_class = ''; ?>
@@ -21,24 +21,26 @@
</div>
<?php
if (isset($errors['file_empty_name'])) echo '&nbsp;&nbsp;&nbsp;<span style="color:red">'.$errors['file_empty_name'].'</span>';
if (isset($errors['file_exists'])) echo '&nbsp;&nbsp;&nbsp;<span style="color:red">'.$errors['file_exists'].'</span>';
if (isset($errors['file_empty_name'])) echo '<span class="error-message">'.$errors['file_empty_name'].'</span>';
if (isset($errors['file_exists'])) echo '<span class="error-message">'.$errors['file_exists'].'</span>';
?>
<br>
<div class="margin-top-2 margin-bottom-2">
<?php
if ($action == 'chunk') { echo Form::label('content', __('Chunk content', 'themes')); }
if ($action == 'template') { echo Form::label('content', __('Template content', 'themes')); }
if ($action == 'styles') { echo Form::label('content', __('Styles content', 'themes')); }
if ($action == 'script') { echo Form::label('content', __('Script content', 'themes')); }
echo Form::textarea('content', $content, array('style' => 'width:100%;height:400px;', 'class' => 'source-editor'));
echo Form::textarea('content', $content, array('style' => 'width:100%;height:400px;', 'class' => 'source-editor'));
?>
</div>
<?php
echo (
Html::br(2).
Form::submit('add_file_and_exit', __('Save and Exit', 'themes'), array('class' => 'btn btn-primary')).Html::nbsp(2).
Form::submit('add_file', __('Save', 'themes'), array('class' => 'btn btn-default')).
Form::submit('add_file', __('Save', 'themes'), array('class' => 'btn btn-default')).Html::nbsp(2).
Html::anchor(__('Cancel', 'themes'), 'index.php?id=themes', array('title' => __('Cancel', 'themes'), 'class' => 'btn btn-default')).
Form::close()
);
?>

View File

@@ -1,8 +1,7 @@
<?php if ($action == 'chunk') { ?><h2><?php echo __('Edit Chunk', 'themes'); ?></h2><?php } ?>
<?php if ($action == 'template') { ?><h2><?php echo __('Edit Template', 'themes'); ?></h2><?php } ?>
<?php if ($action == 'styles') { ?><h2><?php echo __('Edit Styles', 'themes'); ?></h2><?php } ?>
<?php if ($action == 'script') { ?><h2><?php echo __('Edit Script', 'themes'); ?></h2><?php } ?>
<br>
<?php if ($action == 'chunk') { ?><h2 class="margin-bottom-1"><?php echo __('Edit Chunk', 'themes'); ?></h2><?php } ?>
<?php if ($action == 'template') { ?><h2 class="margin-bottom-1"><?php echo __('Edit Template', 'themes'); ?></h2><?php } ?>
<?php if ($action == 'styles') { ?><h2 class="margin-bottom-1"><?php echo __('Edit Styles', 'themes'); ?></h2><?php } ?>
<?php if ($action == 'script') { ?><h2 class="margin-bottom-1"><?php echo __('Edit Script', 'themes'); ?></h2><?php } ?>
<?php
if ($content !== null) {
@@ -30,24 +29,27 @@
</div>
<?php
if (isset($errors['file_empty_name'])) echo '&nbsp;&nbsp;&nbsp;<span style="color:red">'.$errors['file_empty_name'].'</span>';
if (isset($errors['file_exists'])) echo '&nbsp;&nbsp;&nbsp;<span style="color:red">'.$errors['file_exists'].'</span>';
if (isset($errors['file_empty_name'])) echo '<span class="error-message">'.$errors['file_empty_name'].'</span>';
if (isset($errors['file_exists'])) echo '<span class="error-message">'.$errors['file_exists'].'</span>';
?>
<br>
<div class="margin-top-2 margin-bottom-2">
<?php
if ($action == 'chunk') { echo Form::label('content', __('Chunk content', 'themes')); }
if ($action == 'template') { echo Form::label('content', __('Template content', 'themes')); }
if ($action == 'styles') { echo Form::label('content', __('Styles content', 'themes')); }
if ($action == 'script') { echo Form::label('content', __('Script content', 'themes')); }
echo (
Form::textarea('content', Html::toText($content), array('style' => 'width:100%;height:400px;', 'class' => 'source-editor')).
Html::br(2).
Form::textarea('content', Html::toText($content), array('style' => 'width:100%;height:400px;', 'class' => 'source-editor'))
);
?>
</div>
<?php
echo (
Form::submit('edit_file_and_exit', __('Save and Exit', 'themes'), array('class' => 'btn btn-primary')).Html::nbsp(2).
Form::submit('edit_file', __('Save', 'themes'), array('class' => 'btn btn-default')). Html::nbsp().
Form::submit('edit_file', __('Save', 'themes'), array('class' => 'btn btn-default')).Html::nbsp(2).
Html::anchor(__('Cancel', 'themes'), 'index.php?id=themes', array('title' => __('Cancel', 'themes'), 'class' => 'btn btn-default')).
Form::close()
);
@@ -57,3 +59,4 @@
if ($action == 'styles') { echo '<div class="message-error">'.__('This styles does not exist', 'themes').'</div>'; }
if ($action == 'script') { echo '<div class="message-error">'.__('This script does not exist', 'themes').'</div>'; }
}
?>

View File

@@ -1,52 +1,49 @@
<div class="row-fluid">
<div class="row">
<div class="col-xs-6">
<div class="span6">
<h2 class="margin-bottom-1"><?php echo __('Site Theme', 'themes'); ?></h2>
<h2><?php echo __('Site Theme', 'themes'); ?></h2>
<br>
<!-- Themes_selector -->
<?php
echo (
Form::open().
Form::hidden('csrf', Security::token()).
Form::label('themes', __('Select Theme', 'themes')).
Form::select('themes', $themes_site, $current_site_theme, array('class' => 'form-control')). Html::br().
Form::submit('save_site_theme', __('Save', 'themes'), array('class' => 'btn btn-primary')).
Form::close()
);
?>
<!-- /Themes_selector -->
<!-- Themes_selector -->
<?php
echo (
Form::open().
Form::hidden('csrf', Security::token()).
Form::label('themes', __('Select Theme', 'themes')).
Form::select('themes', $themes_site, $current_site_theme, array('class' => 'form-control')). Html::br().
Form::submit('save_site_theme', __('Save', 'themes'), array('class' => 'btn btn-primary')).
Form::close()
);
?>
<!-- /Themes_selector -->
</div>
</div>
<div class="col-xs-6">
<div class="span6">
<h2 class="margin-bottom-1"><?php echo __('Admin Theme', 'themes'); ?></h2>
<!-- Themes_selector -->
<?php
echo (
Form::open().
Form::hidden('csrf', Security::token()).
Form::label('themes', __('Select Theme', 'themes')).
Form::select('themes', $themes_admin, $current_admin_theme, array('class' => 'form-control')). Html::br().
Form::submit('save_admin_theme', __('Save', 'themes'), array('class' => 'btn btn-primary')).
Form::close()
);
?>
<!-- /Themes_selector -->
<h2><?php echo __('Admin Theme', 'themes'); ?></h2>
<br>
<!-- Themes_selector -->
<?php
echo (
Form::open().
Form::hidden('csrf', Security::token()).
Form::label('themes', __('Select Theme', 'themes')).
Form::select('themes', $themes_admin, $current_admin_theme, array('class' => 'form-control')). Html::br().
Form::submit('save_admin_theme', __('Save', 'themes'), array('class' => 'btn btn-primary')).
Form::close()
);
?>
<!-- /Themes_selector -->
</div>
</div>
</div>
<hr>
<div class="row-fluid">
<div class="row">
<div class="span12">
<div class="col-xs-12">
<?php
echo (
@@ -72,8 +69,11 @@
<div class="pull-right">
<div class="btn-group">
<?php echo Html::anchor(__('Edit', 'themes'), 'index.php?id=themes&action=edit_template&filename='.basename($template, '.template.php'), array('class' => 'btn btn-primary')); ?>
<a class="btn dropdown-toggle btn-primary" data-toggle="dropdown" href="#" style="font-family:arial;"><span class="caret"></span></a>
<ul class="dropdown-menu">
<button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown">
<span class="caret"></span>
<span class="sr-only">Toggle Dropdown</span>
</button>
<ul class="dropdown-menu" role="menu">
<li><?php echo Html::anchor(__('Clone', 'themes'), 'index.php?id=themes&action=clone_template&filename='.basename($template, '.template.php').'&token='.Security::token(), array('title' => __('Clone'))); ?></li>
</ul>
</div>
@@ -107,8 +107,11 @@
<div class="pull-right">
<div class="btn-group">
<?php echo Html::anchor(__('Edit', 'themes'), 'index.php?id=themes&action=edit_chunk&filename='.basename($chunk, '.chunk.php'), array('class' => 'btn btn-primary')); ?>
<a class="btn dropdown-toggle btn-primary" data-toggle="dropdown" href="#" style="font-family:arial;"><span class="caret"></span></a>
<ul class="dropdown-menu">
<button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown">
<span class="caret"></span>
<span class="sr-only">Toggle Dropdown</span>
</button>
<ul class="dropdown-menu" role="menu">
<li><?php echo Html::anchor(__('Clone', 'themes'), 'index.php?id=themes&action=clone_chunk&filename='.basename($chunk, '.chunk.php').'&token='.Security::token(), array('title' => __('Clone', 'themes'))); ?></li>
</ul>
</div>
@@ -142,8 +145,11 @@
<div class="pull-right">
<div class="btn-group">
<?php echo Html::anchor(__('Edit', 'themes'), 'index.php?id=themes&action=edit_styles&filename='.basename($style, '.css'), array('class' => 'btn btn-primary')); ?>
<a class="btn dropdown-toggle btn-primary" data-toggle="dropdown" href="#" style="font-family:arial;"><span class="caret"></span></a>
<ul class="dropdown-menu">
<button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown">
<span class="caret"></span>
<span class="sr-only">Toggle Dropdown</span>
</button>
<ul class="dropdown-menu" role="menu">
<li><?php echo Html::anchor(__('Clone', 'themes'), 'index.php?id=themes&action=clone_styles&filename='.basename($style, '.css').'&token='.Security::token(), array('title' => __('Clone', 'themes'))); ?></li>
</ul>
</div>
@@ -177,8 +183,11 @@
<div class="pull-right">
<div class="btn-group">
<?php echo Html::anchor(__('Edit', 'themes'), 'index.php?id=themes&action=edit_script&filename='.basename($script, '.js'), array('class' => 'btn btn-primary')); ?>
<a class="btn dropdown-toggle btn-primary" data-toggle="dropdown" href="#" style="font-family:arial;"><span class="caret"></span></a>
<ul class="dropdown-menu">
<button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown">
<span class="caret"></span>
<span class="sr-only">Toggle Dropdown</span>
</button>
<ul class="dropdown-menu" role="menu">
<li><?php echo Html::anchor(__('Clone', 'themes'), 'index.php?id=themes&action=clone_script&filename='.basename($script, '.js').'&token='.Security::token(), array('title' => __('Clone', 'themes'))); ?></li>
</ul>
</div>