summaryrefslogtreecommitdiffstats
path: root/modules-available/main
diff options
context:
space:
mode:
authorSimon Rettberg2016-05-18 18:04:56 +0200
committerSimon Rettberg2016-05-18 18:04:56 +0200
commit2e18b36a287ad9b25619f9e2a073dcedf6d620ee (patch)
tree96d802fdc1c21ee9aa9b4d89a6611db7d8502433 /modules-available/main
parentModularized baseconfig fetching (api) (diff)
downloadslx-admin-2e18b36a287ad9b25619f9e2a073dcedf6d620ee.tar.gz
slx-admin-2e18b36a287ad9b25619f9e2a073dcedf6d620ee.tar.xz
slx-admin-2e18b36a287ad9b25619f9e2a073dcedf6d620ee.zip
MORE WMORK
Diffstat (limited to 'modules-available/main')
-rw-r--r--modules-available/main/lang/de/global-tags.json2
-rw-r--r--modules-available/main/lang/de/template-tags.json8
-rw-r--r--modules-available/main/lang/en/global-tags.json2
-rw-r--r--modules-available/main/lang/en/template-tags.json8
-rw-r--r--modules-available/main/page.inc.php44
-rw-r--r--modules-available/main/templates/messagebox-error.html1
-rw-r--r--modules-available/main/templates/messagebox-info.html1
-rw-r--r--modules-available/main/templates/messagebox-success.html1
-rw-r--r--modules-available/main/templates/messagebox-warning.html1
-rw-r--r--modules-available/main/templates/messagebox.html7
-rw-r--r--modules-available/main/templates/page-main.html31
11 files changed, 26 insertions, 80 deletions
diff --git a/modules-available/main/lang/de/global-tags.json b/modules-available/main/lang/de/global-tags.json
index 39236fd4..a8fa0034 100644
--- a/modules-available/main/lang/de/global-tags.json
+++ b/modules-available/main/lang/de/global-tags.json
@@ -2,8 +2,10 @@
"lang_back": "Zur\u00fcck",
"lang_cancel": "Abbrechen",
"lang_close": "Schlie\u00dfen",
+ "lang_days": "Tag(e)",
"lang_delete": "L\u00f6schen",
"lang_hint": "Hinweis",
+ "lang_hours": "Stunde(n)",
"lang_next": "Weiter",
"lang_save": "Speichern",
"lang_today": "Heute",
diff --git a/modules-available/main/lang/de/template-tags.json b/modules-available/main/lang/de/template-tags.json
index b299cbad..c11843a0 100644
--- a/modules-available/main/lang/de/template-tags.json
+++ b/modules-available/main/lang/de/template-tags.json
@@ -1,6 +1,5 @@
{
- "lang_bootMenuWarning": "Das Bootmen\u00fc ist veraltet oder wurde noch nicht generiert.",
- "lang_configure": "Konfigurieren",
+ "lang_goTo": "Gehe zu",
"lang_intro": "Dies ist die bwLehrpool Konfigurationsoberfl\u00e4che.",
"lang_introGuest": "Dies ist das Administrations-Interface der lokalen bwLehrpool-Installation. Bitte authentifizieren Sie sich, um Einstellungen vorzunehmen.",
"lang_language": "Sprachen",
@@ -8,16 +7,11 @@
"lang_loggedInSuffix": " ",
"lang_login": "Anmelden",
"lang_logout": "Abmelden",
- "lang_minilinuxMissing": "Wichtige Dateien der MiniLinux-Installation fehlen.",
"lang_needsSetup": "Einrichtung unvollst\u00e4ndig",
"lang_noExistingAccount": "Es existiert noch kein Administrator-Zugang f\u00fcr diesen Satelliten-Server.",
- "lang_numerOfImagesMarkedForDeletion": "Zur L\u00f6schung markierte Abbilder",
"lang_register": "Registrieren",
- "lang_systemConfiguration": "Systemkonfiguration",
- "lang_systemConfigurationNotChosen": "Es wurde noch keine Systemkonfiguration ausgew\u00e4hlt.",
"lang_toggleNavigation": "Navigation ein\/ausblenden",
"lang_translations": "\u00dcbersetzungen",
- "lang_vmLocationNotSet": "Es ist noch kein Speicherort f\u00fcr die Virtuellen Maschinen festgelegt.",
"lang_warning": "Warnung",
"lang_warningDebug": "Debugmodus aktiv!",
"lang_welcome": "Willkommen"
diff --git a/modules-available/main/lang/en/global-tags.json b/modules-available/main/lang/en/global-tags.json
index 10581ae2..181f600a 100644
--- a/modules-available/main/lang/en/global-tags.json
+++ b/modules-available/main/lang/en/global-tags.json
@@ -2,8 +2,10 @@
"lang_back": "Back",
"lang_cancel": "Cancel",
"lang_close": "Close",
+ "lang_days": "day(s)",
"lang_delete": "Delete",
"lang_hint": "Hint",
+ "lang_hours": "hour(s)",
"lang_next": "Next",
"lang_save": "Save",
"lang_today": "Today",
diff --git a/modules-available/main/lang/en/template-tags.json b/modules-available/main/lang/en/template-tags.json
index be03e53e..fcb34031 100644
--- a/modules-available/main/lang/en/template-tags.json
+++ b/modules-available/main/lang/en/template-tags.json
@@ -1,6 +1,5 @@
{
- "lang_bootMenuWarning": "The boot menu is outdated or has not been generated.",
- "lang_configure": "Configure",
+ "lang_goTo": "Gehe zu",
"lang_intro": "This is the bwLehrpool configuration interface.",
"lang_introGuest": "This is the administration interface of the local bwLehrpool intallation. Please authenticate yourself to adjust settings.",
"lang_language": "Language",
@@ -8,16 +7,11 @@
"lang_loggedInSuffix": " ",
"lang_login": "Login",
"lang_logout": "Logout",
- "lang_minilinuxMissing": "Important files from the mini Linux installation are missing.",
"lang_needsSetup": "Setup incomplete",
"lang_noExistingAccount": "No account has been created yet. Sign up to become the administrator.",
- "lang_numerOfImagesMarkedForDeletion": "Images marked for deletion",
"lang_register": "Register",
- "lang_systemConfiguration": "System Configuration",
- "lang_systemConfigurationNotChosen": "A system configuration has not been chosen yet.",
"lang_toggleNavigation": "toggle navigation",
"lang_translations": "Translations",
- "lang_vmLocationNotSet": "A location for the virtual machine is not set yet.",
"lang_warning": "Warning",
"lang_warningDebug": "Debug mode active!",
"lang_welcome": "Welcome"
diff --git a/modules-available/main/page.inc.php b/modules-available/main/page.inc.php
index 0a9acd81..bd50a5d1 100644
--- a/modules-available/main/page.inc.php
+++ b/modules-available/main/page.inc.php
@@ -3,24 +3,9 @@
class Page_Main extends Page
{
- private $sysconfig;
- private $minilinux;
- private $vmstore;
- private $ipxe;
- private $delPending;
-
protected function doPreprocess()
{
User::load();
- if (User::isLoggedIn()) {
- $this->sysconfig = !file_exists(CONFIG_HTTP_DIR . '/default/config.tgz');
- $this->minilinux = !file_exists(CONFIG_HTTP_DIR . '/default/kernel') || !file_exists(CONFIG_HTTP_DIR . '/default/initramfs-stage31') || !file_exists(CONFIG_HTTP_DIR . '/default/stage32.sqfs');
- $this->vmstore = !is_array(Property::getVmStoreConfig());
- $this->ipxe = !preg_match('/^\d+\.\d+\.\d+\.\d+$/', Property::getServerIp());
- Property::setNeedsSetup(($this->sysconfig || $this->minilinux || $this->vmstore || $this->ipxe) ? 1 : 0);
- $res = Database::queryFirst("SELECT Count(*) AS cnt FROM sat.imageversion WHERE deletestate = 'SHOULD_DELETE'", array(), true);
- $this->delPending = isset($res['cnt']) ? $res['cnt'] : 0;
- }
}
protected function doRender()
@@ -33,24 +18,21 @@ class Page_Main extends Page
}
// Logged in here
- // Load news
- $lines = array();
- $paginate = new Paginate("SELECT newsid, dateline, title, content FROM news ORDER BY dateline DESC", 10);
- $res = $paginate->exec();
- while ($row = $res->fetch(PDO::FETCH_ASSOC)) {
- if(count($lines) >= 3) break;
- $lines[] = $row;
- }
-
Render::addTemplate('page-main', array(
- 'user' => User::getName(),
- 'sysconfig' => $this->sysconfig,
- 'minilinux' => $this->minilinux,
- 'vmstore' => $this->vmstore,
- 'ipxe' => $this->ipxe,
- 'delpending' => $this->delPending,
- 'news' => $lines
+ 'user' => User::getName()
));
+
+ // Warnings
+ $needSetup = false;
+ foreach (glob('modules/*/hooks/main-warning.inc.php') as $file) {
+ preg_match('#^modules/([^/]+)/#', $file, $out);
+ if (!Module::isAvailable($out[1]))
+ continue;
+ include $file;
+ }
+
+ // Update warning state
+ Property::setNeedsSetup($needSetup ? 1 : 0);
}
protected function doAjax()
diff --git a/modules-available/main/templates/messagebox-error.html b/modules-available/main/templates/messagebox-error.html
deleted file mode 100644
index 873716c9..00000000
--- a/modules-available/main/templates/messagebox-error.html
+++ /dev/null
@@ -1 +0,0 @@
-<div class="alert alert-danger"><span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span> {{{message}}}</div>
diff --git a/modules-available/main/templates/messagebox-info.html b/modules-available/main/templates/messagebox-info.html
deleted file mode 100644
index eb9d518a..00000000
--- a/modules-available/main/templates/messagebox-info.html
+++ /dev/null
@@ -1 +0,0 @@
-<div class="alert alert-info"><span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span> {{{message}}}</div>
diff --git a/modules-available/main/templates/messagebox-success.html b/modules-available/main/templates/messagebox-success.html
deleted file mode 100644
index 93674d69..00000000
--- a/modules-available/main/templates/messagebox-success.html
+++ /dev/null
@@ -1 +0,0 @@
-<div class="alert alert-success"><span class="glyphicon glyphicon-ok" aria-hidden="true"></span> {{{message}}}</div>
diff --git a/modules-available/main/templates/messagebox-warning.html b/modules-available/main/templates/messagebox-warning.html
deleted file mode 100644
index b02e2e8a..00000000
--- a/modules-available/main/templates/messagebox-warning.html
+++ /dev/null
@@ -1 +0,0 @@
-<div class="alert alert-warning"><span class="glyphicon glyphicon-warning" aria-hidden="true"></span> {{{message}}}</div>
diff --git a/modules-available/main/templates/messagebox.html b/modules-available/main/templates/messagebox.html
new file mode 100644
index 00000000..45d5d8f6
--- /dev/null
+++ b/modules-available/main/templates/messagebox.html
@@ -0,0 +1,7 @@
+<div class="alert alert-{{type}}">
+ <span class="glyphicon glyphicon-{{icon}}" aria-hidden="true"></span>
+ {{#link}}
+ <a class="pull-right" href="?do={{link}}">{{lang_goTo}} &raquo;</a>
+ {{/link}}
+ {{{message}}}
+</div>
diff --git a/modules-available/main/templates/page-main.html b/modules-available/main/templates/page-main.html
index 39e4e74e..a0b2d3b0 100644
--- a/modules-available/main/templates/page-main.html
+++ b/modules-available/main/templates/page-main.html
@@ -3,34 +3,3 @@
<p>{{lang_intro}}</p>
</div>
-<ul class="list-group">
-{{#vmstore}}
- <li class="list-group-item list-group-item-text">
- {{lang_vmLocationNotSet}}
- <a class="btn btn-sm btn-primary" href="?do=VmStore">{{lang_configure}} &raquo;</a>
- </li>
-{{/vmstore}}
-{{#ipxe}}
- <li class="list-group-item list-group-item-text">
- {{lang_bootMenuWarning}}
- <a class="btn btn-sm btn-primary" href="?do=ServerSetup">{{lang_configure}} &raquo;</a>
- </li>
-{{/ipxe}}
-{{#minilinux}}
- <li class="list-group-item list-group-item-text">
- {{lang_minilinuxMissing}}
- <a class="btn btn-sm btn-primary" href="?do=MiniLinux">MiniLinux &raquo;</a>
- </li>
-{{/minilinux}}
-{{#sysconfig}}
- <li class="list-group-item list-group-item-text">
- {{lang_systemConfigurationNotChosen}}
- <a class="btn btn-sm btn-primary" href="?do=SysConfig">{{lang_systemConfiguration}} &raquo;</a>
- </li>
-{{/sysconfig}}
-{{#delpending}}
- <li class="list-group-item list-group-item-text">
- <a href="?do=DozMod">{{lang_numerOfImagesMarkedForDeletion}}: {{delpending}}</a>
- </li>
-{{/delpending}}
-</ul>