From 4e703393208e5cfae47e13bc993cf48998de4f39 Mon Sep 17 00:00:00 2001 From: Renaud Le Gac <renaud.legac@free.fr> Date: Wed, 27 Oct 2010 20:35:47 +0000 Subject: [PATCH] Remove files related to web2py applications. Add the view for the plugin_dbui --- views/appadmin.html | 81 ---------------------- views/generic.html | 12 ---- views/layout.html | 46 ------------ views/{applayout.html => plugin_dbui.html} | 4 +- views/web2py_ajax.html | 42 ----------- 5 files changed, 2 insertions(+), 183 deletions(-) delete mode 100644 views/appadmin.html delete mode 100644 views/generic.html delete mode 100644 views/layout.html rename views/{applayout.html => plugin_dbui.html} (90%) delete mode 100644 views/web2py_ajax.html diff --git a/views/appadmin.html b/views/appadmin.html deleted file mode 100644 index 67ce287f..00000000 --- a/views/appadmin.html +++ /dev/null @@ -1,81 +0,0 @@ -{{extend 'layout.html'}} -<script><!-- -$(document).ready(function(){ - $("table.sortable tbody tr").mouseover( function() { - $(this).addClass("highlight"); }).mouseout( function() { - $(this).removeClass("highlight"); }); - $('table.sortable tbody tr:odd').addClass('odd'); - $('table.sortable tbody tr:even').addClass('even'); - -}); -//--></script> - -{{if request.function=='index':}} - <h1>Available databases and tables</h1> - {{if not databases:}}No databases in this application{{pass}} - {{for db in sorted(databases):}} - {{for table in databases[db].tables:}} - <h2>{{=A("%s.%s"%(db,table),_href=URL(r=request,f='select',args=[db],vars=dict(query='%s.%s.id>0'%(db,table))))}}</h2> - [ {{=A('insert new '+table,_href=URL(r=request,f='insert',args=[db,table]))}} ] - <br /><br /> - {{pass}} - {{pass}} - - -{{elif request.function=='select':}} - <h1>database {{=A(request.args[0],_href=URL(r=request,f='index'))}} select - </h1> - {{if table:}} - [ {{=A('insert new %s'%table,_href=URL(r=request,f='insert',args=[request.args[0],table]))}} ]<br/><br/> - <h2>Rows in table</h2><br/> - {{else:}} - <h2>Rows selected</h2><br/> - {{pass}} - {{=form}} - <p>The "query" is a condition like "db.table1.field1=='value'". Something like "db.table1.field1==db.table2.field2" results in a SQL JOIN.<br/> - Use (...)&(...) for AND, (...)|(...) for OR, and ~(...) for NOT to build more complex queries.<br/> - "update" is an optional expression like "field1='newvalue'". You cannot update or delete the results of a JOIN</p> - <br/><br/> - <h3>{{=nrows}} selected</h3> - {{if start>0:}}[ {{=A('previous 100 rows',_href=URL(r=request,f='select',args=request.args[0],vars=dict(start=start-100)))}} ]{{pass}} - {{if stop<nrows:}}[ {{=A('next 100 rows',_href=URL(r=request,f='select',args=request.args[0],vars=dict(start=start+100)))}} ]{{pass}} - {{if rows:}} - <div style="overflow: auto;" width="80%"> - {{linkto=URL(r=request,f='update',args=request.args[0])}} - {{upload=URL(r=request,f='download',args=request.args[0])}} - {{=SQLTABLE(rows,linkto,upload,orderby=True,_class='sortable')}} - </div> - {{pass}} - <br/><br/><h2>Import/Export</h2><br/> - [ <a href="{{=URL(r=request,f='csv',args=request.args[0],vars=dict(query=query))}}">export as csv file</a> ] - {{if table:}} - {{=FORM('or import from csv file ',INPUT(_type='file',_name='csvfile'),INPUT(_type='hidden',_value=table,_name='table'),INPUT(_type='submit',_value='import'))}} - {{pass}} - -{{elif request.function=='insert':}} - <h1>database {{=A(request.args[0],_href=URL(r=request,f='index'))}} - table {{=A(request.args[1],_href=URL(r=request,f='select',args=request.args[0],vars=dict(query='%s.%s.id>0'%tuple(request.args[:2]))))}} - </h1> - <h2>New Record</h2><br/> - {{=form}} - - - -{{elif request.function=='update':}} - <h1>database {{=A(request.args[0],_href=URL(r=request,f='index'))}} - table {{=A(request.args[1],_href=URL(r=request,f='select',args=request.args[0],vars=dict(query='%s.%s.id>0'%tuple(request.args[:2]))))}} - record id {{=A(request.args[2],_href=URL(r=request,f='update',args=request.args[:3]))}} - </h1> - <h2>Edit current record</h2><br/><br/>{{=form}} - - - -{{elif request.function=='state':}} - <h1>Internal State</h1> - <h2>Current request</h2> - {{=BEAUTIFY(request)}} - <br/><h2>Current response</h2> - {{=BEAUTIFY(response)}} - <br/><h2>Current session</h2> - {{=BEAUTIFY(session)}} -{{pass}} \ No newline at end of file diff --git a/views/generic.html b/views/generic.html deleted file mode 100644 index 35055baa..00000000 --- a/views/generic.html +++ /dev/null @@ -1,12 +0,0 @@ -{{extend 'layout.html'}} -{{=BEAUTIFY(response._vars)}} - - -<button onclick="document.location='{{=URL("admin","default","design",args=request.application)}}'">admin</button> -<button onclick="$('#request').slideToggle()">request</button> -<div class="hidden" id="request"><h2>request</h2>{{=BEAUTIFY(request)}}</div> -<button onclick="$('#session').slideToggle()">session</button> -<div class="hidden" id="session"><h2>session</h2>{{=BEAUTIFY(session)}}</div> -<button onclick="$('#response').slideToggle()">response</button> -<div class="hidden" id="response"><h2>response</h2>{{=BEAUTIFY(response)}}</div> -<script>$('.hidden').hide();</script> diff --git a/views/layout.html b/views/layout.html deleted file mode 100644 index c14ff423..00000000 --- a/views/layout.html +++ /dev/null @@ -1,46 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> -<head> -<meta http-equiv="content-type" content="text/html; charset=utf-8" /> -<meta name="author" lang="en" content="{{=response.author}}" /> -<meta name="keywords" content="{{=response.keywords}}" /> -<meta name="description" content="{{=response.description}}" /> -<title>{{=response.title or URL(r=request)}}</title> -<link rel="stylesheet" media="screen,projection" type="text/css" href="{{=URL(r=request,c='static',f='styles.css')}}" /> -{{include 'web2py_ajax.html'}} -</head> -<body> -<div id="header"> - <div id="header_inner" class="fixed"> - <div id="logo"> - <h1><a href="http://www.web2py.com">[web2py<sup style="font-size:0.5em;">TM</sup>]</a></h1> - <h2>{{=request.application}}</h2> - </div> - {{if response.menu is not None:}} - <div id="menu"> - <ul> - {{for _name,_active,_link in response.menu:}} - <li><a href="{{=_link}}" onmouseover="this.ccc=this.style.backgroundColor;this.style.backgroundColor='white';" onmouseout="this.style.backgroundColor=this.ccc;" {{if not _active:}}class="inactive"{{pass}}>{{=_name}}</a></li> - {{pass}} - </ul> - </div> - {{pass}} - </div> -</div> -<div id="main"> - <div id="main_inner" class="fixed"> - <div id="primaryContent_columnless"> - <div id="columnA_columnless"> - {{if response.flash:}} - <div class="flash">{{=response.flash}}</div> - {{pass}} - {{include}} - </div> - </div> - </div> -</div> -<div id="footer" class="fixed"> - Powered by <a href="http://www.web2py.com">web2py</a> (TM) created by Massimo Di Pierro © 2007, 2008, 2009 -</div> -</body> -</html> diff --git a/views/applayout.html b/views/plugin_dbui.html similarity index 90% rename from views/applayout.html rename to views/plugin_dbui.html index bf83544a..a291a92c 100644 --- a/views/applayout.html +++ b/views/plugin_dbui.html @@ -24,9 +24,9 @@ Ext.namespace('App'); App.name = '{{=request.application}}'; App.debug = {{=str(appdebug).lower()}}; - App.dburl = '/{{=request.application}}/database'; + App.dburl = '/{{=request.application}}/plugin_dbui/database'; App.cfgSvcMethods = { - "url": '/{{=request.application}}/configuration', + "url": '/{{=request.application}}/plugin_dbui/configuration', "type":"remoting", "actions": { "cfgSvc": {{=XML(cfgSvcMethods)}} diff --git a/views/web2py_ajax.html b/views/web2py_ajax.html deleted file mode 100644 index bafd6435..00000000 --- a/views/web2py_ajax.html +++ /dev/null @@ -1,42 +0,0 @@ -{{import os}} -<link href="{{=URL(r=request,c='static',f='calendar.css')}}" rel="stylesheet" type="text/css" media="screen" charset="utf-8" /> -<script src="{{=URL(r=request,c='static',f='jquery.js')}}" type="text/javascript"></script> -<script src="{{=URL(r=request,c='static',f='calendar.js')}}" type="text/javascript" charset="utf-8"></script> -<script type="text/javascript"><!-- -function popup(url) { - newwindow=window.open(url,'name','height=400,width=600'); - if (window.focus) newwindow.focus(); - return false; -} -function collapse(id) { $('#'+id).slideToggle(); } -function fade(id,value) { if(value>0) $('#'+id).hide().fadeIn('slow'); else $('#'+id).show().fadeOut('slow'); } -function ajax(u,s,t) { - var query=""; - for(i=0; i<s.length; i++) { - if(i>0) query=query+"&"; - query=query+encodeURIComponent(s[i])+"="+encodeURIComponent(document.getElementById(s[i]).value); - } - $.ajax({type: "POST", url: u, data: query, success: function(msg) { document.getElementById(t).innerHTML=msg; } }); -} -String.prototype.reverse = function () { return this.split('').reverse().join('');}; -$(document).ready(function() { -$('.hidden').hide(); -$('.error').hide().slideDown('slow'); -$('.flash').hide().slideDown('slow') -$('.flash').click(function() { $(this).fadeOut('slow'); return false; }); -$('input.string').attr('size',50); -$('textarea.text').attr('cols',50).attr('rows',10); -$('input.integer').keyup(function(){this.value=this.value.reverse().replace(/[^0-9\-]|\-(?=.)/g,'').reverse();}); -$('input.double').keyup(function(){this.value=this.value.reverse().replace(/[^0-9\-\.]|[\-](?=.)|[\.](?=[0-9]*[\.])/g,'').reverse();}); -$('input.delete').attr('onclick','if(this.checked) if(!confirm("{{=T('Sure you want to delete this object?')}}")) this.checked=false;'); -try {$("input.date").focus( function() {Calendar.setup({ - inputField:this.id, ifFormat:"{{=T('%Y-%m-%d')}}", showsTime:false -}); }); } catch(e) {}; -try { $("input.datetime").focus( function() {Calendar.setup({ - inputField:this.id, ifFormat:"{{=T('%Y-%m-%d %H:%M:%S')}}", showsTime: true,timeFormat: "24" -}); }); } catch(e) {}; -try { $("input.time").clockpick({ - starthour:0, endhour:23, showminutes:true, military:true -}); } catch(e) {}; -}); -//--></script> \ No newline at end of file -- GitLab