/
options.scala.html
146 lines (144 loc) · 7.27 KB
/
options.scala.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
@(repository: gitbucket.core.service.RepositoryService.RepositoryInfo, info: Option[Any])(implicit context: gitbucket.core.controller.Context)
@import gitbucket.core.view.helpers
@gitbucket.core.html.main("Settings", Some(repository)){
@gitbucket.core.html.menu("settings", repository){
@gitbucket.core.settings.html.menu("options", repository){
@gitbucket.core.helper.html.information(info)
<form id="form" method="post" action="@helpers.url(repository)/settings/options" validate="true">
<div class="panel panel-default">
<div class="panel-heading strong">Settings</div>
<div class="panel-body">
<fieldset class="form-group">
<label for="repositoryName" class="strong">Repository Name:</label>
<input type="text" name="repositoryName" id="repositoryName" class="form-control" value="@repository.name"/>
<span id="error-repositoryName" class="error"></span>
</fieldset>
<fieldset class="border-top form-group">
<label for="description" class="strong">Description:</label>
<input type="text" name="description" id="description" class="form-control" value="@repository.repository.description"/>
</fieldset>
<fieldset class="border-top">
<label class="radio">
<input type="radio" name="isPrivate" value="false"
@if(!repository.repository.isPrivate ){ checked }
@if(repository.repository.parentUserName.isDefined){ disabled }
>
<span class="strong"><i class="octicon octicon-repo"></i> Public</span><br>
<div class="normal muted">
Anyone can see this repository. You choose who can commit.
</div>
</label>
<label class="radio">
<input type="radio" name="isPrivate" value="true"
@if(repository.repository.isPrivate ){ checked }
@if(repository.repository.parentUserName.isDefined){ disabled }
>
<span class="strong"><i class="octicon octicon-lock"></i> Private</span><br>
<div class="normal muted">
You choose who can see and commit to this repository.
</div>
</label>
</fieldset>
<fieldset class="form-group">
<label class="checkbox" for="allowFork">
<input type="checkbox" id="allowFork" name="allowFork"@if(repository.repository.options.allowFork){ checked}/>
Forks<br>
<div class="normal muted">
Allow users who can access this repository to fork it.
</div>
</label>
</fieldset>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading strong">Issues</div>
<div class="panel-body">
<fieldset class="form-group">
<div class="radio">
<label>
<input type="radio" name="issuesOption" value="DISABLE" @if(repository.repository.options.issuesOption == "DISABLE"){ checked}> Disable issues tracking system
</label>
</div>
<div class="radio">
<label>
<input type="radio" name="issuesOption" value="PRIVATE" @if(repository.repository.options.issuesOption == "PRIVATE"){ checked}> Developers can view, create and comment on issues
</label>
</div>
<div class="radio">
<label>
<input type="radio" name="issuesOption" value="PUBLIC" @if(repository.repository.options.issuesOption == "PUBLIC"){ checked}> Developers and guests can view, create and comment on isues
</label>
</div>
<div class="radio for-public-repo">
<label>
<input type="radio" name="issuesOption" value="ALL" @if(repository.repository.options.issuesOption == "ALL"){ checked}> All users can view, create and comment on isues
</label>
</div>
<label for="externalIssuesUrl" class="strong">External URL:
<span class="normal muted">(Fill if you use an external issue tracking system for this project)</span>
</label>
<input type="text" class="form-control" id="externalIssuesUrl" name="externalIssuesUrl" value="@repository.repository.options.externalIssuesUrl"/>
</fieldset>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading strong">Wiki</div>
<div class="panel-body">
<fieldset class="form-group">
<div class="radio">
<label>
<input type="radio" name="wikiOption" value="DISABLE" @if(repository.repository.options.wikiOption == "DISABLE"){ checked}> Disable wiki
</label>
</div>
<div class="radio">
<label>
<input type="radio" name="wikiOption" value="PRIVATE" @if(repository.repository.options.wikiOption == "PRIVATE"){ checked}> Developers can view, create and edit wiki pages
</label>
</div>
<div class="radio">
<label>
<input type="radio" name="wikiOption" value="PUBLIC" @if(repository.repository.options.wikiOption == "PUBLIC"){ checked}> Developers and guests can view, create and edit wiki pages
</label>
</div>
<div class="radio for-public-repo">
<label>
<input type="radio" name="wikiOption" value="ALL" @if(repository.repository.options.issuesOption == "ALL"){ checked}> All users can view, create and comment on isues
</label>
</div>
<label for="externalWikiUrl" class="strong">External URL:
<span class="normal muted">(Fill if you use an external wiki for this project)</span>
</label>
<input type="text" class="form-control" id="externalWikiUrl" name="externalWikiUrl" value="@repository.repository.options.externalWikiUrl"/>
</fieldset>
</div>
</div>
<div class="align-right" style="margin-top: 20px;">
<input type="submit" class="btn btn-success" value="Apply changes"/>
</div>
</form>
}
}
}
<script>
$(function(){
updateFeatures();
$('input[name=isPrivate], input[name=issuesOption], input[name=wikiOption]').click(function(){
updateFeatures();
});
});
function updateFeatures() {
if($('input[name=isPrivate]:checked').val() == 'false'){
$('.for-public-repo').show();
} else {
if($('input[name=issuesOption]:checked').val() == 'ALL'){
$('input[name=issuesOption][value=PUBLIC]').prop('checked', true);
}
if($('input[name=wikiOption]:checked').val() == 'ALL'){
$('input[name=wikiOption][value=PUBLIC]').prop('checked', true);
}
$('.for-public-repo').hide();
}
$('#externalIssuesUrl').prop('disabled', $('input[name=issuesOption]:checked').val() != 'DISABLE');
$('#externalWikiUrl').prop('disabled', $('input[name=wikiOption]:checked').val() != 'DISABLE');
}
</script>