Commit e3c143ad authored by Alain Takoudjou's avatar Alain Takoudjou

Now display diff file in a popup box

parent c8c3363e
...@@ -127,4 +127,12 @@ ...@@ -127,4 +127,12 @@
</div> </div>
</div> </div>
</div> </div>
<!-- This contains the hidden content for inline calls -->
<a id='inlineViewer' style='display:none' href="#inline_content">Inline HTML</a>
<div style='display:none'>
<div id='inline_content' style='padding:10px; background:#fff;'>
</div>
</div>
{% endblock %} {% endblock %}
{% extends "layout.html" %}
{% block title %}Diff for '{{project}}'{% endblock %}
{% block head %}
{{ super() }}
<script src="{{ url_for('static', filename='js/ace/ace.js') }}" type="text/javascript" charset="utf-8"></script>
<script src="{{ url_for('static', filename='js/ace/theme-crimson_editor.js') }}" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
$(document).ready( function() {
var editor = ace.edit("editor");
editor.setTheme("ace/theme/crimson_editor");
var CurentMode = require("ace/mode/text").Mode;
editor.getSession().setMode(new CurentMode());
editor.getSession().setTabSize(2);
editor.getSession().setUseSoftTabs(true);
editor.renderer.setHScrollBarAlwaysVisible(false);
editor.setReadOnly(true);
});
</script>
{% endblock %}
{% block body %}
<form action="{{ url_for('manageProject') }}" method=get>
<dl>
<dd><h2 class='title'>Diff file for "{{project}}"</h2></dd>
<dd>
<div class="main_content">
<pre id="editor">
{{ diff }}
</pre>
</div>
</dd>
<dd><input type=submit value="Back" class="button"></dd>
</dl>
</form>
{% endblock %}
...@@ -418,10 +418,13 @@ def newBranch(): ...@@ -418,10 +418,13 @@ def newBranch():
@login_required(login_redirect) @login_required(login_redirect)
def getProjectDiff(project): def getProjectDiff():
path = os.path.join(app.config['workspace'], project) path = realpath(app.config, request.form['project'])
return render_template('projectDiff.html', project=project, if path:
diff=getDiff(path)) return jsonify(code=1, result=getDiff(path))
else:
return jsonify(code=0,
result="Error: No such file or directory. PERMISSION DENIED!")
@login_required() @login_required()
...@@ -735,8 +738,8 @@ app.add_url_rule("/pullProjectFiles", 'pullProjectFiles', pullProjectFiles, ...@@ -735,8 +738,8 @@ app.add_url_rule("/pullProjectFiles", 'pullProjectFiles', pullProjectFiles,
methods=['POST']) methods=['POST'])
app.add_url_rule("/pushProjectFiles", 'pushProjectFiles', pushProjectFiles, app.add_url_rule("/pushProjectFiles", 'pushProjectFiles', pushProjectFiles,
methods=['POST']) methods=['POST'])
app.add_url_rule("/getProjectDiff/<project>", 'getProjectDiff', getProjectDiff, app.add_url_rule("/getProjectDiff", 'getProjectDiff', getProjectDiff,
methods=['GET']) methods=['POST'])
app.add_url_rule("/newBranch", 'newBranch', newBranch, methods=['POST']) app.add_url_rule("/newBranch", 'newBranch', newBranch, methods=['POST'])
app.add_url_rule("/changeBranch", 'changeBranch', changeBranch, methods=['POST']) app.add_url_rule("/changeBranch", 'changeBranch', changeBranch, methods=['POST'])
app.add_url_rule("/saveFileContent", 'saveFileContent', saveFileContent, app.add_url_rule("/saveFileContent", 'saveFileContent', saveFileContent,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment