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