Skip to content
Snippets Groups Projects
Commit 2be73df1 authored by LE GAC Renaud's avatar LE GAC Renaud
Browse files

Add actions and views to display about, documentations and versions

information.
parent acd50da8
No related branches found
No related tags found
No related merge requests found
......@@ -24,6 +24,14 @@ App.REMOTE_API = {
};"""
def about():
fn = os.path.join("applications",
request.application,
"static",
"ABOUT.html")
return open(fn, 'rb').read()
def call():
"""Action to handle the Ext.Direct protocol.
......@@ -191,6 +199,19 @@ def debug():
return dict(plugin=plugin)
def documentations():
di = {}
di["app"] = request.application
di["app_name"] = request.application.replace('_', ' ')
di["epydoc_dbui"] = URL('static', 'plugin_dbui/docs/epydoc/index.html')
di["epydoc_application"] = URL('static', 'docs/epydoc/index.html')
di["jsduck_dbui"] = URL('static', 'plugin_dbui/docs/jsduck/index.html')
di["png_db"] = URL('static', 'docs/database.png')
return di
def index():
"""Default Action to run the plugin
Load compressed version of all libraries.
......@@ -253,11 +274,4 @@ def versions():
"""Return the versions of the different part of the code.
"""
import plugin_dbui as dbui
my_style = \
"""
margin-left: 20px;
font-size: 10px;
"""
return BEAUTIFY(dbui.get_versions(), _style=my_style)
return dbui.get_versions()
# -*- coding: utf-8 -*-
# coding: utf8
{
'%Y-%m-%d': '%Y-%m-%d',
'Abbreviation': 'Abréviation',
'about': 'à propos',
'AERES': 'AERES',
'agency': 'agence',
'Authors': 'Auteurs',
......@@ -22,13 +23,17 @@
'Definition': 'Définition',
'dev': 'dev',
'Dictionary': 'Dictionary',
'documentations': 'documentations',
'Doi': 'Doi',
'domain': 'domaine',
'E Print': 'E Print',
'End date': 'Date de fin',
'enter a number between %(min)g and %(max)g': 'enter a number between %(min)g and %(max)g',
'Enter a number between %(min)g and %(max)g': 'Enter a number between %(min)g and %(max)g',
'enter a value': 'entré une valeur',
'Enter an integer between %(min)g and %(max)g': 'Enter an integer between %(min)g and %(max)g',
'enter an integer between %(min)g and %(max)g': 'enter an integer between %(min)g and %(max)g',
'enter an integer greater than or equal to %(min)g': 'enter an integer greater than or equal to %(min)g',
'Enter an integer greater than or equal to %(min)g': 'Enter an integer greater than or equal to %(min)g',
'Filter categories': 'Filter categories',
'Filter collaborations': 'Filter collaborations',
......@@ -49,6 +54,7 @@
'Help': 'Help',
'Host': 'Host',
'Id': 'Id',
'install': 'installé',
'invalid json': 'invalid json',
'Json': 'Json',
'Last Page': 'Dernière Page',
......
......@@ -36,7 +36,8 @@ plugins = PluginManager('dbui',
app_script_dir=None, # relative directory static/scripts
dbui_conf=URL(c='plugin_dbui', f='dbui_conf'),
dbui_css='static/plugin_dbui/resources/css/kde-oxygen.css',
dbui_css=['static/plugin_dbui/resources/css/kde-oxygen.css',
'static/plugin_dbui/resources/css/dbui.css'],
dbui_js='static/plugin_dbui/src',
dbui_lg='static/plugin_dbui/locale/dbui-lang-%s.js' % lg,
dbui_libmin='static/plugin_dbui/dbui-min.js',
......
......@@ -2,73 +2,105 @@
""" widgets viewport
"""
# helper function translating a tablename into the grid configuration
to_grid = lambda tablename: dbui.to_gridPanel(db[tablename])
# short cuts
Node = dbui.Node
Panel = dbui.Panel
PanelWithUrlSelector = dbui.to_panelWithUrlSelector
Window = dbui.Window
#-------------------------------------------------------------------------------
#
# the CAS node
# CAS
#
#-------------------------------------------------------------------------------
casNode = None
#-------------------------------------------------------------------------------
#
# The form node
# FORM
#
formNode = dbui.Node(T('Forms'))
#-------------------------------------------------------------------------------
formNode = Node(T('Forms'))
for tablename in ('categories', 'harvesters', 'publications', 'new_fields'):
leaf = dbui.Window(closable=True,
items=[dbui.to_formPanel(db[tablename])],
layout='fit',
title="Add %s ..." % tablename,
modal=True)
leaf = Window(closable=True,
items=[dbui.to_formPanel(db[tablename])],
layout='fit',
title="Add %s ..." % tablename,
modal=True)
formNode.add_child(T(tablename), leaf)
#-------------------------------------------------------------------------------
#
# the grid node
# GRID
#
gridNode = dbui.Node(T('Tables'))
configurator = lambda tablename: dbui.to_gridPanel(db[tablename])
gridNode.add_children(db.tables, func=configurator)
#-------------------------------------------------------------------------------
gridNode = Node(T('Tables'))
gridNode.add_children(db.tables, func=to_grid)
#-------------------------------------------------------------------------------
#
# The helper node
# HELP
#
#-------------------------------------------------------------------------------
loader = dict(ajaxOptions=dict(disableCaching=False),
autoLoad=True,
renderer='html',
url=URL('plugin_dbui', 'versions'))
versionLeaf = dbui.Panel(loader=loader,
plugins=['pPanelLoaderException'])
aboutLeaf = Panel(autoLoad=URL('plugin_dbui', 'about'), autoScroll=True)
docLeaf = Panel(autoLoad=URL('plugin_dbui', 'documentations'), autoScroll=True)
versionLeaf = Panel(loader=loader, plugins=['pPanelLoaderException'])
helpNode = dbui.Node(T('Help'))
helpNode = Node(T('Help'))
helpNode.add_child(T('about'), aboutLeaf)
helpNode.add_child(T('documentations'), docLeaf)
helpNode.add_child(T('versions'), versionLeaf)
#-------------------------------------------------------------------------------
#
# the report node
# REPORT
#
leaf_1 = dbui.Panel(html="salut ma poule")
#-------------------------------------------------------------------------------
leaf_1 = Panel(html="salut ma poule")
leaf_2 = dbui.to_panelWithUrlSelector(virtdb.foo1,
baseUrl=URL('reports', 'report_2'),
baseParams={'hello': 3},
extField='my_format',
plugins=['pMathJax'])
leaf_2 = PanelWithUrlSelector(virtdb.foo1,
baseUrl=URL('reports', 'report_2'),
baseParams={'hello': 3},
extField='my_format',
plugins=['pMathJax'])
leaf_3 = dbui.to_panelWithUrlSelector(virtdb.harvester_selector,
baseUrl=URL('reports', 'report_3'),
selectorRegion='east',
selectorTitle='Select a project')
leaf_3 = PanelWithUrlSelector(virtdb.harvester_selector,
baseUrl=URL('reports', 'report_3'),
selectorRegion='east',
selectorTitle='Select a project')
reportNode = dbui.Node(T('Reports'))
reportNode = Node(T('Reports'))
reportNode.add_child(T('report_1'), leaf_1)
reportNode.add_child(T('report_2'), leaf_2)
reportNode.add_child(T('report_3'), leaf_3)
#-------------------------------------------------------------------------------
#
# The viewport with its navigation tree
# VIEWPORT
#
#-------------------------------------------------------------------------------
nodes = [helpNode,
casNode,
formNode,
gridNode,
reportNode]
viewportModifier = dbui.ViewportModifier()
viewportModifier.configure(tabTitleTpl="{1}")
viewportModifier.add_node(*nodes)
viewportModifier.configure(plugins=['pViewportLogin'], logged=True);
viewportModifier.add_node(helpNode, casNode, formNode, gridNode, reportNode)
viewportModifier.default_node(T('Tables'), T('categories'))
# viewportModifier.default_node(T('Tables'), T('new_fields'))
......
......@@ -547,6 +547,7 @@ def get_versions():
@rtype: dict
@return:
- C{ace} the version of the plugin ace
- C{dbui} the version of the plugin dbui
- C{extjs} the version of the plugin extjs
- C{mathjax} the version of the plugin mathjax
......@@ -556,6 +557,13 @@ def get_versions():
"""
server_path, client_path = get_reference_paths()
# plugin ace
ace = current.T('plugin not install')
path = os.path.join(server_path, 'static', 'plugin_ace')
if os.path.exists(path):
ace = current.T('install')
# plugin dbui
fn = os.path.join(server_path, 'static', 'plugin_dbui', 'src', 'App.js')
......@@ -625,7 +633,12 @@ def get_versions():
os.chdir(ref_path)
return dict(dbui=dbui, extjs=extjs, mathjax=mathjax, web2py=web2py, myapp=myapp)
return dict(ace=ace,
dbui=dbui,
extjs=extjs,
mathjax=mathjax,
myapp=myapp,
web2py=web2py)
def get_where_query(table):
......
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<p class="dbui-p">the about file for the application ....</p>
</body>
</html>
\ No newline at end of file
......@@ -26,6 +26,7 @@
- Take benefit of Ext JS 4.2 to deploy the dynamic loading when running
in debug mode.
0.6.0.19 (Mar 2014)
- Take benefit of Ext JS 4.2 to user requires and use class parameters.
0.6.0.7 (Feb 2014)
......
/*
* CSS Class definition for application reporting
*/
.dbui-h2,
.dbui-h3,
.dbui-li,
.dbui-ol,
.dbui-p,
.dbui-table,
.dbui-td,
.dbui-th,
.dbui-tr,
.dbui-ul,
.dbui-ul-none {font-family: Liberation Sherif, Sherif;
font-size: 11px;}
/*
* Body
*/
.dbui-h2 {font-family: Liberation Sans, Sans;
margin-bottom: 2ex;
margin-left: 3%;
margin-top: 3ex;}
.dbui-p {margin-left: 3%;
text-align: justify;}
/*
* Font
*/
.dbui-large {font-size: 90%;}
/*
* List
*/
.dbui-li {margin-bottom: 1ex;
margin-left: 9%;
margin-right: 9%;
text-align: justify;}
.dbui-ol {list-style-type: decimal;}
.dbui-ul {list-style-type: disc;}
.dbui-ul-none {list-style-type: none;}
/*
* Table
*/
.dbui-td,
.dbui-th,
.dbui-tr {outline-style: solid;
outline-width: 1px;
outline-color: LightGray;
padding-left: 5px;
padding-right: 5px;}
/*
* Text
*/
.dbui-left {text-align: left;}
.dbui-right {text-align: right;}
.dbui-small-cap {font-variant: small-caps;}
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<h2 class="dbui-h2 dbui-small-cap">Documentations</h2>
<table border="0" style="margin-left: 6%">
<tr>
<td class="dbui-td">
{{=app_name}}
</td>
<td class="dbui-td">
<a href="{{=png_db}}" target="_blank">
Schéma de la base de données
</a>
</td>
<td class="dbui-td">
<a href="{{=epydoc_application}}" target="_blank">
python API
</a>
</td>
<td class="dbui-td"></td>
</tr>
<tr>
<td class="dbui-td">
<a href="https://marprod.in2p3.fr/plugin_dbui_book" target="_blank">
plugin dbui
</a>
</td>
<td class="dbui-td">
<a href="https://marprod.in2p3.fr/plugin_dbui_book/default/chapter/29" target="_blank">
documentation développeurs
</a>
</td>
<td class="dbui-td">
<a href="{{=epydoc_dbui}}" target="_blank">
python API
</a>
</td>
<td class="dbui-td">
<a href="{{=jsduck_dbui}}" target="_blank">
javascript API
</a>
</td>
</tr>
<tr>
<td class="dbui-td">
<a href="http://web2py.com/" target="_blank">
Web2py
</a>
</td>
<td class="dbui-td">
<a href="http://web2py.com/book" target="_blank">
documentation développeurs
</a>
</td>
<td class="dbui-td">
<a href="http://www.web2py.com/examples/static/epydoc/index.html" target="_blank">
python API
</a>
</td>
<td class="dbui-td"></td>
</tr>
<tr>
<td class="dbui-td">
<a href="http://www.sencha.com/products/extjs/" target="_blank">
Ext JS
</a>
</td>
<td class="dbui-td"></td>
<td class="dbui-td"></td>
<td class="dbui-td">
<a href="http://docs.sencha.com/extjs/4.2.1/" target="_blank">
javascript API
</a>
</td>
</tr>
<tr>
<td class="dbui-td">
<a href="http://www.mathjax.org/" target="_blank">
MathJax
</a>
</td>
<td class="dbui-td"></td>
<td class="dbui-td"></td>
<td class="dbui-td">
<a href="http://docs.mathjax.org/" target="_blank">
Javascript API
</a>
</td>
</tr>
<tr>
<td class="dbui-td">
<a href="http://ace.c9.io/#nav=about" target="_blank">
Ace
</a>
</td>
<td class="dbui-td"></td>
<td class="dbui-td"></td>
<td class="dbui-td">
<a href="http://ace.c9.io/#nav=api" target="_blank">
Javascript API
</a>
</td>
</tr>
</table>
<h2 class="dbui-h2 dbui-small-cap">Code source</h2>
<table border="0" style="margin-left: 6%">
<tr>
<td class="dbui-td">
{{=app_name}}
</td>
<td class="dbui-td">
<em>git clone http://marwww.in2p3.fr/~legac/wap/git/{{=app}}.git</em>
</td>
</tr>
<tr>
<td class="dbui-td">
plugin dbui
</td>
<td class="dbui-td">
<em>git clone http://marwww.in2p3.fr/~legac/wap/git/web2py_plugin_dbui.git</em>
</td>
</tr>
<tr>
<td class="dbui-td">
Web2py
</td>
<td class="dbui-td">
<em>git clone git://github.com/web2py/web2py.git</em>
</td>
</tr>
<tr>
<td class="dbui-td">
Ext JS
</td>
<td class="dbui-td">
A télécharger à partir de leur site web.<br>
Disponible dans le répertoire
<em>{{=app}}/static/plugin_extjs/src</em>
</td>
</tr>
<tr>
<td class="dbui-td">
MathJax
</td>
<td class="dbui-td">
<em>git clone http://github.com/mathjax/MathJax</em>
</td>
</tr>
<tr>
<td class="dbui-td">
Ace
</td>
<td class="dbui-td">
<em>git clone git://github.com/ajaxorg/ace.git</em>
</td>
</tr>
</table>
<h2 class="dbui-h2 dbui-small-cap">Binnaires pour web2py</h2>
<p class="dbui-p">
Les logiciels tierce
<span class="dbui-small-cap">ACE</span>,
<span class="dbui-small-cap">Ext JS</span>,
<span class="dbui-small-cap">MathJax</span>,
<span class="dbui-small-cap">Plugin dbui</span>,
sont construits sous la forme de plugins qui peuvent être chargés dans
le serveur webpy.
Des versions cohérentes sont disponible en utilisant
le gestionnaire de version <a href="http://git-scm.com/" target="_blank">git</a> :
<em>git clone http://marwww.in2p3.fr/~legac/wap/git/plugin_dbui_build.git</em>.
</p>
</body>
{{
title = 'Software versions'
response.write(P(title, _class="dbui-p dbui-small-cap dbui-large"))
table = TABLE(TR(TD("web2py", _class="dbui-td"), TD(web2py, _class="dbui-td")),
TR(TD("dbui", _class="dbui-td"), TD(dbui, _class="dbui-td")),
TR(TD("extjs", _class="dbui-td"), TD(extjs, _class="dbui-td")),
TR(TD("mathjax", _class="dbui-td"), TD(mathjax, _class="dbui-td")),
TR(TD("ace", _class="dbui-td"), TD(ace, _class="dbui-td")),
TR(TD(request.application, _class="dbui-td"), TD(myapp, _class="dbui-td")),
_style="margin-left:6%")
response.write(P(table))
}}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment