summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorValery Sizov <vsv2711@gmail.com>2012-01-07 13:24:23 +0200
committerValery Sizov <vsv2711@gmail.com>2012-01-07 13:24:23 +0200
commitfb3815b28af492bd51db7a292d79aea487dc82cc (patch)
treee1fa9d5bca67a8fffe5e5332f8b2715f38107fbd
parent9d0794df15255ae671ed0d42acef928f78fd2797 (diff)
parent97e74c5bde3269d4760b55971e7c06b42679f422 (diff)
downloadgitlab-ce-fb3815b28af492bd51db7a292d79aea487dc82cc.tar.gz
Merge branch 'feature_311'
-rw-r--r--app/views/projects/_form.html.haml12
-rw-r--r--app/views/projects/new.html.haml13
2 files changed, 19 insertions, 6 deletions
diff --git a/app/views/projects/_form.html.haml b/app/views/projects/_form.html.haml
index 788c2b462c2..2fc6f9d9a9a 100644
--- a/app/views/projects/_form.html.haml
+++ b/app/views/projects/_form.html.haml
@@ -59,13 +59,13 @@
:javascript
- $('.new_project, .edit_project').bind('ajax:before', function() {
- $(this).find(".form_content").hide();
- $('.ajax_loader').show();
- });
-
-:javascript
$(function(){
+ $('.new_project, .edit_project').bind('ajax:before', function() {
+ $(this).find(".form_content").hide();
+ $('.ajax_loader').show();
+ });
+
taggifyForm();
+
$('form #project_default_branch').chosen();
})
diff --git a/app/views/projects/new.html.haml b/app/views/projects/new.html.haml
index 1678ba5d940..02ddc683851 100644
--- a/app/views/projects/new.html.haml
+++ b/app/views/projects/new.html.haml
@@ -8,3 +8,16 @@
%div.clear
= render 'form'
+
+:javascript
+ $(function(){
+ $("#project_name").change(function(){
+ var slug = slugify($(this).val());
+ $("#project_code").val(slug);
+ $("#project_path").val(slug);
+ });
+ });
+
+ function slugify(text) {
+ return text.replace(/[^-a-zA-Z0-9]+/g, '_').toLowerCase();
+ }