diff --git a/module/repo/js/create.js b/module/repo/js/create.js new file mode 100644 index 0000000000..2e37eed12e --- /dev/null +++ b/module/repo/js/create.js @@ -0,0 +1,12 @@ +$(function() +{ + scmChanged(scm); +}); + +function scmChanged(scm) { + if(scm == 'Git') { + $('.account-fields').addClass('hidden'); + } else { + $('.account-fields').removeClass('hidden'); + } +} \ No newline at end of file diff --git a/module/repo/js/edit.js b/module/repo/js/edit.js new file mode 100644 index 0000000000..2e37eed12e --- /dev/null +++ b/module/repo/js/edit.js @@ -0,0 +1,12 @@ +$(function() +{ + scmChanged(scm); +}); + +function scmChanged(scm) { + if(scm == 'Git') { + $('.account-fields').addClass('hidden'); + } else { + $('.account-fields').removeClass('hidden'); + } +} \ No newline at end of file diff --git a/module/repo/view/create.html.php b/module/repo/view/create.html.php index 62b21c074c..050e8db2b0 100644 --- a/module/repo/view/create.html.php +++ b/module/repo/view/create.html.php @@ -12,6 +12,8 @@ ?> + +
@@ -26,7 +28,8 @@ repo->type; ?> - repo->scmList, 'git', "class='form-control'"); ?> + repo->scmList, 'Git', + "onchange='scmChanged(this.value)' class='form-control'"); ?> @@ -49,11 +52,11 @@ repo->example->client;?> - + repo->account;?> - + repo->password;?> diff --git a/module/repo/view/edit.html.php b/module/repo/view/edit.html.php index 5ac37ef974..666d47bd9b 100644 --- a/module/repo/view/edit.html.php +++ b/module/repo/view/edit.html.php @@ -12,6 +12,8 @@ ?> +SCM)?> +
@@ -26,7 +28,8 @@ repo->type; ?> - repo->scmList, $repo->SCM, "class='form-control'"); ?> + repo->scmList, $repo->SCM, + "onchange='scmChanged(this.value)' class='form-control'"); ?> @@ -49,11 +52,11 @@ client, "class='form-control'")?> repo->example->client;?> - + repo->account;?> account, "class='form-control'");?> - + repo->password;?> password, "class='form-control'");?>