Skip to content

Commit

Permalink
Improve formatting of scripts page
Browse files Browse the repository at this point in the history
  • Loading branch information
slusarz committed Jan 15, 2015
1 parent fa0aabe commit 8ef431c
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 24 deletions.
3 changes: 1 addition & 2 deletions ingo/templates/basic/script/_script.html.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<h2 class="smallheader"><?php echo _("Script name:") . ' ' . $this->h($script['name']) ?></h2>

This comment has been minimized.

Copy link
@yunosh

yunosh Jan 15, 2015

Member

Please re-add the script name. This is necessary to distinguish different files in multi-script or composite enging environments.

This comment has been minimized.

Copy link
@slusarz

slusarz Jan 15, 2015

Author Member

Think I left it out since we don't really have a pre-defined header color other than the one used by control/button row. Which is the same, so there is no way of distinguishing between header row and script name row. (buttons usually go at bottom of page, so we don't see this too often).

I've re-added with the hacky 'rowOdd' being used as the script name background color instead. I'm open to other ideas.

<pre>
<?php foreach ($script['lines'] as $i => $line): ?>
<?php printf('%' . $script['width'] . "d: %s\n", $i + 1, $this->h($line)) ?>
<?php printf('%' . $script['width'] . "d: %s\n", $i + 1, $this->h($line)) ?>
<?php endforeach; ?>
</pre>
40 changes: 18 additions & 22 deletions ingo/templates/basic/script/script.html.php
Original file line number Diff line number Diff line change
@@ -1,32 +1,28 @@
<h1 class="header"><?php echo _("Script") ?></h1>
<?php if ($this->scriptexists): ?>
<table class="scriptHeader">
<tr>
<td align="center">
<div class="horde-form-buttons scriptHeader">
<?php if ($this->showactivate): ?>
<form method="post" name="activate_script" action="<?php echo $this->scripturl ?>">
<input type="hidden" name="actionID" value="action_activate" />
<input class="horde-default" type="submit" name="submit" value="<?php echo _("Activate Script") ?>" />
</form>
<form method="post" name="deactivate_script" action="<?php echo $this->scripturl ?>">
<input type="hidden" name="actionID" value="action_deactivate" />
<input type="submit" name="submit" value="<?php echo _("Deactivate Script") ?>" />
</form>
<form method="post" name="show_active_script" action="<?php echo $this->scripturl ?>">
<input type="hidden" name="actionID" value="show_active" />
<input type="submit" name="submit" value="<?php echo _("Show Active Script") ?>" />
</form>
<form method="post" name="activate_script" action="<?php echo $this->scripturl ?>">
<input type="hidden" name="actionID" value="action_activate" />
<input class="horde-default" type="submit" name="submit" value="<?php echo _("Activate Script") ?>" />
</form>
<form method="post" name="deactivate_script" action="<?php echo $this->scripturl ?>">
<input type="hidden" name="actionID" value="action_deactivate" />
<input type="submit" name="submit" value="<?php echo _("Deactivate Script") ?>" />
</form>
<form method="post" name="show_active_script" action="<?php echo $this->scripturl ?>">
<input type="hidden" name="actionID" value="show_active" />
<input type="submit" name="submit" value="<?php echo _("Show Active Script") ?>" />
</form>
<?php else: ?>
<form method="post" name="show_current_script" action="<?php echo $this->scripturl ?>">
<input type="submit" name="submit" value="<?php echo _("Show Current Script") ?>" />
</form>
<form method="post" name="show_current_script" action="<?php echo $this->scripturl ?>">
<input type="submit" name="submit" value="<?php echo _("Show Current Script") ?>" />
</form>
<?php endif; ?>
</td>
</tr>
</table>
</div>

<?php echo $this->renderPartial('script', array('collection' => $this->scripts)) ?>

<?php else: ?>
<div>[<?php echo _("No script generated.") ?>]</div>
<div class="scriptHeader">[<?php echo _("No script generated.") ?>]</div>
<?php endif; ?>
2 changes: 2 additions & 0 deletions ingo/themes/default/screen.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ table {

/* Scripts page. */
.scriptHeader {
margin: 0;
text-align: center;
width: 100%;
}
.scriptHeader form {
Expand Down

0 comments on commit 8ef431c

Please sign in to comment.