##// END OF EJS Templates
meta: update copyright year
Mads Kiilerich -
r4770:47d2659e default
parent child Browse files
Show More
@@ -1,226 +1,226 b''
1 1 # -*- coding: utf-8 -*-
2 2 #
3 3 # Kallithea documentation build configuration file, created by
4 4 # sphinx-quickstart on Sun Oct 10 16:46:37 2010.
5 5 #
6 6 # This file is execfile()d with the current directory set to its containing dir.
7 7 #
8 8 # Note that not all possible configuration values are present in this
9 9 # autogenerated file.
10 10 #
11 11 # All configuration values have a default; values that are commented out
12 12 # serve to show the default.
13 13
14 14 import sys
15 15 import os
16 16
17 17 # If extensions (or modules to document with autodoc) are in another directory,
18 18 # add these directories to sys.path here. If the directory is relative to the
19 19 # documentation root, use os.path.abspath to make it absolute, like shown here.
20 20 sys.path.insert(0, os.path.abspath('..'))
21 21
22 22 # -- General configuration -----------------------------------------------------
23 23
24 24 # If your documentation needs a minimal Sphinx version, state it here.
25 25 #needs_sphinx = '1.0'
26 26
27 27 # Add any Sphinx extension module names here, as strings. They can be extensions
28 28 # coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
29 29 extensions = ['sphinx.ext.autodoc', 'sphinx.ext.doctest',
30 30 'sphinx.ext.intersphinx', 'sphinx.ext.todo',
31 31 'sphinx.ext.viewcode']
32 32
33 33 # Add any paths that contain templates here, relative to this directory.
34 34 templates_path = ['_templates']
35 35
36 36 # The suffix of source filenames.
37 37 source_suffix = '.rst'
38 38
39 39 # The encoding of source files.
40 40 #source_encoding = 'utf-8-sig'
41 41
42 42 # The master toctree document.
43 43 master_doc = 'index'
44 44
45 45 # General information about the project.
46 46 project = u'Kallithea'
47 copyright = u'2010-2014 by various authors, licensed as GPLv3.'
47 copyright = u'2010-2015 by various authors, licensed as GPLv3.'
48 48
49 49 # The version info for the project you're documenting, acts as replacement for
50 50 # |version| and |release|, also used in various other places throughout the
51 51 # built documents.
52 52 #
53 53 # The short X.Y version.
54 54 root = os.path.dirname(os.path.dirname(__file__))
55 55 sys.path.append(root)
56 56 from kallithea import __version__
57 57 version = __version__
58 58 # The full version, including alpha/beta/rc tags.
59 59 release = __version__
60 60
61 61 # The language for content autogenerated by Sphinx. Refer to documentation
62 62 # for a list of supported languages.
63 63 #language = None
64 64
65 65 # There are two options for replacing |today|: either, you set today to some
66 66 # non-false value, then it is used:
67 67 #today = ''
68 68 # Else, today_fmt is used as the format for a strftime call.
69 69 #today_fmt = '%B %d, %Y'
70 70
71 71 # List of patterns, relative to source directory, that match files and
72 72 # directories to ignore when looking for source files.
73 73 exclude_patterns = ['_build']
74 74
75 75 # The reST default role (used for this markup: `text`) to use for all documents.
76 76 #default_role = None
77 77
78 78 # If true, '()' will be appended to :func: etc. cross-reference text.
79 79 #add_function_parentheses = True
80 80
81 81 # If true, the current module name will be prepended to all description
82 82 # unit titles (such as .. function::).
83 83 #add_module_names = True
84 84
85 85 # If true, sectionauthor and moduleauthor directives will be shown in the
86 86 # output. They are ignored by default.
87 87 #show_authors = False
88 88
89 89 # The name of the Pygments (syntax highlighting) style to use.
90 90 pygments_style = 'sphinx'
91 91
92 92 # A list of ignored prefixes for module index sorting.
93 93 #modindex_common_prefix = []
94 94
95 95
96 96 # -- Options for HTML output ---------------------------------------------------
97 97
98 98 # The theme to use for HTML and HTML Help pages. See the documentation for
99 99 # a list of builtin themes.
100 100 html_theme = 'nature'
101 101
102 102 # Theme options are theme-specific and customize the look and feel of a theme
103 103 # further. For a list of options available for each theme, see the
104 104 # documentation.
105 105 #html_theme_options = {}
106 106
107 107 # Add any paths that contain custom themes here, relative to this directory.
108 108 html_theme_path = ['theme']
109 109
110 110 # The name for this set of Sphinx documents. If None, it defaults to
111 111 # "<project> v<release> documentation".
112 112 #html_title = None
113 113
114 114 # A shorter title for the navigation bar. Default is the same as html_title.
115 115 #html_short_title = None
116 116
117 117 # The name of an image file (relative to this directory) to place at the top
118 118 # of the sidebar.
119 119 #html_logo = None
120 120
121 121 # The name of an image file (within the static path) to use as favicon of the
122 122 # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
123 123 # pixels large.
124 124 #html_favicon = None
125 125
126 126 # Add any paths that contain custom static files (such as style sheets) here,
127 127 # relative to this directory. They are copied after the builtin static files,
128 128 # so a file named "default.css" will overwrite the builtin "default.css".
129 129 #html_static_path = ['_static']
130 130
131 131 # If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
132 132 # using the given strftime format.
133 133 #html_last_updated_fmt = '%b %d, %Y'
134 134
135 135 # If true, SmartyPants will be used to convert quotes and dashes to
136 136 # typographically correct entities.
137 137 #html_use_smartypants = True
138 138
139 139 # Custom sidebar templates, maps document names to template names.
140 140 #html_sidebars = {}
141 141
142 142 # Additional templates that should be rendered to pages, maps page names to
143 143 # template names.
144 144 #html_additional_pages = {}
145 145
146 146 # If false, no module index is generated.
147 147 #html_domain_indices = True
148 148
149 149 # If false, no index is generated.
150 150 #html_use_index = True
151 151
152 152 # If true, the index is split into individual pages for each letter.
153 153 #html_split_index = False
154 154
155 155 # If true, links to the reST sources are added to the pages.
156 156 #html_show_sourcelink = True
157 157
158 158 # If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
159 159 #html_show_sphinx = True
160 160
161 161 # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
162 162 #html_show_copyright = True
163 163
164 164 # If true, an OpenSearch description file will be output, and all pages will
165 165 # contain a <link> tag referring to it. The value of this option must be the
166 166 # base URL from which the finished HTML is served.
167 167 #html_use_opensearch = ''
168 168
169 169 # This is the file name suffix for HTML files (e.g. ".xhtml").
170 170 #html_file_suffix = None
171 171
172 172 # Output file base name for HTML help builder.
173 173 htmlhelp_basename = 'Kallithea-docs'
174 174
175 175
176 176 # -- Options for LaTeX output --------------------------------------------------
177 177
178 178 # The paper size ('letter' or 'a4').
179 179 #latex_paper_size = 'letter'
180 180
181 181 # The font size ('10pt', '11pt' or '12pt').
182 182 #latex_font_size = '10pt'
183 183
184 184 # Grouping the document tree into LaTeX files. List of tuples
185 185 # (source start file, target name, title, author, documentclass [howto/manual]).
186 186 latex_documents = [
187 187 ('index', 'Kallithea.tex', u'Kallithea Documentation',
188 188 u'Kallithea Developers', 'manual'),
189 189 ]
190 190
191 191 # The name of an image file (relative to this directory) to place at the top of
192 192 # the title page.
193 193 #latex_logo = None
194 194
195 195 # For "manual" documents, if this is true, then toplevel headings are parts,
196 196 # not chapters.
197 197 #latex_use_parts = False
198 198
199 199 # If true, show page references after internal links.
200 200 #latex_show_pagerefs = False
201 201
202 202 # If true, show URL addresses after external links.
203 203 #latex_show_urls = False
204 204
205 205 # Additional stuff for the LaTeX preamble.
206 206 #latex_preamble = ''
207 207
208 208 # Documents to append as an appendix to all manuals.
209 209 #latex_appendices = []
210 210
211 211 # If false, no module index is generated.
212 212 #latex_domain_indices = True
213 213
214 214
215 215 # -- Options for manual page output --------------------------------------------
216 216
217 217 # One entry per manual page. List of tuples
218 218 # (source start file, name, description, authors, manual section).
219 219 man_pages = [
220 220 ('index', 'kallithea', u'Kallithea Documentation',
221 221 [u'Kallithea Developers'], 1)
222 222 ]
223 223
224 224
225 225 # Example configuration for intersphinx: refer to the Python standard library.
226 226 intersphinx_mapping = {'http://docs.python.org/': None}
@@ -1,605 +1,605 b''
1 1 ## -*- coding: utf-8 -*-
2 2 <%inherit file="root.html"/>
3 3
4 4 <!-- HEADER -->
5 5 <div id="header">
6 6 <div id="header-inner" class="title">
7 7 <div id="logo">
8 8 <a href="${h.url('home')}" style="display: block;">
9 9 <div class="header">
10 10 <img src="${h.url('/images/kallithea-logo.svg')}" onerror="this.onerror='';this.src='${h.url('/images/kallithea-logo.png')}'" alt="Kallithea"/>
11 11 </div>
12 12 %if c.site_name:
13 13 <div class="branding">${c.site_name}</div>
14 14 %endif
15 15 </a>
16 16 </div>
17 17 <!-- MENU -->
18 18 ${self.page_nav()}
19 19 <!-- END MENU -->
20 20 ${self.body()}
21 21 </div>
22 22 </div>
23 23 <!-- END HEADER -->
24 24
25 25 <!-- CONTENT -->
26 26 <div id="content">
27 27 ${self.flash_msg()}
28 28 <div id="main">
29 29 ${next.main()}
30 30 </div>
31 31 </div>
32 32 <!-- END CONTENT -->
33 33
34 34 <!-- FOOTER -->
35 35 <div id="footer">
36 36 <div id="footer-inner" class="title">
37 37 <div>
38 38 <p class="footer-link">
39 39 ${_('Server instance: %s') % c.instance_id if c.instance_id else ''}
40 40 </p>
41 41 <p class="footer-link-right">
42 42 This site is powered by
43 43 %if c.visual.show_version:
44 44 <a href="${h.url('kallithea_project_url')}" target="_blank">Kallithea</a> ${c.kallithea_version},
45 45 %else:
46 46 <a href="${h.url('kallithea_project_url')}" target="_blank">Kallithea</a>,
47 47 %endif
48 48 which is
49 <a href="${h.canonical_url('about')}#copyright">&copy; 2010&ndash;2014 by various authors &amp; licensed under GPLv3</a>.
49 <a href="${h.canonical_url('about')}#copyright">&copy; 2010&ndash;2015 by various authors &amp; licensed under GPLv3</a>.
50 50 %if c.issues_url:
51 51 &ndash; <a href="${c.issues_url}" target="_blank">${_('Support')}</a>
52 52 %endif
53 53 </p>
54 54 </div>
55 55 </div>
56 56 </div>
57 57
58 58 <!-- END FOOTER -->
59 59
60 60 ### MAKO DEFS ###
61 61
62 62 <%def name="flash_msg()">
63 63 <%include file="/base/flash_msg.html"/>
64 64 </%def>
65 65
66 66 <%def name="breadcrumbs()">
67 67 <div class="breadcrumbs">
68 68 ${self.breadcrumbs_links()}
69 69 </div>
70 70 </%def>
71 71
72 72 <%def name="admin_menu()">
73 73 <ul class="admin_menu">
74 74 <li><a href="${h.url('admin_home')}"><i class="icon-book"></i> ${_('Admin Journal')}</a></li>
75 75 <li><a href="${h.url('repos')}"><i class="icon-database"></i> ${_('Repositories')}</a></li>
76 76 <li><a href="${h.url('repos_groups')}"><i class="icon-folder"></i> ${_('Repository Groups')}</a></li>
77 77 <li><a href="${h.url('users')}"><i class="icon-user"></i> ${_('Users')}</a></li>
78 78 <li><a href="${h.url('users_groups')}"><i class="icon-users"></i> ${_('User Groups')}</a></li>
79 79 <li><a href="${h.url('admin_permissions')}"><i class="icon-block"></i> ${_('Permissions')}</a></li>
80 80 <li><a href="${h.url('auth_home')}"><i class="icon-key"></i> ${_('Authentication')}</a></li>
81 81 <li><a href="${h.url('defaults')}"><i class="icon-wrench"></i> ${_('Defaults')}</a></li>
82 82 <li class="last"><a href="${h.url('admin_settings')}"><i class="icon-gear"></i> ${_('Settings')}</a></li>
83 83 </ul>
84 84
85 85 </%def>
86 86
87 87
88 88 ## admin menu used for people that have some admin resources
89 89 <%def name="admin_menu_simple(repositories=None, repository_groups=None, user_groups=None)">
90 90 <ul>
91 91 %if repositories:
92 92 <li><a href="${h.url('repos')}"><i class="icon-database"></i> ${_('Repositories')}</a></li>
93 93 %endif
94 94 %if repository_groups:
95 95 <li><a href="${h.url('repos_groups')}"><i class="icon-folder"></i> ${_('Repository Groups')}</a></li>
96 96 %endif
97 97 %if user_groups:
98 98 <li><a href="${h.url('users_groups')}"><i class="icon-users"></i> ${_('User Groups')}</a></li>
99 99 %endif
100 100 </ul>
101 101 </%def>
102 102
103 103 <%def name="repo_context_bar(current=None, rev=None)">
104 104 <% rev = None if rev == 'tip' else rev %>
105 105 <%
106 106 def follow_class():
107 107 if c.repository_following:
108 108 return h.literal('following')
109 109 else:
110 110 return h.literal('follow')
111 111 %>
112 112 <%
113 113 def is_current(selected):
114 114 if selected == current:
115 115 return h.literal('class="current"')
116 116 %>
117 117
118 118 <!--- CONTEXT BAR -->
119 119 <div id="context-bar" class="box">
120 120 <h2>
121 121 %if h.is_hg(c.db_repo):
122 122 <i class="icon-hg" style="color: #576622; font-size: 24px"></i>
123 123 %endif
124 124 %if h.is_git(c.db_repo):
125 125 <i class="icon-git" style="color: #e85634; font-size: 24px"></i>
126 126 %endif
127 127
128 128 ## public/private
129 129 %if c.db_repo.private:
130 130 <i class="icon-keyhole-circled"></i>
131 131 %else:
132 132 <i class="icon-globe"></i>
133 133 %endif
134 134 ${h.repo_link(c.db_repo.groups_and_repo)}
135 135
136 136 %if current == 'createfork':
137 137 - ${_('Create Fork')}
138 138 %endif
139 139 </h2>
140 140 <!--
141 141 <div id="breadcrumbs">
142 142 ${h.link_to(_(u'Repositories'),h.url('home'))}
143 143 &raquo;
144 144 ${h.repo_link(c.db_repo.groups_and_repo)}
145 145 </div>
146 146 -->
147 147 <ul id="context-pages" class="horizontal-list">
148 148 <li ${is_current('summary')}><a href="${h.url('summary_home', repo_name=c.repo_name)}"><i class="icon-file-text"></i> ${_('Summary')}</a></li>
149 149 %if rev:
150 150 <li ${is_current('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>
151 151 %else:
152 152 <li ${is_current('changelog')}><a href="${h.url('changelog_home', repo_name=c.repo_name)}"><i class="icon-clock"></i> ${_('Changelog')}</a></li>
153 153 %endif
154 154 <li ${is_current('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>
155 155 <li ${is_current('switch-to')}>
156 156 <a href="#" id="branch_tag_switcher_2" class="dropdown"><i class="icon-exchange"></i> ${_('Switch To')}</a>
157 157 <ul id="switch_to_list_2" class="switch_to submenu">
158 158 <li><a href="#">${_('Loading...')}</a></li>
159 159 </ul>
160 160 </li>
161 161 <li ${is_current('options')}>
162 162 %if h.HasRepoPermissionAll('repository.admin')(c.repo_name):
163 163 <a href="${h.url('edit_repo',repo_name=c.repo_name)}" class="dropdown"><i class="icon-wrench"></i> ${_('Options')}</a>
164 164 %else:
165 165 <a href="#" class="dropdown"><i class="icon-wrench"></i> ${_('Options')}</a>
166 166 %endif
167 167 <ul>
168 168 %if h.HasRepoPermissionAll('repository.admin')(c.repo_name):
169 169 <li><a href="${h.url('edit_repo',repo_name=c.repo_name)}"><i class="icon-gear"></i> ${_('Settings')}</a></li>
170 170 %endif
171 171 %if c.db_repo.fork:
172 172 <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)}">
173 173 <i class="icon-git-compare"></i> ${_('Compare Fork')}</a></li>
174 174 %endif
175 175 <li><a href="${h.url('compare_home',repo_name=c.repo_name)}"><i class="icon-git-compare"></i> ${_('Compare')}</a></li>
176 176
177 177 <li><a href="${h.url('search_repo',repo_name=c.repo_name)}"><i class="icon-search"></i> ${_('Search')}</a></li>
178 178
179 179 %if h.HasRepoPermissionAny('repository.write','repository.admin')(c.repo_name) and c.db_repo.enable_locking:
180 180 %if c.db_repo.locked[0]:
181 181 <li>${h.link_to(_('Unlock'), h.url('toggle_locking',repo_name=c.repo_name),class_='locking_del')}</li>
182 182 %else:
183 183 <li>${h.link_to(_('Lock'), h.url('toggle_locking',repo_name=c.repo_name),class_='locking_add')}</li>
184 184 %endif
185 185 %endif
186 186 ## TODO: this check feels wrong, it would be better to have a check for permissions
187 187 ## also it feels like a job for the controller
188 188 %if c.authuser.username != 'default':
189 189 <li>
190 190 <a class="${follow_class()}" onclick="javascript:toggleFollowingRepo(this,${c.db_repo.repo_id},'${str(h.get_token())}');">
191 191 <span class="show-follow"><i class="icon-heart-empty"></i> ${_('Follow')}</span>
192 192 <span class="show-following"><i class="icon-heart"></i> ${_('Unfollow')}</span>
193 193 </a>
194 194 </li>
195 195 <li><a href="${h.url('repo_fork_home',repo_name=c.repo_name)}"><i class="icon-git-pull-request"></i> ${_('Fork')}</a></li>
196 196 <li><a href="${h.url('pullrequest_home',repo_name=c.repo_name)}"><i class="icon-git-pull-request"></i> ${_('Create Pull Request')}</a></li>
197 197 %endif
198 198 </ul>
199 199 </li>
200 200 <li ${is_current('showpullrequest')}>
201 201 <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')}
202 202 %if c.repository_pull_requests:
203 203 <span>${c.repository_pull_requests}</span>
204 204 %endif
205 205 </a>
206 206 </li>
207 207 </ul>
208 208 </div>
209 209 <script type="text/javascript">
210 210 YUE.on('branch_tag_switcher_2','mouseover',function(){
211 211 var $branch_tag_switcher_2 = $('#branch_tag_switcher_2');
212 212 var loaded = $branch_tag_switcher_2.hasClass('loaded');
213 213 if(!loaded){
214 214 $branch_tag_switcher_2.addClass('loaded');
215 215 asynchtml("${h.url('branch_tag_switcher',repo_name=c.repo_name)}", $('#switch_to_list_2'));
216 216 }
217 217 return false;
218 218 });
219 219 </script>
220 220 <!--- END CONTEXT BAR -->
221 221 </%def>
222 222
223 223 <%def name="menu(current=None)">
224 224 <%
225 225 def is_current(selected):
226 226 if selected == current:
227 227 return h.literal('class="current"')
228 228 %>
229 229
230 230 <ul id="quick" class="horizontal-list">
231 231 <!-- repo switcher -->
232 232 <li ${is_current('repositories')}>
233 233 <input id="repo_switcher" name="repo_switcher" type="hidden">
234 234 </li>
235 235
236 236 ##ROOT MENU
237 237 %if c.authuser.username != 'default':
238 238 <li ${is_current('journal')}>
239 239 <a class="menu_link" title="${_('Show recent activity')}" href="${h.url('journal')}">
240 240 <i class="icon-book"></i> ${_('Journal')}
241 241 </a>
242 242 </li>
243 243 %else:
244 244 <li ${is_current('journal')}>
245 245 <a class="menu_link" title="${_('Public journal')}" href="${h.url('public_journal')}">
246 246 <i class="icon-book"></i> ${_('Public journal')}
247 247 </a>
248 248 </li>
249 249 %endif
250 250 <li ${is_current('gists')}>
251 251 <a class="menu_link childs" title="${_('Show public gists')}" href="${h.url('gists')}">
252 252 <i class="icon-clippy"></i> ${_('Gists')}
253 253 </a>
254 254 <ul class="admin_menu">
255 255 <li><a href="${h.url('new_gist', public=1)}"><i class="icon-paste"></i> ${_('Create New Gist')}</a></li>
256 256 <li><a href="${h.url('gists')}"><i class="icon-globe"></i> ${_('All Public Gists')}</a></li>
257 257 %if c.authuser.username != 'default':
258 258 <li><a href="${h.url('gists', public=1)}"><i class="icon-user"></i> ${_('My Public Gists')}</a></li>
259 259 <li><a href="${h.url('gists', private=1)}"><i class="icon-keyhole-circled"></i> ${_('My Private Gists')}</a></li>
260 260 %endif
261 261 </ul>
262 262 </li>
263 263 <li ${is_current('search')}>
264 264 <a class="menu_link" title="${_('Search in repositories')}" href="${h.url('search')}">
265 265 <i class="icon-search"></i> ${_('Search')}
266 266 </a>
267 267 </li>
268 268 % if h.HasPermissionAll('hg.admin')('access admin main page'):
269 269 <li ${is_current('admin')}>
270 270 <a class="menu_link childs" title="${_('Admin')}" href="${h.url('admin_home')}">
271 271 <i class="icon-gear"></i> ${_('Admin')}
272 272 </a>
273 273 ${admin_menu()}
274 274 </li>
275 275 % elif c.authuser.repositories_admin or c.authuser.repository_groups_admin or c.authuser.user_groups_admin:
276 276 <li ${is_current('admin')}>
277 277 <a class="menu_link childs" title="${_('Admin')}">
278 278 <i class="icon-gear"></i> ${_('Admin')}
279 279 </a>
280 280 ${admin_menu_simple(c.authuser.repositories_admin,
281 281 c.authuser.repository_groups_admin,
282 282 c.authuser.user_groups_admin or h.HasPermissionAny('hg.usergroup.create.true')())}
283 283 </li>
284 284 % endif
285 285
286 286 <li ${is_current('my_pullrequests')}>
287 287 <a class="menu_link" title="${_('My Pull Requests')}" href="${h.url('my_pullrequests')}">
288 288 <i class="icon-git-pull-request"></i> ${_('My Pull Requests')}
289 289 %if c.my_pr_count != 0:
290 290 <span class="menu_link_notifications">${c.my_pr_count}</span>
291 291 %endif
292 292 </a>
293 293 </li>
294 294
295 295 ## USER MENU
296 296 <li>
297 297 <a class="menu_link childs" id="quick_login_link">
298 298 <span class="icon">
299 299 <img src="${h.gravatar_url(c.authuser.email,20)}" alt="avatar">
300 300 </span>
301 301 %if c.authuser.username != 'default':
302 302 <span class="menu_link_user">${c.authuser.username}</span>
303 303 %if c.unread_notifications != 0:
304 304 <span class="menu_link_notifications">${c.unread_notifications}</span>
305 305 %endif
306 306 %else:
307 307 <span>${_('Not Logged In')}</span>
308 308 %endif
309 309 </a>
310 310
311 311 <div class="user-menu">
312 312 <div id="quick_login">
313 313 %if c.authuser.username == 'default' or c.authuser.user_id is None:
314 314 <h4>${_('Login to Your Account')}</h4>
315 315 ${h.form(h.url('login_home',came_from=h.url.current()))}
316 316 <div class="form">
317 317 <div class="fields">
318 318 <div class="field">
319 319 <div class="label">
320 320 <label for="username">${_('Username')}:</label>
321 321 </div>
322 322 <div class="input">
323 323 ${h.text('username',class_='focus')}
324 324 </div>
325 325
326 326 </div>
327 327 <div class="field">
328 328 <div class="label">
329 329 <label for="password">${_('Password')}:</label>
330 330 </div>
331 331 <div class="input">
332 332 ${h.password('password',class_='focus')}
333 333 </div>
334 334
335 335 </div>
336 336 <div class="buttons">
337 337 <div class="password_forgoten">${h.link_to(_('Forgot password ?'),h.url('reset_password'))}</div>
338 338 <div class="register">
339 339 %if h.HasPermissionAny('hg.admin', 'hg.register.auto_activate', 'hg.register.manual_activate')():
340 340 ${h.link_to(_("Don't have an account ?"),h.url('register'))}
341 341 %endif
342 342 </div>
343 343 <div class="submit">
344 344 ${h.submit('sign_in',_('Log In'),class_="btn btn-mini")}
345 345 </div>
346 346 </div>
347 347 </div>
348 348 </div>
349 349 ${h.end_form()}
350 350 %else:
351 351 <div class="links_left">
352 352 <div class="big_gravatar"><img alt="gravatar" src="${h.gravatar_url(c.authuser.email,48)}" /></div>
353 353 <div class="full_name">${c.authuser.full_name_or_username}</div>
354 354 <div class="email">${c.authuser.email}</div>
355 355 </div>
356 356 <div class="links_right">
357 357 <ol class="links">
358 358 <li><a href="${h.url('notifications')}">${_('Notifications')}: ${c.unread_notifications}</a></li>
359 359 <li>${h.link_to(_(u'My Account'),h.url('my_account'))}</li>
360 360 <li class="logout">${h.link_to(_(u'Log Out'),h.url('logout_home'))}</li>
361 361 </ol>
362 362 </div>
363 363 %endif
364 364 </div>
365 365 </div>
366 366 </li>
367 367
368 368 <script type="text/javascript">
369 369 var visual_show_public_icon = "${c.visual.show_public_icon}" == "True";
370 370 var cache = {}
371 371 /*format the look of items in the list*/
372 372 var format = function(state){
373 373 if (!state.id){
374 374 return state.text; // optgroup
375 375 }
376 376 var obj_dict = state.obj;
377 377 var tmpl = '';
378 378
379 379 if(obj_dict && state.type == 'repo'){
380 380 tmpl += '<span class="repo-icons">';
381 381 if(obj_dict['repo_type'] === 'hg'){
382 382 tmpl += '<i class="icon-hg"></i> ';
383 383 }
384 384 else if(obj_dict['repo_type'] === 'git'){
385 385 tmpl += '<i class="icon-git"></i> ';
386 386 }
387 387 if(obj_dict['private']){
388 388 tmpl += '<i class="icon-keyhole-circled"></i> ';
389 389 }
390 390 else if(visual_show_public_icon){
391 391 tmpl += '<i class="icon-globe"></i> ';
392 392 }
393 393 tmpl += '</span>';
394 394 }
395 395 if(obj_dict && state.type == 'group'){
396 396 tmpl += '<i class="icon-folder"></i> ';
397 397 }
398 398 tmpl += state.text;
399 399 return tmpl;
400 400 }
401 401
402 402 $("#repo_switcher").select2({
403 403 placeholder: '<i class="icon-database"></i> ${_('Repositories')}',
404 404 dropdownAutoWidth: true,
405 405 formatResult: format,
406 406 formatSelection: format,
407 407 formatNoMatches: function(term){
408 408 return "${_('No matches found')}";
409 409 },
410 410 containerCssClass: "repo-switcher",
411 411 dropdownCssClass: "repo-switcher-dropdown",
412 412 escapeMarkup: function(m){
413 413 // don't escape our custom placeholder
414 414 if(m.substr(0,29) == '<i class="icon-database"></i>'){
415 415 return m;
416 416 }
417 417
418 418 return Select2.util.escapeMarkup(m);
419 419 },
420 420 query: function(query){
421 421 var key = 'cache';
422 422 var cached = cache[key] ;
423 423 if(cached) {
424 424 var data = {results: []};
425 425 //filter results
426 426 $.each(cached.results, function(){
427 427 var section = this.text;
428 428 var children = [];
429 429 $.each(this.children, function(){
430 430 if(query.term.length == 0 || this.text.toUpperCase().indexOf(query.term.toUpperCase()) >= 0 ){
431 431 children.push({'id': this.id, 'text': this.text, 'type': this.type, 'obj': this.obj})
432 432 }
433 433 })
434 434 if(children.length !== 0){
435 435 data.results.push({'text': section, 'children': children})
436 436 }
437 437
438 438 });
439 439 query.callback(data);
440 440 }else{
441 441 $.ajax({
442 442 url: "${h.url('repo_switcher_data')}",
443 443 data: {},
444 444 dataType: 'json',
445 445 type: 'GET',
446 446 success: function(data) {
447 447 cache[key] = data;
448 448 query.callback({results: data.results});
449 449 }
450 450 })
451 451 }
452 452 }
453 453 });
454 454
455 455 $("#repo_switcher").on('select2-selecting', function(e){
456 456 e.preventDefault();
457 457 window.location = pyroutes.url('summary_home', {'repo_name': e.val})
458 458 })
459 459
460 460 ## Global mouse bindings ##
461 461
462 462 // general help "?"
463 463 Mousetrap.bind(['?'], function(e) {
464 464 $('#help_kb').modal({})
465 465 });
466 466
467 467 // / open the quick filter
468 468 Mousetrap.bind(['/'], function(e) {
469 469 $("#repo_switcher").select2("open");
470 470
471 471 // return false to prevent default browser behavior
472 472 // and stop event from bubbling
473 473 return false;
474 474 });
475 475
476 476 // ctrl/command+b, show the the main bar
477 477 Mousetrap.bind(['command+b', 'ctrl+b'], function(e) {
478 478 if($('#header-inner').hasClass('hover') && $('#content').hasClass('hover')){
479 479 $('#header-inner').removeClass('hover');
480 480 $('#content').removeClass('hover');
481 481 }
482 482 else{
483 483 $('#header-inner').addClass('hover');
484 484 $('#content').addClass('hover');
485 485 }
486 486 return false;
487 487 });
488 488
489 489 // general nav g + action
490 490 Mousetrap.bind(['g h'], function(e) {
491 491 window.location = pyroutes.url('home');
492 492 });
493 493 Mousetrap.bind(['g g'], function(e) {
494 494 window.location = pyroutes.url('gists', {'private':1});
495 495 });
496 496 Mousetrap.bind(['g G'], function(e) {
497 497 window.location = pyroutes.url('gists', {'public':1});
498 498 });
499 499 Mousetrap.bind(['n g'], function(e) {
500 500 window.location = pyroutes.url('new_gist');
501 501 });
502 502 Mousetrap.bind(['n r'], function(e) {
503 503 window.location = pyroutes.url('new_repo');
504 504 });
505 505
506 506 % if hasattr(c, 'repo_name') and hasattr(c, 'db_repo'):
507 507 // nav in repo context
508 508 Mousetrap.bind(['g s'], function(e) {
509 509 window.location = pyroutes.url('summary_home', {'repo_name': REPO_NAME});
510 510 });
511 511 Mousetrap.bind(['g c'], function(e) {
512 512 window.location = pyroutes.url('changelog_home', {'repo_name': REPO_NAME});
513 513 });
514 514 Mousetrap.bind(['g F'], function(e) {
515 515 window.location = pyroutes.url('files_home', {'repo_name': REPO_NAME, 'revision': '${c.db_repo.landing_rev[1]}', 'f_path': '', 'search': '1'});
516 516 });
517 517 Mousetrap.bind(['g f'], function(e) {
518 518 window.location = pyroutes.url('files_home', {'repo_name': REPO_NAME, 'revision': '${c.db_repo.landing_rev[1]}', 'f_path': ''});
519 519 });
520 520 Mousetrap.bind(['g o'], function(e) {
521 521 window.location = pyroutes.url('edit_repo', {'repo_name': REPO_NAME});
522 522 });
523 523 Mousetrap.bind(['g O'], function(e) {
524 524 window.location = pyroutes.url('edit_repo_perms', {'repo_name': REPO_NAME});
525 525 });
526 526 % endif
527 527
528 528 </script>
529 529 </%def>
530 530
531 531 %if 0:
532 532 <div class="modal" id="help_kb" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
533 533 <div class="modal-dialog">
534 534 <div class="modal-content">
535 535 <div class="modal-header">
536 536 <button type="button" class="close" data-dismiss="modal" aria-hidden="true"><i class="icon-cancel-circled"></i></button>
537 537 <h4 class="modal-title">${_('Keyboard shortcuts')}</h4>
538 538 </div>
539 539 <div class="modal-body">
540 540 <div class="row">
541 541 <div class="col-md-5">
542 542 <table class="keyboard-mappings">
543 543 <tbody>
544 544 <tr>
545 545 <th></th>
546 546 <th>${_('Site-wide shortcuts')}</th>
547 547 </tr>
548 548 <%
549 549 elems = [
550 550 ('/', 'Open quick search box'),
551 551 ('ctrl/cmd+b', 'Show main settings bar'),
552 552 ('g h', 'Goto home page'),
553 553 ('g g', 'Goto my private gists page'),
554 554 ('g G', 'Goto my public gists page'),
555 555 ('n r', 'New repository page'),
556 556 ('n g', 'New gist page')
557 557 ]
558 558 %>
559 559 %for key, desc in elems:
560 560 <tr>
561 561 <td class="keys">
562 562 <span class="key">${key}</span>
563 563 </td>
564 564 <td>${desc}</td>
565 565 </tr>
566 566 %endfor
567 567 </tbody>
568 568 </table>
569 569 </div>
570 570 <div class="col-md-offset-5">
571 571 <table class="keyboard-mappings">
572 572 <tbody>
573 573 <tr>
574 574 <th></th>
575 575 <th>${_('Repositories')}</th>
576 576 </tr>
577 577 <%
578 578 elems = [
579 579 ('g s', 'Goto summary page'),
580 580 ('g c', 'Goto changelog page'),
581 581 ('g f', 'Goto files page'),
582 582 ('g F', 'Goto files page with file search activated'),
583 583 ('g o', 'Goto repository settings'),
584 584 ('g O', 'Goto repository permissions settings')
585 585 ]
586 586 %>
587 587 %for key, desc in elems:
588 588 <tr>
589 589 <td class="keys">
590 590 <span class="key">${key}</span>
591 591 </td>
592 592 <td>${desc}</td>
593 593 </tr>
594 594 %endfor
595 595 </tbody>
596 596 </table>
597 597 </div>
598 598 </div>
599 599 </div>
600 600 <div class="modal-footer">
601 601 </div>
602 602 </div><!-- /.modal-content -->
603 603 </div><!-- /.modal-dialog -->
604 604 </div><!-- /.modal -->
605 605 %endif
General Comments 0
You need to be logged in to leave comments. Login now