Skip to content

Commit

Permalink
Added interface for login, partial Dashboard, and settings
Browse files Browse the repository at this point in the history
Also upgraded jQuery and jQueryUI. Swapped tinyMCE with
jHtmlArea. Removed all themes for the time being until the
interface is finalized and then a few other themes will be made.
  • Loading branch information
lfkeitel committed Mar 5, 2015
1 parent f952470 commit 927a9a6
Show file tree
Hide file tree
Showing 184 changed files with 1,417 additions and 5,064 deletions.
16 changes: 9 additions & 7 deletions app/classes/Dandelion/Utils/View.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,13 @@ private static function isVenderJS($name)

switch (strtolower($name)) {
case 'jquery':
$include .= '<script src="assets/js/vendor/jquery/js/jquery-2.1.1.min.js"></script>';
$include .= '<script src="assets/js/vendor/jquery/js/jquery-2.1.3.min.js"></script>';
break;
case 'jqueryui':
$include .= '<script src="assets/js/vendor/jquery/js/jquery-ui-1.10.4.min.js"></script>';
$include .= '<script src="assets/js/vendor/jquery/js/jquery-ui-1.11.3.min.js"></script>';
break;
case 'tinymce':
$include .= '<script src="assets/js/vendor/tinymce/js/jquery.tinymce.min.js"></script>';
$include .= '<script src="assets/js/vendor/tinymce/js/tinymce.min.js"></script>';
case 'jhtmlarea':
$include .= '<script src="assets/js/vendor/jhtmlarea/jHtmlArea-0.8.min.js"></script>';
break;
}
return $include;
Expand Down Expand Up @@ -102,7 +101,7 @@ public static function getThemeList($theme = null, $showDefaultOption = true)
return '';
}

$themeList .= '<select name="userTheme" id="userTheme">';
$themeList .= '<select id="theme">';
if ($showDefaultOption) {
$themeList .= '<option value="default">Default</option>';
}
Expand Down Expand Up @@ -160,7 +159,10 @@ public static function loadCssSheets()

// Special case for jQueryUI styles
if ($normalized == 'jqueryui') {
$cssList .= '<link rel="stylesheet" type="text/css" href="assets/js/vendor/jquery/css/smoothness/jquery-ui-1.10.4.custom.min.css">';
$cssList .= '<link rel="stylesheet" type="text/css" href="assets/js/vendor/jquery/css/jquery-ui.min.css">';
continue;
} elseif ($normalized == 'jhtmlarea') {
$cssList .= '<link rel="stylesheet" type="text/css" href="assets/js/vendor/jhtmlarea/styles/jHtmlArea.css">';
continue;
}

Expand Down
4 changes: 2 additions & 2 deletions app/controllers/DashboardController.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public function dashboard()
$rightsRepo = Repos::makeRepo($this->app->config['db']['type'], 'Rights');
$userRights = new Rights($_SESSION['userInfo']['userid'], $rightsRepo);

$showCheesto = ($this->app->config['cheestoEnabled'] && $userRights->authorized('viewcheesto'));
$showCheesto = $userRights->authorized('viewcheesto');
$showLog = $userRights->authorized('viewlog');
$showCreateButton = $userRights->authorized('createlog');

Expand All @@ -24,7 +24,7 @@ public function dashboard()
$template->addData([
'showCheesto' => $showCheesto,
'showLog' => $showLog,
'createButton' => $showCreateButton ? '<button type="button" class="dButton cpButton" onClick="addFun.showaddinputs();">Add New Log</button>' : ''
'createButton' => $showCreateButton ? '<button type="button" class="button" id="create-log-button">Create New</button>' : ''
]);

$template->render('dashboard');
Expand Down
9 changes: 9 additions & 0 deletions app/controllers/SettingsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use \Dandelion\Template;
use \Dandelion\Utils\View;
use \Dandelion\Utils\Repos;
use \Dandelion\KeyManager;

class SettingsController extends BaseController
{
Expand All @@ -22,8 +23,16 @@ public function settings()
return View::getThemeList();
});

$key = '';
if ($this->app->config['publicApiEnabled']) {
$keyRepo = Repos::makeRepo($this->app->config['db']['type'], 'KeyManager');
$keyManager = new KeyManager($keyRepo);
$key = $keyManager->getKey($_SESSION['userInfo']['userid']);
}

$template->addData([
'publicApiEnabled' => $this->app->config['publicApiEnabled'],
'apiKey' => $key,
'userRights' => $userRights
]);

Expand Down
34 changes: 0 additions & 34 deletions app/templates/categories.php

This file was deleted.

95 changes: 60 additions & 35 deletions app/templates/dashboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,49 +2,74 @@
/**
* Dashboard page
*/
$this->layout('layouts::main', ['requiredCssFiles' => ['dashboard','cheesto','jqueryui']]);
$this->layout('layouts::main', ['requiredCssFiles' => ['dashboard', 'jqueryui', 'jhtmlarea']]);
?>
<!-- Begin Page Body -->
<div id="dashboard">
<?php if ($showLog): ?>
<div id="controlPanel">
<form>
<input type="search" id="searchquery" onKeyPress="return searchFun.check(event);" autocomplete="off"><span class="controlButtons"><!--
--><input type="button" value="Search" class="dButton cpButton" onClick="searchFun.searchlog();"><!--
--><?= $createButton ?></span>
</form>
<div id="add-edit-form">
<form>
Title: <input type="text" id="log-title" value="" size="60"><br><br>
<textarea id="log-body" cols="80" rows="10"></textarea><br>
<div>Category: <span id="categories"></span></div>
</form>
<div id="messages"></div>
</div>

<button type="button" class="section-title disabled" id="show-cheesto-button">Show Message Center</button>

<section id="messages-panel" class="messages-panel">
<?php if ($showCheesto): ?>
<div class="messages-cheesto">
<div class="messages-cheesto-header">
<span class="messages-title">Ĉeesto</span>

<div class="messages-controls">
<select id="status-select">
<option value="-1">Set Status:</option>
</select>
</div>
</div>

<div id="cheesto-status-table" class="messages-cheesto-content"></div>
</div>
<?php endif; ?>

<?php if ($showCheesto): ?>
<div id="presence">
<h3><a href="#" onClick="presence.showHideP();"><span id="showHide">[ - ]</span></a> &#264;eesto: <a href="mail"><img id="mailicon" src="assets/images/nomail.png" width="32" height="16" alt="No Mail"></a></h3>
<div class="messages-msg">
<div class="messages-msg-header">
<span class="messages-title">Messages</span>

<div id="mainPresence"></div>
<div class="messages-controls">
<button class="button" id="new-msg-button">New</button>
</div>
</div>
<?php endif;

if ($showLog): ?>
<div id="add_edit" title="">
<form id="add_edit_form">
Title: <input type="text" id="logTitle" name="logTitle" value="" size="60"><br><br>
<textarea id="logEntry" name="logEntry" cols="80" rows="10"></textarea><br>
<div class="categories">
Category: <span id="catSpace"></span>
</div>

<div id="msgs-table" class="messages-msg-content"></div>
</div>
</section>


<button type="button" class="section-title disabled" id="show-logs-button">Show Logs</button>

<section id="logs-panel" class="logs-panel">
<div class="control-panel">
<div class="search-console">
<input type="search" class="query-box" id="search-query" placeholder="Search" value="" autocomplete="off">
<button class="search-button" type="button" id="search-btn">Search</button>
</div>

<div class="top-controls">
<form>
<button type="button" class="button" id="prev-page-button">Prev</button>
<?= $createButton ?>
<button type="button" class="button button-right" id="next-page-button">Next</button>
<button type="button" class="button button-right" id="clear-search-button">Clear Search</button>
</form>
<div id="messages"></div>
</div>
<div id="dialogBox"></div>
</div>

<?php if ($showLog): ?>

<div id="logs">Loading journal...</div>

<div id="log-list">Loading logs...</div>
<?php endif; ?>
</div>
</section>

<?= $this->loadJS(['jquery','jqueryui','common','tinymce','cheesto','catManage','dashboard','mail']) ?>
<script type="text/javascript">
refreshFun.runFirst();
presence.checkstat(0);
mail.areUnread();
</script>
<!-- End Page Body -->
<?= $this->loadJS(['jquery', 'jqueryui', 'jhtmlarea', 'common', 'categories', 'dashboard']) ?>
99 changes: 0 additions & 99 deletions app/templates/editgroups.php

This file was deleted.

22 changes: 0 additions & 22 deletions app/templates/editusers.php

This file was deleted.

0 comments on commit 927a9a6

Please sign in to comment.