From 5bbd0872bb6d1cef6863d0abed3613687b48ab57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20M=C3=BCller?= Date: Wed, 2 Apr 2014 20:37:38 +0200 Subject: [PATCH] registration gui --- app/Config/routes.php | 4 +++ app/Controller/Component/empty | 0 app/Model/DreamjobCompany.php | 13 +++++++++ app/Model/DreamjobWorker.php | 14 ++++++++- app/View/Home/home.ctp | 2 +- app/View/Layouts/default.ctp | 17 +++++++++-- app/webroot/css/dreamjob.css | 4 ++- app/webroot/js/dreamjob.js | 52 ++++++++++++++++++++-------------- 8 files changed, 79 insertions(+), 27 deletions(-) mode change 100755 => 100644 app/Controller/Component/empty diff --git a/app/Config/routes.php b/app/Config/routes.php index 1f0dcd9..03eda0f 100755 --- a/app/Config/routes.php +++ b/app/Config/routes.php @@ -31,6 +31,10 @@ Router::connect('/agb', array('controller' => 'home', 'action' => 'agb')); Router::connect('/contact', array('controller' => 'home', 'action' => 'contact')); + Router::connect('/registration', array('controller' => 'registration', 'action' => 'main')); + Router::connect('/registration/user', array('controller' => 'registration', 'action' => 'worker')); + Router::connect('/registration/company', array('controller' => 'registration', 'action' => 'company')); + Router::connect('/profil', array('controller' => 'user', 'action' => 'profil')); Router::connect('/profil/page/:page', array('controller' => 'user', 'action' => 'profil'),array("page" => "[0-9]+")); Router::connect('/profil/edit', array('controller' => 'user', 'action' => 'profil_edit')); diff --git a/app/Controller/Component/empty b/app/Controller/Component/empty old mode 100755 new mode 100644 diff --git a/app/Model/DreamjobCompany.php b/app/Model/DreamjobCompany.php index cd46a90..da0ad3c 100755 --- a/app/Model/DreamjobCompany.php +++ b/app/Model/DreamjobCompany.php @@ -38,6 +38,19 @@ class DreamjobCompany extends AppModel { public $displayField = 'djaccount_ptr_id'; + public function registration($data){ + $dataSource = $this->getDataSource(); + $dataSource->begin(); + if ($result) { + $dataSource->commit(); + return true; + } else { + $dataSource->rollback(); + } + return false; + } + + public function saveSettings($data){ $dataSource = $this->getDataSource(); $dataSource->begin(); diff --git a/app/Model/DreamjobWorker.php b/app/Model/DreamjobWorker.php index 79a8e8b..5639e78 100755 --- a/app/Model/DreamjobWorker.php +++ b/app/Model/DreamjobWorker.php @@ -38,7 +38,19 @@ class DreamjobWorker extends AppModel { */ public $displayField = 'djaccount_ptr_id'; - + public function registration($data){ + $dataSource = $this->getDataSource(); + $dataSource->begin(); + if ($result) { + $dataSource->commit(); + return true; + } else { + $dataSource->rollback(); + } + return false; + } + + public function saveSettings($data){ $dataSource = $this->getDataSource(); $dataSource->begin(); diff --git a/app/View/Home/home.ctp b/app/View/Home/home.ctp index c49938f..4d56efc 100755 --- a/app/View/Home/home.ctp +++ b/app/View/Home/home.ctp @@ -19,7 +19,7 @@ echo $this->Form->end(); echo "
"; if(!$isLoggedin){ - echo $this->Html->link(__('dreamjob.registration.to'),array('controller'=>'home', 'action'=>'home'),array("class" => "btn btn-primary")); + echo $this->Html->link(__('dreamjob.registration.to'),array('controller'=>'registration', 'action'=>'main'),array("class" => "btn btn-primary")); echo "
"; echo "
"; } diff --git a/app/View/Layouts/default.ctp b/app/View/Layouts/default.ctp index afca417..580a314 100755 --- a/app/View/Layouts/default.ctp +++ b/app/View/Layouts/default.ctp @@ -14,6 +14,20 @@ ?> +
Html->script(array('jquery.min','bootstrap.min','dreamjob')); + echo $this->Html->script(array('jquery.min', 'bootstrap.min', 'jquery-ui', 'dreamjob')); ?> - startIfEmpty('scriptEnd'); diff --git a/app/webroot/css/dreamjob.css b/app/webroot/css/dreamjob.css index d2c6b39..1d79171 100755 --- a/app/webroot/css/dreamjob.css +++ b/app/webroot/css/dreamjob.css @@ -406,7 +406,9 @@ body.loading #container{ color:black; box-shadow:none; } - +.modal-body,.modal-title{ + color:black; +} .infofield{ color:black; } diff --git a/app/webroot/js/dreamjob.js b/app/webroot/js/dreamjob.js index 1e367a0..065b805 100755 --- a/app/webroot/js/dreamjob.js +++ b/app/webroot/js/dreamjob.js @@ -4,26 +4,33 @@ */ var global_load = null; !function($) { - $(function() { - $body = $("body"); - $(document).on({ - ajaxStart: function() { $body.addClass("loading"); }, - ajaxStop: function() { $body.removeClass("loading"); } - }); - function event(where){ - $("#alert .alert").alert(); - $(where+'.dropdown-toggle').dropdown(); - - $(where+" a").each(function(that){ - if($(this).attr("rel")!=="external" && $(this).attr("ref")!=="eventOff") - $(this).click(function(e){ - load($(this).attr('href'),{},($(this).attr('rel')=="tab")); - return false; - }); - }); - - - $(where+" form").submit(function(e){ + $(function() { + $body = $("body"); + $(document).on({ + ajaxStart: function() { $body.addClass("loading"); }, + ajaxStop: function() { $body.removeClass("loading"); } + }); + function event(where){ + $("#alert .alert").alert(); + $("#popup").modal({'remote':false,'show':false}); + $("#popup").on('show.bs.modal',function(e){ + $.ajax({url:$(e.relatedTarget).attr("href"),success:function(data){ + $("#popup .modal-title").html($(e.relatedTarget).attr("title")); + $("#popup .modal-body").html($("#container div.box",data).html()); + } ,error:function(data){}}); + }); + + $(where+'.dropdown-toggle').dropdown(); + + $(where+" a").each(function(that){ + if($(this).attr("rel")!=="external" && $(this).attr("ref")!=="eventOff") + $(this).click(function(e){ + load($(this).attr('href'),{},($(this).attr('rel')=="tab")); + return false; + }); + }); + + $(where+" form").submit(function(e){ if(!$(this).hasClass("hide-form") && $(this).attr('enctype')!='multipart/form-data' ){ e.stopPropagation(); //e.preventDefault(); @@ -35,8 +42,8 @@ return false; } }); - - $("form[ enctype *= 'multipart/form-data' ]").each(function(evt){ + + $(where+" form[ enctype *= 'multipart/form-data' ]").each(function(evt){ if (!$('#fileUpload').length) $('body').append('