commented line with multiple lines
Code Blocks
.codeblock
- Used as a wrapping element around
.code-header
and.code-body
. Used to show the content of a file or a Gist. .diffblock
- Used as a wrapping element to show a diff in a Commit or Pull
Request page. Contains usually
.code-header
,.code-body
and in the edit case a.message
.
Code Blocks are used in the following areas:
- Commit: Showing the Diff (still called Changeset in a few places).
- File: Display a file, annotations, and edit a file.
- Gist: Show the Gist and edit it.
- Pull Request: Display the Diff of a Pull Request.
Compare Commits
... | ... |
@@ -391,7 +391,7 @@ |
391 | 391 |
} /* Existing line, it might have a quite long content actually and in this case we might need some horizontal scrolling. The remaining text here is just used to make this line very long. |
392 | 392 | |
393 | 393 |
.code-body.textarea.editor, |
394 |
div.code-body{ |
|
394 |
div.code-body { |
|
395 | 395 |
float: left; |
396 | 396 |
position: relative; |
397 | 397 |
max-width: none; |
... | ... |
@@ -399,3 +399,6 @@ |
399 | 399 |
box-sizing: border-box; |
400 | 400 |
} |
401 | 401 | |
402 |
.code-body td{ |
|
403 |
line-height: 1.2em; |
|
404 |
} |
|
... | ... |
No newline at end of file |
Pull Request
rhodecode/public/css/main.less Unified Diff | Side-by-side Diff |
1 2 |
|||||||||||||||||||||||||||||||||||||||||||||||||||||
|
File View
License changes
Gist Edit
47
1
import re
2
3
from django.utils.text import compress_sequence, compress_string
4
from django.utils.cache import patch_vary_headers
5
6
re_accepts_gzip = re.compile(r'\bgzip\b')
7
8
9
class GZipMiddleware(object): # Intentionally long line to show what will happen if this line does not fit onto the screen. It might have some horizontal scrolling applied or some other fancy mechanism to deal with it.
10
"""
11
This middleware compresses content if the browser allows gzip compression.
12
It sets the Vary header accordingly, so that caches will base their storage
13
on the Accept-Encoding header.
14
"""
15
def process_response(self, request, response):
16
# It's not worth attempting to compress really short responses.
17
if not response.streaming and len(response.content) < 200:
18
return response
19
20
# Avoid gzipping if we've already got a content-encoding.
21
if response.has_header('Content-Encoding'):
22
return response
23
24
patch_vary_headers(response, ('Accept-Encoding',))
25
26
ae = request.META.get('HTTP_ACCEPT_ENCODING', '')
27
if not re_accepts_gzip.search(ae):
28
return response
29
30
if response.streaming:
31
# Delete the `Content-Length` header for streaming content, because
32
# we won't know the compressed size until we stream it.
33
response.streaming_content = compress_sequence(response.streaming_content)
34
del response['Content-Length']
35
else:
36
# Return the compressed content only if it's actually shorter.
37
compressed_content = compress_string(response.content)
38
if len(compressed_content) >= len(response.content):
39
return response
40
response.content = compressed_content
41
response['Content-Length'] = str(len(response.content))
42
43
if response.has_header('ETag'):
44
response['ETag'] = re.sub('"$', ';gzip"', response['ETag'])
45
response['Content-Encoding'] = 'gzip'
46
47
return response
File Edit
rhodecode /
1
# -*- coding: utf-8 -*-
2
3
# Published under Commercial License.
4
# Read the full license text at https://rhodecode.com/licenses.
5
"""
6
rhodecode.websetup
7
~~~~~~~~~~~~~~~~~~
8
9
Weboperations and setup for rhodecode
10
11
:created_on: Dec 11, 2010
12
:author: marcink
13
:copyright: (c) 2013-2015 RhodeCode GmbH.
14
:license: Commercial License, see LICENSE for more details.
15
"""
16
17
import logging
18
19
from rhodecode.config.environment import load_environment
20
from rhodecode.lib.db_manage import DbManage
21
from rhodecode.model.meta import Session
22
23
24
log = logging.getLogger(__name__) # Intentionally long line to show what will happen if this line does not fit onto the screen. It might have some horizontal scrolling applied or some other fancy mechanism to deal with it.
25
26
27
def setup_app(command, conf, vars):
28
"""Place any commands to setup rhodecode here"""
29
dbconf = conf['sqlalchemy.db1.url']
30
dbmanage = DbManage(log_sql=True, dbconf=dbconf, root=conf['here'],
31
tests=False, cli_args=command.options.__dict__)
32
dbmanage.create_tables(override=True)
33
dbmanage.set_db_version()
34
opts = dbmanage.config_prompt(None)
35
dbmanage.create_settings(opts)
36
dbmanage.create_default_user()
37
dbmanage.admin_prompt()
38
dbmanage.create_permissions()
39
dbmanage.populate_default_permissions()
40
Session().commit()
41
load_environment(conf.global_conf, conf.local_conf, initial=True)
42
Commit with comments
... | ... |
@@ -59,7 +59,7 @@ |
59 | 59 |
'tag': 'v0.2.0', |
60 | 60 |
'branch': 'default', |
61 | 61 |
'response': # Intentionally long line to show what will happen if this line does not fit onto the screen. It might have some horizontal scrolling applied or some other fancy mechanism to deal with it. |
62 |
'147 files changed: 5700 inserted, 10176 deleted' |
|
62 |
'147 files changed: 5700 inserted, 10176 deleted' |
|
63 | 63 |
}, |
64 | 64 |
'git': { |
65 | 65 |
'tag': 'v0.2.2', |
... | ... |
@@ -77,9 +77,11 @@ |
77 | 77 |
target_ref=revisions[backend.alias]['tag'], |
78 | 78 |
)) |
Add another comment
| ||
79 | 79 | |
80 |
response.mustcontain('%s@%s' % ( |
|
| ||
80 |
response.mustcontain('%s@%s' % ( |
|
81 |
backend.repo_name, |
|
81 | 82 |
revisions[backend.alias]['branch'])) |
82 |
response.mustcontain('%s@%s' % ( |
|
83 |
response.mustcontain('%s@%s' % ( |
|
84 |
backend.repo_name, |
|
83 | 85 |
revisions[backend.alias]['tag'])) |
84 | 86 |
response.mustcontain(revisions[backend.alias]['response']) |
85 | 87 |