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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Rafael Monnerat
slapos.toolbox
Commits
847c2044
Commit
847c2044
authored
Feb 14, 2014
by
Nicolas Wavrant
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Now display diff file in a popup box
Conflicts: slapos/runner/views.py
parent
ca9b829b
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
45 deletions
+14
-45
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
+6
-9
No files found.
slapos/runner/templates/manageRepository.html
View file @
847c2044
...
...
@@ -127,4 +127,12 @@
</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 %}
slapos/runner/templates/projectDiff.html
deleted
100644 → 0
View file @
ca9b829b
{% 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 @
847c2044
...
...
@@ -376,16 +376,13 @@ def newBranch():
return
jsonify
(
code
=
0
,
result
=
"Can not read folder: Permission Denied"
)
def
getProjectDiff
(
project
):
path
=
os
.
path
.
join
(
app
.
config
[
'workspace'
],
project
)
return
render_template
(
'projectDiff.html'
,
project
=
project
,
diff
=
getDiff
(
path
))
def
commitProjectFiles
():
def
getProjectDiff
():
path
=
realpath
(
app
.
config
,
request
.
form
[
'project'
])
if
path
:
return
gitCommit
(
path
,
request
.
form
[
'msg'
]
)
return
jsonify
(
code
=
1
,
result
=
getDiff
(
path
)
)
else
:
return
jsonify
(
code
=
0
,
result
=
"Can not read folder: Permission Denied"
)
return
jsonify
(
code
=
0
,
result
=
"Error: No such file or directory. PERMISSION DENIED!"
)
def
pushProjectFiles
():
...
...
@@ -695,8 +692,8 @@ app.add_url_rule("/commitProjectFiles", 'commitProjectFiles', commitProjectFiles
methods
=
[
'POST'
])
app
.
add_url_rule
(
"/pushProjectFiles"
,
'pushProjectFiles'
,
pushProjectFiles
,
methods
=
[
'POST'
])
app
.
add_url_rule
(
"/getProjectDiff
/<project>
"
,
'getProjectDiff'
,
getProjectDiff
,
methods
=
[
'
GE
T'
])
app
.
add_url_rule
(
"/getProjectDiff"
,
'getProjectDiff'
,
getProjectDiff
,
methods
=
[
'
POS
T'
])
app
.
add_url_rule
(
"/newBranch"
,
'newBranch'
,
newBranch
,
methods
=
[
'POST'
])
app
.
add_url_rule
(
"/changeBranch"
,
'changeBranch'
,
changeBranch
,
methods
=
[
'POST'
])
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