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