From 727754f7a765a606ec07bc3a037b8a2d42079bc3 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Jan 19 2016 09:32:21 +0000 Subject: [PATCH 1/2] Rename disableMarkup and renderMarkup to a single ``raw`` variable --- diff --git a/pagure/ui/repo.py b/pagure/ui/repo.py index aeeae81..91a4ef4 100644 --- a/pagure/ui/repo.py +++ b/pagure/ui/repo.py @@ -411,7 +411,7 @@ def view_file(repo, identifier, filename, username=None): flask.abort(404, 'File not found') if isinstance(content, pygit2.Blob): - disableMarkup = str(flask.request.args.get('renderMarkup')).lower() in ['0', 'false'] + raw = str(flask.request.args.get('raw')).lower() in ['1', 'true'] ext = filename[filename.rfind('.'):] if ext in ( '.gif', '.png', '.bmp', '.tif', '.tiff', '.jpg', @@ -424,7 +424,7 @@ def view_file(repo, identifier, filename, username=None): 'Failed to load image %s, error: %s', filename, err ) output_type = 'binary' - elif ext in ('.rst', '.mk', '.md') and not disableMarkup: + elif ext in ('.rst', '.mk', '.md') and not raw: content, safe = pagure.doc_utils.convert_readme(content.data, ext) output_type = 'markup' elif not content.is_binary and pagure.lib.could_be_text(content.data): From 864a3f4068da0213ac8e6911a749b4066bde2603 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Jan 19 2016 09:36:01 +0000 Subject: [PATCH 2/2] Use text as arg name to be consistent with the button --- diff --git a/pagure/templates/file.html b/pagure/templates/file.html index b5b7600..77c553d 100644 --- a/pagure/templates/file.html +++ b/pagure/templates/file.html @@ -40,7 +40,7 @@ {% if output_type == 'markup' %} Text + filename=filename, text=True) }}" title="View as text">Text {% else %}