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–2017 by various authors & licensed under GPLv3</a>. |
|
26 | <a class="navbar-link" href="${h.canonical_url('about')}#copyright">© 2010–2017 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="breadcrumbs panel-title"> |
|
48 | <div class="breadcrumbs 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- |
|
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- |
|
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- |
|
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,165 +1,165 b'' | |||||
1 | ## DATA TABLE RE USABLE ELEMENTS |
|
1 | ## DATA TABLE RE USABLE ELEMENTS | |
2 | ## usage: |
|
2 | ## usage: | |
3 | ## <%namespace name="dt" file="/data_table/_dt_elements.html"/> |
|
3 | ## <%namespace name="dt" file="/data_table/_dt_elements.html"/> | |
4 |
|
4 | |||
5 | <%namespace name="base" file="/base/base.html"/> |
|
5 | <%namespace name="base" file="/base/base.html"/> | |
6 |
|
6 | |||
7 | <%def name="repo_name(name,rtype,rstate,private,fork_of,short_name=False,admin=False)"> |
|
7 | <%def name="repo_name(name,rtype,rstate,private,fork_of,short_name=False,admin=False)"> | |
8 | <% |
|
8 | <% | |
9 | def get_name(name,short_name=short_name): |
|
9 | def get_name(name,short_name=short_name): | |
10 | if short_name: |
|
10 | if short_name: | |
11 | return name.split('/')[-1] |
|
11 | return name.split('/')[-1] | |
12 | else: |
|
12 | else: | |
13 | return name |
|
13 | return name | |
14 | %> |
|
14 | %> | |
15 | <div class="dt_repo ${'dt_repo_pending' if rstate == 'repo_state_pending' else ''}"> |
|
15 | <div class="dt_repo ${'dt_repo_pending' if rstate == 'repo_state_pending' else ''}"> | |
16 | ${base.repolabel(rtype)} |
|
16 | ${base.repolabel(rtype)} | |
17 | <a href="${h.url('edit_repo' if admin else 'summary_home', repo_name=name)}"> |
|
17 | <a href="${h.url('edit_repo' if admin else 'summary_home', repo_name=name)}"> | |
18 | ${get_name(name)} |
|
18 | ${get_name(name)} | |
19 | </a> |
|
19 | </a> | |
20 | %if private and c.visual.show_private_icon: |
|
20 | %if private and c.visual.show_private_icon: | |
21 |
<i class="icon- |
|
21 | <i class="icon-lock" title="${_('Private repository')}"></i> | |
22 | %elif not private and c.visual.show_public_icon: |
|
22 | %elif not private and c.visual.show_public_icon: | |
23 | <i class="icon-globe" title="${_('Public repository')}"></i> |
|
23 | <i class="icon-globe" title="${_('Public repository')}"></i> | |
24 | %endif |
|
24 | %endif | |
25 | %if fork_of: |
|
25 | %if fork_of: | |
26 | <a href="${h.url('summary_home',repo_name=fork_of.repo_name)}"><i class="icon-fork"></i></a> |
|
26 | <a href="${h.url('summary_home',repo_name=fork_of.repo_name)}"><i class="icon-fork"></i></a> | |
27 | %endif |
|
27 | %endif | |
28 | %if rstate == 'repo_state_pending': |
|
28 | %if rstate == 'repo_state_pending': | |
29 | <i class="icon-wrench" title="${_('Repository creation in progress...')}"></i> |
|
29 | <i class="icon-wrench" title="${_('Repository creation in progress...')}"></i> | |
30 | %endif |
|
30 | %endif | |
31 | </div> |
|
31 | </div> | |
32 | </%def> |
|
32 | </%def> | |
33 |
|
33 | |||
34 | <%def name="last_change(last_change)"> |
|
34 | <%def name="last_change(last_change)"> | |
35 | <span data-toggle="tooltip" title="${h.fmt_date(last_change)}" date="${last_change}">${h.age(last_change)}</span> |
|
35 | <span data-toggle="tooltip" title="${h.fmt_date(last_change)}" date="${last_change}">${h.age(last_change)}</span> | |
36 | </%def> |
|
36 | </%def> | |
37 |
|
37 | |||
38 | <%def name="revision(name,rev,tip,author,last_msg)"> |
|
38 | <%def name="revision(name,rev,tip,author,last_msg)"> | |
39 | <div> |
|
39 | <div> | |
40 | %if rev >= 0: |
|
40 | %if rev >= 0: | |
41 | <a data-toggle="popover" title="${author | entity}" data-content="${last_msg | entity}" class="changeset_hash" href="${h.url('changeset_home',repo_name=name,revision=tip)}">${'r%s:%s' % (rev,h.short_id(tip))}</a> |
|
41 | <a data-toggle="popover" title="${author | entity}" data-content="${last_msg | entity}" class="changeset_hash" href="${h.url('changeset_home',repo_name=name,revision=tip)}">${'r%s:%s' % (rev,h.short_id(tip))}</a> | |
42 | %else: |
|
42 | %else: | |
43 | ${_('No changesets yet')} |
|
43 | ${_('No changesets yet')} | |
44 | %endif |
|
44 | %endif | |
45 | </div> |
|
45 | </div> | |
46 | </%def> |
|
46 | </%def> | |
47 |
|
47 | |||
48 | <%def name="rss(name)"> |
|
48 | <%def name="rss(name)"> | |
49 | %if request.authuser.username != 'default': |
|
49 | %if request.authuser.username != 'default': | |
50 | <a title="${_('Subscribe to %s rss feed')% name}" href="${h.url('rss_feed_home',repo_name=name,api_key=request.authuser.api_key)}"><i class="icon-rss-squared"></i></a> |
|
50 | <a title="${_('Subscribe to %s rss feed')% name}" href="${h.url('rss_feed_home',repo_name=name,api_key=request.authuser.api_key)}"><i class="icon-rss-squared"></i></a> | |
51 | %else: |
|
51 | %else: | |
52 | <a title="${_('Subscribe to %s rss feed')% name}" href="${h.url('rss_feed_home',repo_name=name)}"><i class="icon-rss-squared"></i></a> |
|
52 | <a title="${_('Subscribe to %s rss feed')% name}" href="${h.url('rss_feed_home',repo_name=name)}"><i class="icon-rss-squared"></i></a> | |
53 | %endif |
|
53 | %endif | |
54 | </%def> |
|
54 | </%def> | |
55 |
|
55 | |||
56 | <%def name="atom(name)"> |
|
56 | <%def name="atom(name)"> | |
57 | %if request.authuser.username != 'default': |
|
57 | %if request.authuser.username != 'default': | |
58 | <a title="${_('Subscribe to %s atom feed')% name}" href="${h.url('atom_feed_home',repo_name=name,api_key=request.authuser.api_key)}"><i class="icon-rss-squared"></i></a> |
|
58 | <a title="${_('Subscribe to %s atom feed')% name}" href="${h.url('atom_feed_home',repo_name=name,api_key=request.authuser.api_key)}"><i class="icon-rss-squared"></i></a> | |
59 | %else: |
|
59 | %else: | |
60 | <a title="${_('Subscribe to %s atom feed')% name}" href="${h.url('atom_feed_home',repo_name=name)}"><i class="icon-rss-squared"></i></a> |
|
60 | <a title="${_('Subscribe to %s atom feed')% name}" href="${h.url('atom_feed_home',repo_name=name)}"><i class="icon-rss-squared"></i></a> | |
61 | %endif |
|
61 | %endif | |
62 | </%def> |
|
62 | </%def> | |
63 |
|
63 | |||
64 | <%def name="repo_actions(repo_name, super_user=True)"> |
|
64 | <%def name="repo_actions(repo_name, super_user=True)"> | |
65 | <div> |
|
65 | <div> | |
66 | <div class="pull-left"> |
|
66 | <div class="pull-left"> | |
67 | <a href="${h.url('edit_repo',repo_name=repo_name)}" title="${_('Edit')}" class="btn btn-default btn-xs"> |
|
67 | <a href="${h.url('edit_repo',repo_name=repo_name)}" title="${_('Edit')}" class="btn btn-default btn-xs"> | |
68 | <i class="icon-pencil"></i>${_('Edit')} |
|
68 | <i class="icon-pencil"></i>${_('Edit')} | |
69 | </a> |
|
69 | </a> | |
70 | </div> |
|
70 | </div> | |
71 | <div class="pull-left"> |
|
71 | <div class="pull-left"> | |
72 | ${h.form(h.url('delete_repo', repo_name=repo_name))} |
|
72 | ${h.form(h.url('delete_repo', repo_name=repo_name))} | |
73 | <button name="${'remove_%s' % repo_name}" class="btn btn-default btn-xs" |
|
73 | <button name="${'remove_%s' % repo_name}" class="btn btn-default btn-xs" | |
74 | onclick="return confirm('${_('Confirm to delete this repository: %s') % repo_name}');"> |
|
74 | onclick="return confirm('${_('Confirm to delete this repository: %s') % repo_name}');"> | |
75 | <i class="icon-trashcan"></i>${_('Delete')} |
|
75 | <i class="icon-trashcan"></i>${_('Delete')} | |
76 | </button> |
|
76 | </button> | |
77 | ${h.end_form()} |
|
77 | ${h.end_form()} | |
78 | </div> |
|
78 | </div> | |
79 | </div> |
|
79 | </div> | |
80 | </%def> |
|
80 | </%def> | |
81 |
|
81 | |||
82 | <%def name="repo_state(repo_state)"> |
|
82 | <%def name="repo_state(repo_state)"> | |
83 | <div> |
|
83 | <div> | |
84 | %if repo_state == u'repo_state_pending': |
|
84 | %if repo_state == u'repo_state_pending': | |
85 | <div class="label label-info">${_('Creating')}</div> |
|
85 | <div class="label label-info">${_('Creating')}</div> | |
86 | %elif repo_state == u'repo_state_created': |
|
86 | %elif repo_state == u'repo_state_created': | |
87 | <div class="label label-success">${_('Created')}</div> |
|
87 | <div class="label label-success">${_('Created')}</div> | |
88 | %else: |
|
88 | %else: | |
89 | <div class="label label-danger" title="${repo_state}">invalid</div> |
|
89 | <div class="label label-danger" title="${repo_state}">invalid</div> | |
90 | %endif |
|
90 | %endif | |
91 | </div> |
|
91 | </div> | |
92 | </%def> |
|
92 | </%def> | |
93 |
|
93 | |||
94 | <%def name="user_actions(user_id, username)"> |
|
94 | <%def name="user_actions(user_id, username)"> | |
95 | <div class="pull-left"> |
|
95 | <div class="pull-left"> | |
96 | <a href="${h.url('edit_user',id=user_id)}" title="${_('Edit')}" class="btn btn-default btn-xs"> |
|
96 | <a href="${h.url('edit_user',id=user_id)}" title="${_('Edit')}" class="btn btn-default btn-xs"> | |
97 | <i class="icon-pencil"></i>${_('Edit')} |
|
97 | <i class="icon-pencil"></i>${_('Edit')} | |
98 | </a> |
|
98 | </a> | |
99 | </div> |
|
99 | </div> | |
100 | <div class="pull-left"> |
|
100 | <div class="pull-left"> | |
101 | ${h.form(h.url('delete_user', id=user_id))} |
|
101 | ${h.form(h.url('delete_user', id=user_id))} | |
102 | <button id="${'remove_user_%s' % user_id}" name="${'remove_user_%s' % repo_name}" class="btn btn-default btn-xs" title="${_('Delete')}" |
|
102 | <button id="${'remove_user_%s' % user_id}" name="${'remove_user_%s' % repo_name}" class="btn btn-default btn-xs" title="${_('Delete')}" | |
103 | onclick="return confirm('${_('Confirm to delete this user: %s') % username}');"> |
|
103 | onclick="return confirm('${_('Confirm to delete this user: %s') % username}');"> | |
104 | <i class="icon-trashcan"></i>${_('Delete')} |
|
104 | <i class="icon-trashcan"></i>${_('Delete')} | |
105 | </button> |
|
105 | </button> | |
106 | ${h.end_form()} |
|
106 | ${h.end_form()} | |
107 | </div> |
|
107 | </div> | |
108 | </%def> |
|
108 | </%def> | |
109 |
|
109 | |||
110 | <%def name="user_group_actions(user_group_id, user_group_name)"> |
|
110 | <%def name="user_group_actions(user_group_id, user_group_name)"> | |
111 | <div class="pull-left"> |
|
111 | <div class="pull-left"> | |
112 | <a href="${h.url('edit_users_group', id=user_group_id)}" title="${_('Edit')}" class="btn btn-default btn-xs"> |
|
112 | <a href="${h.url('edit_users_group', id=user_group_id)}" title="${_('Edit')}" class="btn btn-default btn-xs"> | |
113 | <i class="icon-pencil"></i>${_('Edit')} |
|
113 | <i class="icon-pencil"></i>${_('Edit')} | |
114 | </a> |
|
114 | </a> | |
115 | </div> |
|
115 | </div> | |
116 | <div class="pull-left"> |
|
116 | <div class="pull-left"> | |
117 | ${h.form(h.url('delete_users_group', id=user_group_id))} |
|
117 | ${h.form(h.url('delete_users_group', id=user_group_id))} | |
118 | <button id="${'remove_group_%s' % user_group_id}" name="${'remove_user_%s' % repo_name}" class="btn btn-default btn-xs" title="${_('Delete')}" |
|
118 | <button id="${'remove_group_%s' % user_group_id}" name="${'remove_user_%s' % repo_name}" class="btn btn-default btn-xs" title="${_('Delete')}" | |
119 | onclick="return confirm('${_('Confirm to delete this user group: %s') % user_group_name}');"> |
|
119 | onclick="return confirm('${_('Confirm to delete this user group: %s') % user_group_name}');"> | |
120 | <i class="icon-trashcan"></i>${_('Delete')} |
|
120 | <i class="icon-trashcan"></i>${_('Delete')} | |
121 | </button> |
|
121 | </button> | |
122 | ${h.end_form()} |
|
122 | ${h.end_form()} | |
123 | </div> |
|
123 | </div> | |
124 | </%def> |
|
124 | </%def> | |
125 |
|
125 | |||
126 | <%def name="group_name_html(group_name,name)"> |
|
126 | <%def name="group_name_html(group_name,name)"> | |
127 | <div class="dt_repo"> |
|
127 | <div class="dt_repo"> | |
128 | <i class="icon-folder"></i> |
|
128 | <i class="icon-folder"></i> | |
129 | <a href="${h.url('repos_group_home',group_name=group_name)}">${name}</a> |
|
129 | <a href="${h.url('repos_group_home',group_name=group_name)}">${name}</a> | |
130 | </div> |
|
130 | </div> | |
131 | </%def> |
|
131 | </%def> | |
132 |
|
132 | |||
133 | <%def name="repo_group_actions(repo_group_id, repo_group_name, gr_count)"> |
|
133 | <%def name="repo_group_actions(repo_group_id, repo_group_name, gr_count)"> | |
134 | <div class="pull-left"> |
|
134 | <div class="pull-left"> | |
135 | <a href="${h.url('edit_repo_group',group_name=repo_group_name)}" title="${_('Edit')}" class="btn btn-default btn-xs"> |
|
135 | <a href="${h.url('edit_repo_group',group_name=repo_group_name)}" title="${_('Edit')}" class="btn btn-default btn-xs"> | |
136 | <i class="icon-pencil"></i>${_('Edit')} |
|
136 | <i class="icon-pencil"></i>${_('Edit')} | |
137 | </a> |
|
137 | </a> | |
138 | </div> |
|
138 | </div> | |
139 | <div class="pull-left"> |
|
139 | <div class="pull-left"> | |
140 | ${h.form(h.url('delete_repo_group', group_name=repo_group_name))} |
|
140 | ${h.form(h.url('delete_repo_group', group_name=repo_group_name))} | |
141 | <button id="${'remove_%s' % repo_group_name}" name="${'remove_%s' % repo_group_name}" class="btn btn-default btn-xs" title="${_('Delete')}" |
|
141 | <button id="${'remove_%s' % repo_group_name}" name="${'remove_%s' % repo_group_name}" class="btn btn-default btn-xs" title="${_('Delete')}" | |
142 | onclick="return confirm('${ungettext('Confirm to delete this group: %s with %s repository','Confirm to delete this group: %s with %s repositories',gr_count) % (repo_group_name, gr_count)}')"> |
|
142 | onclick="return confirm('${ungettext('Confirm to delete this group: %s with %s repository','Confirm to delete this group: %s with %s repositories',gr_count) % (repo_group_name, gr_count)}')"> | |
143 | <i class="icon-trashcan"></i>${_('Delete')} |
|
143 | <i class="icon-trashcan"></i>${_('Delete')} | |
144 | </button> |
|
144 | </button> | |
145 | ${h.end_form()} |
|
145 | ${h.end_form()} | |
146 | </div> |
|
146 | </div> | |
147 | </%def> |
|
147 | </%def> | |
148 |
|
148 | |||
149 | <%def name="user_name(user_id, username)"> |
|
149 | <%def name="user_name(user_id, username)"> | |
150 | ${h.link_to(username,h.url('edit_user', id=user_id))} |
|
150 | ${h.link_to(username,h.url('edit_user', id=user_id))} | |
151 | </%def> |
|
151 | </%def> | |
152 |
|
152 | |||
153 | <%def name="repo_group_name(repo_group_name, children_groups)"> |
|
153 | <%def name="repo_group_name(repo_group_name, children_groups)"> | |
154 | <div class="text-nowrap"> |
|
154 | <div class="text-nowrap"> | |
155 | <a href="${h.url('repos_group_home',group_name=repo_group_name)}"> |
|
155 | <a href="${h.url('repos_group_home',group_name=repo_group_name)}"> | |
156 | <i class="icon-folder" title="${_('Repository group')}"></i>${h.literal(' » '.join(children_groups))}</a> |
|
156 | <i class="icon-folder" title="${_('Repository group')}"></i>${h.literal(' » '.join(children_groups))}</a> | |
157 | </div> |
|
157 | </div> | |
158 | </%def> |
|
158 | </%def> | |
159 |
|
159 | |||
160 | <%def name="user_group_name(user_group_id, user_group_name)"> |
|
160 | <%def name="user_group_name(user_group_id, user_group_name)"> | |
161 | <div class="text-nowrap"> |
|
161 | <div class="text-nowrap"> | |
162 | <a href="${h.url('edit_users_group', id=user_group_id)}"> |
|
162 | <a href="${h.url('edit_users_group', id=user_group_id)}"> | |
163 | <i class="icon-users" title="${_('User group')}"></i>${user_group_name}</a> |
|
163 | <i class="icon-users" title="${_('User group')}"></i>${user_group_name}</a> | |
164 | </div> |
|
164 | </div> | |
165 | </%def> |
|
165 | </%def> |
General Comments 0
You need to be logged in to leave comments.
Login now