Commit 824aa072 authored by Tibor Katelbach's avatar Tibor Katelbach
Browse files

tweaks

parent 57a4bf7a
......@@ -90,43 +90,6 @@ function isUniqueUsername(username) {
return response;
}
function addCustomValidators() {
//Validate a postalCode
jQuery.validator.addMethod("validPostalCode", function(value, element) {
var response;
$.ajax({
url: baseUrl+'/'+moduleId+"/opendata/getcitiesbypostalcode/",
data: {postalCode: value},
type: 'post',
global: false,
async: false,
dataType: 'json',
success: function(data) {
response = data;
}
});
if (Object.keys(response).length > 0) {
return true;
} else {
return false;
}
}, "Code postal inconnu");
jQuery.validator.addMethod("validUserName", function(value, element) {
//Check authorized caracters
var usernameRegex = /^[a-zA-Z0-9]+$/;
var validUsername = value.match(usernameRegex);
if (validUsername == null) {
return false;
} else {
return true;
}
}, "Invalid username : Only characters A-Z, a-z, 0-9 and '-' are acceptable.");
jQuery.validator.addMethod("uniqueUserName", function(value, element) {
//Check unique username
return isUniqueUsername(value);
}, "A user with the same username already exists. Please choose an other one.");
}
......
......@@ -21,6 +21,7 @@ class ApiController extends Controller
public $pages = array(
"data"=> array(
"get" => array("href" => "/ph/api/data/get", "public" => true),
"tags" => array("href" => "/ph/api/data/tags", "public" => true),
),
"default"=> array(
"index" => array("href" => "/ph/api/default/index", "public" => true),
......
......@@ -8,9 +8,12 @@ class DataController extends ApiController {
public function actions(){
return array(
'get' => 'citizenToolKit.controllers.opendata.GetDataSwaggerAction',
'get' => 'citizenToolKit.controllers.opendata.GetDataSwaggerAction',
'tags' => 'citizenToolKit.controllers.tags.GetAction',
);
}
}
?>
\ No newline at end of file
......@@ -24,6 +24,7 @@ class DefaultController extends ApiController {
*/
public function actionIndex()
{
Yii::app()->theme = "ph-dori";
$this->layout = "//layouts/mainApi";
$this->render("index");
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment