Show More
@@ -1,556 +1,556 b'' | |||||
1 | ## -*- coding: utf-8 -*- |
|
1 | ## -*- coding: utf-8 -*- | |
2 | <%inherit file="root.html"/> |
|
2 | <%inherit file="root.html"/> | |
3 |
|
3 | |||
4 | <!-- CONTENT --> |
|
4 | <!-- CONTENT --> | |
5 | <div id="content" class="container-fluid"> |
|
5 | <div id="content" class="container-fluid"> | |
6 | ${self.flash_msg()} |
|
6 | ${self.flash_msg()} | |
7 | <div id="main"> |
|
7 | <div id="main"> | |
8 | ${next.main()} |
|
8 | ${next.main()} | |
9 | </div> |
|
9 | </div> | |
10 | </div> |
|
10 | </div> | |
11 | <!-- END CONTENT --> |
|
11 | <!-- END CONTENT --> | |
12 |
|
12 | |||
13 | <!-- FOOTER --> |
|
13 | <!-- FOOTER --> | |
14 | <div class="footer navbar navbar-inverse"> |
|
14 | <div class="footer navbar navbar-inverse"> | |
15 | <span class="navbar-text pull-left"> |
|
15 | <span class="navbar-text pull-left"> | |
16 | ${_('Server instance: %s') % c.instance_id if c.instance_id else ''} |
|
16 | ${_('Server instance: %s') % c.instance_id if c.instance_id else ''} | |
17 | </span> |
|
17 | </span> | |
18 | <span class="navbar-text pull-right"> |
|
18 | <span class="navbar-text pull-right"> | |
19 | This site is powered by |
|
19 | This site is powered by | |
20 | %if c.visual.show_version: |
|
20 | %if c.visual.show_version: | |
21 | <a class="navbar-link" href="${h.url('kallithea_project_url')}" target="_blank">Kallithea</a> ${c.kallithea_version}, |
|
21 | <a class="navbar-link" href="${h.url('kallithea_project_url')}" target="_blank">Kallithea</a> ${c.kallithea_version}, | |
22 | %else: |
|
22 | %else: | |
23 | <a class="navbar-link" href="${h.url('kallithea_project_url')}" target="_blank">Kallithea</a>, |
|
23 | <a class="navbar-link" href="${h.url('kallithea_project_url')}" target="_blank">Kallithea</a>, | |
24 | %endif |
|
24 | %endif | |
25 | which is |
|
25 | which is | |
26 | <a class="navbar-link" href="${h.canonical_url('about')}#copyright">© 2010–2018 by various authors & licensed under GPLv3</a>. |
|
26 | <a class="navbar-link" href="${h.canonical_url('about')}#copyright">© 2010–2018 by various authors & licensed under GPLv3</a>. | |
27 | %if c.issues_url: |
|
27 | %if c.issues_url: | |
28 | – <a class="navbar-link" href="${c.issues_url}" target="_blank">${_('Support')}</a> |
|
28 | – <a class="navbar-link" href="${c.issues_url}" target="_blank">${_('Support')}</a> | |
29 | %endif |
|
29 | %endif | |
30 | </span> |
|
30 | </span> | |
31 | </div> |
|
31 | </div> | |
32 |
|
32 | |||
33 | <!-- END FOOTER --> |
|
33 | <!-- END FOOTER --> | |
34 |
|
34 | |||
35 | ### MAKO DEFS ### |
|
35 | ### MAKO DEFS ### | |
36 |
|
36 | |||
37 | <%block name="branding_title"> |
|
37 | <%block name="branding_title"> | |
38 | %if c.site_name: |
|
38 | %if c.site_name: | |
39 | · ${c.site_name} |
|
39 | · ${c.site_name} | |
40 | %endif |
|
40 | %endif | |
41 | </%block> |
|
41 | </%block> | |
42 |
|
42 | |||
43 | <%def name="flash_msg()"> |
|
43 | <%def name="flash_msg()"> | |
44 | <%include file="/base/flash_msg.html"/> |
|
44 | <%include file="/base/flash_msg.html"/> | |
45 | </%def> |
|
45 | </%def> | |
46 |
|
46 | |||
47 | <%def name="breadcrumbs()"> |
|
47 | <%def name="breadcrumbs()"> | |
48 |
<div class=" |
|
48 | <div class="panel-title"> | |
49 | ${self.breadcrumbs_links()} |
|
49 | ${self.breadcrumbs_links()} | |
50 | </div> |
|
50 | </div> | |
51 | </%def> |
|
51 | </%def> | |
52 |
|
52 | |||
53 | <%def name="admin_menu()"> |
|
53 | <%def name="admin_menu()"> | |
54 | <ul class="dropdown-menu" role="menu"> |
|
54 | <ul class="dropdown-menu" role="menu"> | |
55 | <li><a href="${h.url('admin_home')}"><i class="icon-book"></i>${_('Admin Journal')}</a></li> |
|
55 | <li><a href="${h.url('admin_home')}"><i class="icon-book"></i>${_('Admin Journal')}</a></li> | |
56 | <li><a href="${h.url('repos')}"><i class="icon-database"></i>${_('Repositories')}</a></li> |
|
56 | <li><a href="${h.url('repos')}"><i class="icon-database"></i>${_('Repositories')}</a></li> | |
57 | <li><a href="${h.url('repos_groups')}"><i class="icon-folder"></i>${_('Repository Groups')}</a></li> |
|
57 | <li><a href="${h.url('repos_groups')}"><i class="icon-folder"></i>${_('Repository Groups')}</a></li> | |
58 | <li><a href="${h.url('users')}"><i class="icon-user"></i>${_('Users')}</a></li> |
|
58 | <li><a href="${h.url('users')}"><i class="icon-user"></i>${_('Users')}</a></li> | |
59 | <li><a href="${h.url('users_groups')}"><i class="icon-users"></i>${_('User Groups')}</a></li> |
|
59 | <li><a href="${h.url('users_groups')}"><i class="icon-users"></i>${_('User Groups')}</a></li> | |
60 | <li><a href="${h.url('admin_permissions')}"><i class="icon-block"></i>${_('Default Permissions')}</a></li> |
|
60 | <li><a href="${h.url('admin_permissions')}"><i class="icon-block"></i>${_('Default Permissions')}</a></li> | |
61 | <li><a href="${h.url('auth_home')}"><i class="icon-key"></i>${_('Authentication')}</a></li> |
|
61 | <li><a href="${h.url('auth_home')}"><i class="icon-key"></i>${_('Authentication')}</a></li> | |
62 | <li><a href="${h.url('defaults')}"><i class="icon-wrench"></i>${_('Repository Defaults')}</a></li> |
|
62 | <li><a href="${h.url('defaults')}"><i class="icon-wrench"></i>${_('Repository Defaults')}</a></li> | |
63 | <li class="last"><a href="${h.url('admin_settings')}"><i class="icon-gear"></i>${_('Settings')}</a></li> |
|
63 | <li class="last"><a href="${h.url('admin_settings')}"><i class="icon-gear"></i>${_('Settings')}</a></li> | |
64 | </ul> |
|
64 | </ul> | |
65 |
|
65 | |||
66 | </%def> |
|
66 | </%def> | |
67 |
|
67 | |||
68 |
|
68 | |||
69 | ## admin menu used for people that have some admin resources |
|
69 | ## admin menu used for people that have some admin resources | |
70 | <%def name="admin_menu_simple(repositories=None, repository_groups=None, user_groups=None)"> |
|
70 | <%def name="admin_menu_simple(repositories=None, repository_groups=None, user_groups=None)"> | |
71 | <ul class="dropdown-menu" role="menu"> |
|
71 | <ul class="dropdown-menu" role="menu"> | |
72 | %if repositories: |
|
72 | %if repositories: | |
73 | <li><a href="${h.url('repos')}"><i class="icon-database"></i>${_('Repositories')}</a></li> |
|
73 | <li><a href="${h.url('repos')}"><i class="icon-database"></i>${_('Repositories')}</a></li> | |
74 | %endif |
|
74 | %endif | |
75 | %if repository_groups: |
|
75 | %if repository_groups: | |
76 | <li><a href="${h.url('repos_groups')}"><i class="icon-folder"></i>${_('Repository Groups')}</a></li> |
|
76 | <li><a href="${h.url('repos_groups')}"><i class="icon-folder"></i>${_('Repository Groups')}</a></li> | |
77 | %endif |
|
77 | %endif | |
78 | %if user_groups: |
|
78 | %if user_groups: | |
79 | <li><a href="${h.url('users_groups')}"><i class="icon-users"></i>${_('User Groups')}</a></li> |
|
79 | <li><a href="${h.url('users_groups')}"><i class="icon-users"></i>${_('User Groups')}</a></li> | |
80 | %endif |
|
80 | %endif | |
81 | </ul> |
|
81 | </ul> | |
82 | </%def> |
|
82 | </%def> | |
83 |
|
83 | |||
84 | <%def name="repolabel(repo)"> |
|
84 | <%def name="repolabel(repo)"> | |
85 | %if h.is_hg(repo): |
|
85 | %if h.is_hg(repo): | |
86 | <span class="label label-repo" title="${_('Mercurial repository')}">hg</span> |
|
86 | <span class="label label-repo" title="${_('Mercurial repository')}">hg</span> | |
87 | %endif |
|
87 | %endif | |
88 | %if h.is_git(repo): |
|
88 | %if h.is_git(repo): | |
89 | <span class="label label-repo" title="${_('Git repository')}">git</span> |
|
89 | <span class="label label-repo" title="${_('Git repository')}">git</span> | |
90 | %endif |
|
90 | %endif | |
91 | </%def> |
|
91 | </%def> | |
92 |
|
92 | |||
93 | <%def name="repo_context_bar(current=None, rev=None)"> |
|
93 | <%def name="repo_context_bar(current=None, rev=None)"> | |
94 | <% rev = None if rev == 'tip' else rev %> |
|
94 | <% rev = None if rev == 'tip' else rev %> | |
95 | <!--- CONTEXT BAR --> |
|
95 | <!--- CONTEXT BAR --> | |
96 | <nav id="context-bar" class="navbar navbar-inverse"> |
|
96 | <nav id="context-bar" class="navbar navbar-inverse"> | |
97 | <div class="container-fluid"> |
|
97 | <div class="container-fluid"> | |
98 | <div class="navbar-header"> |
|
98 | <div class="navbar-header"> | |
99 | <div class="navbar-brand"> |
|
99 | <div class="navbar-brand"> | |
100 | ${repolabel(c.db_repo)} |
|
100 | ${repolabel(c.db_repo)} | |
101 |
|
101 | |||
102 | ## public/private |
|
102 | ## public/private | |
103 | %if c.db_repo.private: |
|
103 | %if c.db_repo.private: | |
104 | <i class="icon-lock"></i> |
|
104 | <i class="icon-lock"></i> | |
105 | %else: |
|
105 | %else: | |
106 | <i class="icon-globe"></i> |
|
106 | <i class="icon-globe"></i> | |
107 | %endif |
|
107 | %endif | |
108 | %for group in c.db_repo.groups_with_parents: |
|
108 | %for group in c.db_repo.groups_with_parents: | |
109 | ${h.link_to(group.name, url('repos_group_home', group_name=group.group_name), class_='navbar-link')} |
|
109 | ${h.link_to(group.name, url('repos_group_home', group_name=group.group_name), class_='navbar-link')} | |
110 | » |
|
110 | » | |
111 | %endfor |
|
111 | %endfor | |
112 | ${h.link_to(c.db_repo.just_name, url('summary_home', repo_name=c.db_repo.repo_name), class_='navbar-link')} |
|
112 | ${h.link_to(c.db_repo.just_name, url('summary_home', repo_name=c.db_repo.repo_name), class_='navbar-link')} | |
113 |
|
113 | |||
114 | %if current == 'createfork': |
|
114 | %if current == 'createfork': | |
115 | - ${_('Create Fork')} |
|
115 | - ${_('Create Fork')} | |
116 | %endif |
|
116 | %endif | |
117 | </div> |
|
117 | </div> | |
118 | <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#context-pages" aria-expanded="false"> |
|
118 | <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#context-pages" aria-expanded="false"> | |
119 | <span class="sr-only">Toggle navigation</span> |
|
119 | <span class="sr-only">Toggle navigation</span> | |
120 | <span class="icon-bar"></span> |
|
120 | <span class="icon-bar"></span> | |
121 | <span class="icon-bar"></span> |
|
121 | <span class="icon-bar"></span> | |
122 | <span class="icon-bar"></span> |
|
122 | <span class="icon-bar"></span> | |
123 | </button> |
|
123 | </button> | |
124 | </div> |
|
124 | </div> | |
125 | <div id="context-pages" class="navbar-collapse collapse"> |
|
125 | <div id="context-pages" class="navbar-collapse collapse"> | |
126 | <ul class="nav navbar-nav navbar-right"> |
|
126 | <ul class="nav navbar-nav navbar-right"> | |
127 | <li class="${'active' if current == 'summary' else ''}" data-context="summary"><a href="${h.url('summary_home', repo_name=c.repo_name)}"><i class="icon-doc-text"></i>${_('Summary')}</a></li> |
|
127 | <li class="${'active' if current == 'summary' else ''}" data-context="summary"><a href="${h.url('summary_home', repo_name=c.repo_name)}"><i class="icon-doc-text"></i>${_('Summary')}</a></li> | |
128 | %if rev: |
|
128 | %if rev: | |
129 | <li class="${'active' if current == 'changelog' else ''}" data-context="changelog"><a href="${h.url('changelog_file_home', repo_name=c.repo_name, revision=rev, f_path='')}"><i class="icon-clock"></i>${_('Changelog')}</a></li> |
|
129 | <li class="${'active' if current == 'changelog' else ''}" data-context="changelog"><a href="${h.url('changelog_file_home', repo_name=c.repo_name, revision=rev, f_path='')}"><i class="icon-clock"></i>${_('Changelog')}</a></li> | |
130 | %else: |
|
130 | %else: | |
131 | <li class="${'active' if current == 'changelog' else ''}" data-context="changelog"><a href="${h.url('changelog_home', repo_name=c.repo_name)}"><i class="icon-clock"></i>${_('Changelog')}</a></li> |
|
131 | <li class="${'active' if current == 'changelog' else ''}" data-context="changelog"><a href="${h.url('changelog_home', repo_name=c.repo_name)}"><i class="icon-clock"></i>${_('Changelog')}</a></li> | |
132 | %endif |
|
132 | %endif | |
133 | <li class="${'active' if current == 'files' else ''}" data-context="files"><a href="${h.url('files_home', repo_name=c.repo_name, revision=rev or 'tip')}"><i class="icon-doc-inv"></i>${_('Files')}</a></li> |
|
133 | <li class="${'active' if current == 'files' else ''}" data-context="files"><a href="${h.url('files_home', repo_name=c.repo_name, revision=rev or 'tip')}"><i class="icon-doc-inv"></i>${_('Files')}</a></li> | |
134 | <li class="${'active' if current == 'showpullrequest' else ''}" data-context="showpullrequest"> |
|
134 | <li class="${'active' if current == 'showpullrequest' else ''}" data-context="showpullrequest"> | |
135 | <a href="${h.url('pullrequest_show_all',repo_name=c.repo_name)}" title="${_('Show Pull Requests for %s') % c.repo_name}"> <i class="icon-git-pull-request"></i>${_('Pull Requests')} |
|
135 | <a href="${h.url('pullrequest_show_all',repo_name=c.repo_name)}" title="${_('Show Pull Requests for %s') % c.repo_name}"> <i class="icon-git-pull-request"></i>${_('Pull Requests')} | |
136 | %if c.repository_pull_requests: |
|
136 | %if c.repository_pull_requests: | |
137 | <span class="badge">${c.repository_pull_requests}</span> |
|
137 | <span class="badge">${c.repository_pull_requests}</span> | |
138 | %endif |
|
138 | %endif | |
139 | </a> |
|
139 | </a> | |
140 | </li> |
|
140 | </li> | |
141 | <li class="${'active' if current == 'switch-to' else ''}" data-context="switch-to"> |
|
141 | <li class="${'active' if current == 'switch-to' else ''}" data-context="switch-to"> | |
142 | <input id="branch_switcher" name="branch_switcher" type="hidden"> |
|
142 | <input id="branch_switcher" name="branch_switcher" type="hidden"> | |
143 | </li> |
|
143 | </li> | |
144 | <li class="${'active' if current == 'options' else ''} dropdown" data-context="options"> |
|
144 | <li class="${'active' if current == 'options' else ''} dropdown" data-context="options"> | |
145 | %if h.HasRepoPermissionLevel('admin')(c.repo_name): |
|
145 | %if h.HasRepoPermissionLevel('admin')(c.repo_name): | |
146 | <a href="${h.url('edit_repo',repo_name=c.repo_name)}" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false" aria-haspopup="true"><i class="icon-wrench"></i>${_('Options')} <i class="caret"></i></a> |
|
146 | <a href="${h.url('edit_repo',repo_name=c.repo_name)}" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false" aria-haspopup="true"><i class="icon-wrench"></i>${_('Options')} <i class="caret"></i></a> | |
147 | %else: |
|
147 | %else: | |
148 | <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false" aria-haspopup="true"><i class="icon-wrench"></i>${_('Options')} <i class="caret"></i></a> |
|
148 | <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false" aria-haspopup="true"><i class="icon-wrench"></i>${_('Options')} <i class="caret"></i></a> | |
149 | %endif |
|
149 | %endif | |
150 | <ul class="dropdown-menu" role="menu" aria-hidden="true"> |
|
150 | <ul class="dropdown-menu" role="menu" aria-hidden="true"> | |
151 | %if h.HasRepoPermissionLevel('admin')(c.repo_name): |
|
151 | %if h.HasRepoPermissionLevel('admin')(c.repo_name): | |
152 | <li><a href="${h.url('edit_repo',repo_name=c.repo_name)}"><i class="icon-gear"></i>${_('Settings')}</a></li> |
|
152 | <li><a href="${h.url('edit_repo',repo_name=c.repo_name)}"><i class="icon-gear"></i>${_('Settings')}</a></li> | |
153 | %endif |
|
153 | %endif | |
154 | %if c.db_repo.fork: |
|
154 | %if c.db_repo.fork: | |
155 | <li><a href="${h.url('compare_url',repo_name=c.db_repo.fork.repo_name,org_ref_type=c.db_repo.landing_rev[0],org_ref_name=c.db_repo.landing_rev[1], other_repo=c.repo_name,other_ref_type='branch' if request.GET.get('branch') else c.db_repo.landing_rev[0],other_ref_name=request.GET.get('branch') or c.db_repo.landing_rev[1], merge=1)}"> |
|
155 | <li><a href="${h.url('compare_url',repo_name=c.db_repo.fork.repo_name,org_ref_type=c.db_repo.landing_rev[0],org_ref_name=c.db_repo.landing_rev[1], other_repo=c.repo_name,other_ref_type='branch' if request.GET.get('branch') else c.db_repo.landing_rev[0],other_ref_name=request.GET.get('branch') or c.db_repo.landing_rev[1], merge=1)}"> | |
156 | <i class="icon-git-compare"></i>${_('Compare Fork')}</a></li> |
|
156 | <i class="icon-git-compare"></i>${_('Compare Fork')}</a></li> | |
157 | %endif |
|
157 | %endif | |
158 | <li><a href="${h.url('compare_home',repo_name=c.repo_name)}"><i class="icon-git-compare"></i>${_('Compare')}</a></li> |
|
158 | <li><a href="${h.url('compare_home',repo_name=c.repo_name)}"><i class="icon-git-compare"></i>${_('Compare')}</a></li> | |
159 |
|
159 | |||
160 | <li><a href="${h.url('search_repo',repo_name=c.repo_name)}"><i class="icon-search"></i>${_('Search')}</a></li> |
|
160 | <li><a href="${h.url('search_repo',repo_name=c.repo_name)}"><i class="icon-search"></i>${_('Search')}</a></li> | |
161 |
|
161 | |||
162 | %if h.HasRepoPermissionLevel('write')(c.repo_name) and c.db_repo.enable_locking: |
|
162 | %if h.HasRepoPermissionLevel('write')(c.repo_name) and c.db_repo.enable_locking: | |
163 | %if c.db_repo.locked[0]: |
|
163 | %if c.db_repo.locked[0]: | |
164 | <li><a href="${h.url('toggle_locking', repo_name=c.repo_name)}"><i class="icon-lock"></i>${_('Unlock')}</a></li> |
|
164 | <li><a href="${h.url('toggle_locking', repo_name=c.repo_name)}"><i class="icon-lock"></i>${_('Unlock')}</a></li> | |
165 | %else: |
|
165 | %else: | |
166 | <li><a href="${h.url('toggle_locking', repo_name=c.repo_name)}"><i class="icon-lock-open-alt"></i>${_('Lock')}</a></li> |
|
166 | <li><a href="${h.url('toggle_locking', repo_name=c.repo_name)}"><i class="icon-lock-open-alt"></i>${_('Lock')}</a></li> | |
167 | %endif |
|
167 | %endif | |
168 | %endif |
|
168 | %endif | |
169 | ## TODO: this check feels wrong, it would be better to have a check for permissions |
|
169 | ## TODO: this check feels wrong, it would be better to have a check for permissions | |
170 | ## also it feels like a job for the controller |
|
170 | ## also it feels like a job for the controller | |
171 | %if request.authuser.username != 'default': |
|
171 | %if request.authuser.username != 'default': | |
172 | <li> |
|
172 | <li> | |
173 | <a href="#" class="${'following' if c.repository_following else 'follow'}" onclick="toggleFollowingRepo(this, ${c.db_repo.repo_id});"> |
|
173 | <a href="#" class="${'following' if c.repository_following else 'follow'}" onclick="toggleFollowingRepo(this, ${c.db_repo.repo_id});"> | |
174 | <span class="show-follow"><i class="icon-heart-empty"></i>${_('Follow')}</span> |
|
174 | <span class="show-follow"><i class="icon-heart-empty"></i>${_('Follow')}</span> | |
175 | <span class="show-following"><i class="icon-heart"></i>${_('Unfollow')}</span> |
|
175 | <span class="show-following"><i class="icon-heart"></i>${_('Unfollow')}</span> | |
176 | </a> |
|
176 | </a> | |
177 | </li> |
|
177 | </li> | |
178 | <li><a href="${h.url('repo_fork_home',repo_name=c.repo_name)}"><i class="icon-git-pull-request"></i>${_('Fork')}</a></li> |
|
178 | <li><a href="${h.url('repo_fork_home',repo_name=c.repo_name)}"><i class="icon-git-pull-request"></i>${_('Fork')}</a></li> | |
179 | <li><a href="${h.url('pullrequest_home',repo_name=c.repo_name)}"><i class="icon-git-pull-request"></i>${_('Create Pull Request')}</a></li> |
|
179 | <li><a href="${h.url('pullrequest_home',repo_name=c.repo_name)}"><i class="icon-git-pull-request"></i>${_('Create Pull Request')}</a></li> | |
180 | %endif |
|
180 | %endif | |
181 | </ul> |
|
181 | </ul> | |
182 | </li> |
|
182 | </li> | |
183 | </ul> |
|
183 | </ul> | |
184 | </div> |
|
184 | </div> | |
185 | </div> |
|
185 | </div> | |
186 | </nav> |
|
186 | </nav> | |
187 | <script type="text/javascript"> |
|
187 | <script type="text/javascript"> | |
188 | $(document).ready(function() { |
|
188 | $(document).ready(function() { | |
189 | var bcache = {}; |
|
189 | var bcache = {}; | |
190 |
|
190 | |||
191 | $("#branch_switcher").select2({ |
|
191 | $("#branch_switcher").select2({ | |
192 | placeholder: '<i class="icon-exchange"></i>' + ${h.jshtml(_('Switch To'))} + ' <span class="caret"></span>', |
|
192 | placeholder: '<i class="icon-exchange"></i>' + ${h.jshtml(_('Switch To'))} + ' <span class="caret"></span>', | |
193 | dropdownAutoWidth: true, |
|
193 | dropdownAutoWidth: true, | |
194 | sortResults: prefixFirstSort, |
|
194 | sortResults: prefixFirstSort, | |
195 | formatResult: function(obj) { |
|
195 | formatResult: function(obj) { | |
196 | return obj.text; |
|
196 | return obj.text; | |
197 | }, |
|
197 | }, | |
198 | formatSelection: function(obj) { |
|
198 | formatSelection: function(obj) { | |
199 | return obj.text; |
|
199 | return obj.text; | |
200 | }, |
|
200 | }, | |
201 | formatNoMatches: function(term) { |
|
201 | formatNoMatches: function(term) { | |
202 | return ${h.jshtml(_('No matches found'))}; |
|
202 | return ${h.jshtml(_('No matches found'))}; | |
203 | }, |
|
203 | }, | |
204 | escapeMarkup: function(m) { |
|
204 | escapeMarkup: function(m) { | |
205 | // don't escape our custom placeholder |
|
205 | // don't escape our custom placeholder | |
206 | if (m.substr(0, 25) == '<i class="icon-exchange">') { |
|
206 | if (m.substr(0, 25) == '<i class="icon-exchange">') { | |
207 | return m; |
|
207 | return m; | |
208 | } |
|
208 | } | |
209 |
|
209 | |||
210 | return Select2.util.escapeMarkup(m); |
|
210 | return Select2.util.escapeMarkup(m); | |
211 | }, |
|
211 | }, | |
212 | containerCssClass: "branch-switcher", |
|
212 | containerCssClass: "branch-switcher", | |
213 | dropdownCssClass: "repo-switcher-dropdown", |
|
213 | dropdownCssClass: "repo-switcher-dropdown", | |
214 | query: function(query) { |
|
214 | query: function(query) { | |
215 | var key = 'cache'; |
|
215 | var key = 'cache'; | |
216 | var cached = bcache[key]; |
|
216 | var cached = bcache[key]; | |
217 | if (cached) { |
|
217 | if (cached) { | |
218 | var data = { |
|
218 | var data = { | |
219 | results: [] |
|
219 | results: [] | |
220 | }; |
|
220 | }; | |
221 | // filter results |
|
221 | // filter results | |
222 | $.each(cached.results, function() { |
|
222 | $.each(cached.results, function() { | |
223 | var section = this.text; |
|
223 | var section = this.text; | |
224 | var children = []; |
|
224 | var children = []; | |
225 | $.each(this.children, function() { |
|
225 | $.each(this.children, function() { | |
226 | if (query.term.length === 0 || this.text.toUpperCase().indexOf(query.term.toUpperCase()) >= 0) { |
|
226 | if (query.term.length === 0 || this.text.toUpperCase().indexOf(query.term.toUpperCase()) >= 0) { | |
227 | children.push({ |
|
227 | children.push({ | |
228 | 'id': this.id, |
|
228 | 'id': this.id, | |
229 | 'text': this.text, |
|
229 | 'text': this.text, | |
230 | 'type': this.type, |
|
230 | 'type': this.type, | |
231 | 'obj': this.obj |
|
231 | 'obj': this.obj | |
232 | }); |
|
232 | }); | |
233 | } |
|
233 | } | |
234 | }); |
|
234 | }); | |
235 | if (children.length !== 0) { |
|
235 | if (children.length !== 0) { | |
236 | data.results.push({ |
|
236 | data.results.push({ | |
237 | 'text': section, |
|
237 | 'text': section, | |
238 | 'children': children |
|
238 | 'children': children | |
239 | }); |
|
239 | }); | |
240 | } |
|
240 | } | |
241 |
|
241 | |||
242 | }); |
|
242 | }); | |
243 | query.callback(data); |
|
243 | query.callback(data); | |
244 | } else { |
|
244 | } else { | |
245 | $.ajax({ |
|
245 | $.ajax({ | |
246 | url: pyroutes.url('repo_refs_data', { |
|
246 | url: pyroutes.url('repo_refs_data', { | |
247 | 'repo_name': ${h.js(c.repo_name)} |
|
247 | 'repo_name': ${h.js(c.repo_name)} | |
248 | }), |
|
248 | }), | |
249 | data: {}, |
|
249 | data: {}, | |
250 | dataType: 'json', |
|
250 | dataType: 'json', | |
251 | type: 'GET', |
|
251 | type: 'GET', | |
252 | success: function(data) { |
|
252 | success: function(data) { | |
253 | bcache[key] = data; |
|
253 | bcache[key] = data; | |
254 | query.callback(data); |
|
254 | query.callback(data); | |
255 | } |
|
255 | } | |
256 | }); |
|
256 | }); | |
257 | } |
|
257 | } | |
258 | } |
|
258 | } | |
259 | }); |
|
259 | }); | |
260 |
|
260 | |||
261 | $("#branch_switcher").on('select2-selecting', function(e) { |
|
261 | $("#branch_switcher").on('select2-selecting', function(e) { | |
262 | e.preventDefault(); |
|
262 | e.preventDefault(); | |
263 | var context = $('#context-bar .active').data('context'); |
|
263 | var context = $('#context-bar .active').data('context'); | |
264 | if (context == 'files') { |
|
264 | if (context == 'files') { | |
265 | window.location = pyroutes.url('files_home', { |
|
265 | window.location = pyroutes.url('files_home', { | |
266 | 'repo_name': REPO_NAME, |
|
266 | 'repo_name': REPO_NAME, | |
267 | 'revision': e.choice.id, |
|
267 | 'revision': e.choice.id, | |
268 | 'f_path': '', |
|
268 | 'f_path': '', | |
269 | 'at': e.choice.text |
|
269 | 'at': e.choice.text | |
270 | }); |
|
270 | }); | |
271 | } else if (context == 'changelog') { |
|
271 | } else if (context == 'changelog') { | |
272 | if (e.choice.type == 'tag' || e.choice.type == 'book') { |
|
272 | if (e.choice.type == 'tag' || e.choice.type == 'book') { | |
273 | $("#branch_filter").append($('<'+'option/>').val(e.choice.text)); |
|
273 | $("#branch_filter").append($('<'+'option/>').val(e.choice.text)); | |
274 | } |
|
274 | } | |
275 | $("#branch_filter").val(e.choice.text).change(); |
|
275 | $("#branch_filter").val(e.choice.text).change(); | |
276 | } else { |
|
276 | } else { | |
277 | window.location = pyroutes.url('changelog_home', { |
|
277 | window.location = pyroutes.url('changelog_home', { | |
278 | 'repo_name': ${h.js(c.repo_name)}, |
|
278 | 'repo_name': ${h.js(c.repo_name)}, | |
279 | 'branch': e.choice.text |
|
279 | 'branch': e.choice.text | |
280 | }); |
|
280 | }); | |
281 | } |
|
281 | } | |
282 | }); |
|
282 | }); | |
283 | }); |
|
283 | }); | |
284 | </script> |
|
284 | </script> | |
285 | <!--- END CONTEXT BAR --> |
|
285 | <!--- END CONTEXT BAR --> | |
286 | </%def> |
|
286 | </%def> | |
287 |
|
287 | |||
288 | <%def name="menu(current=None)"> |
|
288 | <%def name="menu(current=None)"> | |
289 | <ul id="quick" class="nav navbar-nav navbar-right"> |
|
289 | <ul id="quick" class="nav navbar-nav navbar-right"> | |
290 | <!-- repo switcher --> |
|
290 | <!-- repo switcher --> | |
291 | <li class="${'active' if current == 'repositories' else ''}"> |
|
291 | <li class="${'active' if current == 'repositories' else ''}"> | |
292 | <input id="repo_switcher" name="repo_switcher" type="hidden"> |
|
292 | <input id="repo_switcher" name="repo_switcher" type="hidden"> | |
293 | </li> |
|
293 | </li> | |
294 |
|
294 | |||
295 | ##ROOT MENU |
|
295 | ##ROOT MENU | |
296 | %if request.authuser.username != 'default': |
|
296 | %if request.authuser.username != 'default': | |
297 | <li class="${'active' if current == 'journal' else ''}"> |
|
297 | <li class="${'active' if current == 'journal' else ''}"> | |
298 | <a class="menu_link" title="${_('Show recent activity')}" href="${h.url('journal')}"> |
|
298 | <a class="menu_link" title="${_('Show recent activity')}" href="${h.url('journal')}"> | |
299 | <i class="icon-book"></i>${_('Journal')} |
|
299 | <i class="icon-book"></i>${_('Journal')} | |
300 | </a> |
|
300 | </a> | |
301 | </li> |
|
301 | </li> | |
302 | %else: |
|
302 | %else: | |
303 | <li class="${'active' if current == 'journal' else ''}"> |
|
303 | <li class="${'active' if current == 'journal' else ''}"> | |
304 | <a class="menu_link" title="${_('Public journal')}" href="${h.url('public_journal')}"> |
|
304 | <a class="menu_link" title="${_('Public journal')}" href="${h.url('public_journal')}"> | |
305 | <i class="icon-book"></i>${_('Public journal')} |
|
305 | <i class="icon-book"></i>${_('Public journal')} | |
306 | </a> |
|
306 | </a> | |
307 | </li> |
|
307 | </li> | |
308 | %endif |
|
308 | %endif | |
309 | <li class="${'active' if current == 'gists' else ''} dropdown"> |
|
309 | <li class="${'active' if current == 'gists' else ''} dropdown"> | |
310 | <a class="menu_link dropdown-toggle" data-toggle="dropdown" role="button" title="${_('Show public gists')}" href="${h.url('gists')}"> |
|
310 | <a class="menu_link dropdown-toggle" data-toggle="dropdown" role="button" title="${_('Show public gists')}" href="${h.url('gists')}"> | |
311 | <i class="icon-clippy"></i>${_('Gists')} <span class="caret"></span> |
|
311 | <i class="icon-clippy"></i>${_('Gists')} <span class="caret"></span> | |
312 | </a> |
|
312 | </a> | |
313 | <ul class="dropdown-menu" role="menu"> |
|
313 | <ul class="dropdown-menu" role="menu"> | |
314 | <li><a href="${h.url('new_gist', public=1)}"><i class="icon-paste"></i>${_('Create New Gist')}</a></li> |
|
314 | <li><a href="${h.url('new_gist', public=1)}"><i class="icon-paste"></i>${_('Create New Gist')}</a></li> | |
315 | <li><a href="${h.url('gists')}"><i class="icon-globe"></i>${_('All Public Gists')}</a></li> |
|
315 | <li><a href="${h.url('gists')}"><i class="icon-globe"></i>${_('All Public Gists')}</a></li> | |
316 | %if request.authuser.username != 'default': |
|
316 | %if request.authuser.username != 'default': | |
317 | <li><a href="${h.url('gists', public=1)}"><i class="icon-user"></i>${_('My Public Gists')}</a></li> |
|
317 | <li><a href="${h.url('gists', public=1)}"><i class="icon-user"></i>${_('My Public Gists')}</a></li> | |
318 | <li><a href="${h.url('gists', private=1)}"><i class="icon-lock"></i>${_('My Private Gists')}</a></li> |
|
318 | <li><a href="${h.url('gists', private=1)}"><i class="icon-lock"></i>${_('My Private Gists')}</a></li> | |
319 | %endif |
|
319 | %endif | |
320 | </ul> |
|
320 | </ul> | |
321 | </li> |
|
321 | </li> | |
322 | <li class="${'active' if current == 'search' else ''}"> |
|
322 | <li class="${'active' if current == 'search' else ''}"> | |
323 | <a class="menu_link" title="${_('Search in repositories')}" href="${h.url('search')}"> |
|
323 | <a class="menu_link" title="${_('Search in repositories')}" href="${h.url('search')}"> | |
324 | <i class="icon-search"></i>${_('Search')} |
|
324 | <i class="icon-search"></i>${_('Search')} | |
325 | </a> |
|
325 | </a> | |
326 | </li> |
|
326 | </li> | |
327 | % if h.HasPermissionAny('hg.admin')('access admin main page'): |
|
327 | % if h.HasPermissionAny('hg.admin')('access admin main page'): | |
328 | <li class="${'active' if current == 'admin' else ''} dropdown"> |
|
328 | <li class="${'active' if current == 'admin' else ''} dropdown"> | |
329 | <a class="menu_link dropdown-toggle" data-toggle="dropdown" role="button" title="${_('Admin')}" href="${h.url('admin_home')}"> |
|
329 | <a class="menu_link dropdown-toggle" data-toggle="dropdown" role="button" title="${_('Admin')}" href="${h.url('admin_home')}"> | |
330 | <i class="icon-gear"></i>${_('Admin')} <span class="caret"></span> |
|
330 | <i class="icon-gear"></i>${_('Admin')} <span class="caret"></span> | |
331 | </a> |
|
331 | </a> | |
332 | ${admin_menu()} |
|
332 | ${admin_menu()} | |
333 | </li> |
|
333 | </li> | |
334 | % elif request.authuser.repositories_admin or request.authuser.repository_groups_admin or request.authuser.user_groups_admin: |
|
334 | % elif request.authuser.repositories_admin or request.authuser.repository_groups_admin or request.authuser.user_groups_admin: | |
335 | <li class="${'active' if current == 'admin' else ''} dropdown"> |
|
335 | <li class="${'active' if current == 'admin' else ''} dropdown"> | |
336 | <a class="menu_link dropdown-toggle" data-toggle="dropdown" role="button" title="${_('Admin')}" href=""> |
|
336 | <a class="menu_link dropdown-toggle" data-toggle="dropdown" role="button" title="${_('Admin')}" href=""> | |
337 | <i class="icon-gear"></i>${_('Admin')} |
|
337 | <i class="icon-gear"></i>${_('Admin')} | |
338 | </a> |
|
338 | </a> | |
339 | ${admin_menu_simple(request.authuser.repositories_admin, |
|
339 | ${admin_menu_simple(request.authuser.repositories_admin, | |
340 | request.authuser.repository_groups_admin, |
|
340 | request.authuser.repository_groups_admin, | |
341 | request.authuser.user_groups_admin or h.HasPermissionAny('hg.usergroup.create.true')())} |
|
341 | request.authuser.user_groups_admin or h.HasPermissionAny('hg.usergroup.create.true')())} | |
342 | </li> |
|
342 | </li> | |
343 | % endif |
|
343 | % endif | |
344 |
|
344 | |||
345 | <li class="${'active' if current == 'my_pullrequests' else ''}"> |
|
345 | <li class="${'active' if current == 'my_pullrequests' else ''}"> | |
346 | <a class="menu_link" title="${_('My Pull Requests')}" href="${h.url('my_pullrequests')}"> |
|
346 | <a class="menu_link" title="${_('My Pull Requests')}" href="${h.url('my_pullrequests')}"> | |
347 | <i class="icon-git-pull-request"></i>${_('My Pull Requests')} |
|
347 | <i class="icon-git-pull-request"></i>${_('My Pull Requests')} | |
348 | %if c.my_pr_count != 0: |
|
348 | %if c.my_pr_count != 0: | |
349 | <span class="badge">${c.my_pr_count}</span> |
|
349 | <span class="badge">${c.my_pr_count}</span> | |
350 | %endif |
|
350 | %endif | |
351 | </a> |
|
351 | </a> | |
352 | </li> |
|
352 | </li> | |
353 |
|
353 | |||
354 | ## USER MENU |
|
354 | ## USER MENU | |
355 | <li class="dropdown"> |
|
355 | <li class="dropdown"> | |
356 | <a class="menu_link dropdown-toggle" data-toggle="dropdown" role="button" id="quick_login_link" |
|
356 | <a class="menu_link dropdown-toggle" data-toggle="dropdown" role="button" id="quick_login_link" | |
357 | aria-expanded="false" aria-controls="quick_login" |
|
357 | aria-expanded="false" aria-controls="quick_login" | |
358 | %if request.authuser.username != 'default': |
|
358 | %if request.authuser.username != 'default': | |
359 | href="${h.url('notifications')}" |
|
359 | href="${h.url('notifications')}" | |
360 | %else: |
|
360 | %else: | |
361 | href="#" |
|
361 | href="#" | |
362 | %endif |
|
362 | %endif | |
363 | > |
|
363 | > | |
364 | ${h.gravatar_div(request.authuser.email, size=20, div_class="icon")} |
|
364 | ${h.gravatar_div(request.authuser.email, size=20, div_class="icon")} | |
365 | %if request.authuser.username != 'default': |
|
365 | %if request.authuser.username != 'default': | |
366 | <span class="menu_link_user">${request.authuser.username}</span> |
|
366 | <span class="menu_link_user">${request.authuser.username}</span> | |
367 | %if c.unread_notifications != 0: |
|
367 | %if c.unread_notifications != 0: | |
368 | <span class="badge">${c.unread_notifications}</span> |
|
368 | <span class="badge">${c.unread_notifications}</span> | |
369 | %endif |
|
369 | %endif | |
370 | %else: |
|
370 | %else: | |
371 | <span>${_('Not Logged In')}</span> |
|
371 | <span>${_('Not Logged In')}</span> | |
372 | %endif |
|
372 | %endif | |
373 | <i class="caret"></i> |
|
373 | <i class="caret"></i> | |
374 | </a> |
|
374 | </a> | |
375 |
|
375 | |||
376 | <div class="dropdown-menu user-menu" role="menu"> |
|
376 | <div class="dropdown-menu user-menu" role="menu"> | |
377 | <div id="quick_login" role="form" aria-describedby="quick_login_h" aria-hidden="true" class="container-fluid"> |
|
377 | <div id="quick_login" role="form" aria-describedby="quick_login_h" aria-hidden="true" class="container-fluid"> | |
378 | %if request.authuser.username == 'default' or request.authuser.user_id is None: |
|
378 | %if request.authuser.username == 'default' or request.authuser.user_id is None: | |
379 | ${h.form(h.url('login_home', came_from=request.path_qs), class_='form clearfix')} |
|
379 | ${h.form(h.url('login_home', came_from=request.path_qs), class_='form clearfix')} | |
380 | <h4 id="quick_login_h">${_('Login to Your Account')}</h4> |
|
380 | <h4 id="quick_login_h">${_('Login to Your Account')}</h4> | |
381 | <label> |
|
381 | <label> | |
382 | ${_('Username')}: |
|
382 | ${_('Username')}: | |
383 | ${h.text('username',class_='form-control')} |
|
383 | ${h.text('username',class_='form-control')} | |
384 | </label> |
|
384 | </label> | |
385 | <label> |
|
385 | <label> | |
386 | ${_('Password')}: |
|
386 | ${_('Password')}: | |
387 | ${h.password('password',class_='form-control')} |
|
387 | ${h.password('password',class_='form-control')} | |
388 | </label> |
|
388 | </label> | |
389 | <div class="password_forgotten"> |
|
389 | <div class="password_forgotten"> | |
390 | ${h.link_to(_('Forgot password?'),h.url('reset_password'))} |
|
390 | ${h.link_to(_('Forgot password?'),h.url('reset_password'))} | |
391 | </div> |
|
391 | </div> | |
392 | <div class="register"> |
|
392 | <div class="register"> | |
393 | %if h.HasPermissionAny('hg.admin', 'hg.register.auto_activate', 'hg.register.manual_activate')(): |
|
393 | %if h.HasPermissionAny('hg.admin', 'hg.register.auto_activate', 'hg.register.manual_activate')(): | |
394 | ${h.link_to(_("Don't have an account?"),h.url('register'))} |
|
394 | ${h.link_to(_("Don't have an account?"),h.url('register'))} | |
395 | %endif |
|
395 | %endif | |
396 | </div> |
|
396 | </div> | |
397 | <div class="submit"> |
|
397 | <div class="submit"> | |
398 | ${h.submit('sign_in',_('Log In'),class_="btn btn-default btn-xs")} |
|
398 | ${h.submit('sign_in',_('Log In'),class_="btn btn-default btn-xs")} | |
399 | </div> |
|
399 | </div> | |
400 | ${h.end_form()} |
|
400 | ${h.end_form()} | |
401 | %else: |
|
401 | %else: | |
402 | <div class="pull-left"> |
|
402 | <div class="pull-left"> | |
403 | ${h.gravatar_div(request.authuser.email, size=48, div_class="big_gravatar")} |
|
403 | ${h.gravatar_div(request.authuser.email, size=48, div_class="big_gravatar")} | |
404 | <b class="full_name">${request.authuser.full_name_or_username}</b> |
|
404 | <b class="full_name">${request.authuser.full_name_or_username}</b> | |
405 | <div class="email">${request.authuser.email}</div> |
|
405 | <div class="email">${request.authuser.email}</div> | |
406 | </div> |
|
406 | </div> | |
407 | <div id="quick_login_h" class="pull-right list-group text-right"> |
|
407 | <div id="quick_login_h" class="pull-right list-group text-right"> | |
408 | <a class="list-group-item" href="${h.url('notifications')}">${_('Notifications')}: ${c.unread_notifications}</a> |
|
408 | <a class="list-group-item" href="${h.url('notifications')}">${_('Notifications')}: ${c.unread_notifications}</a> | |
409 | ${h.link_to(_('My Account'),h.url('my_account'),class_='list-group-item')} |
|
409 | ${h.link_to(_('My Account'),h.url('my_account'),class_='list-group-item')} | |
410 | %if not request.authuser.is_external_auth: |
|
410 | %if not request.authuser.is_external_auth: | |
411 | ## Cannot log out if using external (container) authentication. |
|
411 | ## Cannot log out if using external (container) authentication. | |
412 | ${h.link_to(_('Log Out'), h.url('logout_home'),class_='list-group-item')} |
|
412 | ${h.link_to(_('Log Out'), h.url('logout_home'),class_='list-group-item')} | |
413 | %endif |
|
413 | %endif | |
414 | </div> |
|
414 | </div> | |
415 | %endif |
|
415 | %endif | |
416 | </div> |
|
416 | </div> | |
417 | </div> |
|
417 | </div> | |
418 | </li> |
|
418 | </li> | |
419 | </ul> |
|
419 | </ul> | |
420 |
|
420 | |||
421 | <script type="text/javascript"> |
|
421 | <script type="text/javascript"> | |
422 | $(document).ready(function(){ |
|
422 | $(document).ready(function(){ | |
423 | var visual_show_public_icon = ${h.js(c.visual.show_public_icon)}; |
|
423 | var visual_show_public_icon = ${h.js(c.visual.show_public_icon)}; | |
424 | var cache = {} |
|
424 | var cache = {} | |
425 | /*format the look of items in the list*/ |
|
425 | /*format the look of items in the list*/ | |
426 | var format = function(state){ |
|
426 | var format = function(state){ | |
427 | if (!state.id){ |
|
427 | if (!state.id){ | |
428 | return state.text; // optgroup |
|
428 | return state.text; // optgroup | |
429 | } |
|
429 | } | |
430 | var obj_dict = state.obj; |
|
430 | var obj_dict = state.obj; | |
431 | var tmpl = ''; |
|
431 | var tmpl = ''; | |
432 |
|
432 | |||
433 | if(obj_dict && state.type == 'repo'){ |
|
433 | if(obj_dict && state.type == 'repo'){ | |
434 | tmpl += '<span class="repo-icons">'; |
|
434 | tmpl += '<span class="repo-icons">'; | |
435 | if(obj_dict['repo_type'] === 'hg'){ |
|
435 | if(obj_dict['repo_type'] === 'hg'){ | |
436 | tmpl += '<span class="label label-repo" title="${_('Mercurial repository')}">hg</span> '; |
|
436 | tmpl += '<span class="label label-repo" title="${_('Mercurial repository')}">hg</span> '; | |
437 | } |
|
437 | } | |
438 | else if(obj_dict['repo_type'] === 'git'){ |
|
438 | else if(obj_dict['repo_type'] === 'git'){ | |
439 | tmpl += '<span class="label label-repo" title="${_('Git repository')}">git</span> '; |
|
439 | tmpl += '<span class="label label-repo" title="${_('Git repository')}">git</span> '; | |
440 | } |
|
440 | } | |
441 | if(obj_dict['private']){ |
|
441 | if(obj_dict['private']){ | |
442 | tmpl += '<i class="icon-lock"></i>'; |
|
442 | tmpl += '<i class="icon-lock"></i>'; | |
443 | } |
|
443 | } | |
444 | else if(visual_show_public_icon){ |
|
444 | else if(visual_show_public_icon){ | |
445 | tmpl += '<i class="icon-globe"></i>'; |
|
445 | tmpl += '<i class="icon-globe"></i>'; | |
446 | } |
|
446 | } | |
447 | tmpl += '</span>'; |
|
447 | tmpl += '</span>'; | |
448 | } |
|
448 | } | |
449 | if(obj_dict && state.type == 'group'){ |
|
449 | if(obj_dict && state.type == 'group'){ | |
450 | tmpl += '<i class="icon-folder"></i>'; |
|
450 | tmpl += '<i class="icon-folder"></i>'; | |
451 | } |
|
451 | } | |
452 | tmpl += state.text; |
|
452 | tmpl += state.text; | |
453 | return tmpl; |
|
453 | return tmpl; | |
454 | } |
|
454 | } | |
455 |
|
455 | |||
456 | $("#repo_switcher").select2({ |
|
456 | $("#repo_switcher").select2({ | |
457 | placeholder: '<i class="icon-database"></i>' + ${h.jshtml(_('Repositories'))} + ' <span class="caret"></span>', |
|
457 | placeholder: '<i class="icon-database"></i>' + ${h.jshtml(_('Repositories'))} + ' <span class="caret"></span>', | |
458 | dropdownAutoWidth: true, |
|
458 | dropdownAutoWidth: true, | |
459 | sortResults: prefixFirstSort, |
|
459 | sortResults: prefixFirstSort, | |
460 | formatResult: format, |
|
460 | formatResult: format, | |
461 | formatSelection: format, |
|
461 | formatSelection: format, | |
462 | formatNoMatches: function(term){ |
|
462 | formatNoMatches: function(term){ | |
463 | return ${h.jshtml(_('No matches found'))}; |
|
463 | return ${h.jshtml(_('No matches found'))}; | |
464 | }, |
|
464 | }, | |
465 | containerCssClass: "repo-switcher", |
|
465 | containerCssClass: "repo-switcher", | |
466 | dropdownCssClass: "repo-switcher-dropdown", |
|
466 | dropdownCssClass: "repo-switcher-dropdown", | |
467 | escapeMarkup: function(m){ |
|
467 | escapeMarkup: function(m){ | |
468 | // don't escape our custom placeholder |
|
468 | // don't escape our custom placeholder | |
469 | if(m.substr(0,29) == '<i class="icon-database"></i>'){ |
|
469 | if(m.substr(0,29) == '<i class="icon-database"></i>'){ | |
470 | return m; |
|
470 | return m; | |
471 | } |
|
471 | } | |
472 |
|
472 | |||
473 | return Select2.util.escapeMarkup(m); |
|
473 | return Select2.util.escapeMarkup(m); | |
474 | }, |
|
474 | }, | |
475 | query: function(query){ |
|
475 | query: function(query){ | |
476 | var key = 'cache'; |
|
476 | var key = 'cache'; | |
477 | var cached = cache[key] ; |
|
477 | var cached = cache[key] ; | |
478 | if(cached) { |
|
478 | if(cached) { | |
479 | var data = {results: []}; |
|
479 | var data = {results: []}; | |
480 | //filter results |
|
480 | //filter results | |
481 | $.each(cached.results, function(){ |
|
481 | $.each(cached.results, function(){ | |
482 | var section = this.text; |
|
482 | var section = this.text; | |
483 | var children = []; |
|
483 | var children = []; | |
484 | $.each(this.children, function(){ |
|
484 | $.each(this.children, function(){ | |
485 | if(query.term.length == 0 || this.text.toUpperCase().indexOf(query.term.toUpperCase()) >= 0 ){ |
|
485 | if(query.term.length == 0 || this.text.toUpperCase().indexOf(query.term.toUpperCase()) >= 0 ){ | |
486 | children.push({'id': this.id, 'text': this.text, 'type': this.type, 'obj': this.obj}); |
|
486 | children.push({'id': this.id, 'text': this.text, 'type': this.type, 'obj': this.obj}); | |
487 | } |
|
487 | } | |
488 | }); |
|
488 | }); | |
489 | if(children.length !== 0){ |
|
489 | if(children.length !== 0){ | |
490 | data.results.push({'text': section, 'children': children}); |
|
490 | data.results.push({'text': section, 'children': children}); | |
491 | } |
|
491 | } | |
492 |
|
492 | |||
493 | }); |
|
493 | }); | |
494 | query.callback(data); |
|
494 | query.callback(data); | |
495 | }else{ |
|
495 | }else{ | |
496 | $.ajax({ |
|
496 | $.ajax({ | |
497 | url: ${h.js(h.url('repo_switcher_data'))}, |
|
497 | url: ${h.js(h.url('repo_switcher_data'))}, | |
498 | data: {}, |
|
498 | data: {}, | |
499 | dataType: 'json', |
|
499 | dataType: 'json', | |
500 | type: 'GET', |
|
500 | type: 'GET', | |
501 | success: function(data) { |
|
501 | success: function(data) { | |
502 | cache[key] = data; |
|
502 | cache[key] = data; | |
503 | query.callback({results: data.results}); |
|
503 | query.callback({results: data.results}); | |
504 | } |
|
504 | } | |
505 | }); |
|
505 | }); | |
506 | } |
|
506 | } | |
507 | } |
|
507 | } | |
508 | }); |
|
508 | }); | |
509 |
|
509 | |||
510 | $("#repo_switcher").on('select2-selecting', function(e){ |
|
510 | $("#repo_switcher").on('select2-selecting', function(e){ | |
511 | e.preventDefault(); |
|
511 | e.preventDefault(); | |
512 | window.location = pyroutes.url('summary_home', {'repo_name': e.val}); |
|
512 | window.location = pyroutes.url('summary_home', {'repo_name': e.val}); | |
513 | }); |
|
513 | }); | |
514 |
|
514 | |||
515 | $(document).on('shown.bs.dropdown', function(event) { |
|
515 | $(document).on('shown.bs.dropdown', function(event) { | |
516 | var dropdown = $(event.target); |
|
516 | var dropdown = $(event.target); | |
517 |
|
517 | |||
518 | dropdown.attr('aria-expanded', true); |
|
518 | dropdown.attr('aria-expanded', true); | |
519 | dropdown.find('.dropdown-menu').attr('aria-hidden', false); |
|
519 | dropdown.find('.dropdown-menu').attr('aria-hidden', false); | |
520 | }); |
|
520 | }); | |
521 |
|
521 | |||
522 | $(document).on('hidden.bs.dropdown', function(event) { |
|
522 | $(document).on('hidden.bs.dropdown', function(event) { | |
523 | var dropdown = $(event.target); |
|
523 | var dropdown = $(event.target); | |
524 |
|
524 | |||
525 | dropdown.attr('aria-expanded', false); |
|
525 | dropdown.attr('aria-expanded', false); | |
526 | dropdown.find('.dropdown-menu').attr('aria-hidden', true); |
|
526 | dropdown.find('.dropdown-menu').attr('aria-hidden', true); | |
527 | }); |
|
527 | }); | |
528 | }); |
|
528 | }); | |
529 | </script> |
|
529 | </script> | |
530 | </%def> |
|
530 | </%def> | |
531 |
|
531 | |||
532 | <%def name="parent_child_navigation()"> |
|
532 | <%def name="parent_child_navigation()"> | |
533 | <div class="pull-left"> |
|
533 | <div class="pull-left"> | |
534 | <div class="parent-child-link" |
|
534 | <div class="parent-child-link" | |
535 | data-ajax-url="${h.url('changeset_parents',repo_name=c.repo_name, revision=c.changeset.raw_id)}" |
|
535 | data-ajax-url="${h.url('changeset_parents',repo_name=c.repo_name, revision=c.changeset.raw_id)}" | |
536 | data-linktype="parent" |
|
536 | data-linktype="parent" | |
537 | data-reponame="${c.repo_name}"> |
|
537 | data-reponame="${c.repo_name}"> | |
538 | <i class="icon-left-open"></i><a href="#">${_('Parent rev.')}</a> |
|
538 | <i class="icon-left-open"></i><a href="#">${_('Parent rev.')}</a> | |
539 | </div> |
|
539 | </div> | |
540 | </div> |
|
540 | </div> | |
541 |
|
541 | |||
542 | <div class="pull-right"> |
|
542 | <div class="pull-right"> | |
543 | <div class="parent-child-link" |
|
543 | <div class="parent-child-link" | |
544 | data-ajax-url="${h.url('changeset_children',repo_name=c.repo_name, revision=c.changeset.raw_id)}" |
|
544 | data-ajax-url="${h.url('changeset_children',repo_name=c.repo_name, revision=c.changeset.raw_id)}" | |
545 | data-linktype="child" |
|
545 | data-linktype="child" | |
546 | data-reponame="${c.repo_name}"> |
|
546 | data-reponame="${c.repo_name}"> | |
547 | <a href="#">${_('Child rev.')}</a><i class="icon-right-open"></i> |
|
547 | <a href="#">${_('Child rev.')}</a><i class="icon-right-open"></i> | |
548 | </div> |
|
548 | </div> | |
549 | </div> |
|
549 | </div> | |
550 |
|
550 | |||
551 | <script type="text/javascript"> |
|
551 | <script type="text/javascript"> | |
552 | $(document).ready(function(){ |
|
552 | $(document).ready(function(){ | |
553 | activate_parent_child_links(); |
|
553 | activate_parent_child_links(); | |
554 | }); |
|
554 | }); | |
555 | </script> |
|
555 | </script> | |
556 | </%def> |
|
556 | </%def> |
@@ -1,70 +1,70 b'' | |||||
1 | <%page args="parent,group_name=''" /> |
|
1 | <%page args="parent,group_name=''" /> | |
2 | <div class="panel panel-primary"> |
|
2 | <div class="panel panel-primary"> | |
3 | <div class="panel-heading clearfix"> |
|
3 | <div class="panel-heading clearfix"> | |
4 |
<div class="pull-left |
|
4 | <div class="pull-left panel-title"> | |
5 | %if c.group is not None: |
|
5 | %if c.group is not None: | |
6 | %for group in c.group.parents: |
|
6 | %for group in c.group.parents: | |
7 | ${h.link_to(group.name, url('repos_group_home', group_name=group.group_name))} |
|
7 | ${h.link_to(group.name, url('repos_group_home', group_name=group.group_name))} | |
8 | » |
|
8 | » | |
9 | %endfor |
|
9 | %endfor | |
10 | ${c.group.name} |
|
10 | ${c.group.name} | |
11 | %endif |
|
11 | %endif | |
12 | </div> |
|
12 | </div> | |
13 |
|
13 | |||
14 | %if request.authuser.username != 'default': |
|
14 | %if request.authuser.username != 'default': | |
15 | <div class="pull-right"> |
|
15 | <div class="pull-right"> | |
16 | <% |
|
16 | <% | |
17 | gr_name = c.group.group_name if c.group else None |
|
17 | gr_name = c.group.group_name if c.group else None | |
18 | # create repositories with write permission on group is set to true |
|
18 | # create repositories with write permission on group is set to true | |
19 | create_on_write = h.HasPermissionAny('hg.create.write_on_repogroup.true')() |
|
19 | create_on_write = h.HasPermissionAny('hg.create.write_on_repogroup.true')() | |
20 | group_admin = h.HasRepoGroupPermissionLevel('admin')(gr_name, 'can write into group index page') |
|
20 | group_admin = h.HasRepoGroupPermissionLevel('admin')(gr_name, 'can write into group index page') | |
21 | group_write = h.HasRepoGroupPermissionLevel('write')(gr_name, 'can write into group index page') |
|
21 | group_write = h.HasRepoGroupPermissionLevel('write')(gr_name, 'can write into group index page') | |
22 | %> |
|
22 | %> | |
23 | %if h.HasPermissionAny('hg.admin','hg.create.repository')() or (group_admin or (group_write and create_on_write)): |
|
23 | %if h.HasPermissionAny('hg.admin','hg.create.repository')() or (group_admin or (group_write and create_on_write)): | |
24 | %if c.group: |
|
24 | %if c.group: | |
25 | <a href="${h.url('new_repo',parent_group=c.group.group_id)}" class="btn btn-default btn-xs"><i class="icon-plus"></i>${_('Add Repository')}</a> |
|
25 | <a href="${h.url('new_repo',parent_group=c.group.group_id)}" class="btn btn-default btn-xs"><i class="icon-plus"></i>${_('Add Repository')}</a> | |
26 | %if h.HasPermissionAny('hg.admin')() or h.HasRepoGroupPermissionLevel('admin')(c.group.group_name): |
|
26 | %if h.HasPermissionAny('hg.admin')() or h.HasRepoGroupPermissionLevel('admin')(c.group.group_name): | |
27 | <a href="${h.url('new_repos_group', parent_group=c.group.group_id)}" class="btn btn-default btn-xs"><i class="icon-plus"></i>${_('Add Repository Group')}</a> |
|
27 | <a href="${h.url('new_repos_group', parent_group=c.group.group_id)}" class="btn btn-default btn-xs"><i class="icon-plus"></i>${_('Add Repository Group')}</a> | |
28 | %endif |
|
28 | %endif | |
29 | %else: |
|
29 | %else: | |
30 | <a href="${h.url('new_repo')}" class="btn btn-default btn-xs"><i class="icon-plus"></i>${_('Add Repository')}</a> |
|
30 | <a href="${h.url('new_repo')}" class="btn btn-default btn-xs"><i class="icon-plus"></i>${_('Add Repository')}</a> | |
31 | %if h.HasPermissionAny('hg.admin')(): |
|
31 | %if h.HasPermissionAny('hg.admin')(): | |
32 | <a href="${h.url('new_repos_group')}" class="btn btn-default btn-xs"><i class="icon-plus"></i>${_('Add Repository Group')}</a> |
|
32 | <a href="${h.url('new_repos_group')}" class="btn btn-default btn-xs"><i class="icon-plus"></i>${_('Add Repository Group')}</a> | |
33 | %endif |
|
33 | %endif | |
34 | %endif |
|
34 | %endif | |
35 | %endif |
|
35 | %endif | |
36 | %if c.group and h.HasRepoGroupPermissionLevel('admin')(c.group.group_name): |
|
36 | %if c.group and h.HasRepoGroupPermissionLevel('admin')(c.group.group_name): | |
37 | <a href="${h.url('edit_repo_group',group_name=c.group.group_name)}" title="${_('You have admin right to this group, and can edit it')}" class="btn btn-default btn-xs"><i class="icon-pencil"></i>${_('Edit Repository Group')}</a> |
|
37 | <a href="${h.url('edit_repo_group',group_name=c.group.group_name)}" title="${_('You have admin right to this group, and can edit it')}" class="btn btn-default btn-xs"><i class="icon-pencil"></i>${_('Edit Repository Group')}</a> | |
38 | %endif |
|
38 | %endif | |
39 | </div> |
|
39 | </div> | |
40 | %endif |
|
40 | %endif | |
41 | </div> |
|
41 | </div> | |
42 | <div class="panel-body"> |
|
42 | <div class="panel-body"> | |
43 | <table class="table" id="repos_list_wrap" width="100%"></table> |
|
43 | <table class="table" id="repos_list_wrap" width="100%"></table> | |
44 | </div> |
|
44 | </div> | |
45 | </div> |
|
45 | </div> | |
46 |
|
46 | |||
47 | <script> |
|
47 | <script> | |
48 | var data = ${h.js(c.data)}, |
|
48 | var data = ${h.js(c.data)}, | |
49 | $dataTable = $("#repos_list_wrap").DataTable({ |
|
49 | $dataTable = $("#repos_list_wrap").DataTable({ | |
50 | data: data.records, |
|
50 | data: data.records, | |
51 | columns: [ |
|
51 | columns: [ | |
52 | {data: "raw_name", visible: false, searchable: false}, |
|
52 | {data: "raw_name", visible: false, searchable: false}, | |
53 | {title: ${h.jshtml(_('Repository'))}, data: "name", orderData: [0,], render: { |
|
53 | {title: ${h.jshtml(_('Repository'))}, data: "name", orderData: [0,], render: { | |
54 | filter: function(data, type, row, meta) { |
|
54 | filter: function(data, type, row, meta) { | |
55 | return row.just_name; |
|
55 | return row.just_name; | |
56 | } |
|
56 | } | |
57 | }}, |
|
57 | }}, | |
58 | {data: "desc", title: ${h.jshtml(_('Description'))}, searchable: false}, |
|
58 | {data: "desc", title: ${h.jshtml(_('Description'))}, searchable: false}, | |
59 | {data: "last_change_iso", defaultContent: '', visible: false, searchable: false}, |
|
59 | {data: "last_change_iso", defaultContent: '', visible: false, searchable: false}, | |
60 | {data: "last_change", defaultContent: '', title: ${h.jshtml(_('Last Change'))}, orderData: [3,], searchable: false}, |
|
60 | {data: "last_change", defaultContent: '', title: ${h.jshtml(_('Last Change'))}, orderData: [3,], searchable: false}, | |
61 | {data: "last_rev_raw", defaultContent: '', visible: false, searchable: false}, |
|
61 | {data: "last_rev_raw", defaultContent: '', visible: false, searchable: false}, | |
62 | {data: "last_changeset", defaultContent: '', title: ${h.jshtml(_('Tip'))}, orderData: [5,], searchable: false}, |
|
62 | {data: "last_changeset", defaultContent: '', title: ${h.jshtml(_('Tip'))}, orderData: [5,], searchable: false}, | |
63 | {data: "owner", defaultContent: '', title: ${h.jshtml(_('Owner'))}, searchable: false}, |
|
63 | {data: "owner", defaultContent: '', title: ${h.jshtml(_('Owner'))}, searchable: false}, | |
64 | {data: "atom", defaultContent: '', sortable: false} |
|
64 | {data: "atom", defaultContent: '', sortable: false} | |
65 | ], |
|
65 | ], | |
66 | order: [[1, "asc"]], |
|
66 | order: [[1, "asc"]], | |
67 | dom: '<"dataTables_left"f><"dataTables_right"ip>t', |
|
67 | dom: '<"dataTables_left"f><"dataTables_right"ip>t', | |
68 | pageLength: 100 |
|
68 | pageLength: 100 | |
69 | }); |
|
69 | }); | |
70 | </script> |
|
70 | </script> |
@@ -1,391 +1,391 b'' | |||||
1 | <%inherit file="/base/base.html"/> |
|
1 | <%inherit file="/base/base.html"/> | |
2 |
|
2 | |||
3 | <%namespace name="comment" file="/changeset/changeset_file_comment.html"/> |
|
3 | <%namespace name="comment" file="/changeset/changeset_file_comment.html"/> | |
4 |
|
4 | |||
5 | <%block name="title"> |
|
5 | <%block name="title"> | |
6 | ${_('%s Pull Request %s') % (c.repo_name, c.pull_request.nice_id())} |
|
6 | ${_('%s Pull Request %s') % (c.repo_name, c.pull_request.nice_id())} | |
7 | </%block> |
|
7 | </%block> | |
8 |
|
8 | |||
9 | <%def name="breadcrumbs_links()"> |
|
9 | <%def name="breadcrumbs_links()"> | |
10 | ${_('Pull request %s from %s#%s') % (c.pull_request.nice_id(), c.pull_request.org_repo.repo_name, c.cs_branch_name)} |
|
10 | ${_('Pull request %s from %s#%s') % (c.pull_request.nice_id(), c.pull_request.org_repo.repo_name, c.cs_branch_name)} | |
11 | </%def> |
|
11 | </%def> | |
12 |
|
12 | |||
13 | <%block name="header_menu"> |
|
13 | <%block name="header_menu"> | |
14 | ${self.menu('repositories')} |
|
14 | ${self.menu('repositories')} | |
15 | </%block> |
|
15 | </%block> | |
16 |
|
16 | |||
17 | <%def name="main()"> |
|
17 | <%def name="main()"> | |
18 | <% editable = not c.pull_request.is_closed() and (h.HasPermissionAny('hg.admin')() or h.HasRepoPermissionLevel('admin')(c.repo_name) or c.pull_request.owner_id == request.authuser.user_id) %> |
|
18 | <% editable = not c.pull_request.is_closed() and (h.HasPermissionAny('hg.admin')() or h.HasRepoPermissionLevel('admin')(c.repo_name) or c.pull_request.owner_id == request.authuser.user_id) %> | |
19 | ${self.repo_context_bar('showpullrequest')} |
|
19 | ${self.repo_context_bar('showpullrequest')} | |
20 | <div class="panel panel-primary"> |
|
20 | <div class="panel panel-primary"> | |
21 | <div class="panel-heading clearfix"> |
|
21 | <div class="panel-heading clearfix"> | |
22 | ${self.breadcrumbs()} |
|
22 | ${self.breadcrumbs()} | |
23 | </div> |
|
23 | </div> | |
24 |
|
24 | |||
25 | ${h.form(url('pullrequest_post', repo_name=c.repo_name, pull_request_id=c.pull_request.pull_request_id), method='post', id='pull_request_form',class_='panel-body')} |
|
25 | ${h.form(url('pullrequest_post', repo_name=c.repo_name, pull_request_id=c.pull_request.pull_request_id), method='post', id='pull_request_form',class_='panel-body')} | |
26 | <div class="form pr-box pull-left"> |
|
26 | <div class="form pr-box pull-left"> | |
27 | <div class="pr-details-title ${'closed' if c.pull_request.is_closed() else ''}"> |
|
27 | <div class="pr-details-title ${'closed' if c.pull_request.is_closed() else ''}"> | |
28 | <h3> |
|
28 | <h3> | |
29 | ${_('Title')}: ${c.pull_request.title} |
|
29 | ${_('Title')}: ${c.pull_request.title} | |
30 | %if c.pull_request.is_closed(): |
|
30 | %if c.pull_request.is_closed(): | |
31 | (${_('Closed')}) |
|
31 | (${_('Closed')}) | |
32 | %endif |
|
32 | %endif | |
33 | </h3> |
|
33 | </h3> | |
34 | </div> |
|
34 | </div> | |
35 | <div id="pr-summary"> |
|
35 | <div id="pr-summary"> | |
36 |
|
36 | |||
37 | <div class="pr-not-edit form-group"> |
|
37 | <div class="pr-not-edit form-group"> | |
38 | <label>${_('Description')}: |
|
38 | <label>${_('Description')}: | |
39 | %if editable: |
|
39 | %if editable: | |
40 | <div id="pr-edit-btn"> |
|
40 | <div id="pr-edit-btn"> | |
41 | <a class="btn btn-default btn-xs" onclick="$('.pr-do-edit').show();$('.pr-not-edit').hide()">${_("Edit")}</a> |
|
41 | <a class="btn btn-default btn-xs" onclick="$('.pr-do-edit').show();$('.pr-not-edit').hide()">${_("Edit")}</a> | |
42 | </div> |
|
42 | </div> | |
43 | %endif |
|
43 | %endif | |
44 | </label> |
|
44 | </label> | |
45 | <div> |
|
45 | <div> | |
46 | <div class="formatted-fixed">${h.urlify_text(c.pull_request.description, c.pull_request.org_repo.repo_name)}</div> |
|
46 | <div class="formatted-fixed">${h.urlify_text(c.pull_request.description, c.pull_request.org_repo.repo_name)}</div> | |
47 | </div> |
|
47 | </div> | |
48 | </div> |
|
48 | </div> | |
49 |
|
49 | |||
50 | %if editable: |
|
50 | %if editable: | |
51 | <div class="pr-do-edit form-group" style="display:none"> |
|
51 | <div class="pr-do-edit form-group" style="display:none"> | |
52 | <label for="pullrequest_title">${_('Title')}:</label> |
|
52 | <label for="pullrequest_title">${_('Title')}:</label> | |
53 | <div> |
|
53 | <div> | |
54 | ${h.text('pullrequest_title',class_='form-control',value=c.pull_request.title,placeholder=_('Summarize the changes'))} |
|
54 | ${h.text('pullrequest_title',class_='form-control',value=c.pull_request.title,placeholder=_('Summarize the changes'))} | |
55 | </div> |
|
55 | </div> | |
56 | </div> |
|
56 | </div> | |
57 |
|
57 | |||
58 | <div class="pr-do-edit form-group" style="display:none"> |
|
58 | <div class="pr-do-edit form-group" style="display:none"> | |
59 | <label for="pullrequest_desc">${_('Description')}:</label> |
|
59 | <label for="pullrequest_desc">${_('Description')}:</label> | |
60 | <div> |
|
60 | <div> | |
61 | ${h.textarea('pullrequest_desc',content=c.pull_request.description,placeholder=_('Write a short description on this pull request'),class_='form-control')} |
|
61 | ${h.textarea('pullrequest_desc',content=c.pull_request.description,placeholder=_('Write a short description on this pull request'),class_='form-control')} | |
62 | </div> |
|
62 | </div> | |
63 | </div> |
|
63 | </div> | |
64 | %endif |
|
64 | %endif | |
65 |
|
65 | |||
66 | <div class="form-group"> |
|
66 | <div class="form-group"> | |
67 | <label>${_('Voting Result')}:</label> |
|
67 | <label>${_('Voting Result')}:</label> | |
68 | <div> |
|
68 | <div> | |
69 | %if c.current_voting_result: |
|
69 | %if c.current_voting_result: | |
70 | <i class="icon-circle changeset-status-${c.current_voting_result}" title="${_('Pull request status calculated from votes')}"></i> |
|
70 | <i class="icon-circle changeset-status-${c.current_voting_result}" title="${_('Pull request status calculated from votes')}"></i> | |
71 | <span class="changeset-status-lbl" data-toggle="tooltip" title="${_('Pull request status calculated from votes')}"> |
|
71 | <span class="changeset-status-lbl" data-toggle="tooltip" title="${_('Pull request status calculated from votes')}"> | |
72 | %if c.pull_request.is_closed(): |
|
72 | %if c.pull_request.is_closed(): | |
73 | ${_('Closed')}, |
|
73 | ${_('Closed')}, | |
74 | %endif |
|
74 | %endif | |
75 | ${h.changeset_status_lbl(c.current_voting_result)} |
|
75 | ${h.changeset_status_lbl(c.current_voting_result)} | |
76 | </span> |
|
76 | </span> | |
77 | %endif |
|
77 | %endif | |
78 | </div> |
|
78 | </div> | |
79 | </div> |
|
79 | </div> | |
80 | <div class="form-group"> |
|
80 | <div class="form-group"> | |
81 | <label>${_('Origin')}:</label> |
|
81 | <label>${_('Origin')}:</label> | |
82 | <div> |
|
82 | <div> | |
83 | <div> |
|
83 | <div> | |
84 | ${h.link_to_ref(c.pull_request.org_repo.repo_name, c.cs_ref_type, c.cs_ref_name, c.cs_rev)} |
|
84 | ${h.link_to_ref(c.pull_request.org_repo.repo_name, c.cs_ref_type, c.cs_ref_name, c.cs_rev)} | |
85 | %if c.cs_ref_type != 'branch': |
|
85 | %if c.cs_ref_type != 'branch': | |
86 | ${_('on')} ${h.link_to_ref(c.pull_request.org_repo.repo_name, 'branch', c.cs_branch_name)} |
|
86 | ${_('on')} ${h.link_to_ref(c.pull_request.org_repo.repo_name, 'branch', c.cs_branch_name)} | |
87 | %endif |
|
87 | %endif | |
88 | </div> |
|
88 | </div> | |
89 | </div> |
|
89 | </div> | |
90 | </div> |
|
90 | </div> | |
91 | <div class="form-group"> |
|
91 | <div class="form-group"> | |
92 | <label>${_('Target')}:</label> |
|
92 | <label>${_('Target')}:</label> | |
93 | <div> |
|
93 | <div> | |
94 | %if c.is_range: |
|
94 | %if c.is_range: | |
95 | ${_("This is just a range of changesets and doesn't have a target or a real merge ancestor.")} |
|
95 | ${_("This is just a range of changesets and doesn't have a target or a real merge ancestor.")} | |
96 | %else: |
|
96 | %else: | |
97 | ${h.link_to_ref(c.pull_request.other_repo.repo_name, c.a_ref_type, c.a_ref_name)} |
|
97 | ${h.link_to_ref(c.pull_request.other_repo.repo_name, c.a_ref_type, c.a_ref_name)} | |
98 | ## we don't know other rev - c.a_rev is ancestor and not necessarily on other_name_branch branch |
|
98 | ## we don't know other rev - c.a_rev is ancestor and not necessarily on other_name_branch branch | |
99 | %endif |
|
99 | %endif | |
100 | </div> |
|
100 | </div> | |
101 | </div> |
|
101 | </div> | |
102 | <div class="form-group"> |
|
102 | <div class="form-group"> | |
103 | <label>${_('Pull changes')}:</label> |
|
103 | <label>${_('Pull changes')}:</label> | |
104 | <div> |
|
104 | <div> | |
105 | %if c.cs_ranges: |
|
105 | %if c.cs_ranges: | |
106 | <div> |
|
106 | <div> | |
107 | ## TODO: use cs_ranges[-1] or org_ref_parts[1] in both cases? |
|
107 | ## TODO: use cs_ranges[-1] or org_ref_parts[1] in both cases? | |
108 | %if h.is_hg(c.pull_request.org_repo): |
|
108 | %if h.is_hg(c.pull_request.org_repo): | |
109 | <span>hg pull ${c.pull_request.org_repo.clone_url()} -r ${h.short_id(c.cs_ranges[-1].raw_id)}</span> |
|
109 | <span>hg pull ${c.pull_request.org_repo.clone_url()} -r ${h.short_id(c.cs_ranges[-1].raw_id)}</span> | |
110 | %elif h.is_git(c.pull_request.org_repo): |
|
110 | %elif h.is_git(c.pull_request.org_repo): | |
111 | <span>git pull ${c.pull_request.org_repo.clone_url()} ${c.pull_request.org_ref_parts[1]}</span> |
|
111 | <span>git pull ${c.pull_request.org_repo.clone_url()} ${c.pull_request.org_ref_parts[1]}</span> | |
112 | %endif |
|
112 | %endif | |
113 | </div> |
|
113 | </div> | |
114 | %endif |
|
114 | %endif | |
115 | </div> |
|
115 | </div> | |
116 | </div> |
|
116 | </div> | |
117 | <div class="form-group"> |
|
117 | <div class="form-group"> | |
118 | <label>${_('Created on')}:</label> |
|
118 | <label>${_('Created on')}:</label> | |
119 | <div> |
|
119 | <div> | |
120 | <div>${h.fmt_date(c.pull_request.created_on)}</div> |
|
120 | <div>${h.fmt_date(c.pull_request.created_on)}</div> | |
121 | </div> |
|
121 | </div> | |
122 | </div> |
|
122 | </div> | |
123 | <div class="form-group"> |
|
123 | <div class="form-group"> | |
124 | <label>${_('Owner')}:</label> |
|
124 | <label>${_('Owner')}:</label> | |
125 | <div class="pr-not-edit"> |
|
125 | <div class="pr-not-edit"> | |
126 | ${h.gravatar_div(c.pull_request.owner.email, size=20)} |
|
126 | ${h.gravatar_div(c.pull_request.owner.email, size=20)} | |
127 | <span>${c.pull_request.owner.full_name_and_username}</span><br/> |
|
127 | <span>${c.pull_request.owner.full_name_and_username}</span><br/> | |
128 | <span><a href="mailto:${c.pull_request.owner.email}">${c.pull_request.owner.email}</a></span><br/> |
|
128 | <span><a href="mailto:${c.pull_request.owner.email}">${c.pull_request.owner.email}</a></span><br/> | |
129 | </div> |
|
129 | </div> | |
130 | <div class="pr-do-edit" style="display:none"> |
|
130 | <div class="pr-do-edit" style="display:none"> | |
131 | ${h.text('owner', class_='form-control', value=c.pull_request.owner.username, placeholder=_('Type name of user'))} |
|
131 | ${h.text('owner', class_='form-control', value=c.pull_request.owner.username, placeholder=_('Type name of user'))} | |
132 | </div> |
|
132 | </div> | |
133 | </div> |
|
133 | </div> | |
134 |
|
134 | |||
135 | <div class="form-group"> |
|
135 | <div class="form-group"> | |
136 | <label>${_('Next iteration')}:</label> |
|
136 | <label>${_('Next iteration')}:</label> | |
137 | <div> |
|
137 | <div> | |
138 | <p>${c.update_msg}</p> |
|
138 | <p>${c.update_msg}</p> | |
139 | %if c.avail_revs: |
|
139 | %if c.avail_revs: | |
140 | <div id="updaterevs" class="clearfix"> |
|
140 | <div id="updaterevs" class="clearfix"> | |
141 | <div id="updaterevs-graph"> |
|
141 | <div id="updaterevs-graph"> | |
142 | <canvas id="avail_graph_canvas"></canvas> |
|
142 | <canvas id="avail_graph_canvas"></canvas> | |
143 | </div> |
|
143 | </div> | |
144 | <table class="table" id="updaterevs-table"> |
|
144 | <table class="table" id="updaterevs-table"> | |
145 | %for cnt, cs in enumerate(c.avail_cs): |
|
145 | %for cnt, cs in enumerate(c.avail_cs): | |
146 | <tr id="chg_available_${cnt+1}" class="${'mergerow' if len(cs.parents) > 1 and not (editable and cs.revision in c.avail_revs) else ''}"> |
|
146 | <tr id="chg_available_${cnt+1}" class="${'mergerow' if len(cs.parents) > 1 and not (editable and cs.revision in c.avail_revs) else ''}"> | |
147 | %if c.cs_ranges and cs.revision == c.cs_ranges[-1].revision: |
|
147 | %if c.cs_ranges and cs.revision == c.cs_ranges[-1].revision: | |
148 | %if editable: |
|
148 | %if editable: | |
149 | <td> |
|
149 | <td> | |
150 | ${h.radio(name='updaterev', value='', checked=True)} |
|
150 | ${h.radio(name='updaterev', value='', checked=True)} | |
151 | </td> |
|
151 | </td> | |
152 | %endif |
|
152 | %endif | |
153 | <td colspan="4"><span>${_("Current revision - no change")}</span></td> |
|
153 | <td colspan="4"><span>${_("Current revision - no change")}</span></td> | |
154 | %else: |
|
154 | %else: | |
155 | %if editable: |
|
155 | %if editable: | |
156 | <td> |
|
156 | <td> | |
157 | ${h.radio(name='updaterev', value=cs.raw_id, style=None if cs.revision in c.avail_revs else 'visibility: hidden')} |
|
157 | ${h.radio(name='updaterev', value=cs.raw_id, style=None if cs.revision in c.avail_revs else 'visibility: hidden')} | |
158 | </td> |
|
158 | </td> | |
159 | %endif |
|
159 | %endif | |
160 | <td><span data-toggle="tooltip" title="${h.age(cs.date)}">${cs.date}</span></td> |
|
160 | <td><span data-toggle="tooltip" title="${h.age(cs.date)}">${cs.date}</span></td> | |
161 | <td>${h.link_to(h.show_id(cs),h.url('changeset_home',repo_name=c.cs_repo.repo_name,revision=cs.raw_id), class_='changeset_hash')}</td> |
|
161 | <td>${h.link_to(h.show_id(cs),h.url('changeset_home',repo_name=c.cs_repo.repo_name,revision=cs.raw_id), class_='changeset_hash')}</td> | |
162 | <td> |
|
162 | <td> | |
163 | <div class="pull-right"> |
|
163 | <div class="pull-right"> | |
164 | %for tag in cs.tags: |
|
164 | %for tag in cs.tags: | |
165 | <span class="label label-tag" title="${_('Tag %s') % tag}"> |
|
165 | <span class="label label-tag" title="${_('Tag %s') % tag}"> | |
166 | ${h.link_to(tag,h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id))} |
|
166 | ${h.link_to(tag,h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id))} | |
167 | </span> |
|
167 | </span> | |
168 | %endfor |
|
168 | %endfor | |
169 | </div> |
|
169 | </div> | |
170 | <div class="message">${h.urlify_text(cs.message, c.repo_name)}</div> |
|
170 | <div class="message">${h.urlify_text(cs.message, c.repo_name)}</div> | |
171 | </td> |
|
171 | </td> | |
172 | %endif |
|
172 | %endif | |
173 | </tr> |
|
173 | </tr> | |
174 | %endfor |
|
174 | %endfor | |
175 | </table> |
|
175 | </table> | |
176 | </div> |
|
176 | </div> | |
177 | <div class="alert alert-info">${_("Pull request iterations do not change content once created. Select a revision to create a new iteration.")}</div> |
|
177 | <div class="alert alert-info">${_("Pull request iterations do not change content once created. Select a revision to create a new iteration.")}</div> | |
178 | %endif |
|
178 | %endif | |
179 | %if c.update_msg_other: |
|
179 | %if c.update_msg_other: | |
180 | <div class="alert alert-info">${c.update_msg_other}</div> |
|
180 | <div class="alert alert-info">${c.update_msg_other}</div> | |
181 | %endif |
|
181 | %endif | |
182 | </div> |
|
182 | </div> | |
183 | </div> |
|
183 | </div> | |
184 | %if editable: |
|
184 | %if editable: | |
185 | <div class="form-group"> |
|
185 | <div class="form-group"> | |
186 | <div class="buttons"> |
|
186 | <div class="buttons"> | |
187 | ${h.submit('pr-form-save',_('Save Changes'),class_="btn btn-default btn-sm")} |
|
187 | ${h.submit('pr-form-save',_('Save Changes'),class_="btn btn-default btn-sm")} | |
188 | ${h.submit('pr-form-clone',_('Create New Iteration with Changes'),class_="btn btn-default btn-sm",disabled='disabled')} |
|
188 | ${h.submit('pr-form-clone',_('Create New Iteration with Changes'),class_="btn btn-default btn-sm",disabled='disabled')} | |
189 | ${h.reset('pr-form-reset',_('Cancel Changes'),class_="btn btn-default btn-sm")} |
|
189 | ${h.reset('pr-form-reset',_('Cancel Changes'),class_="btn btn-default btn-sm")} | |
190 | </div> |
|
190 | </div> | |
191 | </div> |
|
191 | </div> | |
192 | %endif |
|
192 | %endif | |
193 | </div> |
|
193 | </div> | |
194 | </div> |
|
194 | </div> | |
195 | ## REVIEWERS |
|
195 | ## REVIEWERS | |
196 | <div class="pr-reviewers-box pull-left"> |
|
196 | <div class="pr-reviewers-box pull-left"> | |
197 | <h4 class="pr-details-title">${_('Reviewers')}</h4> |
|
197 | <h4 class="pr-details-title">${_('Reviewers')}</h4> | |
198 | <div id="reviewers"> |
|
198 | <div id="reviewers"> | |
199 | ## members goes here ! |
|
199 | ## members goes here ! | |
200 | <div> |
|
200 | <div> | |
201 | %for member,status in c.pull_request_reviewers: |
|
201 | %for member,status in c.pull_request_reviewers: | |
202 | <input type="hidden" value="${member.user_id}" name="org_review_members" /> |
|
202 | <input type="hidden" value="${member.user_id}" name="org_review_members" /> | |
203 | %endfor |
|
203 | %endfor | |
204 | <ul id="review_members" class="list-unstyled"> |
|
204 | <ul id="review_members" class="list-unstyled"> | |
205 | %for member,status in c.pull_request_reviewers: |
|
205 | %for member,status in c.pull_request_reviewers: | |
206 | ## WARNING: the HTML below is duplicate with |
|
206 | ## WARNING: the HTML below is duplicate with | |
207 | ## kallithea/public/js/base.js |
|
207 | ## kallithea/public/js/base.js | |
208 | ## If you change something here it should be reflected in the template too. |
|
208 | ## If you change something here it should be reflected in the template too. | |
209 | <li id="reviewer_${member.user_id}"> |
|
209 | <li id="reviewer_${member.user_id}"> | |
210 | <span class="reviewers_member"> |
|
210 | <span class="reviewers_member"> | |
211 | <input type="hidden" value="${member.user_id}" name="review_members" /> |
|
211 | <input type="hidden" value="${member.user_id}" name="review_members" /> | |
212 | <span class="reviewer_status" data-toggle="tooltip" title="${h.changeset_status_lbl(status)}"> |
|
212 | <span class="reviewer_status" data-toggle="tooltip" title="${h.changeset_status_lbl(status)}"> | |
213 | <i class="icon-circle changeset-status-${status}"></i> |
|
213 | <i class="icon-circle changeset-status-${status}"></i> | |
214 | </span> |
|
214 | </span> | |
215 | ${h.gravatar(member.email, size=14)} |
|
215 | ${h.gravatar(member.email, size=14)} | |
216 | <span> |
|
216 | <span> | |
217 | ${member.full_name_and_username} |
|
217 | ${member.full_name_and_username} | |
218 | %if c.pull_request.owner_id == member.user_id: |
|
218 | %if c.pull_request.owner_id == member.user_id: | |
219 | (${_('Owner')}) |
|
219 | (${_('Owner')}) | |
220 | %endif |
|
220 | %endif | |
221 | </span> |
|
221 | </span> | |
222 | %if editable: |
|
222 | %if editable: | |
223 | <a href="#" class="reviewer_member_remove" onclick="removeReviewMember(${member.user_id})" title="${_('Remove reviewer')}"> |
|
223 | <a href="#" class="reviewer_member_remove" onclick="removeReviewMember(${member.user_id})" title="${_('Remove reviewer')}"> | |
224 | <i class="icon-minus-circled"></i> |
|
224 | <i class="icon-minus-circled"></i> | |
225 | </a> |
|
225 | </a> | |
226 | %endif |
|
226 | %endif | |
227 | </span> |
|
227 | </span> | |
228 | </li> |
|
228 | </li> | |
229 | %endfor |
|
229 | %endfor | |
230 | </ul> |
|
230 | </ul> | |
231 | </div> |
|
231 | </div> | |
232 | %if editable: |
|
232 | %if editable: | |
233 | <div> |
|
233 | <div> | |
234 | ${h.text('user', class_='form-control',placeholder=_('Type name of reviewer to add'))} |
|
234 | ${h.text('user', class_='form-control',placeholder=_('Type name of reviewer to add'))} | |
235 | </div> |
|
235 | </div> | |
236 | %endif |
|
236 | %endif | |
237 | </div> |
|
237 | </div> | |
238 |
|
238 | |||
239 | %if not c.pull_request_reviewers: |
|
239 | %if not c.pull_request_reviewers: | |
240 | <h4>${_('Potential Reviewers')}</h4> |
|
240 | <h4>${_('Potential Reviewers')}</h4> | |
241 | <div> |
|
241 | <div> | |
242 | <div> |
|
242 | <div> | |
243 | ${_('Click to add the repository owner as reviewer:')} |
|
243 | ${_('Click to add the repository owner as reviewer:')} | |
244 | </div> |
|
244 | </div> | |
245 | <ul class="list-unstyled"> |
|
245 | <ul class="list-unstyled"> | |
246 | %for u in [c.pull_request.other_repo.owner]: |
|
246 | %for u in [c.pull_request.other_repo.owner]: | |
247 | <li> |
|
247 | <li> | |
248 | <a class="btn btn-default btn-xs missing_reviewer missing_reviewer_${u.user_id}" |
|
248 | <a class="btn btn-default btn-xs missing_reviewer missing_reviewer_${u.user_id}" | |
249 | href="#" |
|
249 | href="#" | |
250 | data-user_id="${u.user_id}" |
|
250 | data-user_id="${u.user_id}" | |
251 | data-fname="${u.name}" |
|
251 | data-fname="${u.name}" | |
252 | data-lname="${u.lastname}" |
|
252 | data-lname="${u.lastname}" | |
253 | data-nname="${u.username}" |
|
253 | data-nname="${u.username}" | |
254 | data-gravatar_lnk="${h.gravatar_url(u.email, size=28, default='default')}" |
|
254 | data-gravatar_lnk="${h.gravatar_url(u.email, size=28, default='default')}" | |
255 | data-gravatar_size="14" |
|
255 | data-gravatar_size="14" | |
256 | title="Click to add reviewer to the list, then Save Changes."><i class="icon-plus"></i>${u.full_name}</a> |
|
256 | title="Click to add reviewer to the list, then Save Changes."><i class="icon-plus"></i>${u.full_name}</a> | |
257 | </li> |
|
257 | </li> | |
258 | %endfor |
|
258 | %endfor | |
259 | </ul> |
|
259 | </ul> | |
260 | </div> |
|
260 | </div> | |
261 | %endif |
|
261 | %endif | |
262 | </div> |
|
262 | </div> | |
263 | ${h.end_form()} |
|
263 | ${h.end_form()} | |
264 | </div> |
|
264 | </div> | |
265 |
|
265 | |||
266 | <div class="panel panel-primary"> |
|
266 | <div class="panel panel-primary"> | |
267 | <div class="panel-heading clearfix"> |
|
267 | <div class="panel-heading clearfix"> | |
268 |
<div class=" |
|
268 | <div class="panel-title">${_('Pull Request Content')}</div> | |
269 | </div> |
|
269 | </div> | |
270 | <div class="panel-body"> |
|
270 | <div class="panel-body"> | |
271 | <div> |
|
271 | <div> | |
272 | <div id="changeset_compare_view_content"> |
|
272 | <div id="changeset_compare_view_content"> | |
273 | <h5> |
|
273 | <h5> | |
274 | ${comment.comment_count(c.inline_cnt, len(c.comments))} |
|
274 | ${comment.comment_count(c.inline_cnt, len(c.comments))} | |
275 | </h5> |
|
275 | </h5> | |
276 | ##CS |
|
276 | ##CS | |
277 | <h5> |
|
277 | <h5> | |
278 | ${ungettext('Showing %s commit','Showing %s commits', len(c.cs_ranges)) % len(c.cs_ranges)} |
|
278 | ${ungettext('Showing %s commit','Showing %s commits', len(c.cs_ranges)) % len(c.cs_ranges)} | |
279 | </h5> |
|
279 | </h5> | |
280 | <%include file="/compare/compare_cs.html" /> |
|
280 | <%include file="/compare/compare_cs.html" /> | |
281 |
|
281 | |||
282 | <h5> |
|
282 | <h5> | |
283 | ${_('Common ancestor')}: |
|
283 | ${_('Common ancestor')}: | |
284 | ${h.link_to(h.short_id(c.a_rev),h.url('changeset_home',repo_name=c.a_repo.repo_name,revision=c.a_rev), class_="changeset_hash")} |
|
284 | ${h.link_to(h.short_id(c.a_rev),h.url('changeset_home',repo_name=c.a_repo.repo_name,revision=c.a_rev), class_="changeset_hash")} | |
285 | </h5> |
|
285 | </h5> | |
286 |
|
286 | |||
287 | ## FILES |
|
287 | ## FILES | |
288 | <h5> |
|
288 | <h5> | |
289 | % if c.limited_diff: |
|
289 | % if c.limited_diff: | |
290 | ${ungettext('%s file changed', '%s files changed', len(c.file_diff_data)) % len(c.file_diff_data)}: |
|
290 | ${ungettext('%s file changed', '%s files changed', len(c.file_diff_data)) % len(c.file_diff_data)}: | |
291 | % else: |
|
291 | % else: | |
292 | ${ungettext('%s file changed with %s insertions and %s deletions','%s files changed with %s insertions and %s deletions', len(c.file_diff_data)) % (len(c.file_diff_data),c.lines_added,c.lines_deleted)}: |
|
292 | ${ungettext('%s file changed with %s insertions and %s deletions','%s files changed with %s insertions and %s deletions', len(c.file_diff_data)) % (len(c.file_diff_data),c.lines_added,c.lines_deleted)}: | |
293 | %endif |
|
293 | %endif | |
294 | </h5> |
|
294 | </h5> | |
295 | <div class="cs_files"> |
|
295 | <div class="cs_files"> | |
296 | %if not c.file_diff_data: |
|
296 | %if not c.file_diff_data: | |
297 | <span class="text-muted">${_('No files')}</span> |
|
297 | <span class="text-muted">${_('No files')}</span> | |
298 | %endif |
|
298 | %endif | |
299 | %for fid, url_fid, op, a_path, path, diff, stats in c.file_diff_data: |
|
299 | %for fid, url_fid, op, a_path, path, diff, stats in c.file_diff_data: | |
300 | <div class="cs_${op} clearfix"> |
|
300 | <div class="cs_${op} clearfix"> | |
301 | <span class="node"> |
|
301 | <span class="node"> | |
302 | <i class="icon-diff-${op}"></i> |
|
302 | <i class="icon-diff-${op}"></i> | |
303 | ${h.link_to(h.safe_unicode(path), '#%s' % fid)} |
|
303 | ${h.link_to(h.safe_unicode(path), '#%s' % fid)} | |
304 | </span> |
|
304 | </span> | |
305 | <div class="changes">${h.fancy_file_stats(stats)}</div> |
|
305 | <div class="changes">${h.fancy_file_stats(stats)}</div> | |
306 | </div> |
|
306 | </div> | |
307 | %endfor |
|
307 | %endfor | |
308 | %if c.limited_diff: |
|
308 | %if c.limited_diff: | |
309 | <h5>${_('Changeset was too big and was cut off...')} <a href="${h.url.current(fulldiff=1, **request.GET.mixed())}">${_('Show full diff anyway')}</a></h5> |
|
309 | <h5>${_('Changeset was too big and was cut off...')} <a href="${h.url.current(fulldiff=1, **request.GET.mixed())}">${_('Show full diff anyway')}</a></h5> | |
310 | %endif |
|
310 | %endif | |
311 | </div> |
|
311 | </div> | |
312 | </div> |
|
312 | </div> | |
313 | </div> |
|
313 | </div> | |
314 | </div> |
|
314 | </div> | |
315 | <script> |
|
315 | <script> | |
316 | var _USERS_AC_DATA = ${h.js(c.users_array)}; |
|
316 | var _USERS_AC_DATA = ${h.js(c.users_array)}; | |
317 | // TODO: switch this to pyroutes |
|
317 | // TODO: switch this to pyroutes | |
318 | AJAX_COMMENT_URL = ${h.js(url('pullrequest_comment',repo_name=c.repo_name,pull_request_id=c.pull_request.pull_request_id))}; |
|
318 | AJAX_COMMENT_URL = ${h.js(url('pullrequest_comment',repo_name=c.repo_name,pull_request_id=c.pull_request.pull_request_id))}; | |
319 | AJAX_COMMENT_DELETE_URL = ${h.js(url('pullrequest_comment_delete',repo_name=c.repo_name,comment_id='__COMMENT_ID__'))}; |
|
319 | AJAX_COMMENT_DELETE_URL = ${h.js(url('pullrequest_comment_delete',repo_name=c.repo_name,comment_id='__COMMENT_ID__'))}; | |
320 |
|
320 | |||
321 | pyroutes.register('pullrequest_comment', ${h.js(url('pullrequest_comment',repo_name='%(repo_name)s',pull_request_id='%(pull_request_id)s'))}, ['repo_name', 'pull_request_id']); |
|
321 | pyroutes.register('pullrequest_comment', ${h.js(url('pullrequest_comment',repo_name='%(repo_name)s',pull_request_id='%(pull_request_id)s'))}, ['repo_name', 'pull_request_id']); | |
322 | pyroutes.register('pullrequest_comment_delete', ${h.js(url('pullrequest_comment_delete',repo_name='%(repo_name)s',comment_id='%(comment_id)s'))}, ['repo_name', 'comment_id']); |
|
322 | pyroutes.register('pullrequest_comment_delete', ${h.js(url('pullrequest_comment_delete',repo_name='%(repo_name)s',comment_id='%(comment_id)s'))}, ['repo_name', 'comment_id']); | |
323 |
|
323 | |||
324 | </script> |
|
324 | </script> | |
325 |
|
325 | |||
326 | ## diff block |
|
326 | ## diff block | |
327 | <div class="panel-body"> |
|
327 | <div class="panel-body"> | |
328 | <div class="commentable-diff"> |
|
328 | <div class="commentable-diff"> | |
329 | <%namespace name="diff_block" file="/changeset/diff_block.html"/> |
|
329 | <%namespace name="diff_block" file="/changeset/diff_block.html"/> | |
330 | ${diff_block.diff_block_js()} |
|
330 | ${diff_block.diff_block_js()} | |
331 | ${diff_block.diff_block(c.a_repo.repo_name, c.a_ref_type, c.a_ref_name, c.a_rev, |
|
331 | ${diff_block.diff_block(c.a_repo.repo_name, c.a_ref_type, c.a_ref_name, c.a_rev, | |
332 | c.cs_repo.repo_name, c.cs_ref_type, c.cs_ref_name, c.cs_rev, c.file_diff_data)} |
|
332 | c.cs_repo.repo_name, c.cs_ref_type, c.cs_ref_name, c.cs_rev, c.file_diff_data)} | |
333 | % if c.limited_diff: |
|
333 | % if c.limited_diff: | |
334 | <h4>${_('Changeset was too big and was cut off...')} <a href="${h.url.current(fulldiff=1, **request.GET.mixed())}">${_('Show full diff anyway')}</a></h4> |
|
334 | <h4>${_('Changeset was too big and was cut off...')} <a href="${h.url.current(fulldiff=1, **request.GET.mixed())}">${_('Show full diff anyway')}</a></h4> | |
335 | % endif |
|
335 | % endif | |
336 | </div> |
|
336 | </div> | |
337 |
|
337 | |||
338 | ## template for inline comment form |
|
338 | ## template for inline comment form | |
339 | ${comment.comment_inline_form()} |
|
339 | ${comment.comment_inline_form()} | |
340 |
|
340 | |||
341 | ## render comments and inlines |
|
341 | ## render comments and inlines | |
342 | ${comment.generate_comments()} |
|
342 | ${comment.generate_comments()} | |
343 |
|
343 | |||
344 | ## main comment form and it status |
|
344 | ## main comment form and it status | |
345 | ${comment.comments(change_status=c.allowed_to_change_status)} |
|
345 | ${comment.comments(change_status=c.allowed_to_change_status)} | |
346 |
|
346 | |||
347 | <script type="text/javascript"> |
|
347 | <script type="text/javascript"> | |
348 | $(document).ready(function(){ |
|
348 | $(document).ready(function(){ | |
349 | PullRequestAutoComplete($('#user')); |
|
349 | PullRequestAutoComplete($('#user')); | |
350 | SimpleUserAutoComplete($('#owner')); |
|
350 | SimpleUserAutoComplete($('#owner')); | |
351 |
|
351 | |||
352 | $('.code-difftable').on('click', '.add-bubble', function(e){ |
|
352 | $('.code-difftable').on('click', '.add-bubble', function(e){ | |
353 | show_comment_form($(this)); |
|
353 | show_comment_form($(this)); | |
354 | }); |
|
354 | }); | |
355 |
|
355 | |||
356 | var avail_jsdata = ${h.js(c.avail_jsdata)}; |
|
356 | var avail_jsdata = ${h.js(c.avail_jsdata)}; | |
357 | var avail_r = new BranchRenderer('avail_graph_canvas', 'updaterevs-table', 'chg_available_'); |
|
357 | var avail_r = new BranchRenderer('avail_graph_canvas', 'updaterevs-table', 'chg_available_'); | |
358 | avail_r.render(avail_jsdata); |
|
358 | avail_r.render(avail_jsdata); | |
359 |
|
359 | |||
360 | move_comments($(".comments .comments-list-chunk")); |
|
360 | move_comments($(".comments .comments-list-chunk")); | |
361 |
|
361 | |||
362 | $('#updaterevs input').change(function(e){ |
|
362 | $('#updaterevs input').change(function(e){ | |
363 | var update = !!e.target.value; |
|
363 | var update = !!e.target.value; | |
364 | $('#pr-form-save').prop('disabled',update); |
|
364 | $('#pr-form-save').prop('disabled',update); | |
365 | $('#pr-form-clone').prop('disabled',!update); |
|
365 | $('#pr-form-clone').prop('disabled',!update); | |
366 | }); |
|
366 | }); | |
367 | var $org_review_members = $('#review_members').clone(); |
|
367 | var $org_review_members = $('#review_members').clone(); | |
368 | $('#pr-form-reset').click(function(e){ |
|
368 | $('#pr-form-reset').click(function(e){ | |
369 | $('.pr-do-edit').hide(); |
|
369 | $('.pr-do-edit').hide(); | |
370 | $('.pr-not-edit').show(); |
|
370 | $('.pr-not-edit').show(); | |
371 | $('#pr-form-save').prop('disabled',false); |
|
371 | $('#pr-form-save').prop('disabled',false); | |
372 | $('#pr-form-clone').prop('disabled',true); |
|
372 | $('#pr-form-clone').prop('disabled',true); | |
373 | $('#review_members').html($org_review_members); |
|
373 | $('#review_members').html($org_review_members); | |
374 | }); |
|
374 | }); | |
375 |
|
375 | |||
376 | // hack: re-navigate to target after JS is done ... if a target is set and setting href thus won't reload |
|
376 | // hack: re-navigate to target after JS is done ... if a target is set and setting href thus won't reload | |
377 | if (window.location.hash != "") { |
|
377 | if (window.location.hash != "") { | |
378 | window.location.href = window.location.href; |
|
378 | window.location.href = window.location.href; | |
379 | } |
|
379 | } | |
380 |
|
380 | |||
381 | $('.missing_reviewer').click(function(){ |
|
381 | $('.missing_reviewer').click(function(){ | |
382 | var $this = $(this); |
|
382 | var $this = $(this); | |
383 | addReviewMember($this.data('user_id'), $this.data('fname'), $this.data('lname'), $this.data('nname'), $this.data('gravatar_lnk'), $this.data('gravatar_size')); |
|
383 | addReviewMember($this.data('user_id'), $this.data('fname'), $this.data('lname'), $this.data('nname'), $this.data('gravatar_lnk'), $this.data('gravatar_size')); | |
384 | }); |
|
384 | }); | |
385 | }); |
|
385 | }); | |
386 | </script> |
|
386 | </script> | |
387 | </div> |
|
387 | </div> | |
388 |
|
388 | |||
389 | </div> |
|
389 | </div> | |
390 |
|
390 | |||
391 | </%def> |
|
391 | </%def> |
@@ -1,407 +1,407 b'' | |||||
1 | <%inherit file="/base/base.html"/> |
|
1 | <%inherit file="/base/base.html"/> | |
2 | <%namespace name="changelog_table" file="/changelog/changelog_table.html"/> |
|
2 | <%namespace name="changelog_table" file="/changelog/changelog_table.html"/> | |
3 |
|
3 | |||
4 | <%block name="title"> |
|
4 | <%block name="title"> | |
5 | ${_('%s Summary') % c.repo_name} |
|
5 | ${_('%s Summary') % c.repo_name} | |
6 | </%block> |
|
6 | </%block> | |
7 |
|
7 | |||
8 | <%def name="breadcrumbs_links()"> |
|
8 | <%def name="breadcrumbs_links()"> | |
9 | ${_('Summary')} |
|
9 | ${_('Summary')} | |
10 |
|
10 | |||
11 | ## locking icon |
|
11 | ## locking icon | |
12 | %if c.db_repo.enable_locking: |
|
12 | %if c.db_repo.enable_locking: | |
13 | %if c.db_repo.locked[0]: |
|
13 | %if c.db_repo.locked[0]: | |
14 | <span class="locking_locked icon-block" data-toggle="tooltip" title="${_('Repository locked by %s') % h.person_by_id(c.db_repo.locked[0])}"></span> |
|
14 | <span class="locking_locked icon-block" data-toggle="tooltip" title="${_('Repository locked by %s') % h.person_by_id(c.db_repo.locked[0])}"></span> | |
15 | %else: |
|
15 | %else: | |
16 | <span class="locking_unlocked icon-ok" data-toggle="tooltip" title="${_('Repository unlocked')}"></span> |
|
16 | <span class="locking_unlocked icon-ok" data-toggle="tooltip" title="${_('Repository unlocked')}"></span> | |
17 | %endif |
|
17 | %endif | |
18 | %endif |
|
18 | %endif | |
19 |
|
19 | |||
20 | ##FORK |
|
20 | ##FORK | |
21 | %if c.db_repo.fork: |
|
21 | %if c.db_repo.fork: | |
22 | - <i class="icon-fork"></i>${_('Fork of')} "<a href="${h.url('summary_home',repo_name=c.db_repo.fork.repo_name)}">${c.db_repo.fork.repo_name}</a>" |
|
22 | - <i class="icon-fork"></i>${_('Fork of')} "<a href="${h.url('summary_home',repo_name=c.db_repo.fork.repo_name)}">${c.db_repo.fork.repo_name}</a>" | |
23 | %endif |
|
23 | %endif | |
24 |
|
24 | |||
25 | ##REMOTE |
|
25 | ##REMOTE | |
26 | %if c.db_repo.clone_uri: |
|
26 | %if c.db_repo.clone_uri: | |
27 | - <i class="icon-fork"></i>${_('Clone from')} "<a href="${h.url(str(h.hide_credentials(c.db_repo.clone_uri)))}">${h.hide_credentials(c.db_repo.clone_uri)}</a>" |
|
27 | - <i class="icon-fork"></i>${_('Clone from')} "<a href="${h.url(str(h.hide_credentials(c.db_repo.clone_uri)))}">${h.hide_credentials(c.db_repo.clone_uri)}</a>" | |
28 | %endif |
|
28 | %endif | |
29 | </%def> |
|
29 | </%def> | |
30 |
|
30 | |||
31 | <%block name="header_menu"> |
|
31 | <%block name="header_menu"> | |
32 | ${self.menu('repositories')} |
|
32 | ${self.menu('repositories')} | |
33 | </%block> |
|
33 | </%block> | |
34 |
|
34 | |||
35 | <%block name="head_extra"> |
|
35 | <%block name="head_extra"> | |
36 | <link href="${h.url('atom_feed_home',repo_name=c.db_repo.repo_name,api_key=request.authuser.api_key)}" rel="alternate" title="${_('%s ATOM feed') % c.repo_name}" type="application/atom+xml" /> |
|
36 | <link href="${h.url('atom_feed_home',repo_name=c.db_repo.repo_name,api_key=request.authuser.api_key)}" rel="alternate" title="${_('%s ATOM feed') % c.repo_name}" type="application/atom+xml" /> | |
37 | <link href="${h.url('rss_feed_home',repo_name=c.db_repo.repo_name,api_key=request.authuser.api_key)}" rel="alternate" title="${_('%s RSS feed') % c.repo_name}" type="application/rss+xml" /> |
|
37 | <link href="${h.url('rss_feed_home',repo_name=c.db_repo.repo_name,api_key=request.authuser.api_key)}" rel="alternate" title="${_('%s RSS feed') % c.repo_name}" type="application/rss+xml" /> | |
38 |
|
38 | |||
39 | <script> |
|
39 | <script> | |
40 | redirect_hash_branch = function(){ |
|
40 | redirect_hash_branch = function(){ | |
41 | var branch = window.location.hash.replace(/^#(.*)/, '$1'); |
|
41 | var branch = window.location.hash.replace(/^#(.*)/, '$1'); | |
42 | if (branch){ |
|
42 | if (branch){ | |
43 | window.location = ${h.js(h.url('changelog_home',repo_name=c.repo_name,branch='__BRANCH__'))} |
|
43 | window.location = ${h.js(h.url('changelog_home',repo_name=c.repo_name,branch='__BRANCH__'))} | |
44 | .replace('__BRANCH__',branch); |
|
44 | .replace('__BRANCH__',branch); | |
45 | } |
|
45 | } | |
46 | } |
|
46 | } | |
47 | redirect_hash_branch(); |
|
47 | redirect_hash_branch(); | |
48 | window.onhashchange = function() { |
|
48 | window.onhashchange = function() { | |
49 | redirect_hash_branch(); |
|
49 | redirect_hash_branch(); | |
50 | }; |
|
50 | }; | |
51 | </script> |
|
51 | </script> | |
52 | </%block> |
|
52 | </%block> | |
53 |
|
53 | |||
54 | <%def name="main()"> |
|
54 | <%def name="main()"> | |
55 | ${self.repo_context_bar('summary')} |
|
55 | ${self.repo_context_bar('summary')} | |
56 | <div class="panel panel-primary"> |
|
56 | <div class="panel panel-primary"> | |
57 | <div class="panel-heading clearfix"> |
|
57 | <div class="panel-heading clearfix"> | |
58 | ${self.breadcrumbs()} |
|
58 | ${self.breadcrumbs()} | |
59 | </div> |
|
59 | </div> | |
60 | <div id="summary-panel-body" class="form panel-body"> |
|
60 | <div id="summary-panel-body" class="form panel-body"> | |
61 | <div id="summary" class="pull-left"> |
|
61 | <div id="summary" class="pull-left"> | |
62 | <div class="form-group form-inline"> |
|
62 | <div class="form-group form-inline"> | |
63 | <label>${_('Clone URL')}:</label> |
|
63 | <label>${_('Clone URL')}:</label> | |
64 | <div id="clone-url"> |
|
64 | <div id="clone-url"> | |
65 | <div id="clone_by_name" class="input-group"> |
|
65 | <div id="clone_by_name" class="input-group"> | |
66 | <span class="input-group-addon">${self.repolabel(c.db_repo)}</span> |
|
66 | <span class="input-group-addon">${self.repolabel(c.db_repo)}</span> | |
67 | <input class="form-control" size="80" readonly="readonly" value="${c.clone_repo_url}"/> |
|
67 | <input class="form-control" size="80" readonly="readonly" value="${c.clone_repo_url}"/> | |
68 | <span class="input-group-addon btn">${_('Show by ID')}</span> |
|
68 | <span class="input-group-addon btn">${_('Show by ID')}</span> | |
69 | </div> |
|
69 | </div> | |
70 | <div id="clone_by_id" class="input-group" style="display:none"> |
|
70 | <div id="clone_by_id" class="input-group" style="display:none"> | |
71 | <span class="input-group-addon">${self.repolabel(c.db_repo)}</span> |
|
71 | <span class="input-group-addon">${self.repolabel(c.db_repo)}</span> | |
72 | <input class="form-control" size="80" readonly="readonly" value="${c.clone_repo_url_id}"/> |
|
72 | <input class="form-control" size="80" readonly="readonly" value="${c.clone_repo_url_id}"/> | |
73 | <span class="input-group-addon btn">${_('Show by Name')}</span> |
|
73 | <span class="input-group-addon btn">${_('Show by Name')}</span> | |
74 | </div> |
|
74 | </div> | |
75 | </div> |
|
75 | </div> | |
76 | </div> |
|
76 | </div> | |
77 |
|
77 | |||
78 | <div class="form-group"> |
|
78 | <div class="form-group"> | |
79 | <label>${_('Description')}:</label> |
|
79 | <label>${_('Description')}:</label> | |
80 | <div class="formatted-fixed">${h.urlify_text(c.db_repo.description, stylize=c.visual.stylify_metalabels)}</div> |
|
80 | <div class="formatted-fixed">${h.urlify_text(c.db_repo.description, stylize=c.visual.stylify_metalabels)}</div> | |
81 | </div> |
|
81 | </div> | |
82 |
|
82 | |||
83 | <div class="form-group"> |
|
83 | <div class="form-group"> | |
84 | <label>${_('Trending files')}:</label> |
|
84 | <label>${_('Trending files')}:</label> | |
85 | <div> |
|
85 | <div> | |
86 | %if c.show_stats: |
|
86 | %if c.show_stats: | |
87 | <div id="lang_stats"></div> |
|
87 | <div id="lang_stats"></div> | |
88 | %else: |
|
88 | %else: | |
89 | ${_('Statistics are disabled for this repository')} |
|
89 | ${_('Statistics are disabled for this repository')} | |
90 | %if h.HasPermissionAny('hg.admin')('enable stats on from summary'): |
|
90 | %if h.HasPermissionAny('hg.admin')('enable stats on from summary'): | |
91 | ${h.link_to(_('Enable'),h.url('edit_repo',repo_name=c.repo_name, anchor='repo_enable_statistics'),class_="btn btn-default btn-xs")} |
|
91 | ${h.link_to(_('Enable'),h.url('edit_repo',repo_name=c.repo_name, anchor='repo_enable_statistics'),class_="btn btn-default btn-xs")} | |
92 | %endif |
|
92 | %endif | |
93 | %endif |
|
93 | %endif | |
94 | </div> |
|
94 | </div> | |
95 | </div> |
|
95 | </div> | |
96 |
|
96 | |||
97 | <div class="form-group"> |
|
97 | <div class="form-group"> | |
98 | <label>${_('Download')}:</label> |
|
98 | <label>${_('Download')}:</label> | |
99 | <div> |
|
99 | <div> | |
100 | %if len(c.db_repo_scm_instance.revisions) == 0: |
|
100 | %if len(c.db_repo_scm_instance.revisions) == 0: | |
101 | ${_('There are no downloads yet')} |
|
101 | ${_('There are no downloads yet')} | |
102 | %elif not c.enable_downloads: |
|
102 | %elif not c.enable_downloads: | |
103 | ${_('Downloads are disabled for this repository')} |
|
103 | ${_('Downloads are disabled for this repository')} | |
104 | %if h.HasPermissionAny('hg.admin')('enable downloads on from summary'): |
|
104 | %if h.HasPermissionAny('hg.admin')('enable downloads on from summary'): | |
105 | ${h.link_to(_('Enable'),h.url('edit_repo',repo_name=c.repo_name, anchor='repo_enable_downloads'),class_="btn btn-default btn-xs")} |
|
105 | ${h.link_to(_('Enable'),h.url('edit_repo',repo_name=c.repo_name, anchor='repo_enable_downloads'),class_="btn btn-default btn-xs")} | |
106 | %endif |
|
106 | %endif | |
107 | %else: |
|
107 | %else: | |
108 | <span id="${'zip_link'}"> |
|
108 | <span id="${'zip_link'}"> | |
109 | <a class="btn btn-default btn-sm" href="${h.url('files_archive_home',repo_name=c.db_repo.repo_name,fname='tip.zip')}"><i class="icon-file-zip"></i>${_('Download as zip')}</a> |
|
109 | <a class="btn btn-default btn-sm" href="${h.url('files_archive_home',repo_name=c.db_repo.repo_name,fname='tip.zip')}"><i class="icon-file-zip"></i>${_('Download as zip')}</a> | |
110 | </span> |
|
110 | </span> | |
111 | ${h.hidden('download_options')} |
|
111 | ${h.hidden('download_options')} | |
112 | <span> |
|
112 | <span> | |
113 | <label data-toggle="tooltip" title="${_('Check this to download archive with subrepos')}"> |
|
113 | <label data-toggle="tooltip" title="${_('Check this to download archive with subrepos')}"> | |
114 | <input id="archive_subrepos" type="checkbox" name="subrepos" /> |
|
114 | <input id="archive_subrepos" type="checkbox" name="subrepos" /> | |
115 | ${_('With subrepos')} |
|
115 | ${_('With subrepos')} | |
116 | </label> |
|
116 | </label> | |
117 | </span> |
|
117 | </span> | |
118 | %endif |
|
118 | %endif | |
119 | </div> |
|
119 | </div> | |
120 | </div> |
|
120 | </div> | |
121 | </div> |
|
121 | </div> | |
122 | <ul id="summary-menu-stats" class="list-group pull-right"> |
|
122 | <ul id="summary-menu-stats" class="list-group pull-right"> | |
123 | <li class="list-group-item"> |
|
123 | <li class="list-group-item"> | |
124 | <a title="${_('Owner')} ${c.db_repo.owner.email}"> |
|
124 | <a title="${_('Owner')} ${c.db_repo.owner.email}"> | |
125 | <i class="icon-user"></i>${c.db_repo.owner.username} |
|
125 | <i class="icon-user"></i>${c.db_repo.owner.username} | |
126 | ${h.gravatar_div(c.db_repo.owner.email, size=18, div_class="pull-right")} |
|
126 | ${h.gravatar_div(c.db_repo.owner.email, size=18, div_class="pull-right")} | |
127 | </a> |
|
127 | </a> | |
128 | </li> |
|
128 | </li> | |
129 | <li class="list-group-item"> |
|
129 | <li class="list-group-item"> | |
130 | <a title="${_('Followers')}" href="${h.url('repo_followers_home',repo_name=c.repo_name)}"> |
|
130 | <a title="${_('Followers')}" href="${h.url('repo_followers_home',repo_name=c.repo_name)}"> | |
131 | <i class="icon-heart"></i>${_('Followers')} |
|
131 | <i class="icon-heart"></i>${_('Followers')} | |
132 | <span class="badge pull-right" id="current_followers_count">${c.repository_followers}</span> |
|
132 | <span class="badge pull-right" id="current_followers_count">${c.repository_followers}</span> | |
133 | </a> |
|
133 | </a> | |
134 | </li> |
|
134 | </li> | |
135 | <li class="list-group-item"> |
|
135 | <li class="list-group-item"> | |
136 | <a title="${_('Forks')}" href="${h.url('repo_forks_home',repo_name=c.repo_name)}"> |
|
136 | <a title="${_('Forks')}" href="${h.url('repo_forks_home',repo_name=c.repo_name)}"> | |
137 | <i class="icon-fork"></i>${_('Forks')} |
|
137 | <i class="icon-fork"></i>${_('Forks')} | |
138 | <span class="badge pull-right">${c.repository_forks}</span> |
|
138 | <span class="badge pull-right">${c.repository_forks}</span> | |
139 | </a> |
|
139 | </a> | |
140 | </li> |
|
140 | </li> | |
141 |
|
141 | |||
142 | %if request.authuser.username != 'default': |
|
142 | %if request.authuser.username != 'default': | |
143 | <li class="list-group-item clearfix"> |
|
143 | <li class="list-group-item clearfix"> | |
144 | <a href="#" onclick="javascript:showRepoSize('repo_size_2','${c.db_repo.repo_name}')"> |
|
144 | <a href="#" onclick="javascript:showRepoSize('repo_size_2','${c.db_repo.repo_name}')"> | |
145 | <i class="icon-ruler"></i>${_('Size')} |
|
145 | <i class="icon-ruler"></i>${_('Size')} | |
146 | <span class="badge pull-right" id="repo_size_2"></span> |
|
146 | <span class="badge pull-right" id="repo_size_2"></span> | |
147 | </a> |
|
147 | </a> | |
148 | </li> |
|
148 | </li> | |
149 | %endif |
|
149 | %endif | |
150 |
|
150 | |||
151 | <li class="list-group-item"> |
|
151 | <li class="list-group-item"> | |
152 | %if request.authuser.username != 'default': |
|
152 | %if request.authuser.username != 'default': | |
153 | <a href="${h.url('atom_feed_home',repo_name=c.db_repo.repo_name,api_key=request.authuser.api_key)}"><i class="icon-rss-squared"></i>${_('Feed')}</a> |
|
153 | <a href="${h.url('atom_feed_home',repo_name=c.db_repo.repo_name,api_key=request.authuser.api_key)}"><i class="icon-rss-squared"></i>${_('Feed')}</a> | |
154 | %else: |
|
154 | %else: | |
155 | <a href="${h.url('atom_feed_home',repo_name=c.db_repo.repo_name)}"><i class="icon-rss-squared"></i>${_('Feed')}</a> |
|
155 | <a href="${h.url('atom_feed_home',repo_name=c.db_repo.repo_name)}"><i class="icon-rss-squared"></i>${_('Feed')}</a> | |
156 | %endif |
|
156 | %endif | |
157 | </li> |
|
157 | </li> | |
158 |
|
158 | |||
159 | %if c.show_stats: |
|
159 | %if c.show_stats: | |
160 | <li class="list-group-item"> |
|
160 | <li class="list-group-item"> | |
161 | <a title="${_('Statistics')}" href="${h.url('repo_stats_home',repo_name=c.repo_name)}"> |
|
161 | <a title="${_('Statistics')}" href="${h.url('repo_stats_home',repo_name=c.repo_name)}"> | |
162 | <i class="icon-graph"></i>${_('Statistics')} |
|
162 | <i class="icon-graph"></i>${_('Statistics')} | |
163 | </a> |
|
163 | </a> | |
164 | </li> |
|
164 | </li> | |
165 | %endif |
|
165 | %endif | |
166 | </ul> |
|
166 | </ul> | |
167 | </div> |
|
167 | </div> | |
168 | </div> |
|
168 | </div> | |
169 |
|
169 | |||
170 |
|
170 | |||
171 | <div class="panel panel-primary"> |
|
171 | <div class="panel panel-primary"> | |
172 | <div class="panel-heading"> |
|
172 | <div class="panel-heading"> | |
173 |
<div class=" |
|
173 | <div class="panel-title"> | |
174 | %if c.cs_pagination: |
|
174 | %if c.cs_pagination: | |
175 | ${h.link_to(_('Latest Changes'),h.url('changelog_home',repo_name=c.repo_name))} |
|
175 | ${h.link_to(_('Latest Changes'),h.url('changelog_home',repo_name=c.repo_name))} | |
176 | %else: |
|
176 | %else: | |
177 | ${_('Quick Start')} |
|
177 | ${_('Quick Start')} | |
178 | %endif |
|
178 | %endif | |
179 | </div> |
|
179 | </div> | |
180 | </div> |
|
180 | </div> | |
181 | <div class="panel-body"> |
|
181 | <div class="panel-body"> | |
182 | <div id="shortlog_data"> |
|
182 | <div id="shortlog_data"> | |
183 | %if c.cs_pagination: |
|
183 | %if c.cs_pagination: | |
184 | ${changelog_table.changelog(c.repo_name, c.cs_pagination, c.cs_statuses, c.cs_comments, show_checkbox=False)} |
|
184 | ${changelog_table.changelog(c.repo_name, c.cs_pagination, c.cs_statuses, c.cs_comments, show_checkbox=False)} | |
185 | ${c.cs_pagination.pager()} |
|
185 | ${c.cs_pagination.pager()} | |
186 | %else: |
|
186 | %else: | |
187 | %if h.HasRepoPermissionLevel('write')(c.repo_name): |
|
187 | %if h.HasRepoPermissionLevel('write')(c.repo_name): | |
188 | <h4>${_('Add or upload files directly via Kallithea')}</h4> |
|
188 | <h4>${_('Add or upload files directly via Kallithea')}</h4> | |
189 | <div> |
|
189 | <div> | |
190 | <div id="add_node_id" class="add_node"> |
|
190 | <div id="add_node_id" class="add_node"> | |
191 | <a class="btn btn-default btn-xs" href="${h.url('files_add_home',repo_name=c.repo_name,revision=0,f_path='', anchor='edit')}">${_('Add New File')}</a> |
|
191 | <a class="btn btn-default btn-xs" href="${h.url('files_add_home',repo_name=c.repo_name,revision=0,f_path='', anchor='edit')}">${_('Add New File')}</a> | |
192 | </div> |
|
192 | </div> | |
193 | </div> |
|
193 | </div> | |
194 | %endif |
|
194 | %endif | |
195 |
|
195 | |||
196 | <h4>${_('Push new repository')}</h4> |
|
196 | <h4>${_('Push new repository')}</h4> | |
197 | <pre> |
|
197 | <pre> | |
198 | ${c.db_repo_scm_instance.alias} clone ${c.clone_repo_url} |
|
198 | ${c.db_repo_scm_instance.alias} clone ${c.clone_repo_url} | |
199 | ${c.db_repo_scm_instance.alias} add README # add first file |
|
199 | ${c.db_repo_scm_instance.alias} add README # add first file | |
200 | ${c.db_repo_scm_instance.alias} commit -m "Initial" # commit with message |
|
200 | ${c.db_repo_scm_instance.alias} commit -m "Initial" # commit with message | |
201 | ${c.db_repo_scm_instance.alias} push ${'origin master' if h.is_git(c.db_repo_scm_instance) else ''} # push changes back |
|
201 | ${c.db_repo_scm_instance.alias} push ${'origin master' if h.is_git(c.db_repo_scm_instance) else ''} # push changes back | |
202 | </pre> |
|
202 | </pre> | |
203 |
|
203 | |||
204 | <h4>${_('Existing repository?')}</h4> |
|
204 | <h4>${_('Existing repository?')}</h4> | |
205 | <pre> |
|
205 | <pre> | |
206 | %if h.is_git(c.db_repo_scm_instance): |
|
206 | %if h.is_git(c.db_repo_scm_instance): | |
207 | git remote add origin ${c.clone_repo_url} |
|
207 | git remote add origin ${c.clone_repo_url} | |
208 | git push -u origin master |
|
208 | git push -u origin master | |
209 | %else: |
|
209 | %else: | |
210 | hg push ${c.clone_repo_url} |
|
210 | hg push ${c.clone_repo_url} | |
211 | %endif |
|
211 | %endif | |
212 | </pre> |
|
212 | </pre> | |
213 | %endif |
|
213 | %endif | |
214 | </div> |
|
214 | </div> | |
215 | </div> |
|
215 | </div> | |
216 | </div> |
|
216 | </div> | |
217 |
|
217 | |||
218 | %if c.readme_data: |
|
218 | %if c.readme_data: | |
219 | <div id="readme" class="anchor"> |
|
219 | <div id="readme" class="anchor"> | |
220 | </div> |
|
220 | </div> | |
221 | <div class="panel panel-primary"> |
|
221 | <div class="panel panel-primary"> | |
222 | <div class="panel-heading" title="${_('Readme file from revision %s:%s') % (c.db_repo.landing_rev[0], c.db_repo.landing_rev[1])}"> |
|
222 | <div class="panel-heading" title="${_('Readme file from revision %s:%s') % (c.db_repo.landing_rev[0], c.db_repo.landing_rev[1])}"> | |
223 |
<div class=" |
|
223 | <div class="panel-title"> | |
224 | <a href="${h.url('files_home',repo_name=c.repo_name,revision='tip',f_path=c.readme_file)}">${c.readme_file}</a> |
|
224 | <a href="${h.url('files_home',repo_name=c.repo_name,revision='tip',f_path=c.readme_file)}">${c.readme_file}</a> | |
225 | </div> |
|
225 | </div> | |
226 | </div> |
|
226 | </div> | |
227 | <div class="readme panel-body"> |
|
227 | <div class="readme panel-body"> | |
228 | ${c.readme_data|n} |
|
228 | ${c.readme_data|n} | |
229 | </div> |
|
229 | </div> | |
230 | </div> |
|
230 | </div> | |
231 | %endif |
|
231 | %endif | |
232 |
|
232 | |||
233 | <script type="text/javascript"> |
|
233 | <script type="text/javascript"> | |
234 | $(document).ready(function(){ |
|
234 | $(document).ready(function(){ | |
235 | $('#clone-url input').click(function(e){ |
|
235 | $('#clone-url input').click(function(e){ | |
236 | if($(this).hasClass('selected')){ |
|
236 | if($(this).hasClass('selected')){ | |
237 | $(this).removeClass('selected'); |
|
237 | $(this).removeClass('selected'); | |
238 | return ; |
|
238 | return ; | |
239 | }else{ |
|
239 | }else{ | |
240 | $(this).addClass('selected'); |
|
240 | $(this).addClass('selected'); | |
241 | $(this).select(); |
|
241 | $(this).select(); | |
242 | } |
|
242 | } | |
243 | }); |
|
243 | }); | |
244 |
|
244 | |||
245 | var $clone_by_name = $('#clone_by_name'); |
|
245 | var $clone_by_name = $('#clone_by_name'); | |
246 | var $clone_by_id = $('#clone_by_id'); |
|
246 | var $clone_by_id = $('#clone_by_id'); | |
247 | $clone_by_name.find('.btn').click(function(e){ |
|
247 | $clone_by_name.find('.btn').click(function(e){ | |
248 | $clone_by_name.hide(); |
|
248 | $clone_by_name.hide(); | |
249 | $clone_by_id.show(); |
|
249 | $clone_by_id.show(); | |
250 | }); |
|
250 | }); | |
251 | $clone_by_id.find('.btn').click(function(e){ |
|
251 | $clone_by_id.find('.btn').click(function(e){ | |
252 | $clone_by_id.hide(); |
|
252 | $clone_by_id.hide(); | |
253 | $clone_by_name.show(); |
|
253 | $clone_by_name.show(); | |
254 | }); |
|
254 | }); | |
255 |
|
255 | |||
256 | var cache = {} |
|
256 | var cache = {} | |
257 | $("#download_options").select2({ |
|
257 | $("#download_options").select2({ | |
258 | placeholder: _TM['Select changeset'], |
|
258 | placeholder: _TM['Select changeset'], | |
259 | dropdownAutoWidth: true, |
|
259 | dropdownAutoWidth: true, | |
260 | query: function(query){ |
|
260 | query: function(query){ | |
261 | var key = 'cache'; |
|
261 | var key = 'cache'; | |
262 | var cached = cache[key] ; |
|
262 | var cached = cache[key] ; | |
263 | if(cached) { |
|
263 | if(cached) { | |
264 | var data = {results: []}; |
|
264 | var data = {results: []}; | |
265 | //filter results |
|
265 | //filter results | |
266 | $.each(cached.results, function(){ |
|
266 | $.each(cached.results, function(){ | |
267 | var section = this.text; |
|
267 | var section = this.text; | |
268 | var children = []; |
|
268 | var children = []; | |
269 | $.each(this.children, function(){ |
|
269 | $.each(this.children, function(){ | |
270 | if(query.term.length == 0 || this.text.toUpperCase().indexOf(query.term.toUpperCase()) >= 0 ){ |
|
270 | if(query.term.length == 0 || this.text.toUpperCase().indexOf(query.term.toUpperCase()) >= 0 ){ | |
271 | children.push({'id': this.id, 'text': this.text}); |
|
271 | children.push({'id': this.id, 'text': this.text}); | |
272 | } |
|
272 | } | |
273 | }); |
|
273 | }); | |
274 | data.results.push({'text': section, 'children': children}); |
|
274 | data.results.push({'text': section, 'children': children}); | |
275 | }); |
|
275 | }); | |
276 | query.callback(data); |
|
276 | query.callback(data); | |
277 | }else{ |
|
277 | }else{ | |
278 | $.ajax({ |
|
278 | $.ajax({ | |
279 | url: pyroutes.url('repo_refs_data', {'repo_name': ${h.js(c.repo_name)}}), |
|
279 | url: pyroutes.url('repo_refs_data', {'repo_name': ${h.js(c.repo_name)}}), | |
280 | data: {}, |
|
280 | data: {}, | |
281 | dataType: 'json', |
|
281 | dataType: 'json', | |
282 | type: 'GET', |
|
282 | type: 'GET', | |
283 | success: function(data) { |
|
283 | success: function(data) { | |
284 | cache[key] = data; |
|
284 | cache[key] = data; | |
285 | query.callback({results: data.results}); |
|
285 | query.callback({results: data.results}); | |
286 | } |
|
286 | } | |
287 | }); |
|
287 | }); | |
288 | } |
|
288 | } | |
289 | } |
|
289 | } | |
290 | }); |
|
290 | }); | |
291 | // on change of download options |
|
291 | // on change of download options | |
292 | $('#download_options').change(function(e){ |
|
292 | $('#download_options').change(function(e){ | |
293 | var new_cs = e.added |
|
293 | var new_cs = e.added | |
294 |
|
294 | |||
295 | for(k in tmpl_links){ |
|
295 | for(k in tmpl_links){ | |
296 | var s = $('#'+k+'_link'); |
|
296 | var s = $('#'+k+'_link'); | |
297 | if(s){ |
|
297 | if(s){ | |
298 | var title_tmpl = ${h.jshtml(_('Download %s as %s') % ('__CS_NAME__','__CS_EXT__'))}; |
|
298 | var title_tmpl = ${h.jshtml(_('Download %s as %s') % ('__CS_NAME__','__CS_EXT__'))}; | |
299 | title_tmpl= title_tmpl.replace('__CS_NAME__',new_cs.text); |
|
299 | title_tmpl= title_tmpl.replace('__CS_NAME__',new_cs.text); | |
300 | title_tmpl = title_tmpl.replace('__CS_EXT__',k); |
|
300 | title_tmpl = title_tmpl.replace('__CS_EXT__',k); | |
301 | title_tmpl = '<i class="icon-file-zip"></i>'+ title_tmpl; |
|
301 | title_tmpl = '<i class="icon-file-zip"></i>'+ title_tmpl; | |
302 | var url = tmpl_links[k].replace('__CS__',new_cs.id); |
|
302 | var url = tmpl_links[k].replace('__CS__',new_cs.id); | |
303 | var subrepos = $('#archive_subrepos').is(':checked'); |
|
303 | var subrepos = $('#archive_subrepos').is(':checked'); | |
304 | url = url.replace('__SUB__',subrepos); |
|
304 | url = url.replace('__SUB__',subrepos); | |
305 | url = url.replace('__NAME__',title_tmpl); |
|
305 | url = url.replace('__NAME__',title_tmpl); | |
306 |
|
306 | |||
307 | s.html(url); |
|
307 | s.html(url); | |
308 | } |
|
308 | } | |
309 | } |
|
309 | } | |
310 | }); |
|
310 | }); | |
311 |
|
311 | |||
312 | var tmpl_links = {}; |
|
312 | var tmpl_links = {}; | |
313 | %for cnt,archive in enumerate(c.db_repo_scm_instance._get_archives()): |
|
313 | %for cnt,archive in enumerate(c.db_repo_scm_instance._get_archives()): | |
314 | tmpl_links[${h.jshtml(archive['type'])}] = ${h.js(h.link_to('__NAME__', h.url('files_archive_home',repo_name=c.db_repo.repo_name, fname='__CS__'+archive['extension'],subrepos='__SUB__'),class_='btn btn-default btn-sm'))}; |
|
314 | tmpl_links[${h.jshtml(archive['type'])}] = ${h.js(h.link_to('__NAME__', h.url('files_archive_home',repo_name=c.db_repo.repo_name, fname='__CS__'+archive['extension'],subrepos='__SUB__'),class_='btn btn-default btn-sm'))}; | |
315 | %endfor |
|
315 | %endfor | |
316 | }); |
|
316 | }); | |
317 | </script> |
|
317 | </script> | |
318 |
|
318 | |||
319 | %if c.show_stats: |
|
319 | %if c.show_stats: | |
320 | <script type="text/javascript"> |
|
320 | <script type="text/javascript"> | |
321 | $(document).ready(function(){ |
|
321 | $(document).ready(function(){ | |
322 | var data = ${h.js(c.trending_languages)}; |
|
322 | var data = ${h.js(c.trending_languages)}; | |
323 | var total = 0; |
|
323 | var total = 0; | |
324 | var no_data = true; |
|
324 | var no_data = true; | |
325 | var tbl = document.createElement('table'); |
|
325 | var tbl = document.createElement('table'); | |
326 | tbl.setAttribute('class','table'); |
|
326 | tbl.setAttribute('class','table'); | |
327 | var cnt = 0; |
|
327 | var cnt = 0; | |
328 | for (var i=0;i<data.length;i++){ |
|
328 | for (var i=0;i<data.length;i++){ | |
329 | total+= data[i][1].count; |
|
329 | total+= data[i][1].count; | |
330 | } |
|
330 | } | |
331 | for (var i=0;i<data.length;i++){ |
|
331 | for (var i=0;i<data.length;i++){ | |
332 | cnt += 1; |
|
332 | cnt += 1; | |
333 | no_data = false; |
|
333 | no_data = false; | |
334 |
|
334 | |||
335 | var hide = cnt>2; |
|
335 | var hide = cnt>2; | |
336 | var tr = document.createElement('tr'); |
|
336 | var tr = document.createElement('tr'); | |
337 | if (hide){ |
|
337 | if (hide){ | |
338 | tr.setAttribute('style','display:none'); |
|
338 | tr.setAttribute('style','display:none'); | |
339 | tr.setAttribute('class','stats_hidden'); |
|
339 | tr.setAttribute('class','stats_hidden'); | |
340 | } |
|
340 | } | |
341 | var k = data[i][0]; |
|
341 | var k = data[i][0]; | |
342 | var obj = data[i][1]; |
|
342 | var obj = data[i][1]; | |
343 | var percentage = Math.round((obj.count/total*100),2); |
|
343 | var percentage = Math.round((obj.count/total*100),2); | |
344 |
|
344 | |||
345 | var td1 = document.createElement('td'); |
|
345 | var td1 = document.createElement('td'); | |
346 | td1.width = 250; |
|
346 | td1.width = 250; | |
347 | var trending_language_label = document.createElement('div'); |
|
347 | var trending_language_label = document.createElement('div'); | |
348 | trending_language_label.innerHTML = obj.desc+" ("+k+")"; |
|
348 | trending_language_label.innerHTML = obj.desc+" ("+k+")"; | |
349 | td1.appendChild(trending_language_label); |
|
349 | td1.appendChild(trending_language_label); | |
350 |
|
350 | |||
351 | var td2 = document.createElement('td'); |
|
351 | var td2 = document.createElement('td'); | |
352 | td2.setAttribute('style','padding-right:14px !important'); |
|
352 | td2.setAttribute('style','padding-right:14px !important'); | |
353 | var trending_language = document.createElement('div'); |
|
353 | var trending_language = document.createElement('div'); | |
354 | var nr_files = obj.count + ' ' + ${h.jshtml(_('files'))}; |
|
354 | var nr_files = obj.count + ' ' + ${h.jshtml(_('files'))}; | |
355 |
|
355 | |||
356 | trending_language.title = k+" "+nr_files; |
|
356 | trending_language.title = k+" "+nr_files; | |
357 |
|
357 | |||
358 | if (percentage>22){ |
|
358 | if (percentage>22){ | |
359 | trending_language.innerHTML = "<b class='progress-bar' role='progressbar'" |
|
359 | trending_language.innerHTML = "<b class='progress-bar' role='progressbar'" | |
360 | + "aria-valuemin='0' aria-valuemax='100' aria-valuenow='" + percentage |
|
360 | + "aria-valuemin='0' aria-valuemax='100' aria-valuenow='" + percentage | |
361 | + "' style='width: " + percentage + "%;'>" + percentage + "%, " + nr_files + "</b>"; |
|
361 | + "' style='width: " + percentage + "%;'>" + percentage + "%, " + nr_files + "</b>"; | |
362 | } |
|
362 | } | |
363 | else if (percentage>5){ |
|
363 | else if (percentage>5){ | |
364 | trending_language.innerHTML = "<b class='progress-bar' role='progressbar'" |
|
364 | trending_language.innerHTML = "<b class='progress-bar' role='progressbar'" | |
365 | + "aria-valuemin='0' aria-valuemax='100' aria-valuenow='" + percentage |
|
365 | + "aria-valuemin='0' aria-valuemax='100' aria-valuenow='" + percentage | |
366 | + "' style='width: " + percentage + "%;'>" + percentage + "%</b>"; |
|
366 | + "' style='width: " + percentage + "%;'>" + percentage + "%</b>"; | |
367 | }else{ |
|
367 | }else{ | |
368 | trending_language.innerHTML = "<b class='progress-bar' role='progressbar'" |
|
368 | trending_language.innerHTML = "<b class='progress-bar' role='progressbar'" | |
369 | + "aria-valuemin='0' aria-valuemax='100' aria-valuenow='" + percentage |
|
369 | + "aria-valuemin='0' aria-valuemax='100' aria-valuenow='" + percentage | |
370 | + "' style='width: " + percentage + "%;'> </b> " + percentage + "%"; |
|
370 | + "' style='width: " + percentage + "%;'> </b> " + percentage + "%"; | |
371 | } |
|
371 | } | |
372 |
|
372 | |||
373 | td2.appendChild(trending_language); |
|
373 | td2.appendChild(trending_language); | |
374 |
|
374 | |||
375 | tr.appendChild(td1); |
|
375 | tr.appendChild(td1); | |
376 | tr.appendChild(td2); |
|
376 | tr.appendChild(td2); | |
377 | tbl.appendChild(tr); |
|
377 | tbl.appendChild(tr); | |
378 | if(cnt == 3){ |
|
378 | if(cnt == 3){ | |
379 | var show_more = document.createElement('tr'); |
|
379 | var show_more = document.createElement('tr'); | |
380 | var td = document.createElement('td'); |
|
380 | var td = document.createElement('td'); | |
381 | lnk = document.createElement('a'); |
|
381 | lnk = document.createElement('a'); | |
382 |
|
382 | |||
383 | lnk.href='#'; |
|
383 | lnk.href='#'; | |
384 | lnk.innerHTML = ${h.jshtml(_('Show more'))}; |
|
384 | lnk.innerHTML = ${h.jshtml(_('Show more'))}; | |
385 | lnk.id='code_stats_show_more'; |
|
385 | lnk.id='code_stats_show_more'; | |
386 | td.appendChild(lnk); |
|
386 | td.appendChild(lnk); | |
387 |
|
387 | |||
388 | show_more.appendChild(td); |
|
388 | show_more.appendChild(td); | |
389 | show_more.appendChild(document.createElement('td')); |
|
389 | show_more.appendChild(document.createElement('td')); | |
390 | tbl.appendChild(show_more); |
|
390 | tbl.appendChild(show_more); | |
391 | } |
|
391 | } | |
392 |
|
392 | |||
393 | } |
|
393 | } | |
394 | if (data.length == 0) { |
|
394 | if (data.length == 0) { | |
395 | tbl.innerHTML = '<tr><td>' + ${h.jshtml(_('No data ready yet'))} + '</td></tr>'; |
|
395 | tbl.innerHTML = '<tr><td>' + ${h.jshtml(_('No data ready yet'))} + '</td></tr>'; | |
396 | } |
|
396 | } | |
397 |
|
397 | |||
398 | $('#lang_stats').append(tbl); |
|
398 | $('#lang_stats').append(tbl); | |
399 | $('#code_stats_show_more').click(function(){ |
|
399 | $('#code_stats_show_more').click(function(){ | |
400 | $('.stats_hidden').show(); |
|
400 | $('.stats_hidden').show(); | |
401 | $('#code_stats_show_more').hide(); |
|
401 | $('#code_stats_show_more').hide(); | |
402 | }); |
|
402 | }); | |
403 | }); |
|
403 | }); | |
404 | </script> |
|
404 | </script> | |
405 | %endif |
|
405 | %endif | |
406 |
|
406 | |||
407 | </%def> |
|
407 | </%def> |
General Comments 0
You need to be logged in to leave comments.
Login now