Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kodex
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
2
Issues
2
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gargantext
kodex
Commits
fa1c95ee
Commit
fa1c95ee
authored
Sep 08, 2017
by
Yannick Chudy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
side by side edition frama & ggl
parent
3a5548fa
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
45 additions
and
75 deletions
+45
-75
botapadapp.py
botapadapp.py
+23
-8
gviz.min.js
static/gviz.min.js
+1
-1
main.js
static/main.js
+6
-6
framagraph.html
templates/framagraph.html
+4
-1
homepage.html
templates/homepage.html
+11
-59
No files found.
botapadapp.py
View file @
fa1c95ee
...
...
@@ -25,8 +25,8 @@ STATIC_HOST = os.environ.get('STATIC_HOST', "")
ENGINES_HOST
=
os
.
environ
.
get
(
'ENGINES_HOST'
,
"http://padagraph.io"
)
KEY
=
codecs
.
open
(
"secret/key.txt"
,
'r'
,
encoding
=
'utf8'
)
.
read
()
.
strip
()
ENGINES_HOST
=
os
.
environ
.
get
(
'ENGINES_HOST'
,
"http://localhost:5000"
)
KEY
=
codecs
.
open
(
"../me.local"
,
'r'
,
encoding
=
'utf8'
)
.
read
()
.
strip
()
#
ENGINES_HOST = os.environ.get('ENGINES_HOST', "http://localhost:5000")
#
KEY = codecs.open("../me.local", 'r', encoding='utf8').read().strip()
# delete before import
DELETE
=
os
.
environ
.
get
(
'BOTAPAD_DELETE'
,
"True"
)
.
lower
()
==
"true"
...
...
@@ -214,14 +214,19 @@ def home():
@
app
.
route
(
'/framagraph/<string:gid>'
,
methods
=
[
'GET'
])
def
live
(
gid
):
padurl
=
"https://annuel2.framapad.org/p/
%
s"
%
gid
graphurl
=
"/import/igraph.html?gid=
%
s&live=1&nofoot=1"
%
gid
graphurl
=
"/import/igraph.html?
s=framapad&
gid=
%
s&live=1&nofoot=1"
%
gid
return
render_template
(
'framagraph.html'
,
graphurl
=
graphurl
,
padurl
=
padurl
)
@
app
.
route
(
'/googledoc'
,
methods
=
[
'GET'
])
@
app
.
route
(
'/googledoc/<string:gid>'
,
methods
=
[
'GET'
])
def
googledoc
(
gid
):
padurl
=
"https://docs.google.com/document/d/
%
s/edit"
%
gid
graphurl
=
"/import/igraph.html?gid=
%
s&live=1&nofoot=1"
%
gid
def
googledoc
(
gid
=
None
):
if
gid
:
padurl
=
"https://docs.google.com/document/d/
%
s?embedded=true"
%
gid
else
:
padurl
=
"https://docs.google.com/document/u/0/"
graphurl
=
"/import/igraph.html?s=google&gid=
%
s&live=1&nofoot=1"
%
gid
return
render_template
(
'framagraph.html'
,
graphurl
=
graphurl
,
padurl
=
padurl
)
...
...
@@ -277,18 +282,27 @@ def botimport(repo, content_type="html"):
# form
gid
=
request
.
form
.
get
(
'gid'
,
None
)
padurl
=
request
.
form
.
get
(
'url'
,
None
)
content_type
=
request
.
form
.
get
(
'content_type'
,
content_type
)
promote
=
1
if
request
.
form
.
get
(
'promote'
,
0
)
else
0
#args
args
=
request
.
args
pad_source
=
args
.
get
(
's'
,
None
)
color
=
"#"
+
args
.
get
(
"color"
,
"249999"
)
footer
=
not
(
args
.
get
(
'nofoot'
,
0
)
==
"1"
)
live
=
args
.
get
(
'live'
,
0
)
==
"1"
if
live
:
gid
=
args
.
get
(
'gid'
,
None
)
padurl
=
"https://annuel2.framapad.org/p/
%
s"
%
gid
graphurl
=
"/import/igraph.html?gid=
%
s&live=1&nofoot=1"
%
gid
graphurl
=
"/import/igraph.html?s=
%
s&gid=
%
s&live=1&nofoot=1"
%
(
pad_source
,
gid
)
if
pad_source
==
"framapad"
:
padurl
=
"https://annuel2.framapad.org/p/
%
s"
%
gid
elif
pad_source
==
"google"
:
padurl
=
"https://docs.google.com/document/d/
%
s/edit"
%
gid
if
gid
and
padurl
:
...
...
@@ -325,6 +339,7 @@ def botimport(repo, content_type="html"):
return
redirect
(
data
,
code
=
302
)
elif
repo
==
"igraph"
:
graph
=
pad2igraph
(
gid
,
padurl
)
graph
=
prepare_graph
(
graph
)
data
=
export_graph
(
graph
,
id_attribute
=
'uuid'
)
...
...
static/gviz.min.js
View file @
fa1c95ee
This diff is collapsed.
Click to expand it.
static/main.js
View file @
fa1c95ee
...
...
@@ -12,13 +12,13 @@ var path = "../static/bower_components/"
//backbone : path + 'backbone/backbone-min',
//jquery : path + 'jquery/dist/jquery.min',
cello
:
'cello.min'
,
gviz
:
'gviz.min'
,
embed
:
'embed.min'
,
//
cello : 'cello.min',
//
gviz : 'gviz.min',
//
embed : 'embed.min',
//
cello : 'cello',
//
gviz : 'gviz',
//
embed : 'embed',
cello
:
'cello'
,
gviz
:
'gviz'
,
embed
:
'embed'
,
threejs
:
'three'
,
numeric
:
'numeric-1.2.6'
,
...
...
templates/framagraph.html
View file @
fa1c95ee
...
...
@@ -16,8 +16,11 @@
-->
<style
type=
"text/css"
>
body
{
padding
:
0
;
overflow
:
hidden
;
}
iframe
{
width
:
49%
;
width
:
calc
(
50%
-
2px
);
height
:
100%
;
margin
:
auto
;
}
...
...
templates/homepage.html
View file @
fa1c95ee
...
...
@@ -16,15 +16,15 @@
-->
<style
type=
"text/css"
>
.ui.inverted.segment
{
body
,
.ui.inverted.segment
{
background
:
#127777
;
}
.masthead.segment
{
min-height
:
700px
;
padding
:
1em
0em
;
padding
:
5px
;
}
.masthead
.logo.item
img
{
margin-right
:
1em
;
...
...
@@ -324,62 +324,10 @@
</div>
{% elif framapad and not fail %}
<div
class=
"ui container"
>
<div
class=
"ui inverted link list"
>
<a
class=
"active item"
href=
"{{padurl}}"
>
Imported from {{padurl}}
</a>
</div>
<script
src=
"{{static_host}}/static/webcomponents-lite.js"
></script>
<script
data-main=
"{{static_host}}/static/main"
src=
"{{static_host}}/static/require.js"
></script>
<link
rel=
"import"
href=
"{{static_host}}/static/padagraph-gviz-min.html"
/>
<!--
<link rel="import" href="{{static_host}}/static/padagraph_webcomponents/padagraph-collection.html"/>
<link rel="import" href="{{static_host}}/static/padagraph_webcomponents/padagraph-controls.html"/>
<link rel="import" href="{{static_host}}/static/padagraph_webcomponents/padagraph-gviz.html"/>
-->
<div
id=
"gviz"
>
<padagraph-gviz-json
routes=
"{{routes}}"
data=
"{{data}}"
>
<padagraph-gviz
options=
"{{options}}"
>
<div
id=
"viz"
></div>
<padagraph-model-popup
id=
"gvizpopup"
></padagraph-model-popup>
<div
id=
"menu"
class=
"ui icon vertical borderless menu"
>
<padagraph-collection-filter
mode=
"node"
asitem=
"asitem"
></padagraph-collection-filter>
<padagraph-collection-filter
mode=
"edge"
asitem=
"asitem"
></padagraph-collection-filter>
<padagraph-engine-control
engine=
"layout"
asitem=
"asitem"
></padagraph-engine-control>
<padagraph-engine-control
engine=
"clustering"
asitem=
"asitem"
></padagraph-engine-control>
</div>
<div
id=
"labels"
>
<padagraph-labels-control></padagraph-labels-control>
</div>
</padagraph-gviz>
</padagraph-gviz-json>
<script>
e
=
document
.
getElementById
(
'gviz'
);
e
.
style
.
height
=
(
window
.
innerHeight
-
70
)
+
"px"
;
</script>
</div>
<div
class=
"ui inverted link list"
>
<a
class=
"active item"
href=
"{{graphurl}}"
>
Visit {{graphurl}}
</a>
</div>
</p>
</div>
{% elif complete and not fail %}
<div
class=
"ui container"
>
{% if footer%}
<h4
class=
"ui inverted horizontal divider"
>
Import complete
</h4>
...
...
@@ -387,7 +335,7 @@
<div
class=
"ui inverted link list"
>
<a
class=
"active item"
href=
"{{padurl}}"
>
Imported from {{padurl}}
</a>
</div>
{% endif %}
<script
src=
"{{static_host}}/static/webcomponents-lite.js"
></script>
...
...
@@ -426,9 +374,12 @@
e
.
style
.
height
=
(
window
.
innerHeight
-
70
)
+
"px"
;
</script>
</div>
{% if
not
live %}
{% if live %}
<div
class=
"ui inverted link list"
>
<a
class=
"ui active button"
href=
"{{graphurl}}"
>
refresh
</a>
<!--
<a class="active item" href="{{padurl}}">Imported from {{padurl}}</a>
-->
<a
class=
"ui active button"
href=
"{{refreshurl}}"
>
refresh
</a>
</div>
{% else %}
<div
class=
"ui inverted link list"
>
...
...
@@ -539,6 +490,7 @@
{% if footer%}
<div
class=
"ui inverted vertical footer segment"
>
...
...
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