##// END OF EJS Templates
Adde raw file to routes, and refactoring...
marcink -
r148:d928d5f0 default
parent child Browse files
Show More
@@ -1,44 +1,53 b''
1 1 """Routes configuration
2 2
3 3 The more specific and detailed routes should be defined first so they
4 4 may take precedent over the more generic routes. For more information
5 5 refer to the routes manual at http://routes.groovie.org/docs/
6 6 """
7 7 from routes import Mapper
8 8
9 9 def make_map(config):
10 10 """Create, configure and return the routes Mapper"""
11 11 map = Mapper(directory=config['pylons.paths']['controllers'],
12 12 always_scan=config['debug'])
13 13 map.minimization = False
14 14 map.explicit = False
15 15
16 16 # The ErrorController route (handles 404/500 error pages); it should
17 17 # likely stay at the top, ensuring it can always be resolved
18 18 map.connect('/error/{action}', controller='error')
19 19 map.connect('/error/{action}/{id}', controller='error')
20 20
21 21 # CUSTOM ROUTES HERE
22 22 map.connect('hg_home', '/', controller='hg', action='index')
23 23
24 24
25 25 #REST controllers
26 26 map.resource('repo', 'repos', path_prefix='/_admin')
27 27 map.resource('user', 'users', path_prefix='/_admin')
28 28
29 29 #ADMIN
30 30 with map.submapper(path_prefix='/_admin', controller='admin') as m:
31 31 m.connect('admin_home', '/', action='index')#main page
32 32 m.connect('admin_add_repo', '/add_repo/{new_repo:[a-z0-9\. _-]*}', action='add_repo')
33 33
34 34
35 map.connect('changeset_home', '/{repo_name}/changeset/{revision}', controller='changeset', revision='tip')
36 map.connect('summary_home', '/{repo_name}/summary', controller='summary')
37 map.connect('shortlog_home', '/{repo_name}/shortlog/{revision}', controller='shortlog', revision='tip')
38 map.connect('branches_home', '/{repo_name}/branches', controller='branches')
39 map.connect('tags_home', '/{repo_name}/tags', controller='tags')
40 map.connect('changelog_home', '/{repo_name}/changelog/{revision}', controller='changelog', revision='tip')
41 map.connect('files_home', '/{repo_name}/files/{revision}/{f_path:.*}', controller='files', revision='tip', f_path='')
42 map.connect('files_diff_home', '/{repo_name}/diff/{f_path:.*}', controller='files', action='diff', revision='tip', f_path='')
43
35 map.connect('changeset_home', '/{repo_name}/changeset/{revision}',
36 controller='changeset', revision='tip')
37 map.connect('summary_home', '/{repo_name}/summary',
38 controller='summary')
39 map.connect('shortlog_home', '/{repo_name}/shortlog/{revision}',
40 controller='shortlog', revision='tip')
41 map.connect('branches_home', '/{repo_name}/branches',
42 controller='branches')
43 map.connect('tags_home', '/{repo_name}/tags',
44 controller='tags')
45 map.connect('changelog_home', '/{repo_name}/changelog/{revision}',
46 controller='changelog', revision='tip')
47 map.connect('files_home', '/{repo_name}/files/{revision}/{f_path:.*}',
48 controller='files', revision='tip', f_path='')
49 map.connect('files_diff_home', '/{repo_name}/diff/{f_path:.*}',
50 controller='files', action='diff', revision='tip', f_path='')
51 map.connect('files_raw_home', '/{repo_name}/rawfile/{revision}/{f_path:.*}',
52 controller='files', action='rawfile', revision='tip', f_path='')
44 53 return map
@@ -1,25 +1,26 b''
1 1 <dl class="overview">
2 2 <dt>${_('Revision')}</dt>
3 3 <dd>r${c.files_list.last_changeset.revision}:${c.files_list.last_changeset._short}</dd>
4 4 <dt>${_('Size')}</dt>
5 5 <dd>${h.filesizeformat(c.files_list.size)}</dd>
6 6 <dt>${_('Options')}</dt>
7 <dd>${h.link_to(_('annotate'),h.url('#'))} / ${h.link_to(_('raw'),h.url('#'))}</dd>
7 <dd>${h.link_to(_('annotate'),h.url('#'))} / ${h.link_to(_('raw'),h.url('files_raw_home',repo_name=c.repo_name,revision=c.cur_rev,f_path=c.f_path))}</dd>
8 8 <dt>${_('History')}</dt>
9 9 <dd>
10 10 ${h.form(h.url('files_diff_home',repo_name=c.repo_name,f_path=c.f_path),method='GET')}
11 11 ${h.hidden('diff2',c.files_list.last_changeset._short)}
12 12 ${h.select('diff1','',c.file_history)}
13 13 ${h.submit('diff','diff')}
14 14 ${h.end_form()}
15 15 </dd>
16 16
17 17 </dl>
18 18 <div id="body" class="codeblock">
19 19 <div class="code-header">
20 20 <span>${c.files_list.name}@r${c.files_list.last_changeset.revision}:${c.files_list.last_changeset._short}</span>
21 <span style="font-size:70%">"${c.file_msg}"</span>
21 22 </div>
22 23 <div class="code-body">
23 24 ${h.pygmentize(c.files_list.content,linenos=True,anchorlinenos=True,cssclass="code-highlight")}
24 25 </div>
25 26 </div> No newline at end of file
General Comments 0
You need to be logged in to leave comments. Login now