Skip to content

Commit

Permalink
Merge pull request #75 from flipside-org/frontend
Browse files Browse the repository at this point in the history
Frontend
  • Loading branch information
ricardoduplos committed Apr 1, 2014
2 parents 714a79e + 6ba4573 commit b9bcd23
Show file tree
Hide file tree
Showing 54 changed files with 2,728 additions and 798 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@
[submodule "assets/libs/enketo-core"]
path = assets/libs/enketo-core
url = [email protected]:MartijnR/enketo-core.git
[submodule "src/vendor/jquery-toastmessage"]
path = src/vendor/jquery-toastmessage
url = [email protected]:akquinet/jquery-toastmessage-plugin.git
3 changes: 3 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ module.exports = function(grunt) {

'assets/scripts/website.min.js': [
'src/vendor/chosen/chosen.jquery.min.js',
'src/vendor/jquery-toastmessage/src/main/javascript/jquery.toastmessage.js',
'src/scripts/*.js'
],
}
Expand All @@ -106,6 +107,7 @@ module.exports = function(grunt) {
files : {
'assets/styles/main.css' : [
'src/vendor/chosen/chosen.css',
'src/vendor/jquery-toastmessage/src/main/resources/css/jquery.toastmessage.css',
'src/temp/path_override.css',
'src/temp/main.css'
]
Expand All @@ -115,6 +117,7 @@ module.exports = function(grunt) {
files : {
'assets/styles/main.css' : [
'src/vendor/chosen/chosen.min.css',
'src/vendor/jquery-toastmessage/src/main/resources/css/jquery.toastmessage.css',
'src/temp/path_override.css',
'src/temp/main.css'
]
Expand Down
8 changes: 7 additions & 1 deletion application/config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
| path to your installation.
|
*/
//$config['base_url'] = 'http://dev/airwolf2.0/aw-datacollection/';
$config['base_url'] = 'http://192.168.99.10/work/aw-datacollection/';
//$config['base_url'] = '/work/aw-datacollection/';

/*
|--------------------------------------------------------------------------
Expand Down Expand Up @@ -384,5 +384,11 @@

$config['aw_respondents_per_page'] = 50;

/**
* Email settings and admin data
*/
$config['aw_admin_name'] = 'Aw-datacollection Admin';
$config['aw_admin_email'] = '[email protected]';

/* End of file config.php */
/* Location: ./application/config/config.php */
4 changes: 2 additions & 2 deletions application/config/routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
$route['survey/add'] = 'survey/survey_add';
$route['survey/(:num)'] = 'survey/survey_by_id/$1';
$route['survey/(:num)/edit'] = 'survey/survey_edit_by_id/$1';
$route['survey/delete'] = 'survey/survey_delete_by_id';
$route['survey/(:num)/delete'] = 'survey/survey_delete_by_id/$1';
$route['survey/(:num)/files/(xls|xml)'] = 'survey/survey_file_download/$1/$2';
$route['survey/(:num)/(testrun|data_collection)'] = 'survey/survey_enketo/$1/$2';
// respondents
Expand All @@ -74,7 +74,7 @@
// Users
$route['login'] = 'user/user_login';
$route['logout'] = 'user/user_logout';
$route['user'] = 'user/user_profile';
//$route['user'] = 'user/user_profile'; As of right now profiles are disabled.
$route['user/(:num)/edit'] = 'user/user_edit_by_id/$1';
$route['user/recover'] = 'user/user_recover_password';
$route['user/reset_password/(:any)'] = 'user/user_reset_password/$1';
Expand Down
25 changes: 18 additions & 7 deletions application/controllers/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,22 @@ class Index extends CI_Controller {
public function __construct() {
parent::__construct();
}

public function test() {
$this->load->view('base/html_start');
$this->load->view('frontend');
$this->load->view('base/html_end');
}

public function index() {
$this->load->view('base/html_start');
$this->load->view('navigation');
if (!is_logged()) {
redirect('login');
}
$this->load->model('survey_model');

$this->load->view('base/html_start');
$this->load->view('components/navigation', array('active_menu' => 'dashboard'));

// Use the same permissions for the list but use different statuses.
$surveys = array();
if (has_permission('view survey list any')) {
Expand All @@ -23,21 +33,22 @@ public function index() {
}

// TEMP
$data = '';
if ($surveys) {
$this->output->append_output('Your surveys:<br />');
$data = 'Your surveys:<br />';

foreach ($surveys as $survey) {
$this->output->append_output('-' . $survey->title . '<br />');
$data .= '-' . $survey->title . '<br />';
}

ob_start();
krumo($surveys);
$this->output->append_output(ob_get_clean());
$data .= ob_get_clean();

}
// /TEMP

$this->load->view('dashboard', array('data' => $data));
$this->load->view('base/html_end');
}
}
Expand Down
Loading

0 comments on commit b9bcd23

Please sign in to comment.