##// END OF EJS Templates
repo: re-order creation/fork forms for better UX and consistency.
dan -
r2972:01a27b09 default
parent child Browse files
Show More
@@ -1,164 +1,164 b''
1 1 ## -*- coding: utf-8 -*-
2 2
3 3 ${h.secure_form(h.route_path('repo_create'), request=request)}
4 4 <div class="form">
5 5 <!-- fields -->
6 6 <div class="fields">
7 7 <div class="field">
8 8 <div class="label">
9 9 <label for="repo_name">${_('Name')}:</label>
10 10 </div>
11 11 <div class="input">
12 12 ${h.text('repo_name', class_="medium")}
13 13 <div class="info-block">
14 14 <a id="remote_clone_toggle" href="#"><i class="icon-download-alt"></i> ${_('Import Existing Repository ?')}</a>
15 15 </div>
16 16 %if not c.rhodecode_user.is_admin:
17 17 ${h.hidden('user_created',True)}
18 18 %endif
19 19 </div>
20 20 </div>
21 21 <div id="remote_clone" class="field" style="display: none;">
22 22 <div class="label">
23 23 <label for="clone_uri">${_('Clone from')}:</label>
24 24 </div>
25 25 <div class="input">
26 26 ${h.text('clone_uri', class_="medium")}
27 27 <span class="help-block">
28 28 <pre>
29 29 - The repository must be accessible over http:// or https://
30 30 - For Git projects it's recommended appending .git to the end of clone url.
31 31 - Make sure to select proper repository type from the below selector before importing it.
32 32 - If your HTTP[S] repository is not publicly accessible,
33 33 add authentication information to the URL: https://username:password@server.company.com/repo-name.
34 34 - The Git LFS/Mercurial Largefiles objects will not be imported.
35 35 - For very large repositories, it's recommended to manually copy them into the
36 36 RhodeCode <a href="${h.route_path('admin_settings_vcs', _anchor='vcs-storage-options')}">storage location</a> and run <a href="${h.route_path('admin_settings_mapping')}">Remap and Rescan</a>.
37 37 </pre>
38 38 </span>
39 39 </div>
40 40 </div>
41 41 <div class="field">
42 42 <div class="label">
43 <label for="repo_type">${_('Type')}:</label>
44 </div>
45 <div class="select">
46 ${h.select('repo_type','hg',c.backends)}
47 <span class="help-block">${_('Set the type of repository to create.')}</span>
48 </div>
49 </div>
50 <div class="field">
51 <div class="label">
43 52 <label for="repo_description">${_('Description')}:</label>
44 53 </div>
45 54 <div class="textarea editor">
46 55 ${h.textarea('repo_description')}
47 56 <% metatags_url = h.literal('''<a href="#metatagsShow" onclick="$('#meta-tags-desc').toggle();return false">meta-tags</a>''') %>
48 57 <span class="help-block">${_('Plain text format with support of {metatags}. Add a README file for longer descriptions').format(metatags=metatags_url)|n}</span>
49 58 <span id="meta-tags-desc" style="display: none">
50 59 <%namespace name="dt" file="/data_table/_dt_elements.mako"/>
51 60 ${dt.metatags_help()}
52 61 </span>
53 62 </div>
54 63 </div>
55 64 <div class="field">
56 65 <div class="label">
57 66 <label for="repo_group">${_('Repository Group')}:</label>
58 67 </div>
59 68 <div class="select">
60 69 ${h.select('repo_group',request.GET.get('parent_group'),c.repo_groups,class_="medium")}
61 70 % if c.personal_repo_group:
62 71 <a class="btn" href="#" id="select_my_group" data-personal-group-id="${c.personal_repo_group.group_id}">
63 72 ${_('Select my personal group (%(repo_group_name)s)') % {'repo_group_name': c.personal_repo_group.group_name}}
64 73 </a>
65 74 % endif
66 75 <span class="help-block">${_('Optionally select a group to put this repository into.')}</span>
67 76 </div>
68 77 </div>
78 <div class="field">
79 <div class="label">
80 <label for="repo_landing_rev">${_('Landing commit')}:</label>
81 </div>
82 <div class="select">
83 ${h.select('repo_landing_rev','',c.landing_revs,class_="medium")}
84 <span class="help-block">${_('The default commit for file pages, downloads, full text search index, and README generation.')}</span>
85 </div>
86 </div>
69 87 <div id="copy_perms" class="field">
70 88 <div class="label label-checkbox">
71 89 <label for="repo_copy_permissions">${_('Copy Parent Group Permissions')}:</label>
72 90 </div>
73 91 <div class="checkboxes">
74 92 ${h.checkbox('repo_copy_permissions', value="True", checked="checked")}
75 93 <span class="help-block">${_('Copy permission set from the parent repository group.')}</span>
76 94 </div>
77 95 </div>
78 96 <div class="field">
79 <div class="label">
80 <label for="repo_type">${_('Type')}:</label>
81 </div>
82 <div class="select">
83 ${h.select('repo_type','hg',c.backends)}
84 <span class="help-block">${_('Set the type of repository to create.')}</span>
85 </div>
86 </div>
87 <div class="field">
88 <div class="label">
89 <label for="repo_landing_rev">${_('Landing commit')}:</label>
90 </div>
91 <div class="select">
92 ${h.select('repo_landing_rev','',c.landing_revs,class_="medium")}
93 <span class="help-block">${_('The default commit for file pages, downloads, full text search index, and README generation.')}</span>
94 </div>
95 </div>
96 <div class="field">
97 97 <div class="label label-checkbox">
98 98 <label for="repo_private">${_('Private Repository')}:</label>
99 99 </div>
100 100 <div class="checkboxes">
101 101 ${h.checkbox('repo_private',value="True")}
102 102 <span class="help-block">${_('Private repositories are only visible to people explicitly added as collaborators.')}</span>
103 103 </div>
104 104 </div>
105 105 <div class="buttons">
106 106 ${h.submit('save',_('Save'),class_="btn")}
107 107 </div>
108 108 </div>
109 109 </div>
110 110 <script>
111 111 $(document).ready(function(){
112 112 var setCopyPermsOption = function(group_val){
113 113 if(group_val != "-1"){
114 114 $('#copy_perms').show()
115 115 }
116 116 else{
117 117 $('#copy_perms').hide();
118 118 }
119 119 };
120 120
121 121 $('#remote_clone_toggle').on('click', function(e){
122 122 $('#remote_clone').show();
123 123 e.preventDefault();
124 124 });
125 125
126 126 if($('#remote_clone input').hasClass('error')){
127 127 $('#remote_clone').show();
128 128 }
129 129 if($('#remote_clone input').val()){
130 130 $('#remote_clone').show();
131 131 }
132 132
133 133 $("#repo_group").select2({
134 134 'containerCssClass': "drop-menu",
135 135 'dropdownCssClass': "drop-menu-dropdown",
136 136 'dropdownAutoWidth': true,
137 137 'width': "resolve"
138 138 });
139 139
140 140 setCopyPermsOption($('#repo_group').val());
141 141 $("#repo_group").on("change", function(e) {
142 142 setCopyPermsOption(e.val)
143 143 });
144 144
145 145 $("#repo_type").select2({
146 146 'containerCssClass': "drop-menu",
147 147 'dropdownCssClass': "drop-menu-dropdown",
148 148 'minimumResultsForSearch': -1,
149 149 });
150 150 $("#repo_landing_rev").select2({
151 151 'containerCssClass': "drop-menu",
152 152 'dropdownCssClass': "drop-menu-dropdown",
153 153 'minimumResultsForSearch': -1,
154 154 });
155 155 $('#repo_name').focus();
156 156
157 157 $('#select_my_group').on('click', function(e){
158 158 e.preventDefault();
159 159 $("#repo_group").val($(this).data('personalGroupId')).trigger("change");
160 160 })
161 161
162 162 })
163 163 </script>
164 164 ${h.end_form()}
@@ -1,134 +1,134 b''
1 1 ## -*- coding: utf-8 -*-
2 2 <%inherit file="/base/base.mako"/>
3 3
4 4 <%def name="title()">
5 5 ${_('Fork repository %s') % c.repo_name}
6 6 %if c.rhodecode_name:
7 7 &middot; ${h.branding(c.rhodecode_name)}
8 8 %endif
9 9 </%def>
10 10
11 11 <%def name="breadcrumbs_links()">
12 12 ${_('New Fork')}
13 13 </%def>
14 14
15 15 <%def name="menu_bar_nav()">
16 16 ${self.menu_items(active='repositories')}
17 17 </%def>
18 18
19 19 <%def name="menu_bar_subnav()">
20 20 ${self.repo_menu(active='options')}
21 21 </%def>
22 22
23 23 <%def name="main()">
24 24 <div class="box">
25 25 <div class="title">
26 26 ${self.repo_page_title(c.rhodecode_db_repo)}
27 27 ${self.breadcrumbs()}
28 28 </div>
29 29
30 30 ${h.secure_form(h.route_path('repo_fork_create',repo_name=c.rhodecode_db_repo.repo_name), request=request)}
31 31 <div class="form">
32 32 <!-- fields -->
33 33 <div class="fields">
34 34
35 35 <div class="field">
36 36 <div class="label">
37 37 <label for="repo_name">${_('Fork name')}:</label>
38 38 </div>
39 39 <div class="input">
40 40 ${h.text('repo_name', class_="medium")}
41 41 ${h.hidden('repo_type',c.rhodecode_db_repo.repo_type)}
42 42 ${h.hidden('fork_parent_id',c.rhodecode_db_repo.repo_id)}
43 43 </div>
44 44 </div>
45 45
46 46 <div class="field">
47 47 <div class="label label-textarea">
48 48 <label for="description">${_('Description')}:</label>
49 49 </div>
50 50 <div class="textarea-repo textarea text-area editor">
51 51 ${h.textarea('description')}
52 52 <% metatags_url = h.literal('''<a href="#metatagsShow" onclick="$('#meta-tags-desc').toggle();return false">meta-tags</a>''') %>
53 53 <span class="help-block">${_('Plain text format with support of {metatags}. Add a README file for longer descriptions').format(metatags=metatags_url)|n}</span>
54 54 <span id="meta-tags-desc" style="display: none">
55 55 <%namespace name="dt" file="/data_table/_dt_elements.mako"/>
56 56 ${dt.metatags_help()}
57 57 </span>
58 58 </div>
59 59 </div>
60 60
61 61 <div class="field">
62 62 <div class="label">
63 63 <label for="repo_group">${_('Repository group')}:</label>
64 64 </div>
65 65 <div class="select">
66 66 ${h.select('repo_group','',c.repo_groups,class_="medium")}
67 67 % if c.personal_repo_group:
68 68 <a class="btn" href="#" id="select_my_group" data-personal-group-id="${c.personal_repo_group.group_id}">
69 69 ${_('Select my personal group (%(repo_group_name)s)') % {'repo_group_name': c.personal_repo_group.group_name}}
70 70 </a>
71 71 % endif
72 72 <span class="help-block">${_('Optionally select a group to put this repository into.')}</span>
73 73 </div>
74 74 </div>
75 75
76 76 <div class="field">
77 77 <div class="label">
78 78 <label for="landing_rev">${_('Landing commit')}:</label>
79 79 </div>
80 80 <div class="select">
81 81 ${h.select('landing_rev','',c.landing_revs,class_="medium")}
82 82 <span class="help-block">${_('Default commit for files page, downloads, whoosh and readme')}</span>
83 83 </div>
84 84 </div>
85 85
86 86 <div class="field">
87 87 <div class="label label-checkbox">
88 <label for="private">${_('Copy permissions')}:</label>
89 </div>
90 <div class="checkboxes">
91 ${h.checkbox('copy_permissions',value="True", checked="checked")}
92 <span class="help-block">${_('Copy permissions from forked repository')}</span>
93 </div>
94 </div>
95
96 <div class="field">
97 <div class="label label-checkbox">
88 98 <label for="private">${_('Private')}:</label>
89 99 </div>
90 100 <div class="checkboxes">
91 101 ${h.checkbox('private',value="True")}
92 102 <span class="help-block">${_('Private repositories are only visible to people explicitly added as collaborators.')}</span>
93 103 </div>
94 104 </div>
95 105
96 <div class="field">
97 <div class="label label-checkbox">
98 <label for="private">${_('Copy permissions')}:</label>
99 </div>
100 <div class="checkboxes">
101 ${h.checkbox('copy_permissions',value="True", checked="checked")}
102 <span class="help-block">${_('Copy permissions from forked repository')}</span>
103 </div>
104 </div>
105
106 106 <div class="buttons">
107 107 ${h.submit('',_('Fork this Repository'),class_="btn")}
108 108 </div>
109 109 </div>
110 110 </div>
111 111 ${h.end_form()}
112 112 </div>
113 113 <script>
114 114 $(document).ready(function(){
115 115 $("#repo_group").select2({
116 116 'dropdownAutoWidth': true,
117 117 'containerCssClass': "drop-menu",
118 118 'dropdownCssClass': "drop-menu-dropdown",
119 119 'width': "resolve"
120 120 });
121 121 $("#landing_rev").select2({
122 122 'containerCssClass': "drop-menu",
123 123 'dropdownCssClass': "drop-menu-dropdown",
124 124 'minimumResultsForSearch': -1
125 125 });
126 126 $('#repo_name').focus();
127 127
128 128 $('#select_my_group').on('click', function(e){
129 129 e.preventDefault();
130 130 $("#repo_group").val($(this).data('personalGroupId')).trigger("change");
131 131 })
132 132 })
133 133 </script>
134 134 </%def>
General Comments 0
You need to be logged in to leave comments. Login now