summaryrefslogtreecommitdiffstats
path: root/templates/repo/setting.tmpl
blob: 5572671c93320aa4afcaf35dc52997cdd7647449 (plain)
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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
{{template "base/head" .}}
{{template "base/navbar" .}}
{{template "repo/nav" .}}
{{template "repo/toolbar" .}}
<div id="body" class="container">
    <div id="user-setting-nav" class="col-md-3">
        <ul class="list-group">
            <li class="list-group-item active"><a href="/{{.Owner.Name}}/{{.Repository.Name}}/settings">Options</a></li>
            <!--<li class="list-group-item"><a href="#">Collaborators</a></li>
            <li class="list-group-item"><a href="#">Notifications</a></li>-->
        </ul>
    </div>

    <div id="repo-setting-container" class="col-md-9">
        {{template "base/alert" .}}
        <div class="panel panel-default">
            <div class="panel-heading">
                Repository Options
            </div>

            <div class="panel-body">
                <form action="/{{.Owner.Name}}/{{.Repository.Name}}/settings" method="post" class="form-horizontal">
                    {{.CsrfTokenHtml}}
                    <input type="hidden" name="action" value="update">
                    <div class="form-group">
                        <label class="col-md-3 text-right" for="repo-setting-name">Name</label>
                        <div class="col-md-9">
                            <input class="form-control" name="name" value="{{.Repository.Name}}" title="{{.Repository.Name}}" id="repo-setting-name"/>
                            <p class="help-block hidden"><span class="text-danger">Cautious : </span>your repository name is changing !</p>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-md-3 text-right">Description</label>
                        <div class="col-md-9">
                            <textarea class="form-control" name="desc" id="repo-desc" rows="3">{{.Repository.Description}}</textarea>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-md-3 text-right">Official Site</label>
                        <div class="col-md-9">
                            <input type="url" class="form-control" name="site" value="{{.Repository.Website}}" />
                        </div>
                    </div>
                    <hr>
                    <div class="form-group">
                        <label class="col-md-3 text-right">Default Branch</label>
                        <div class="col-md-3">
                            <select name="branch" id="repo-default-branch" class="form-control">
                                <option value="{{.Repository.DefaultBranch}}">{{.Repository.DefaultBranch}}</option>
                                {{range .Branches}}
                                {{if eq . $.Repository.DefaultBranch}}{{else}}<option value="{{.}}">{{.}}</option>{{end}}
                                {{end}}
                            </select>
                        </div>
                    </div>

                    {{if .Repository.IsMirror}}<div class="form-group">
                        <label class="col-md-3 text-right">Mirror Interval(hours)</label>
                        <div class="col-md-3">
                            <input class="form-control" name="interval" value="{{.MirrorInterval}}"/>
                        </div>
                    </div>{{end}}

                    <div class="form-group">
                        <div class="col-md-offset-3 col-md-9">
                            <div class="checkbox">
                                <label style="line-height: 15px;">
                                    <input type="checkbox" name="goget" {{if .Repository.IsGoget}}checked{{end}}>
                                    <strong>Enable 'go get' meta</strong>
                                </label>
                            </div>
                        </div>
                    </div>

                    <div class="form-group">
                        <div class="col-md-9 col-md-offset-3">
                            <button class="btn btn-primary" type="submit">Save Options</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>

        <div class="panel panel-warning">
            <div class="panel-heading">
                Danger Zone
            </div>
            
            <div class="panel-body">
                <button type="button" class="btn btn-default pull-right" href="#transfer-repository-modal" data-toggle="modal">
                    Transfer ownership 
                </button>
                <dd>
                    <dt>Transfer ownership</dt>
                    <dl>Transfer this repo to another user or to an organization where you have admin rights.</dl>
                </dd>

                <div class="modal fade" id="transfer-repository-modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
                    <div class="modal-dialog">
                        <form action="/{{.Owner.Name}}/{{.Repository.Name}}/settings" method="post" class="modal-content">
                            {{.CsrfTokenHtml}}
                            <input type="hidden" name="action" value="transfer">

                            <div class="modal-header">
                                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                                <h4 class="modal-title" id="myModalLabel">Do you really want to transfer this repo?</h4>
                            </div>

                            <div class="modal-body">
                                <div class="alert alert-warning">This is important, pay attention.</div>
                                <ul>
                                    <!-- <li>Transferring may be delayed until the new owner approves the transfer.</li> -->
                                    <!-- <li>If you are transferring into an org, teams <strong>will not be set</strong>.  An owner on the org will need to set teams for the repo.</li> -->
                                    <li>Admin rights will be transferred to the new owner, you <strong>will lose admin rights</strong>.</li>
                                    <!-- <li>Admin rights will be transferred to the new owner, you <strong>may lose admin rights</strong> if you are transferring into an organization account.</li> -->
                                    <li>Redirect entries <strong>will NOT be</strong> set up from the previous location.</li>
                                    <li>Git access <strong>will NOT continue</strong> to work from the previous location.</li>
                                </ul>
                                <div class="form-group">
                                    <label>Please type the name of the repository to confirm "<strong class="text-danger">{{.Repository.Name}}</strong>"</label>
                                    <input name="repository" class="form-control" type="text" placeholder="Type your repository name" required="required">
                                </div>

                                <div class="form-group">
                                    <label>Please type the name of the new owner:</label>
                                    <input name="owner" class="form-control" type="text" placeholder="Type new owner's name" required="required">
                                </div>
                            </div>

                            <div class="modal-footer">
                                <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
                                <button class="btn btn-danger btn-lg">I understand the consequences, transfer this repository</button>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
            <hr>
            <div class="panel-body">
                <button type="button" class="btn btn-default pull-right" href="#delete-repository-modal" data-toggle="modal">
                    Delete this repository
                </button>
                <dd>
                    <dt>Delete this repository</dt>
                    <dl>Once you delete a repository, there is no going back. Please be certain.</dl>
                </dd>

                <div class="modal fade" id="delete-repository-modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
                    <div class="modal-dialog">
                        <form action="/{{.Owner.Name}}/{{.Repository.Name}}/settings" method="post" class="modal-content">
                            {{.CsrfTokenHtml}}
                            <input type="hidden" name="action" value="delete">

                            <div class="modal-header">
                                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                                <h4 class="modal-title" id="myModalLabel">Delete repository</h4>
                            </div>

                            <div class="modal-body">
                                <div class="form-group">
                                    <label>Please enter your repository name "<strong class="text-danger">{{.Repository.Name}}</strong>"</label>
                                    <input name="repository" class="form-control" type="text" placeholder="Type your repository name" required="required">
                                </div>
                            </div>

                            <div class="modal-footer">
                                <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
                                <button class="btn btn-danger btn-lg">I understand the consequences, delete this repository</button>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
{{template "base/footer" .}}