diff --git a/applications/admin/controllers/default.py b/applications/admin/controllers/default.py index f0419e6c..e005e091 100644 --- a/applications/admin/controllers/default.py +++ b/applications/admin/controllers/default.py @@ -1791,3 +1791,55 @@ def git_push(): session.flash = T("Push failed, there are unmerged entries in the cache. Resolve merge issues manually and try again.") redirect(URL('site')) return dict(app=app, form=form) + +def plugins(): + app = request.args(0) + from serializers import loads_json + if not session.plugins: + rawlist = urllib.urlopen("http://www.web2pyslices.com/" + + "public/api.json/action/list/content/Package?package" + + "_type=plugin&search_index=false").read() + session.plugins = loads_json(rawlist) + plugins = TABLE( + *[TR(TD(H5(article["article"]["title"]), + A(T("Install"), + _href=URL(c="default", + f="install_plugin", + args=[app,], + vars={"source": + article["package_data"]["download"], + "plugin": article["article"]["title"]} + ))), + TD(article["article"]["description"], BR(), + A(T("Plugin page"), + _href="http://www.web2pyslices.com/slice/show/%s/" % \ + article["article"]["id"])), + TD(IMG(_src="http://www.web2pyslices.com/download/%s" % \ + article["article"]["thumbnail"]))) + for article in session.plugins["results"]]) + return dict(plugins=plugins, app=request.args(0)) + +def install_plugin(): + app = request.args(0) + source = request.vars.source + plugin = request.vars.plugin + if not (source and app): + raise HTTP(500, T("Invalid request")) + form = SQLFORM.factory() + result = None + if form.process().accepted: + # get w2p plugin + if "web2py.plugin." in source: + filename = "web2py.plugin.%s.w2p" % \ + source.split("web2py.plugin.")[-1].split(".w2p")[0] + else: + filename = "web2py.plugin.%s.w2p" % cleanpath(plugin) + if plugin_install(app, urllib.urlopen(source), + request, filename): + session.flash = T('New plugin installed: %s' % filename) + else: + session.flash = \ + T('unable to create application "%s"', filename) + redirect(URL(f="plugins", args=[app,])) + return dict(form=form, app=app, plugin=plugin, source=source) + diff --git a/applications/admin/languages/es.py b/applications/admin/languages/es.py index cde467c8..76cdb47a 100644 --- a/applications/admin/languages/es.py +++ b/applications/admin/languages/es.py @@ -29,6 +29,7 @@ 'An error occured, please %s the page': 'Ha ocurrido un error, por favor %s la página', 'and rename it (required):': 'y renombrela (requerido):', 'and rename it:': ' y renombrelo:', +'App does not exist or you are not authorized': 'App does not exist or you are not authorized', 'appadmin': 'appadmin', 'appadmin is disabled because insecure channel': 'admin deshabilitado, el canal no es seguro', 'application "%s" uninstalled': 'aplicación "%s" desinstalada', @@ -44,6 +45,7 @@ 'Are you sure you want to uninstall application "%s"': '¿Está seguro que desea desinstalar la aplicación "%s"', 'Are you sure you want to uninstall application "%s"?': '¿Está seguro que desea desinstalar la aplicación "%s"?', 'Are you sure you want to upgrade web2py now?': '¿Está seguro que desea actualizar web2py ahora?', +'Are you sure?': 'Are you sure?', 'arguments': 'argumentos', 'at char %s': 'en el caracter %s', 'at line %s': 'en la línea %s', @@ -54,6 +56,7 @@ 'Autocomplete Python Code': 'Autocompletar código Python', 'Available databases and tables': 'Bases de datos y tablas disponibles', 'back': 'atrás', +'Back to the plugins list': 'Back to the plugins list', 'breakpoint': 'breakpoint', 'breakpoints': 'breakpoints', 'browse': 'buscar', @@ -129,6 +132,7 @@ 'direction: ltr': 'direction: ltr', 'Disable': 'Deshabilitar', 'docs': 'docs', +'Done!': 'Done!', 'done!': 'listo!', 'Download': 'Descargar', 'download files via http:': 'descargar archivos via http:', @@ -188,14 +192,18 @@ 'Group ID': 'ID de Grupo', 'Hello World': 'Hola Mundo', 'Help': 'ayuda', +'here': 'here', 'htmledit': 'htmledit', 'If the report above contains a ticket number it indicates a failure in executing the controller, before any attempt to execute the doctests. This is usually due to an indentation error or an error outside function code.\nA green title indicates that all tests (if defined) passed. In this case test results are not shown.': 'Si el reporte anterior contiene un número de tiquete este indica un falla en la ejecución del controlador, antes de cualquier intento de ejecutat doctests. Esto generalmente se debe a un error en la indentación o un error por fuera del código de la función.\r\nUn titulo verde indica que todas las pruebas pasaron (si existen). En dicho caso los resultados no se muestran.', +'Image': 'Image', 'Import/Export': 'Importar/Exportar', 'includes': 'incluye', 'insert new': 'inserte nuevo', 'insert new %s': 'inserte nuevo %s', 'inspect attributes': 'inspect attributes', 'Install': 'instalar', +'Installation of %(plugin)s for %(app)s': 'Installation of %(plugin)s for %(app)s', +'Installation of %(plugin)s for %(app)s app': 'Installation of %(plugin)s for %(app)s app', 'Installed applications': 'Aplicaciones instaladas', 'Interaction at %s line %s': 'Interaction at %s line %s', 'Interactive console': 'Interactive console', @@ -207,6 +215,7 @@ 'invalid password.': 'invalid password.', 'Invalid Query': 'Consulta inválida', 'invalid request': 'solicitud inválida', +'Invalid request': 'Invalid request', 'invalid ticket': 'tiquete inválido', 'Key bindings': 'Key bindings', 'Key bindings for ZenCoding Plugin': 'Key bindings for ZenCoding Plugin', @@ -218,6 +227,7 @@ 'Last name': 'Apellido', 'Last saved on:': 'Guardado en:', 'License for': 'Licencia para', +'lists by ticket': 'lists by ticket', 'loading...': 'cargando...', 'locals': 'locals', 'Locals##debug': 'Locals', @@ -237,6 +247,8 @@ 'new application "%s" created': 'nueva aplicación "%s" creada', 'New application wizard': 'Asistente para nueva aplicación', 'new plugin installed': 'nuevo plugin instalado', +'New plugin installed: web2py.plugin.attachment.w2p': 'New plugin installed: web2py.plugin.attachment.w2p', +'New plugin installed: web2py.plugin.dialog.w2p': 'New plugin installed: web2py.plugin.dialog.w2p', 'New Record': 'Registro nuevo', 'new record inserted': 'nuevo registro insertado', 'New simple application': 'Nueva aplicación', @@ -266,8 +278,10 @@ 'password changed': 'contraseña cambiada', 'Peeking at file': 'Visualizando archivo', 'Please': 'Please', +'Plugin': 'Plugin', 'plugin "%(plugin)s" deleted': 'plugin "%(plugin)s" eliminado', 'Plugin "%s" in application': 'Plugin "%s" en aplicación', +'Plugin page': 'Plugin page', 'plugins': 'plugins', 'Plugins': 'Plugins', 'Plural-Forms:': 'Plural-Forms:', @@ -326,8 +340,10 @@ 'stop': 'stop', 'submit': 'enviar', 'Submit': 'Submit', +'Success!': 'Success!', 'successful': 'exitoso', 'Sure you want to delete this object?': '¿Está seguro que desea eliminar este objeto?', +'switch to : db': 'switch to : db', 'table': 'tabla', 'Table name': 'Nombre de la tabla', 'test': 'probar', @@ -412,6 +428,8 @@ 'web2py upgraded; please restart it': 'web2py actualizado; favor reiniciar', 'Welcome to web2py': 'Bienvenido a web2py', 'YES': 'SI', +'Yes': 'Yes', +'You are going to install': 'You are going to install', 'You need to set up and reach a': 'You need to set up and reach a', 'Your application will be blocked until you click an action button (next, step, continue, etc.)': 'Your application will be blocked until you click an action button (next, step, continue, etc.)', 'Your can inspect variables using the console below': 'Your can inspect variables using the console below', diff --git a/applications/admin/views/default/design.html b/applications/admin/views/default/design.html index d8748a2a..526082ba 100644 --- a/applications/admin/views/default/design.html +++ b/applications/admin/views/default/design.html @@ -443,7 +443,7 @@ for c in controllers: controller_functions+=[c[:-3]+'/%s.html'%x for x in functi
- {{=button(PLUGINS_APP, T('download plugins'))}} + {{=button(URL(c="default", f="plugins", args=[app,]), T('download plugins'))}}
{{if plugins:}}