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