##// END OF EJS Templates
ux: additional capitalisation and string translation in integration templates
lisaq -
r646:22553ba2 default
parent child Browse files
Show More
@@ -1,40 +1,40 b''
1 1 ## -*- coding: utf-8 -*-
2 2 <%!
3 3 def inherit(context):
4 4 if context['c'].repo:
5 5 return "/admin/repos/repo_edit.html"
6 6 else:
7 7 return "/admin/settings/settings.html"
8 8 %>
9 9 <%inherit file="${inherit(context)}" />
10 10
11 11 <%def name="title()">
12 ${_('Integrations settings')}
12 ${_('Integrations Settings')}
13 13 %if c.rhodecode_name:
14 14 &middot; ${h.branding(c.rhodecode_name)}
15 15 %endif
16 16 </%def>
17 17
18 18 <%def name="breadcrumbs_links()">
19 19 ${h.link_to(_('Admin'),h.url('admin_home'))}
20 20 &raquo;
21 21 ${_('Integrations')}
22 22 </%def>
23 23
24 24 <%def name="menu_bar_nav()">
25 25 %if c.repo:
26 26 ${self.menu_items(active='repositories')}
27 27 %else:
28 28 ${self.menu_items(active='admin')}
29 29 %endif
30 30 </%def>
31 31
32 32 <%def name="menu_bar_subnav()">
33 33 %if c.repo:
34 34 ${self.repo_menu(active='options')}
35 35 %endif
36 36 </%def>
37 37
38 38 <%def name="main_content()">
39 39 ${next.body()}
40 40 </%def>
@@ -1,43 +1,43 b''
1 1 ## -*- coding: utf-8 -*-
2 2 <%inherit file="base.html"/>
3 3
4 4 <%def name="breadcrumbs_links()">
5 5 %if c.repo:
6 6 ${h.link_to('Settings',h.url('edit_repo', repo_name=c.repo.repo_name))}
7 7 &raquo;
8 8 ${h.link_to(_('Integrations'),request.route_url(route_name='repo_integrations_home', repo_name=c.repo.repo_name))}
9 9 &raquo;
10 10 ${h.link_to(current_IntegrationType.display_name,
11 11 request.route_url(route_name='repo_integrations_list',
12 12 repo_name=c.repo.repo_name,
13 13 integration=current_IntegrationType.key))}
14 14 %else:
15 15 ${h.link_to(_('Admin'),h.url('admin_home'))}
16 16 &raquo;
17 17 ${h.link_to(_('Settings'),h.url('admin_settings'))}
18 18 &raquo;
19 19 ${h.link_to(_('Integrations'),request.route_url(route_name='global_integrations_home'))}
20 20 &raquo;
21 21 ${h.link_to(current_IntegrationType.display_name,
22 22 request.route_url(route_name='global_integrations_list',
23 23 integration=current_IntegrationType.key))}
24 24 %endif
25 25 %if integration:
26 26 &raquo;
27 27 ${integration.name}
28 28 %endif
29 29 </%def>
30 30 <div class="panel panel-default">
31 31 <div class="panel-heading">
32 32 <h2 class="panel-title">
33 33 %if integration:
34 34 ${current_IntegrationType.display_name} - ${integration.name}
35 35 %else:
36 ${_('Create new %(integration_type)s integration') % {'integration_type': current_IntegrationType.display_name}}
36 ${_('Create New %(integration_type)s Integration') % {'integration_type': current_IntegrationType.display_name}}
37 37 %endif
38 38 </h2>
39 39 </div>
40 40 <div class="panel-body">
41 41 ${form.render() | n}
42 42 </div>
43 43 </div>
@@ -1,147 +1,147 b''
1 1 ## -*- coding: utf-8 -*-
2 2 <%inherit file="base.html"/>
3 3
4 4 <%def name="breadcrumbs_links()">
5 5 %if c.repo:
6 6 ${h.link_to('Settings',h.url('edit_repo', repo_name=c.repo.repo_name))}
7 7 %else:
8 8 ${h.link_to(_('Admin'),h.url('admin_home'))}
9 9 &raquo;
10 10 ${h.link_to(_('Settings'),h.url('admin_settings'))}
11 11 %endif
12 12 %if current_IntegrationType:
13 13 &raquo;
14 14 %if c.repo:
15 15 ${h.link_to(_('Integrations'),
16 16 request.route_url(route_name='repo_integrations_home',
17 17 repo_name=c.repo.repo_name))}
18 18 %else:
19 19 ${h.link_to(_('Integrations'),
20 20 request.route_url(route_name='global_integrations_home'))}
21 21 %endif
22 22 &raquo;
23 23 ${current_IntegrationType.display_name}
24 24 %else:
25 25 &raquo;
26 26 ${_('Integrations')}
27 27 %endif
28 28 </%def>
29 29 <div class="panel panel-default">
30 30 <div class="panel-heading">
31 <h3 class="panel-title">${_('Create new integration')}</h3>
31 <h3 class="panel-title">${_('Create New Integration')}</h3>
32 32 </div>
33 33 <div class="panel-body">
34 34 %if not available_integrations:
35 No integrations available
35 ${_('No integrations available.')}
36 36 %else:
37 37 %for integration in available_integrations:
38 38 <%
39 39 if c.repo:
40 40 create_url = request.route_url('repo_integrations_create',
41 41 repo_name=c.repo.repo_name,
42 42 integration=integration)
43 43 else:
44 44 create_url = request.route_url('global_integrations_create',
45 45 integration=integration)
46 46 %>
47 47 <a href="${create_url}" class="btn">
48 48 ${integration}
49 49 </a>
50 50 %endfor
51 51 %endif
52 52 </div>
53 53 </div>
54 54 <div class="panel panel-default">
55 55 <div class="panel-heading">
56 <h3 class="panel-title">${_('Current integrations')}</h3>
56 <h3 class="panel-title">${_('Current Integrations')}</h3>
57 57 </div>
58 58 <div class="panel-body">
59 59 <table class="rctable issuetracker">
60 60 <thead>
61 61 <tr>
62 62 <th>${_('Enabled')}</th>
63 63 <th>${_('Description')}</th>
64 64 <th>${_('Type')}</th>
65 65 <th>${_('Actions')}</th>
66 <th ></th>
66 <th></th>
67 67 </tr>
68 68 </thead>
69 69 <tbody>
70 70
71 71 %for integration_type, integrations in sorted(current_integrations.items()):
72 72 %for integration in sorted(integrations, key=lambda x: x.name):
73 73 <tr id="integration_${integration.integration_id}">
74 74 <td class="td-enabled">
75 75 %if integration.enabled:
76 76 <div class="flag_status approved pull-left"></div>
77 77 %else:
78 78 <div class="flag_status rejected pull-left"></div>
79 79 %endif
80 80 </td>
81 81 <td class="td-description">
82 82 ${integration.name}
83 83 </td>
84 84 <td class="td-regex">
85 85 ${integration.integration_type}
86 86 </td>
87 87 <td class="td-action">
88 88 %if integration_type not in available_integrations:
89 89 ${_('unknown integration')}
90 90 %else:
91 91 <%
92 92 if c.repo:
93 93 edit_url = request.route_url('repo_integrations_edit',
94 94 repo_name=c.repo.repo_name,
95 95 integration=integration.integration_type,
96 96 integration_id=integration.integration_id)
97 97 else:
98 98 edit_url = request.route_url('global_integrations_edit',
99 99 integration=integration.integration_type,
100 100 integration_id=integration.integration_id)
101 101 %>
102 102 <div class="grid_edit">
103 103 <a href="${edit_url}">${_('Edit')}</a>
104 104 </div>
105 105 <div class="grid_delete">
106 106 <a href="${edit_url}"
107 107 class="btn btn-link btn-danger delete_integration_entry"
108 108 data-desc="${integration.name}"
109 109 data-uid="${integration.integration_id}">
110 110 ${_('Delete')}
111 111 </a>
112 112 </div>
113 113 %endif
114 114 </td>
115 115 </tr>
116 116 %endfor
117 117 %endfor
118 118 <tr id="last-row"></tr>
119 119 </tbody>
120 120 </table>
121 121 </div>
122 122 </div>
123 123 <script type="text/javascript">
124 124 var delete_integration = function(entry) {
125 125 if (confirm("Confirm to remove this integration: "+$(entry).data('desc'))) {
126 126 var request = $.ajax({
127 127 type: "POST",
128 128 url: $(entry).attr('href'),
129 129 data: {
130 130 'delete': 'delete',
131 131 'csrf_token': CSRF_TOKEN
132 132 },
133 133 success: function(){
134 134 location.reload();
135 135 },
136 136 error: function(data, textStatus, errorThrown){
137 137 alert("Error while deleting entry.\nError code {0} ({1}). URL: {2}".format(data.status,data.statusText,$(entry)[0].url));
138 138 }
139 139 });
140 140 };
141 141 }
142 142
143 143 $('.delete_integration_entry').on('click', function(e){
144 144 e.preventDefault();
145 145 delete_integration(this);
146 146 });
147 147 </script> No newline at end of file
General Comments 0
You need to be logged in to leave comments. Login now