Skip to content
Snippets Groups Projects
Commit d65cbb88 authored by Tim van Dijen's avatar Tim van Dijen
Browse files

# This is a combination of 2 commits.

# The first commit's message is:

core: move inline JS to assets

# This is the 2nd commit message:

Move assets to assets-dir + PSR-2
parent 4453bc17
No related branches found
No related tags found
No related merge requests found
......@@ -159,14 +159,13 @@ if ($this->data['errorcode'] !== null) {
<tr id="submit">
<td class="loginicon"></td><td></td>
<td>
<button class="btn"
onclick="this.value='<?php echo $this->t('{login:processing}'); ?>';
this.disabled=true; this.form.submit(); return true;" tabindex="6">
<button id="submit_button" class="btn" tabindex="6">
<?php echo $this->t('{login:login_button}'); ?>
</button>
</td>
</tr>
</table>
<input type="hidden" id="processing_trans" value="<?php echo $this->t('{login:processing}'); ?>" />
<?php
foreach ($this->data['stateparams'] as $name => $value) {
echo('<input type="hidden" name="'.htmlspecialchars($name).'" value="'.htmlspecialchars($value).'" />');
......
......@@ -2,6 +2,10 @@
{% extends "@core/base.twig" %}
{% block postload %}
<script src="{{baseurlpath}}assets/js/loginuserpass.js"></script>
{% endblock %}
{% block content %}
{% if errorcode -%}
<div class="pure-g">
......@@ -99,10 +103,10 @@
</div> <!-- form-align-->
<br><br>
<button class="pure-button pure-button-red pure-input-1-2 pure-input-sm-1-1 right" type="submit" onclick="this.value='{{ 'Processing...'|trans }}';" tabindex="6">
<button class="pure-button pure-button-red pure-input-1-2 pure-input-sm-1-1 right" id="submit_button" type="submit" tabindex="6">
{{ 'Login'|trans }}
</button>
<input type='hidden' id="processing_trans" value="{{ 'Processing...'|trans }}" />
{% for name, value in stateparams -%}
<input type="hidden" name="{{ name }}" value="{{ value }}" />
{%- endfor %}
......
document.addEventListener(
'DOMContentLoaded',
function () {
var button = document.getElementById("submit_button");
button.addEventListener(
'click',
function () {
var translation = document.getElementById("processing_trans");
this.disabled = true;
this.innerHTML = translation.value;
}
);
}
);
<?php
$this->data['head'] = '<style type="text/css">
table.statustable td, table.statustable th {
border: 1px solid #eee;
padding: 2px 6px;
}
table.statustable {
border-collapse: collapse;
}
.bmax {
border: 1px solid #555;
background: #eee;
}
.bused {
border-right: 1px solid #555;
border-bottom: 1px solid #555;
color: white;
background: #833;
}
</style>
';
$this->data['head'] = '<link href="'.$this->data['baseurlpath'].'assets/css/memcacheMonitor.css" rel="stylesheet" />';
$this->includeAtTemplateBase('includes/header.php');
$title = $this->data['title'];
$table = $this->data['table'];
// Identify column headings
$column_titles = array();
foreach($table as $row_title => $row_data) {
foreach($row_data as $ct => $foo) {
if(!in_array($ct, $column_titles, true)) {
$column_titles[] = $ct;
}
}
foreach ($table as $row_title => $row_data) {
foreach ($row_data as $ct => $foo) {
if (!in_array($ct, $column_titles, true)) {
$column_titles[] = $ct;
}
}
}
?>
......@@ -48,28 +25,28 @@ foreach($table as $row_title => $row_data) {
<tr>
<th></th>
<?php
foreach($column_titles as $ct) {
echo '<th>' . htmlspecialchars($ct) . '</th>' . "\n";
foreach ($column_titles as $ct) {
echo '<th>'.htmlspecialchars($ct).'</th>'."\n";
}
?>
</tr>
<?php
foreach($table as $row_title => $row_data) {
echo '<tr>' . "\n";
echo '<th class="rowtitle" style="text-align: right">' . $this->t($this->data['rowtitles'][$row_title]) . '</th>' . "\n";
foreach ($table as $row_title => $row_data) {
echo '<tr>' . "\n";
echo '<th class="rowtitle" style="text-align: right">'.$this->t($this->data['rowtitles'][$row_title]).'</th>'."\n";
foreach($column_titles as $ct) {
echo '<td>';
foreach ($column_titles as $ct) {
echo '<td>';
if(array_key_exists($ct, $row_data)) {
echo htmlspecialchars($row_data[$ct]);
}
if (array_key_exists($ct, $row_data)) {
echo htmlspecialchars($row_data[$ct]);
}
echo '</td>' . "\n";
}
echo '</td>' . "\n";
}
echo '</tr>' . "\n";
echo '</tr>' . "\n";
}
?>
......@@ -77,15 +54,14 @@ foreach($table as $row_title => $row_data) {
<?php
if (array_key_exists('bytes', $this->data['statsraw']) && array_key_exists('limit_maxbytes', $this->data['statsraw'])) {
foreach($this->data['statsraw']['bytes'] as $key => $row_data) {
echo ('<h3>Storage usage on [' . $key . ']</h3>');
$maxpix = 400;
$pix = floor($this->data['statsraw']['bytes'][$key]*$maxpix / $this->data['statsraw']['limit_maxbytes'][$key]);
echo('<div class="bmax" style="width: ' . $maxpix. 'px"><div class="bused" style="width: ' . $pix . 'px">
Used: ' . $table['bytes'][$key] . '
</div>Total available: ' . $table['limit_maxbytes'][$key] . '</div>');
}
foreach ($this->data['statsraw']['bytes'] as $key => $row_data) {
echo ('<h3>Storage usage on ['.$key.']</h3>');
$maxpix = 400;
$pix = floor($this->data['statsraw']['bytes'][$key]*$maxpix / $this->data['statsraw']['limit_maxbytes'][$key]);
echo '<div class="bmax" style="width: '.$maxpix.'px"><div class="bused" style="width: '.$pix.'px">Used: '.
$table['bytes'][$key].'</div>Total available: '.$table['limit_maxbytes'][$key].'</div>';
}
}
$this->includeAtTemplateBase('includes/footer.php');
......@@ -2,7 +2,7 @@
{% extends "base.twig" %}
{% block preload %}
<link href="{{ baseurlpath }}style.css" rel="stylesheet" />
<link href="{{ baseurlpath }}assets/css/memcacheMonitor.css" rel="stylesheet" />
{% endblock %}
{% block content %}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment