Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.toolbox
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Lisa Casino
slapos.toolbox
Commits
e3c143ad
Commit
e3c143ad
authored
Nov 14, 2013
by
Alain Takoudjou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Now display diff file in a popup box
parent
c8c3363e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
42 deletions
+17
-42
slapos/runner/templates/manageRepository.html
slapos/runner/templates/manageRepository.html
+8
-0
slapos/runner/templates/projectDiff.html
slapos/runner/templates/projectDiff.html
+0
-36
slapos/runner/views.py
slapos/runner/views.py
+9
-6
No files found.
slapos/runner/templates/manageRepository.html
View file @
e3c143ad
...
@@ -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 %}
slapos/runner/templates/projectDiff.html
deleted
100644 → 0
View file @
c8c3363e
{% 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 %}
slapos/runner/views.py
View file @
e3c143ad
...
@@ -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
=
[
'
GE
T'
])
methods
=
[
'
POS
T'
])
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
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment