
revise newProject and project setting
@9c6525603a2c7f17fe62e5686a78051bf6b6e356
--- .gitignore
+++ .gitignore
... | ... | @@ -13,3 +13,4 @@ |
13 | 13 |
.idea* |
14 | 14 |
public/uploadFiles |
15 | 15 |
.DS_Store |
16 |
+repo/(No newline at end of file) |
--- app/views/project/newProject.scala.html
+++ app/views/project/newProject.scala.html
... | ... | @@ -21,6 +21,10 @@ |
21 | 21 |
'_label -> Messages("project.name"), |
22 | 22 |
'_help -> Messages("input.mandatory") |
23 | 23 |
) |
24 |
+ <div class="alert alert-danger hide" id="nameAlert"> |
|
25 |
+ <a class="close" data-dismiss="alert">×</a> |
|
26 |
+ <strong>@Messages("project.name.alert")</strong> |
|
27 |
+ </div> |
|
24 | 28 |
|
25 | 29 |
@textarea( |
26 | 30 |
newProjectForm("overview"), |
... | ... | @@ -56,20 +60,40 @@ |
56 | 60 |
'_text -> Messages("project.new.agreement"), |
57 | 61 |
'_showConstraints -> false |
58 | 62 |
) |
63 |
+ <div class="alert alert-danger hide" id="acceptAlert"> |
|
64 |
+ <a class="close" data-dismiss="alert">×</a> |
|
65 |
+ <strong>@Messages("project.delete.alert")</strong> |
|
66 |
+ </div> |
|
59 | 67 |
</fieldset> |
60 | 68 |
</div> |
61 | 69 |
<div class="row"> |
62 | 70 |
<div class="actions"> |
63 |
- <center><input type="submit" class="btn btn-primary" value="@Messages("project.create")"></center> |
|
71 |
+ <center><input type="submit" class="btn btn-primary" value="@Messages("project.create")" id="save"></center> |
|
64 | 72 |
</div> |
65 | 73 |
</div> |
66 | 74 |
} |
67 | 75 |
<script> |
68 |
- window.onload = function(){ |
|
76 |
+ $(document).ready(function(){ |
|
77 |
+ var reg_name = /^[a-zA-Z0-9_]*$/; |
|
78 |
+ $("#save").click(function() { |
|
79 |
+ if(!reg_name.test($("input[id='name']").val())) { |
|
80 |
+ $("#nameAlert").show(); |
|
81 |
+ return false; |
|
82 |
+ } |
|
83 |
+ |
|
84 |
+ if($("#accept").is(":not(:checked)")) { |
|
85 |
+ $("#acceptAlert").show(); |
|
86 |
+ return false; |
|
87 |
+ } |
|
88 |
+ |
|
89 |
+ return true; |
|
90 |
+ }); |
|
91 |
+ |
|
92 |
+ |
|
69 | 93 |
$("#project_name").popover(); |
70 | 94 |
$("#share_option_explanation").popover(); |
71 | 95 |
$("#terms").popover(); |
72 |
- } |
|
96 |
+ }) |
|
73 | 97 |
</script> |
74 | 98 |
|
75 | 99 |
|
--- app/views/project/setting.scala.html
+++ app/views/project/setting.scala.html
... | ... | @@ -5,7 +5,7 @@ |
5 | 5 |
|
6 | 6 |
|
7 | 7 |
@projectMngMain(message, projectInst) { |
8 |
- @form(action = routes.ProjectApp.saveSetting(projectInst.name), 'class -> "form-horizontal", 'enctype -> "multipart/form-data", 'id -> "saveSetting"){ |
|
8 |
+ @form(action = routes.ProjectApp.saveSetting(projectInst.name), 'class -> "form-horizontal", 'enctype -> "multipart/form-data", 'id -> "saveSetting"){ |
|
9 | 9 |
<div class="row"> |
10 | 10 |
<fieldset> |
11 | 11 |
<div class="icon-question-sign" href = "#" id="project_name" rel="popover" |
... | ... | @@ -17,6 +17,10 @@ |
17 | 17 |
'_label -> Messages("project.name"), |
18 | 18 |
'_help -> Messages("input.mandatory") |
19 | 19 |
) |
20 |
+ <div class="alert alert-danger hide" id="nameAlert"> |
|
21 |
+ <a class="close" data-dismiss="alert">×</a> |
|
22 |
+ <strong>@Messages("project.name.alert")</strong> |
|
23 |
+ </div> |
|
20 | 24 |
|
21 | 25 |
@textarea( |
22 | 26 |
projectForm("overview"), |
... | ... | @@ -40,6 +44,10 @@ |
40 | 44 |
projectForm("logoPath"), |
41 | 45 |
'_label -> Messages("project.logo") |
42 | 46 |
) |
47 |
+ <div class="alert alert-danger hide" id="logoTypeAlert"> |
|
48 |
+ <a class="close" data-dismiss="alert">×</a> |
|
49 |
+ <strong>@Messages("project.logo.alert")</strong> |
|
50 |
+ </div> |
|
43 | 51 |
|
44 | 52 |
<div class="icon-question-sign" href = "#" id="share_option_explanation" rel="popover" |
45 | 53 |
data-content="@Messages("project.shareOption.private.description")" |
... | ... | @@ -65,7 +73,10 @@ |
65 | 73 |
</div> |
66 | 74 |
} |
67 | 75 |
|
68 |
- |
|
76 |
+ <div class="alert alert-danger hide" id="deleteAcceptAlert"> |
|
77 |
+ <a class="close" data-dismiss="alert">×</a> |
|
78 |
+ <strong>@Messages("project.delete.alert")</strong> |
|
79 |
+ </div> |
|
69 | 80 |
<table class="table table-bordered"> |
70 | 81 |
<thead> |
71 | 82 |
<tr> |
... | ... | @@ -105,8 +116,8 @@ |
105 | 116 |
var reg = /\.(gif|bmp|jpg|jpeg|png)$/i; |
106 | 117 |
var reg_name = /^[a-zA-Z0-9_]*$/; |
107 | 118 |
$("input[id='logoPath']").change(function(){ |
108 |
- if (!reg.test($(this).val())) { |
|
109 |
- alert('@Messages("project.logo.alert")'); |
|
119 |
+ if (!reg.test($(this).val())) { |
|
120 |
+ $("#logoTypeAlert").show(); |
|
110 | 121 |
$(this).val(''); |
111 | 122 |
} else { |
112 | 123 |
return $("form[id='saveSetting']").submit(); |
... | ... | @@ -114,7 +125,7 @@ |
114 | 125 |
}); |
115 | 126 |
$("#save").click(function() { |
116 | 127 |
if(!reg_name.test($("input[id='name']").val())) { |
117 |
- alert('@Messages("project.name.alert")'); |
|
128 |
+ $("#nameAlert").show(); |
|
118 | 129 |
return false; |
119 | 130 |
} else { |
120 | 131 |
return true; |
... | ... | @@ -128,7 +139,7 @@ |
128 | 139 |
if($("#acceptDeletion").is(":checked")) { |
129 | 140 |
return true; |
130 | 141 |
}else { |
131 |
- alert('@Messages("project.delete.alert")'); |
|
142 |
+ $("#deleteAcceptAlert").show(); |
|
132 | 143 |
return false; |
133 | 144 |
} |
134 | 145 |
}); |
--- repo/git/abc.git/HEAD
... | ... | @@ -1,1 +0,0 @@ |
1 | -ref: refs/heads/master |
--- repo/git/abc.git/config
... | ... | @@ -1,5 +0,0 @@ |
1 | -[core] | |
2 | - repositoryformatversion = 0 | |
3 | - filemode = false | |
4 | - bare = true | |
5 | - logallrefupdates = false |
--- repo/git/dsfasdf13252153.git/HEAD
... | ... | @@ -1,1 +0,0 @@ |
1 | -ref: refs/heads/master |
--- repo/git/dsfasdf13252153.git/config
... | ... | @@ -1,5 +0,0 @@ |
1 | -[core] | |
2 | - repositoryformatversion = 0 | |
3 | - filemode = false | |
4 | - bare = true | |
5 | - logallrefupdates = false |
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?