Merge lp:~unifield-team/unifield-web/web_aio_4 into lp:unifield-web

Proposed by jftempo
Status: Merged
Merged at revision: 4687
Proposed branch: lp:~unifield-team/unifield-web/web_aio_4
Merge into: lp:unifield-web
Diff against target: 145 lines (+19/-93)
3 files modified
addons/openerp/controllers/database.py (+2/-2)
addons/openerp/controllers/templates/database.mako (+17/-5)
addons/openerp/controllers/templates/database_restore.mako (+0/-86)
To merge this branch: bzr merge lp:~unifield-team/unifield-web/web_aio_4
Reviewer Review Type Date Requested Status
UniField Dev Team Pending
Review via email: mp+151505@code.launchpad.net
To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'addons/openerp/controllers/database.py'
2--- addons/openerp/controllers/database.py 2012-12-03 13:29:03 +0000
3+++ addons/openerp/controllers/database.py 2013-03-04 13:40:38 +0000
4@@ -67,7 +67,7 @@
5 submit_text = _('Create')
6 strip_name = True
7 form_attrs = {'onsubmit': 'return on_create()'}
8- fields = [openobject.widgets.PasswordField(name='password', label=_('Super admin password:'), validator=formencode.validators.NotEmpty(), help=_("This is the password of the user that have the rights to administer databases. This is not a OpenERP user, just a super administrator. If you did not changed it, the password is 'admin' after installation.")),
9+ fields = [openobject.widgets.PasswordField(name='password', label=_('Super admin password:'), validator=formencode.validators.NotEmpty(), help=_("This is the password of the user that have the rights to administer databases. This is not a OpenERP user, just a super administrator.")),
10 openobject.widgets.TextField(name='dbname', label=_('New database name:'), validator=formencode.validators.NotEmpty(), help=_("Choose the name of the database that will be created. The name must not contain any special character. Exemple: 'terp'.")),
11 # openobject.widgets.CheckBox(name='demo_data', label=_('Load Demonstration data:'), default=False, validator=validators.Bool(if_empty=False), help=_("Check this box if you want demonstration data to be installed on your new database. These data will help you to understand OpenERP, with predefined products, partners, etc.")),
12 openobject.widgets.SelectField(name='language', options=get_lang_list, validator=validators.String(), label=_('Default Language:'), help=_("Choose the default language that will be installed for this database. You will be able to install new languages after installation through the administration menu.")),
13@@ -254,7 +254,7 @@
14 return self.backup()
15 raise redirect('/openerp/login')
16
17- @expose(template="/openerp/controllers/templates/database_restore.mako")
18+ @expose(template="/openerp/controllers/templates/database.mako")
19 def restore(self, tg_errors=None, **kw):
20 form = _FORMS['restore']
21 error = self.msg
22
23=== modified file 'addons/openerp/controllers/templates/database.mako'
24--- addons/openerp/controllers/templates/database.mako 2010-11-10 13:11:32 +0000
25+++ addons/openerp/controllers/templates/database.mako 2013-03-04 13:40:38 +0000
26@@ -63,11 +63,23 @@
27 </table>
28 </div>
29 <hr style="margin: 0 0 !important; background-color: #5A5858;">
30- % if form.name == 'create':
31- <div>${form.display(value=dict(password = "admin"))}</div>
32- % else:
33- <div>${form.display()}</div>
34- % endif
35+ <div>${form.display()}</div>
36+
37+ %if form.name == 'restore':
38+ <script type="text/javascript">
39+ jQuery('#filename').change(function() {
40+ var choosen_filename = jQuery(this).val();
41+ var matches = /^(.*)-[0-9]{8}-[0-9]{6}.dump$/.exec(choosen_filename);
42+ if (!matches) {
43+ // show jquery alert
44+ alert('${_('The choosen file in not a valid database file')}');
45+ } else {
46+ jQuery('#dbname').val(matches[1]);
47+ }
48+ });
49+ </script>
50+ %endif
51+
52 </div>
53 <%include file="footer.mako"/>
54 </%def>
55
56=== removed file 'addons/openerp/controllers/templates/database_restore.mako'
57--- addons/openerp/controllers/templates/database_restore.mako 2012-11-15 08:31:02 +0000
58+++ addons/openerp/controllers/templates/database_restore.mako 1970-01-01 00:00:00 +0000
59@@ -1,86 +0,0 @@
60-<%inherit file="/openerp/controllers/templates/base_dispatch.mako"/>
61-<%def name="current_for(name)"><%
62- if form.name == name: context.write('current')
63-%></%def>
64-<%def name="header()">
65- <title>${form.string}</title>
66-
67- <script type="text/javascript" src="/openerp/static/javascript/openerp/openerp.ui.waitbox.js"></script>
68-
69- <link rel="stylesheet" type="text/css" href="/openerp/static/css/waitbox.css"/>
70- <link rel="stylesheet" type="text/css" href="/openerp/static/css/database.css"/>
71-
72- <script type="text/javascript">
73- function on_create() {
74- new openerp.ui.WaitBox().showAfter(2000);
75- return true;
76- }
77- </script>
78- % if error:
79- <script type="text/javascript">
80- var $error_tbl = jQuery('<table class="errorbox">');
81- $error_tbl.append('<tr><td style="padding: 4px 2px;" width="10%"><img src="/openerp/static/images/warning.png"></td><td class="error_message_content">${error["message"]}</td></tr>');
82- $error_tbl.append('<tr><td style="padding: 0 8px 5px 0; vertical-align:top;" align="right" colspan="2"><a class="button-a" id="error_btn" onclick="$error_tbl.dialog(\'close\');">OK</a></td></tr>');
83-
84- jQuery(document).ready(function () {
85- jQuery(document.body).append($error_tbl);
86- $error_tbl.dialog({
87- modal: true,
88- resizable: false,
89- title: '<div class="error_message_header">${error.get("title", "Warning")}</div>'
90- });
91- })
92- </script>
93- % endif
94-</%def>
95-
96-<%def name="content()">
97- <table width="100%">
98- <tr><%include file="header.mako"/></tr>
99- </table>
100- <div class="db-form">
101- <div>
102- <table width="100%" class="titlebar">
103- <tr>
104- <td width="32px" align="center">
105- <img alt="" src="/openerp/static/images/stock/stock_person.png">
106- </td>
107- <td class="action">${form.string}</td>
108- <td class="links">
109- <a class="button static_boxes" href="${py.url('/')}">${_("Login")}</a>
110- <a class="button static_boxes ${current_for('create')}"
111- href="${py.url('/openerp/database/create')}">${_("Create")}</a>
112- <a class="button static_boxes ${current_for('drop')}"
113- href="${py.url('/openerp/database/drop')}">${_("Drop")}</a>
114- <a class="button static_boxes ${current_for('backup')}"
115- href="${py.url('/openerp/database/backup')}">${_("Backup")}</a>
116- <a class="button static_boxes ${current_for('restore')}"
117- href="${py.url('/openerp/database/restore')}">${_("Restore")}</a>
118- <a class="button static_boxes ${current_for('password')}"
119- href="${py.url('/openerp/database/password')}">${_("Password")}</a>
120- </td>
121- </tr>
122- </table>
123- </div>
124- <hr style="margin: 0 0 !important; background-color: #5A5858;">
125- % if form.name == 'create':
126- <div>${form.display(value=dict(password = "admin"))}</div>
127- % else:
128- <div>${form.display()}</div>
129- % endif
130-
131- <script type="text/javascript">
132- jQuery('#filename').change(function() {
133- var choosen_filename = jQuery(this).val();
134- var matches = /^(.*)-[0-9]{8}-[0-9]{6}.dump$/.exec(choosen_filename);
135- if (!matches) {
136- // show jquery alert
137- alert('${_('The choosen file in not a valid database file')}');
138- } else {
139- jQuery('#dbname').val(matches[1]);
140- }
141- });
142- </script>
143- </div>
144-<%include file="footer.mako"/>
145-</%def>

Subscribers

People subscribed via source and target branches

to all changes: