##// END OF EJS Templates
moved diff libs to vcs. updated htmls and css for diff and source
marcink -
r158:f905f45c default
parent child Browse files
Show More
@@ -1,112 +1,104 b''
1 import logging
1 import logging
2
2
3 from pylons import request, response, session, tmpl_context as c, url, config, app_globals as g
3 from pylons import request, response, session, tmpl_context as c, url, config, app_globals as g
4 from pylons.controllers.util import abort, redirect
4 from pylons.controllers.util import abort, redirect
5
5
6 from pylons_app.lib.base import BaseController, render
6 from pylons_app.lib.base import BaseController, render
7 from pylons_app.lib.utils import get_repo_slug
7 from pylons_app.lib.utils import get_repo_slug
8 from pylons_app.model.hg_model import HgModel
8 from pylons_app.model.hg_model import HgModel
9 from difflib import unified_diff
9 from vcs.utils import diffs as differ
10 from pylons_app.lib.differ import render_udiff
11 from vcs.exceptions import RepositoryError, ChangesetError
10 from vcs.exceptions import RepositoryError, ChangesetError
12
11
13 log = logging.getLogger(__name__)
12 log = logging.getLogger(__name__)
14
13
15 class FilesController(BaseController):
14 class FilesController(BaseController):
16 def __before__(self):
15 def __before__(self):
17 c.repos_prefix = config['repos_name']
16 c.repos_prefix = config['repos_name']
18 c.repo_name = get_repo_slug(request)
17 c.repo_name = get_repo_slug(request)
19
18
20 def index(self, repo_name, revision, f_path):
19 def index(self, repo_name, revision, f_path):
21 hg_model = HgModel()
20 hg_model = HgModel()
22 c.repo = repo = hg_model.get_repo(c.repo_name)
21 c.repo = repo = hg_model.get_repo(c.repo_name)
23 revision = request.POST.get('at_rev', None) or revision
22 revision = request.POST.get('at_rev', None) or revision
24
23
25 def get_next_rev(cur):
24 def get_next_rev(cur):
26 max_rev = len(c.repo.revisions) - 1
25 max_rev = len(c.repo.revisions) - 1
27 r = cur + 1
26 r = cur + 1
28 if r > max_rev:
27 if r > max_rev:
29 r = max_rev
28 r = max_rev
30 return r
29 return r
31
30
32 def get_prev_rev(cur):
31 def get_prev_rev(cur):
33 r = cur - 1
32 r = cur - 1
34 return r
33 return r
35
34
36 c.f_path = f_path
35 c.f_path = f_path
37
36
38
37
39 try:
38 try:
40 cur_rev = repo.get_changeset(revision).revision
39 cur_rev = repo.get_changeset(revision).revision
41 prev_rev = repo.get_changeset(get_prev_rev(cur_rev)).raw_id
40 prev_rev = repo.get_changeset(get_prev_rev(cur_rev)).raw_id
42 next_rev = repo.get_changeset(get_next_rev(cur_rev)).raw_id
41 next_rev = repo.get_changeset(get_next_rev(cur_rev)).raw_id
43
42
44 c.url_prev = url('files_home', repo_name=c.repo_name,
43 c.url_prev = url('files_home', repo_name=c.repo_name,
45 revision=prev_rev, f_path=f_path)
44 revision=prev_rev, f_path=f_path)
46 c.url_next = url('files_home', repo_name=c.repo_name,
45 c.url_next = url('files_home', repo_name=c.repo_name,
47 revision=next_rev, f_path=f_path)
46 revision=next_rev, f_path=f_path)
48
47
49 c.changeset = repo.get_changeset(revision)
48 c.changeset = repo.get_changeset(revision)
50 try:
49 try:
51 c.file_msg = c.changeset.get_file_message(f_path)
50 c.file_msg = c.changeset.get_file_message(f_path)
52 except:
51 except:
53 c.file_msg = None
52 c.file_msg = None
54
53
55 c.cur_rev = c.changeset.raw_id
54 c.cur_rev = c.changeset.raw_id
56 c.rev_nr = c.changeset.revision
55 c.rev_nr = c.changeset.revision
57 c.files_list = c.changeset.get_node(f_path)
56 c.files_list = c.changeset.get_node(f_path)
58 c.file_history = self._get_history(repo, c.files_list, f_path)
57 c.file_history = self._get_history(repo, c.files_list, f_path)
59
58
60 except (RepositoryError, ChangesetError):
59 except (RepositoryError, ChangesetError):
61 c.files_list = None
60 c.files_list = None
62
61
63 return render('files/files.html')
62 return render('files/files.html')
64
63
65 def rawfile(self, repo_name, revision, f_path):
64 def rawfile(self, repo_name, revision, f_path):
66 hg_model = HgModel()
65 hg_model = HgModel()
67 c.repo = hg_model.get_repo(c.repo_name)
66 c.repo = hg_model.get_repo(c.repo_name)
68 file_node = c.repo.get_changeset(revision).get_node(f_path)
67 file_node = c.repo.get_changeset(revision).get_node(f_path)
69 response.headers['Content-type'] = file_node.mimetype
68 response.headers['Content-type'] = file_node.mimetype
70 response.headers['Content-disposition'] = 'attachment; filename=%s' \
69 response.headers['Content-disposition'] = 'attachment; filename=%s' \
71 % f_path.split('/')[-1]
70 % f_path.split('/')[-1]
72 return file_node.content
71 return file_node.content
73
72
74 def archivefile(self, repo_name, revision, fileformat):
73 def archivefile(self, repo_name, revision, fileformat):
75 return '%s %s %s' % (repo_name, revision, fileformat)
74 return '%s %s %s' % (repo_name, revision, fileformat)
76
75
77 def diff(self, repo_name, f_path):
76 def diff(self, repo_name, f_path):
78 hg_model = HgModel()
77 hg_model = HgModel()
79 diff1 = request.GET.get('diff1')
78 diff1 = request.GET.get('diff1')
80 diff2 = request.GET.get('diff2')
79 diff2 = request.GET.get('diff2')
81 c.no_changes = diff1 == diff2
80 c.no_changes = diff1 == diff2
82 c.f_path = f_path
81 c.f_path = f_path
83 c.repo = hg_model.get_repo(c.repo_name)
82 c.repo = hg_model.get_repo(c.repo_name)
84 c.changeset_1 = c.repo.get_changeset(diff1)
83 c.changeset_1 = c.repo.get_changeset(diff1)
85 c.changeset_2 = c.repo.get_changeset(diff2)
84 c.changeset_2 = c.repo.get_changeset(diff2)
86 f1 = c.changeset_1.get_node(f_path)
87 f2 = c.changeset_2.get_node(f_path)
88
85
89 c.diff1 = 'r%s:%s' % (c.changeset_1.revision, c.changeset_1._short)
86 c.diff1 = 'r%s:%s' % (c.changeset_1.revision, c.changeset_1._short)
90 c.diff2 = 'r%s:%s' % (c.changeset_2.revision, c.changeset_2._short)
87 c.diff2 = 'r%s:%s' % (c.changeset_2.revision, c.changeset_2._short)
91
88
92 f_udiff = unified_diff(f1.content.splitlines(True),
93 f2.content.splitlines(True),
94 f1.name,
95 f2.name)
96
89
97 c.diff_files = render_udiff(udiff=f_udiff, differ='difflib')
90 f_udiff = differ.get_udiff(c.changeset_1.get_node(f_path),
98 print c.diff_files
91 c.changeset_2.get_node(f_path))
99 if len(c.diff_files) < 1:
92 c.differ = differ.DiffProcessor(f_udiff)
100 c.no_changes = True
101 return render('files/file_diff.html')
93 return render('files/file_diff.html')
102
94
103 def _get_history(self, repo, node, f_path):
95 def _get_history(self, repo, node, f_path):
104 from vcs.nodes import NodeKind
96 from vcs.nodes import NodeKind
105 if not node.kind is NodeKind.FILE:
97 if not node.kind is NodeKind.FILE:
106 return []
98 return []
107 changesets = node.history
99 changesets = node.history
108 hist_l = []
100 hist_l = []
109 for chs in changesets:
101 for chs in changesets:
110 n_desc = 'r%s:%s' % (chs.revision, chs._short)
102 n_desc = 'r%s:%s' % (chs.revision, chs._short)
111 hist_l.append((chs._short, n_desc,))
103 hist_l.append((chs._short, n_desc,))
112 return hist_l
104 return hist_l
@@ -1,95 +1,103 b''
1 div.diffblock {
1 div.diffblock {
2 overflow: auto;
2 overflow: auto;
3 padding: 0px;
3 padding: 0px;
4 border: 1px solid #ccc;
4 border: 1px solid #ccc;
5 background: #f8f8f8;
5 background: #f8f8f8;
6 font-size: 100%;
6 font-size: 100%;
7 line-height: 100%;
7 line-height: 100%;
8 /* new */
8 /* new */
9 line-height: 125%;
9 line-height: 125%;
10 }
10 }
11 div.diffblock .code-header{
11 div.diffblock .code-header{
12 border-bottom: 1px solid #CCCCCC;
12 border-bottom: 1px solid #CCCCCC;
13 background: #EEEEEE;
13 background: #EEEEEE;
14 color:blue;
14 color:blue;
15 padding:10px 0 10px 0;
15 padding:10px 0 10px 0;
16 }
16 }
17 div.diffblock .code-header span{
17 div.diffblock .code-header span{
18 margin-left:25px;
18 margin-left:25px;
19 font-weight: bold;
19 font-weight: bold;
20 }
20 }
21 div.diffblock .code-body{
21 div.diffblock .code-body{
22 background: #EEEEEE;
22 background: #EEEEEE;
23 }
23 }
24
24
25 .code-difftable{
25 .code-difftable{
26 border-collapse: collapse;
26 border-collapse: collapse;
27 width: 99%;
28 }
29 .code-difftable td:target *{
30 background: repeat scroll 0 0 #FFFFBE !important;
31 text-decoration: underline;
32 }
33 .code-difftable .context{
34 background:none repeat scroll 0 0 #DDE7EF;
27 }
35 }
28 .code-difftable .add{
36 .code-difftable .add{
29 background:none repeat scroll 0 0 #DDFFDD;
37 background:none repeat scroll 0 0 #DDFFDD;
30 }
38 }
31 .code-difftable .add ins{
39 .code-difftable .add ins{
32 background:none repeat scroll 0 0 #AAFFAA;
40 background:none repeat scroll 0 0 #AAFFAA;
33 text-decoration:none;
41 text-decoration:none;
34 }
42 }
35
43
36 .code-difftable .del{
44 .code-difftable .del{
37 background:none repeat scroll 0 0 #FFDDDD;
45 background:none repeat scroll 0 0 #FFDDDD;
38 }
46 }
39 .code-difftable .del del{
47 .code-difftable .del del{
40 background:none repeat scroll 0 0 #FFAAAA;
48 background:none repeat scroll 0 0 #FFAAAA;
41 text-decoration:none;
49 text-decoration:none;
42 }
50 }
43
51
44 .code-difftable .lineno{
52 .code-difftable .lineno{
45 background:none repeat scroll 0 0 #EEEEEE !important;
53 background:none repeat scroll 0 0 #EEEEEE !important;
46 border-right:1px solid #DDDDDD;
54 border-right:1px solid #DDDDDD;
47 padding-left:2px;
55 padding-left:2px;
48 padding-right:2px;
56 padding-right:2px;
49 text-align:right;
57 text-align:right;
50 width:20px;
58 width:20px;
51 -moz-user-select:none;
59 -moz-user-select:none;
52 -webkit-user-select: none;
60 -webkit-user-select: none;
53 }
61 }
54 .code-difftable .lineno pre{
62 .code-difftable .lineno pre{
55 color:#747474 !important;
63 color:#747474 !important;
56 font:11px "Bitstream Vera Sans Mono",Monaco,"Courier New",Courier,monospace !important;
64 font:11px "Bitstream Vera Sans Mono",Monaco,"Courier New",Courier,monospace !important;
57 letter-spacing:-1px;
65 letter-spacing:-1px;
58 text-align:right;
66 text-align:right;
59 width:20px;
67 width:20px;
60 }
68 }
61 .code-difftable .lineno a{
69 .code-difftable .lineno a{
62 color:#0000CC !important;
70 color:#0000CC !important;
63 }
71 }
64 .code-difftable .code td{
72 .code-difftable .code td{
65 margin:0;
73 margin:0;
66 padding: 0;
74 padding: 0;
67 }
75 }
68 .code-difftable .code pre{
76 .code-difftable .code pre{
69 margin:0;
77 margin:0;
70 padding:0;
78 padding:0;
71 }
79 }
72
80
73
81
74 .code {
82 .code {
75 display: block;
83 display: block;
76 width: 100%;
84 width: 100%;
77 }
85 }
78 .code-diff {
86 .code-diff {
79 padding: 0px;
87 padding: 0px;
80 margin-top: 5px;
88 margin-top: 5px;
81 margin-bottom: 5px;
89 margin-bottom: 5px;
82 border-left: 2px solid #ccc;
90 border-left: 2px solid #ccc;
83 }
91 }
84 .code-diff pre, .line pre {
92 .code-diff pre, .line pre {
85 padding: 3px;
93 padding: 3px;
86 margin: 0;
94 margin: 0;
87 }
95 }
88 .lineno a {
96 .lineno a {
89 text-decoration: none;
97 text-decoration: none;
90 }
98 }
91
99
92 .line{
100 .line{
93 padding:0;
101 padding:0;
94 margin:0;
102 margin:0;
95 } No newline at end of file
103 }
@@ -1,96 +1,100 b''
1 div.codeblock {
1 div.codeblock {
2 overflow: auto;
2 overflow: auto;
3 padding: 0px;
3 padding: 0px;
4 border: 1px solid #ccc;
4 border: 1px solid #ccc;
5 background: #f8f8f8;
5 background: #f8f8f8;
6 font-size: 100%;
6 font-size: 100%;
7 line-height: 100%;
7 line-height: 100%;
8 /* new */
8 /* new */
9 line-height: 125%;
9 line-height: 125%;
10 }
10 }
11 div.codeblock .code-header{
11 div.codeblock .code-header{
12 border-bottom: 1px solid #CCCCCC;
12 border-bottom: 1px solid #CCCCCC;
13 background: #EEEEEE;
13 background: #EEEEEE;
14 color:blue;
14 color:blue;
15 padding:10px 0 10px 0;
15 padding:10px 0 10px 0;
16 }
16 }
17 div.codeblock .code-header span{
17 div.codeblock .code-header .revision{
18 margin-left:25px;
18 margin-left:25px;
19 font-weight: bold;
19 font-weight: bold;
20 }
20 }
21 div.codeblock .code-header .commit{
22 margin-left:25px;
23 font-weight: normal;
24 }
21
25
22 .code-highlight {
26 .code-highlight {
23 padding: 0px;
27 padding: 0px;
24 margin-top: 5px;
28 margin-top: 5px;
25 margin-bottom: 5px;
29 margin-bottom: 5px;
26 border-left: 2px solid #ccc;
30 border-left: 2px solid #ccc;
27 }
31 }
28 .code-highlight pre, .linenodiv pre {
32 .code-highlight pre, .linenodiv pre {
29 padding: 5px;
33 padding: 5px;
30 margin: 0;
34 margin: 0;
31 }
35 }
32 .linenos a { text-decoration: none; }
36 .linenos a { text-decoration: none; }
33
37
34
38
35 .code { display: block; }
39 .code { display: block; }
36 .code-highlight .hll { background-color: #ffffcc }
40 .code-highlight .hll { background-color: #ffffcc }
37 .code-highlight .c { color: #408080; font-style: italic } /* Comment */
41 .code-highlight .c { color: #408080; font-style: italic } /* Comment */
38 .code-highlight .err { border: 1px solid #FF0000 } /* Error */
42 .code-highlight .err { border: 1px solid #FF0000 } /* Error */
39 .code-highlight .k { color: #008000; font-weight: bold } /* Keyword */
43 .code-highlight .k { color: #008000; font-weight: bold } /* Keyword */
40 .code-highlight .o { color: #666666 } /* Operator */
44 .code-highlight .o { color: #666666 } /* Operator */
41 .code-highlight .cm { color: #408080; font-style: italic } /* Comment.Multiline */
45 .code-highlight .cm { color: #408080; font-style: italic } /* Comment.Multiline */
42 .code-highlight .cp { color: #BC7A00 } /* Comment.Preproc */
46 .code-highlight .cp { color: #BC7A00 } /* Comment.Preproc */
43 .code-highlight .c1 { color: #408080; font-style: italic } /* Comment.Single */
47 .code-highlight .c1 { color: #408080; font-style: italic } /* Comment.Single */
44 .code-highlight .cs { color: #408080; font-style: italic } /* Comment.Special */
48 .code-highlight .cs { color: #408080; font-style: italic } /* Comment.Special */
45 .code-highlight .gd { color: #A00000 } /* Generic.Deleted */
49 .code-highlight .gd { color: #A00000 } /* Generic.Deleted */
46 .code-highlight .ge { font-style: italic } /* Generic.Emph */
50 .code-highlight .ge { font-style: italic } /* Generic.Emph */
47 .code-highlight .gr { color: #FF0000 } /* Generic.Error */
51 .code-highlight .gr { color: #FF0000 } /* Generic.Error */
48 .code-highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */
52 .code-highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */
49 .code-highlight .gi { color: #00A000 } /* Generic.Inserted */
53 .code-highlight .gi { color: #00A000 } /* Generic.Inserted */
50 .code-highlight .go { color: #808080 } /* Generic.Output */
54 .code-highlight .go { color: #808080 } /* Generic.Output */
51 .code-highlight .gp { color: #000080; font-weight: bold } /* Generic.Prompt */
55 .code-highlight .gp { color: #000080; font-weight: bold } /* Generic.Prompt */
52 .code-highlight .gs { font-weight: bold } /* Generic.Strong */
56 .code-highlight .gs { font-weight: bold } /* Generic.Strong */
53 .code-highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
57 .code-highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
54 .code-highlight .gt { color: #0040D0 } /* Generic.Traceback */
58 .code-highlight .gt { color: #0040D0 } /* Generic.Traceback */
55 .code-highlight .kc { color: #008000; font-weight: bold } /* Keyword.Constant */
59 .code-highlight .kc { color: #008000; font-weight: bold } /* Keyword.Constant */
56 .code-highlight .kd { color: #008000; font-weight: bold } /* Keyword.Declaration */
60 .code-highlight .kd { color: #008000; font-weight: bold } /* Keyword.Declaration */
57 .code-highlight .kn { color: #008000; font-weight: bold } /* Keyword.Namespace */
61 .code-highlight .kn { color: #008000; font-weight: bold } /* Keyword.Namespace */
58 .code-highlight .kp { color: #008000 } /* Keyword.Pseudo */
62 .code-highlight .kp { color: #008000 } /* Keyword.Pseudo */
59 .code-highlight .kr { color: #008000; font-weight: bold } /* Keyword.Reserved */
63 .code-highlight .kr { color: #008000; font-weight: bold } /* Keyword.Reserved */
60 .code-highlight .kt { color: #B00040 } /* Keyword.Type */
64 .code-highlight .kt { color: #B00040 } /* Keyword.Type */
61 .code-highlight .m { color: #666666 } /* Literal.Number */
65 .code-highlight .m { color: #666666 } /* Literal.Number */
62 .code-highlight .s { color: #BA2121 } /* Literal.String */
66 .code-highlight .s { color: #BA2121 } /* Literal.String */
63 .code-highlight .na { color: #7D9029 } /* Name.Attribute */
67 .code-highlight .na { color: #7D9029 } /* Name.Attribute */
64 .code-highlight .nb { color: #008000 } /* Name.Builtin */
68 .code-highlight .nb { color: #008000 } /* Name.Builtin */
65 .code-highlight .nc { color: #0000FF; font-weight: bold } /* Name.Class */
69 .code-highlight .nc { color: #0000FF; font-weight: bold } /* Name.Class */
66 .code-highlight .no { color: #880000 } /* Name.Constant */
70 .code-highlight .no { color: #880000 } /* Name.Constant */
67 .code-highlight .nd { color: #AA22FF } /* Name.Decorator */
71 .code-highlight .nd { color: #AA22FF } /* Name.Decorator */
68 .code-highlight .ni { color: #999999; font-weight: bold } /* Name.Entity */
72 .code-highlight .ni { color: #999999; font-weight: bold } /* Name.Entity */
69 .code-highlight .ne { color: #D2413A; font-weight: bold } /* Name.Exception */
73 .code-highlight .ne { color: #D2413A; font-weight: bold } /* Name.Exception */
70 .code-highlight .nf { color: #0000FF } /* Name.Function */
74 .code-highlight .nf { color: #0000FF } /* Name.Function */
71 .code-highlight .nl { color: #A0A000 } /* Name.Label */
75 .code-highlight .nl { color: #A0A000 } /* Name.Label */
72 .code-highlight .nn { color: #0000FF; font-weight: bold } /* Name.Namespace */
76 .code-highlight .nn { color: #0000FF; font-weight: bold } /* Name.Namespace */
73 .code-highlight .nt { color: #008000; font-weight: bold } /* Name.Tag */
77 .code-highlight .nt { color: #008000; font-weight: bold } /* Name.Tag */
74 .code-highlight .nv { color: #19177C } /* Name.Variable */
78 .code-highlight .nv { color: #19177C } /* Name.Variable */
75 .code-highlight .ow { color: #AA22FF; font-weight: bold } /* Operator.Word */
79 .code-highlight .ow { color: #AA22FF; font-weight: bold } /* Operator.Word */
76 .code-highlight .w { color: #bbbbbb } /* Text.Whitespace */
80 .code-highlight .w { color: #bbbbbb } /* Text.Whitespace */
77 .code-highlight .mf { color: #666666 } /* Literal.Number.Float */
81 .code-highlight .mf { color: #666666 } /* Literal.Number.Float */
78 .code-highlight .mh { color: #666666 } /* Literal.Number.Hex */
82 .code-highlight .mh { color: #666666 } /* Literal.Number.Hex */
79 .code-highlight .mi { color: #666666 } /* Literal.Number.Integer */
83 .code-highlight .mi { color: #666666 } /* Literal.Number.Integer */
80 .code-highlight .mo { color: #666666 } /* Literal.Number.Oct */
84 .code-highlight .mo { color: #666666 } /* Literal.Number.Oct */
81 .code-highlight .sb { color: #BA2121 } /* Literal.String.Backtick */
85 .code-highlight .sb { color: #BA2121 } /* Literal.String.Backtick */
82 .code-highlight .sc { color: #BA2121 } /* Literal.String.Char */
86 .code-highlight .sc { color: #BA2121 } /* Literal.String.Char */
83 .code-highlight .sd { color: #BA2121; font-style: italic } /* Literal.String.Doc */
87 .code-highlight .sd { color: #BA2121; font-style: italic } /* Literal.String.Doc */
84 .code-highlight .s2 { color: #BA2121 } /* Literal.String.Double */
88 .code-highlight .s2 { color: #BA2121 } /* Literal.String.Double */
85 .code-highlight .se { color: #BB6622; font-weight: bold } /* Literal.String.Escape */
89 .code-highlight .se { color: #BB6622; font-weight: bold } /* Literal.String.Escape */
86 .code-highlight .sh { color: #BA2121 } /* Literal.String.Heredoc */
90 .code-highlight .sh { color: #BA2121 } /* Literal.String.Heredoc */
87 .code-highlight .si { color: #BB6688; font-weight: bold } /* Literal.String.Interpol */
91 .code-highlight .si { color: #BB6688; font-weight: bold } /* Literal.String.Interpol */
88 .code-highlight .sx { color: #008000 } /* Literal.String.Other */
92 .code-highlight .sx { color: #008000 } /* Literal.String.Other */
89 .code-highlight .sr { color: #BB6688 } /* Literal.String.Regex */
93 .code-highlight .sr { color: #BB6688 } /* Literal.String.Regex */
90 .code-highlight .s1 { color: #BA2121 } /* Literal.String.Single */
94 .code-highlight .s1 { color: #BA2121 } /* Literal.String.Single */
91 .code-highlight .ss { color: #19177C } /* Literal.String.Symbol */
95 .code-highlight .ss { color: #19177C } /* Literal.String.Symbol */
92 .code-highlight .bp { color: #008000 } /* Name.Builtin.Pseudo */
96 .code-highlight .bp { color: #008000 } /* Name.Builtin.Pseudo */
93 .code-highlight .vc { color: #19177C } /* Name.Variable.Class */
97 .code-highlight .vc { color: #19177C } /* Name.Variable.Class */
94 .code-highlight .vg { color: #19177C } /* Name.Variable.Global */
98 .code-highlight .vg { color: #19177C } /* Name.Variable.Global */
95 .code-highlight .vi { color: #19177C } /* Name.Variable.Instance */
99 .code-highlight .vi { color: #19177C } /* Name.Variable.Instance */
96 .code-highlight .il { color: #666666 } /* Literal.Number.Integer.Long */
100 .code-highlight .il { color: #666666 } /* Literal.Number.Integer.Long */
@@ -1,59 +1,41 b''
1 <%inherit file="/base/base.html"/>
1 <%inherit file="/base/base.html"/>
2
2
3 <%def name="title()">
3 <%def name="title()">
4 ${_('Repository managment')}
4 ${_('Repository managment')}
5 </%def>
5 </%def>
6 <%def name="breadcrumbs()">
6 <%def name="breadcrumbs()">
7 ${h.link_to(u'Home',h.url('/'))}
7 ${h.link_to(u'Home',h.url('/'))}
8 /
8 /
9 ${h.link_to(c.repo_name,h.url('files_home',repo_name=c.repo_name))}
9 ${h.link_to(c.repo_name,h.url('files_home',repo_name=c.repo_name))}
10 /
10 /
11 ${_('files')}
11 ${_('files')}
12 </%def>
12 </%def>
13 <%def name="page_nav()">
13 <%def name="page_nav()">
14 <form action="log">
14 <form action="log">
15 <dl class="search">
15 <dl class="search">
16 <dt><label>Search: </label></dt>
16 <dt><label>Search: </label></dt>
17 <dd><input type="text" name="rev" /></dd>
17 <dd><input type="text" name="rev" /></dd>
18 </dl>
18 </dl>
19 </form>
19 </form>
20
20
21 ${self.menu('files')}
21 ${self.menu('files')}
22 </%def>
22 </%def>
23 <%def name="css()">
23 <%def name="css()">
24 <link rel="stylesheet" href="/css/monoblue_custom.css" type="text/css" />
24 <link rel="stylesheet" href="/css/monoblue_custom.css" type="text/css" />
25 <link rel="stylesheet" href="/css/diff.css" type="text/css" />
25 <link rel="stylesheet" href="/css/diff.css" type="text/css" />
26 </%def>
26 </%def>
27 <%def name="main()">
27 <%def name="main()">
28 <h2 class="no-link no-border">${'%s: %s %s %s' % (_('File diff'),c.diff2,'&rarr;',c.diff1)|n}</h2>
28 <h2 class="no-link no-border">${'%s: %s %s %s' % (_('File diff'),c.diff2,'&rarr;',c.diff1)|n}</h2>
29 <div id="body" class="diffblock">
29 <div id="body" class="diffblock">
30 <div class="code-header">
30 <div class="code-header">
31 <span>${h.link_to(c.f_path,h.url('files_home',repo_name=c.repo_name,revision=c.diff2.split(':')[1],f_path=c.f_path))}</span>
31 <span>${h.link_to(c.f_path,h.url('files_home',repo_name=c.repo_name,revision=c.diff2.split(':')[1],f_path=c.f_path))}</span>
32 </div>
32 </div>
33 <div class="code-body">
33 <div class="code-body">
34 %if c.no_changes:
34 %if c.no_changes:
35 ${_('No changes')}
35 ${_('No changes')}
36 %else:
36 %else:
37 <table class='code-difftable'>
37 ${c.differ.as_HTML()|n}
38 %for diff in c.diff_files:
39 %for x in diff['chunks']:
40 %for y in x:
41 <tr class="line ${y['action']}">
42 <td id="#${diff['filename']}_O${y['old_lineno']}" class="lineno old">
43 <pre><a href="#${diff['filename']}_O${y['old_lineno']}">${y['old_lineno']}</a></pre>
44 </td>
45 <td id="#${diff['filename']}_N${y['new_lineno']}"class="lineno new">
46 <pre><a href="#${diff['filename']}_N${y['new_lineno']}">${y['new_lineno']}</a></pre>
47 </td>
48 <td class="code">
49 <pre>${y['line']|n}</pre>
50 </td>
51 </tr>
52 %endfor$
53 %endfor
54 %endfor
55 </table>
56 %endif
38 %endif
57 </div>
39 </div>
58 </div>
40 </div>
59 </%def> No newline at end of file
41 </%def>
@@ -1,26 +1,26 b''
1 <dl class="overview">
1 <dl class="overview">
2 <dt>${_('Revision')}</dt>
2 <dt>${_('Revision')}</dt>
3 <dd>r${c.files_list.last_changeset.revision}:${c.files_list.last_changeset._short}</dd>
3 <dd>r${c.files_list.last_changeset.revision}:${c.files_list.last_changeset._short}</dd>
4 <dt>${_('Size')}</dt>
4 <dt>${_('Size')}</dt>
5 <dd>${h.filesizeformat(c.files_list.size)}</dd>
5 <dd>${h.filesizeformat(c.files_list.size)}</dd>
6 <dt>${_('Options')}</dt>
6 <dt>${_('Options')}</dt>
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>
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 <dt>${_('History')}</dt>
8 <dt>${_('History')}</dt>
9 <dd>
9 <dd>
10 ${h.form(h.url('files_diff_home',repo_name=c.repo_name,f_path=c.f_path),method='GET')}
10 ${h.form(h.url('files_diff_home',repo_name=c.repo_name,f_path=c.f_path),method='GET')}
11 ${h.hidden('diff2',c.files_list.last_changeset._short)}
11 ${h.hidden('diff2',c.files_list.last_changeset._short)}
12 ${h.select('diff1','',c.file_history)}
12 ${h.select('diff1','',c.file_history)}
13 ${h.submit('diff','diff')}
13 ${h.submit('diff','diff')}
14 ${h.end_form()}
14 ${h.end_form()}
15 </dd>
15 </dd>
16
16
17 </dl>
17 </dl>
18 <div id="body" class="codeblock">
18 <div id="body" class="codeblock">
19 <div class="code-header">
19 <div class="code-header">
20 <span>${c.files_list.name}@r${c.files_list.last_changeset.revision}:${c.files_list.last_changeset._short}</span>
20 <div class="revision">${c.files_list.name}@r${c.files_list.last_changeset.revision}:${c.files_list.last_changeset._short}</div>
21 <span style="font-size:70%">"${c.file_msg}"</span>
21 <div class="commit" style="font-size:70%">"${c.file_msg}"</div>
22 </div>
22 </div>
23 <div class="code-body">
23 <div class="code-body">
24 ${h.pygmentize(c.files_list.content,linenos=True,anchorlinenos=True,cssclass="code-highlight")}
24 ${h.pygmentize(c.files_list.content,linenos=True,anchorlinenos=True,cssclass="code-highlight")}
25 </div>
25 </div>
26 </div> No newline at end of file
26 </div>
1 NO CONTENT: file was removed
NO CONTENT: file was removed
General Comments 0
You need to be logged in to leave comments. Login now