design sai_start

This commit is contained in:
Ulf Gebhardt 2018-01-27 21:24:24 +01:00
parent cce11a6657
commit e2f9d8e913
16 changed files with 132 additions and 166 deletions

View File

@ -14,7 +14,7 @@ namespace SYSTEM\SAI;
/**
* saimod_sys_config Class provided by System as saimod to display the config
*/
class saimod_sys_config extends \SYSTEM\SAI\SaiModule {
class saimod_sys_config extends \SYSTEM\SAI\sai_module {
/**
* Generate the HTML for the Saimods startpage
*

View File

@ -1,6 +1,6 @@
<div class="row">
<div class="col-12 sai_padding_off">
<h4 class="sai_padding_10 bg-primary sai_margin_off">&nbsp;<span class="fa fa-wrench" aria-hidden="true"></span>&nbsp;&nbsp;${sai_config_title}</h4>
<div class="col-12 sai_padding_10 bg-primary">
<h4 class="sai_margin_off">&nbsp;<span class="fa fa-wrench" aria-hidden="true"></span>&nbsp;&nbsp;${sai_config_title}</h4>
</div>
<div class="col-md-2 sai_padding_off">
<ul class="nav bg-light flex-column" id="tabs_config">

View File

@ -14,7 +14,7 @@ namespace SYSTEM\SAI;
/**
* saimod_sys_docu Class provided by System as saimod to display the code documentation
*/
class saimod_sys_docu extends \SYSTEM\SAI\SaiModule {
class saimod_sys_docu extends \SYSTEM\SAI\sai_module {
/**
* Generate the HTML for the Saimods startpage
*

View File

@ -14,7 +14,7 @@ namespace SYSTEM\SAI;
/**
* saimod_sys_git Class provided by System as saimod to display git information on the project and system
*/
class saimod_sys_git extends \SYSTEM\SAI\SaiModule {
class saimod_sys_git extends \SYSTEM\SAI\sai_module {
/**
* Generate the HTML for the Saimods startpage
*

View File

@ -14,7 +14,7 @@ namespace SYSTEM\SAI;
/**
* saimod_sys_log Class provided by System as saimod to manage the system_log table
*/
class saimod_sys_log extends \SYSTEM\SAI\SaiModule {
class saimod_sys_log extends \SYSTEM\SAI\sai_module {
/**
* Deletes the Log Entries
*

View File

@ -14,7 +14,7 @@ namespace SYSTEM\SAI;
/**
* saimod_sys_login Class provided by System as saimod to provide login/register functionality
*/
class saimod_sys_login extends \SYSTEM\SAI\SaiModule {
class saimod_sys_login extends \SYSTEM\SAI\sai_module {
/**
* Generate the HTML for the Saimods startpage
*

View File

@ -14,7 +14,7 @@ namespace SYSTEM\SAI;
/**
* saimod_sys_text Class provided by System as saimod to manage the system_text, system_text_tag table
*/
class saimod_sys_text extends \SYSTEM\SAI\SaiModule {
class saimod_sys_text extends \SYSTEM\SAI\sai_module {
/**
* Generate the HTML for the Saimods startpage
*

View File

@ -14,7 +14,7 @@ namespace SYSTEM\SAI;
/**
* saimod_sys_todo Class provided by System as saimod to manage the system_todo, system_todo_assign table
*/
class saimod_sys_todo extends \SYSTEM\SAI\SaiModule {
class saimod_sys_todo extends \SYSTEM\SAI\sai_module {
/** array Variable to store all registred todo_stats*/
private static $stats = array(); //only strings!

View File

@ -9,8 +9,6 @@ function getParameterByName(name, url) {
}
function init_saistart_sys_sai() {
// Set all Panels the same height
$(".inner-page").height(Math.max.apply(null, $(".inner-page").map(function(){return $(this).height();}).get()));
//jqBootstrapValidation
$("#login_form input").not("[type=submit]").jqBootstrapValidation({
preventSubmit: true,
@ -50,16 +48,4 @@ function init_saistart_sys_sai() {
}
});
};
function init_saistart_sys_sai_todo(){
$('#btn_search_todo').click(function(){
system.load($(this).attr('state')+$('#input_search_todo').val(),true);
});
}
function init_saistart_sys_sai_log(){
$('#btn_search_log').click(function(){
system.load($(this).attr('state')+$('#input_search_log').val(),true);
});
}
};

View File

@ -14,15 +14,13 @@ namespace SYSTEM\SAI;
/**
* saimod_sys_sai Class provided by System as start saimod to display an overview over the Project
*/
class saistart_sys_sai extends \SYSTEM\SAI\SaiModule {
class saistart_sys_sai extends \SYSTEM\SAI\sai_module {
/**
* Generate the HTML for the Saimods startpage
*
* @return string Returns HTML for the Saimods startpage
*/
public static function sai_mod__SYSTEM_SAI_saistart_sys_sai(){
if(!\SYSTEM\SECURITY\security::isLoggedIn() || !\SYSTEM\SECURITY\security::check(\SYSTEM\SECURITY\RIGHTS::SYS_SAI)){
return \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saistart_sys_sai/tpl/content_loggedout.tpl'))->SERVERPATH(),\SYSTEM\PAGE\text::tag(\SYSTEM\SQL\system_text::TAG_SAI_START));}
//create timestamp
$week_number = date("W", time());
$date = date("l M Y", time());
@ -30,6 +28,10 @@ class saistart_sys_sai extends \SYSTEM\SAI\SaiModule {
$vars = array();
$vars['week_number'] = $week_number;
$vars['date'] = $date;
if(!\SYSTEM\SECURITY\security::isLoggedIn() || !\SYSTEM\SECURITY\security::check(\SYSTEM\SECURITY\RIGHTS::SYS_SAI)){
return \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saistart_sys_sai/tpl/content_loggedout.tpl'))->SERVERPATH(),array_merge($vars,\SYSTEM\PAGE\text::tag(\SYSTEM\SQL\system_text::TAG_SAI_START)));}
$vars['project_name'] = \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_SAI_CONFIG_PROJECT);
$vars['project_url'] = \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEURL);
$vars['analytics'] = \SYSTEM\SAI\saimod_sys_log::analytics();
@ -37,12 +39,12 @@ class saistart_sys_sai extends \SYSTEM\SAI\SaiModule {
$vars['username'] = $user->username;
$vars['locale'] = $user->locale;
$vars['isadmin'] = \SYSTEM\SECURITY\security::check(\SYSTEM\SECURITY\RIGHTS::SYS_SAI) ? "yes" : "no";
$vars['userstats'] = '';
/*$vars['userstats'] = '';
$userstats = \SYSTEM\SQL\SYS_SAIMOD_TODO_STATS_USERS::QQ();
while($stat = $userstats->next()){
$stat['perc'] = round($stat['state_closed'] / ($stat['state_open']+$stat['state_closed']),2)*100;
$vars['userstats'] .= \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_todo/tpl/todo_stats_users_entry.tpl'))->SERVERPATH(), $stat);
}
}*/
\LIB\lib_git::php();
try{

View File

@ -1,115 +1,88 @@
<div class="row-fluid">
<div class="col-md-12">
<h4 class="muted"><b>${sai_start_welcome}</b></h4>
<div class="row">
<div class="col-12 sai_padding_off bg-primary sai_padding_10">
<h4 class="sai_margin_off" style="float:left;">&nbsp;<span class="fa fa-home" aria-hidden="true"></span>&nbsp;&nbsp;${sai_start_welcome}</h4>
<div id="sai_datetime" class="" style="float:right;">Week of the year: <font style="color: orange;">${week_number}</font>, ${date}</div>
</div>
<div class="col-md-12">
<h4 class="text-info">${sai_start_welcome_description}</h4>
</div>
</div>
<hr>
<div class="row-fluid">
<div class="col-md-12 sai_margin_bottom_20" id="sai_datetime">
Week of the year: <font style="color: orange;">${week_number}</font>, ${date}
</div>
</div>
<div class="row">
<div class="col-md-6">
<div id="project" class="card sai_gridbox">
<div class="card-header"><a href="#!config">${basic_project}</a></div>
<div class="card-body">
<div class="inner-page">
<b>${basic_name}:</b> ${project_name}<br/>
<b>${basic_url}:</b> <a href="${project_url}" target="_blank">${project_url}</a><br/>
<b>${basic_progress}:</b> ${project}%<br/>
<br/>
<table class="table table-hover table-condensed sai_table" style="width: 100%">
<tr>
<th>${table_username}</th>
<th>${table_open}</th>
<th>${table_closed}</th>
<th>${table_all}</th>
<th>${table_percentage}</th>
</tr>
${userstats}
</table>
</div>
<div class="row sai_padding_top_20">
<div class="col-md-6">
<div class="card h-100">
<div class="card-header"><a href="#!config">${basic_project}</a></div>
<div class="card-body">
<table class="table table-striped table-condensed sai_margin_off">
<tr>
<th>${basic_name}</th>
<td>${project_name}</td>
</tr>
<tr>
<th>${basic_url}</th>
<td><a href="${project_url}" target="_blank">${project_url}</a></td>
</tr>
<tr style="border-bottom: 1px solid #dee2e6;">
<th>${basic_progress}</th>
<td><a href="#!todo">${project}% | ${project_closed}/${project_all}</a></td>
</tr>
</table>
<!--<br/>
<table class="table table-hover table-condensed sai_table" style="width: 100%">
<tr>
<th>${table_username}</th>
<th>${table_open}</th>
<th>${table_closed}</th>
<th>${table_all}</th>
<th>${table_percentage}</th>
</tr>
${userstats}
</table>-->
</div>
</div>
</div>
</div>
</div>
<div class="col-md-6">
<div id="project" class="card sai_gridbox">
<div class="card-header"><a href="#!login">${basic_logout}</a></div>
<div class="card-body">
<div class="inner-page">
<table class="table sai_table table-hover table-condensed">
<tr>
<th>${basic_username}</th>
<td>${username}</td>
</tr>
<tr>
<th>${basic_locale}</th>
<td>${locale}</td>
</tr>
<tr>
<th>${basic_admin_rights}</th>
<td>${isadmin}</td>
</tr>
</table>
${basic_text_logout}
<form class="textbox" id="logout_form">
<div class="control-group">
<div class="help-block"></div>
<input type="hidden" />
<button class="btn btn-sm btn-primary" style="clear: left; height: 32px; font-size: 13px;" type="submit" id="logout_submit"><span class="glyphicon glyphicon-log-out" aria-hidden="true"></span> ${basic_logout}</button>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div id="analytics" class="col-md-6" style="margin-top: 25px;">
<div class="card sai_gridbox">
<div class="card-header"><a href="#!log(stats)">${basic_analytics}</a></div>
<div class="card-body">
<div class="inner-page">
${analytics}
</div>
</div>
</div>
</div>
<div class="col-md-6" style="margin-top: 25px;">
<div class="card sai_gridbox">
<div class="card-header"><a href="#!git">${basic_git}</a></div>
<div class="card-body">
<div class="inner-page">
${git}
</div>
<div class="col-md-6">
<div class="card h-100">
<div class="card-header"><a href="#!login">${basic_logout}</a></div>
<div class="card-body">
<table class="table sai_table table-hover table-condensed">
<tr>
<th>${basic_username}</th>
<td>${username}</td>
</tr>
<tr>
<th>${basic_locale}</th>
<td>${locale}</td>
</tr>
<tr>
<th>${basic_admin_rights}</th>
<td>${isadmin}</td>
</tr>
<tr>
<th>${basic_text_logout}</th>
<td>
<form class="textbox" id="logout_form">
<div class="control-group">
<input type="hidden" />
<button class="btn btn-sm btn-primary" style="clear: left; height: 32px; font-size: 13px;" type="submit" id="logout_submit"><span class="glyphicon glyphicon-log-out" aria-hidden="true"></span> ${basic_logout}</button>
</div>
</form>
</td>
</tr>
</table>
<div class="help-block"></div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row-fluid">
<div class="col-md-12 sai_padding_off" style="margin-top: 25px;">
<div class="card" id="todo">
<div class="card-header"><a href="#!todo">${basic_todo}</a></div>
<div class="card-body">
<b>${basic_status}:</b> ${project_closed}/${project_all}<br/>
<b>${basic_progress}:</b> ${project}%
<div id="todo_entries"></div>
<div class="row sai_padding_top_20 sai_padding_bottom_20">
<div class="col-md-6">
<div class="card h-100">
<div class="card-header"><a href="#!log(stats)">${basic_analytics}</a></div>
<div class="card-body">${analytics}</div>
</div>
</div>
</div>
</div>
</div>
<div class="row-fluid">
<div class="col-md-12 sai_padding_off" style="margin-top: 25px;">
<div class="card" id="log">
<div class="card-header"><a href="#!log">${basic_log}</a></div>
<div class="card-body">
<h4 class="muted">100 ${sai_log_latest_entries}</h4>
<div id="log_entries"></div>
<div class="col-md-6">
<div class="card h-100">
<div class="card-header"><a href="#!git">${basic_git}</a></div>
<div class="card-body">${git}</div>
</div>
</div>
</div>
</div>

View File

@ -1,26 +1,26 @@
<div clas="row-fluid">
<div class="col-md-12">
<h3 class="muted">Design. Simple. Fast. Reliable. Innovative.</h3>
<div class="row">
<div class="col-12 sai_padding_off bg-primary sai_padding_10">
<h4 class="sai_margin_off" style="float:left;">&nbsp;<span class="fa fa-home" aria-hidden="true"></span>&nbsp;&nbsp;${sai_start_welcome}</h4>
<div id="sai_datetime" class="" style="float:right;">Week of the year: <font style="color: orange;">${week_number}</font>, ${date}</div>
</div>
</div>
<div clas="row-fluid">
<div class="col-md-12">
<h4 class="text-info">We write awesome Software using <a href="https://github.com/ulfgebhardt/system">SYSTEM</a> and <a href="http://getbootstrap.com/">Twitter Bootstrap.</a></h4><hr>
<div class="col-md-2 sai_padding_off">
<ul class="nav bg-light flex-column" id="tabs_config">
<li class="nav-item"><a class="nav-link active" href="#!start">Login</a></li>
<li class="nav-item"><a class="nav-link" href="#!login(register)">Register</a></li>
<li class="nav-item"><a class="nav-link" href="#!login(resetpassword)">Reset Password</a></li>
</ul>
</div>
</div>
<div clas="row-fluid">
<div class="col-md-4">
<div id="project" class="panel panel-default sai_gridbox">
<div class="panel-heading"><a href="#!login">${basic_login}</a></div>
<div class="panel-body">
${basic_text_login}
<br/>
<br/>
<div class="col-md-10 sai_padding_off sai_border_left">
<div class="row sai_margin_off">
<div class="col-md-4"></div>
<div class="col-md-4">
<div class="card sai_margin_20">
<div class="card-header">${basic_text_login}</div>
<div class="card-body">
<form class="textbox" style="" id="login_form">
<div class="input-group">
<div class="controls">
<div class="controls w-100">
<input type="text"
size="30"
style="margin-bottom: 15px;"
id="bt_login_user"
class="form-control"
@ -29,23 +29,27 @@
maxlength="32" data-validation-maxlength-message="${basic_username_long}"
required data-validation-required-message="${basic_username_miss}"/>
</div>
<div class="controls">
<div class="controls w-100">
<input type="password"
size="30"
style="margin-bottom: 15px;"
id="bt_login_password"
class="form-control"
placeholder="${basic_placeholder_password}"
minlength="5" data-validation-minlength-message="${basic_password_short}"
required data-validation-required-message="${basic_password_miss}"/>
</div>
<div class="help-block"></div>
<input type="hidden" />
<button class="btn-sm btn btn-primary" style="clear: left; height: 32px; font-size: 13px;"
type="submit"
id="login_submit"><span class="glyphicon glyphicon-log-in" aria-hidden="true"></span> ${basic_login}</button>
</div>
<div class="w-100">
<button class="btn-sm btn btn-primary" style="height: 32px; font-size: 13px;" type="submit" id="login_submit">
<span class="glyphicon glyphicon-log-in" aria-hidden="true"></span> ${basic_login}
</button>
<div class="help-block"></div>
</div>
</div>
</form>
</div>
</div>
</div>
<div class="col-md-4"></div>
</div>
</div>
</div>
</div>

View File

@ -10,6 +10,7 @@
<style>
.sai_menu li a.active, #menu_start.active{
background-color: #007bff!important;
color: black;
}
</style>
<style>

View File

@ -29,7 +29,7 @@ class sai {
private static function check_module($module){
if( !\class_exists($module) ||
!\is_array($parents = \class_parents($module)) ||
!\array_search('SYSTEM\SAI\SaiModule', $parents)){
!\array_search('SYSTEM\SAI\sai_module', $parents)){
return false;}
return true;}

View File

@ -14,7 +14,7 @@ namespace SYSTEM\SAI;
/**
* saigui Class provided by System to handle sai userinterface. Invoke (new saigui)->html()
*/
class saigui {
class sai_gui {
/** string field in post or get to be read as saimod modifier */
const SAI_MOD_POSTFIELD = 'sai_mod';
@ -41,6 +41,6 @@ class saigui {
} else {
return '<script type="text/javascript"> window.location = "./sai.php?redirect="+JSON.stringify(system.cur_state());</script>';}
} else {
return \SYSTEM\API\api::run('\SYSTEM\API\verify', '\SYSTEM\SAI\SaiModule', $pg, 42, false, true);}
return \SYSTEM\API\api::run('\SYSTEM\API\verify', '\SYSTEM\SAI\sai_module', $pg, 42, false, true);}
}
}

View File

@ -14,7 +14,7 @@ namespace SYSTEM\SAI;
/**
* SaiModule Class provided by System to be etended by Saimods
*/
class SaiModule extends \SYSTEM\API\api_default{
class sai_module extends \SYSTEM\API\api_default{
/**
* Get the Api Group this Api is operating on
*