From d799398de1e3999c6779164ae956729ad90f840f Mon Sep 17 00:00:00 2001 From: Gaetan Delannay Date: Wed, 19 Sep 2012 17:48:49 +0200 Subject: [PATCH] [gen] Graphical improvements. --- gen/generator.py | 1 + gen/mixins/ToolMixin.py | 8 ++++++-- gen/po.py | 9 +++++++++ gen/ui/appy.css | 10 +++++----- gen/ui/odt.png | Bin 784 -> 791 bytes gen/ui/page.pt | 6 +++++- gen/ui/tabBg.png | Bin 149 -> 174 bytes gen/ui/tabBgu.png | Bin 168 -> 172 bytes gen/ui/tabLeft.png | Bin 203 -> 217 bytes gen/ui/tabLeftu.png | Bin 180 -> 184 bytes gen/ui/tabRight.png | Bin 207 -> 223 bytes gen/ui/tabRightu.png | Bin 171 -> 197 bytes 12 files changed, 26 insertions(+), 8 deletions(-) diff --git a/gen/generator.py b/gen/generator.py index 3853d94..ecd05fa 100644 --- a/gen/generator.py +++ b/gen/generator.py @@ -489,6 +489,7 @@ class ZopeGenerator(Generator): msg('page_next', '', msg.PAGE_NEXT), msg('forgot_password', '', msg.FORGOT_PASSWORD), msg('ask_password_reinit', '', msg.ASK_PASSWORD_REINIT), + msg('wrong_password_reinit','', msg.WRONG_PASSWORD_REINIT), msg('reinit_mail_sent', '', msg.REINIT_MAIL_SENT), msg('reinit_password', '', msg.REINIT_PASSWORD), msg('reinit_password_body', '', msg.REINIT_PASSWORD_BODY), diff --git a/gen/mixins/ToolMixin.py b/gen/mixins/ToolMixin.py index 7105748..ebb61d8 100644 --- a/gen/mixins/ToolMixin.py +++ b/gen/mixins/ToolMixin.py @@ -1116,6 +1116,8 @@ class ToolMixin(BaseMixin): login = rq['login'] token = rq['token'] # Check if such token exists in temp folder + res = None + siteUrl = self.getSiteUrl() tokenFile = os.path.join(getOsTempFolder(), login) if os.path.exists(tokenFile): f = file(tokenFile) @@ -1131,13 +1133,15 @@ class ToolMixin(BaseMixin): if not String.EMAIL.match(email): email = user.email subject = self.translate('new_password') - siteUrl = self.getSiteUrl() map = {'password': newPassword, 'siteUrl': siteUrl} body = self.translate('new_password_body', mapping=map, format='text') sendMail(appyTool, email, subject, body) os.remove(tokenFile) - return self.goto(siteUrl, self.translate('new_password_sent')) + res = self.goto(siteUrl, self.translate('new_password_sent')) + if not res: + res = self.goto(siteUrl, self.translate('wrong_password_reinit')) + return res def getSearchValues(self, name, className): '''Gets the possible values for selecting a value for searching field diff --git a/gen/po.py b/gen/po.py index 59dd2c8..b3305a4 100644 --- a/gen/po.py +++ b/gen/po.py @@ -138,6 +138,15 @@ class PoMessage: PAGE_NEXT = 'Next page' FORGOT_PASSWORD = 'Forgot password?' ASK_PASSWORD_REINIT = 'Ask new password' + WRONG_PASSWORD_REINIT = 'Something went wrong. First possibility: you ' \ + 'have already clicked on the link (maybe have you double-clicked?) ' \ + 'and your password has already been re-initialized. Please check ' \ + 'that you haven\'t received your new password in another email. ' \ + 'Second possibility: the link that you received in your mailer was ' \ + 'splitted on several lines. In this case, please re-type the link in ' \ + 'one single line and retry. Third possibility: you have waited too ' \ + 'long and your request has expired, or a technical error occurred. ' \ + 'In this case, please try again to ask a new password from the start.' REINIT_MAIL_SENT = 'A mail has been sent to you. Please follow the ' \ 'instructions from this email.' REINIT_PASSWORD = 'Password re-initialisation' diff --git a/gen/ui/appy.css b/gen/ui/appy.css index c4275b3..875c8b9 100644 --- a/gen/ui/appy.css +++ b/gen/ui/appy.css @@ -62,7 +62,7 @@ img { border: 0; vertical-align: middle} .fakeButton { border: 1px solid #D7DEE4; background-color: #fde8e0; padding: 0px 8px 2px; font: italic 92% Helvetica,Arial,sans-serif} .message { position: absolute; top: -40px; left: 150px; font-size: 90%; - width: 600px; border: 1px #F0C36D solid; padding: 6px 16px; + width: 600px; border: 1px #F0C36D solid; padding: 6px; background-color: #F9EDBE; text-align: center; border-radius: 2px 2px 2px 2px; box-shadow: 0 2px 4px #A9A9A9;} .focus { font-size: 90%; margin: 7px; padding: 7px; background-color: #d7dee4; @@ -109,15 +109,15 @@ img { border: 0; vertical-align: middle} .section3 { font-size: 100%; font-style: italic; font-weight: bold; margin: 0.45em 0em 0.1em 0; background-color: #95a1b3; text-align: center; color: white; } -.odd { background-color: white; } -.even { background-color: #F4F5F6; } +.odd { background-color: #f9f9f9; } +.even { background-color: #f4f4f4; } .summary {margin-bottom: 5px;} .objectTitle { font-size: 11pt; border-bottom: 3px solid grey; font-weight: bold;} .by { padding-top: 5px;} .workflow { text-align: center; border-top: 1px solid grey; - background-color: #f8f8f8;} -.underTitle { background-color: #F4F5F6;} + background-color: #ececec } +.underTitle { background-color: #e9e9e9 } .objectNavigate { margin-top: 3px;} .underline { border-bottom: 1px dotted grey;} .state { font-weight: bold; border-bottom: 1px dashed grey;} diff --git a/gen/ui/odt.png b/gen/ui/odt.png index 74710e4be0576558260e269d224029e4555a04df..9cb241e0294922db046e2c990621729d15d4be1d 100644 GIT binary patch delta 248 zcmVewsc$m0V_*;swRVk-l*lVKQP*T<&R{TO z=xCKqknvSaaWgArVq&Ug2*;NkHkT yQ>RW+1_?0gwM>EmDX;+JL<9f{OhyJ6UIzdx7($)nMNDA;0000tm6e4hHM`ka zi3=j2YE%?2tt}+Lt;XLC7T}4J%t`09=|Mdy6~S2MJm*Oic>$ z@`>nj$%-}>?#s35VVG)OnBrzu%EZJ}%MjM7;n)yUULj&R1qceQ7z*+^ -
+
+ + +
diff --git a/gen/ui/tabBg.png b/gen/ui/tabBg.png index 4eb1fffb2f712b2219a79e05be5947480cabe096..fd50a4715a955e4f1365aac32c9134f80ab3b87c 100644 GIT binary patch delta 130 zcmbQrxQ=mxq&gb|1H*F5H;aH2V{wqX6T`Z5GB1G~wj^(N7lv;jczc1{$%%S$0e3is z`85st!&&-(@_L>wjv*Y^&mJ=rJ)j`Ky5T~*!IG<4?kaZLD23>!kP6kg`KbLh*2~7YK$}U*| delta 105 zcmZ3-IF)gNq$m>u1A|6%^;aOpSRCZ;#IWw1%*%-ma-O%?m^szdyBiOs1EthGT^vI= zt|$Nb|KFaOnfdho>HLxs5)%K-EewFbiDf2`^TLyn!FxK_%Ei~jyntF5JYD@<);T3K F0RV2-AG81f diff --git a/gen/ui/tabBgu.png b/gen/ui/tabBgu.png index 9318415685d44e8ae0693d810bd5480178914a4f..f65935eae795298e89737c49fc66e48e04a01913 100644 GIT binary patch delta 97 zcmV-n0G|J-0jvR#83+ad005^s?4pq&Jx<&S6AvH}68x{30000iNklPKlB47!LPv+oJIihWtHs|zNs&ic zQp7Fe0RRImuK}i>yaps8sV*ep&a+$FUH+ZD%%YKdt`(Pif!HtiPq+IR3oV%Q9|GQYv;UWt`M0lv;h|9i*WdsD=X2&U qP2OSCbhd%Fr|Xc@-iw04Yz%ERhU!ARPu~HJW$<+Mb6Mw<&;$TTbUyF^ diff --git a/gen/ui/tabLeftu.png b/gen/ui/tabLeftu.png index 91443e869d2e4860917768f97330595c5f40a2d2..a9425c9848372018a04a19313e3cb123dcc6909a 100644 GIT binary patch delta 109 zcmV-z0FwW-0k{E>83+ad002P{C+3kMJzCre6AvXXuIfg20000uNkla3|NlP& zF2I5=@b&B0|5zoze*OCY_qQ)_J`*kpxFj|S6rI?>sN?`iGX8IHz?n_}YfBytbn%Ku P00000NkvXXu0mjf>&PoE delta 105 zcmV-v0G9u_0ki>-83+OZ007Q%u(6RLJyzNV1PLt=O&^9D0000qNkl3OVw~R?fbjMLx04ec5*fd54YiCY8tk+1PhH+26yuf~)S|pP&DqpP&E#|GtV3|LdEX zTmJo@|M36+{~Vqk$Jqn!(f6&t;ucLK6TnA3(qW diff --git a/gen/ui/tabRightu.png b/gen/ui/tabRightu.png index bac7a7f807d7ad81662071ab7a7ce2b11395cecf..37143497061c4da74e642e677a33f856e6d962d8 100644 GIT binary patch delta 153 zcmZ3@c$9I1q&gb|1B0W0`ZFNKSRCZ;#IWw1%u67LEy>&6h2cL4F4((#@V>#m&u)5dHn_3xxF*NrDM3|NGk)xIQLi