Create simple layout for testing

This commit is contained in:
Eike Foken
2011-04-16 18:39:29 +02:00
parent cd405f8543
commit 1bb3832ecc
3 changed files with 124 additions and 0 deletions

View File

@@ -11,6 +11,13 @@ class Auth extends CI_Controller {
* Shows the index page. * Shows the index page.
*/ */
public function index() { public function index() {
$this->load->view('index');
}
/**
* Shows the index page.
*/
public function login() {
$this->load->view('auth/login'); $this->load->view('auth/login');
} }
@@ -20,6 +27,13 @@ class Auth extends CI_Controller {
public function do_login() { public function do_login() {
echo "{success: true}"; echo "{success: true}";
} }
/**
* Logs the user out.
*/
public function do_logout() {
echo "{success: true}";
}
} }
/* End of file auth.php */ /* End of file auth.php */

View File

@@ -3,6 +3,7 @@
<head> <head>
<title>Scattport</title> <title>Scattport</title>
<meta charset="utf-8" /> <meta charset="utf-8" />
<?=link_tag('assets/css/main.css');?>
<?=link_tag('assets/js/ext/resources/css/ext-all.css');?> <?=link_tag('assets/js/ext/resources/css/ext-all.css');?>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script>
<!-- ExtJS library: base/adapter --> <!-- ExtJS library: base/adapter -->

109
application/views/index.php Normal file
View File

@@ -0,0 +1,109 @@
<?php $this->load->view('header'); ?>
<script type="text/javascript">
var layoutLeft1 = new Ext.tree.TreePanel({
region: 'north',
title: "Projekte",
height: 250,
bodyStyle: 'margin-bottom: 6px;',
autoScroll: true,
enableDD: false,
rootVisible: false,
id: 'treePanel',
root: {
text: "Projekte",
expanded: true,
nodeType: 'async',
children: [{
text: 'Projekt 1',
expanded: false
}, {
text: 'Projekt 2',
expanded: false,
}]
}
});
var layoutLeft2 = new Ext.Panel({
region: 'center',
margin: '10 0 0 0',
autoScroll: true,
bodyStyle: 'padding: 10px; background: #eee;',
html: 'Test'
});
var toolbarCenter = new Ext.Toolbar({
items: ['->', {
icon: BASE_PATH + 'assets/images/icons/minus-circle.png',
text: 'Logout',
handler: logout
}]
});
var panelCenter = new Ext.TabPanel({
xtype: 'tabpanel',
resizeTabs: false,
minTabWidth: 115,
tabWidth: 135,
enableTabScroll: true,
layoutOnTabChange: true,
border: false,
activeItem: 'tab_welcome',
autoDestroy: false,
items: [{
xtype: 'panel',
id: 'tab_welcome',
bodyStyle: 'padding: 10px',
title: "Willkommen"
}]
});
var layoutCenter = new Ext.Panel({
id: 'content-panel',
region: 'center',
layout: 'card',
margins: '0 5 5 0',
activeItem: 0,
border: true,
tbar: toolbarCenter,
items: [panelCenter]
});
var layoutMain = new Ext.Viewport({
layout: 'border',
renderTo: Ext.getBody(),
items: [{
region: 'north',
autoHeight: true,
height: 100,
border: false,
html: '<div id="header">Scattport</div>',
margins: '0 0 5 0',
style: 'margin-bottom: 4px;'
}, {
region: 'west',
baseCls: 'x-plain',
xtype: 'panel',
autoHeight: true,
width: 180,
border: false,
split: true,
margins: '0 0 0 5',
items: [layoutLeft1, layoutLeft2]
}, layoutCenter]
});
function logout() {
Ext.Ajax.request({
url: BASE_URL + 'auth/do_logout',
method: 'post',
success: function(xhr) {
window.location = BASE_URL + 'auth/login';
}
});
}
layoutMain.show();
</script>
<?php $this->load->view('footer'); ?>