[Jifty-commit] r2273 - in jifty/branches/template-declare: . lib/Jifty/Action/Record lib/Jifty/Web/Form

jifty-commit at lists.jifty.org jifty-commit at lists.jifty.org
Sat Dec 2 23:10:10 EST 2006


Author: audreyt
Date: Sat Dec  2 23:10:09 2006
New Revision: 2273

Modified:
   jifty/branches/template-declare/   (props changed)
   jifty/branches/template-declare/lib/Jifty/Action/Record/Search.pm
   jifty/branches/template-declare/lib/Jifty/Web/Form/Field.pm
   jifty/branches/template-declare/share/po/en.po
   jifty/branches/template-declare/share/po/fr.po
   jifty/branches/template-declare/share/po/ja.po
   jifty/branches/template-declare/share/po/zh_cn.po
   jifty/branches/template-declare/share/po/zh_tw.po

Log:
* Merge down into template-declare branch.

Modified: jifty/branches/template-declare/lib/Jifty/Action/Record/Search.pm
==============================================================================
--- jifty/branches/template-declare/lib/Jifty/Action/Record/Search.pm	(original)
+++ jifty/branches/template-declare/lib/Jifty/Action/Record/Search.pm	Sat Dec  2 23:10:09 2006
@@ -64,8 +64,18 @@
 
         if($info->{valid_values}) {
             my $valid_values = $info->{valid_values};
-            $valid_values = [$valid_values] unless ref($valid_values) eq 'ARRAY';
-            unshift @$valid_values, "";
+
+            local $@;
+            $info->{valid_values} = $valid_values = (eval { [ @$valid_values ] } || [$valid_values]);
+
+            # For radio display, display an "any" label as empty choices looks weird
+            if (lc $info->{render_as} eq 'radio') {
+                unshift @$valid_values, { display => _("(any)"), value => '' };
+                $info->{default_value} ||= '';
+            }
+            else {
+                unshift @$valid_values, "";
+            }
         }
 
         if(lc $info->{'render_as'} eq 'password') {

Modified: jifty/branches/template-declare/lib/Jifty/Web/Form/Field.pm
==============================================================================
--- jifty/branches/template-declare/lib/Jifty/Web/Form/Field.pm	(original)
+++ jifty/branches/template-declare/lib/Jifty/Web/Form/Field.pm	Sat Dec  2 23:10:09 2006
@@ -462,7 +462,7 @@
     $field .= qq! id="@{[ $self->element_id ]}"!;
     $field .= qq! value="@{[HTML::Entities::encode_entities($self->current_value)]}"! if defined $self->current_value;
     $field .= $self->_widget_class; 
-    $field .= qq! size="@{[ $self->length() ]}"! if ($self->length());
+    $field .= qq! size="@{[ $self->length() ]}" maxlength=@{[ $self->length() ]}"! if ($self->length());
     $field .= " " .$self->other_widget_properties;
     $field .= qq!  />\n!;
     Jifty->web->out($field);

Modified: jifty/branches/template-declare/share/po/en.po
==============================================================================
--- jifty/branches/template-declare/share/po/en.po	(original)
+++ jifty/branches/template-declare/share/po/en.po	Sat Dec  2 23:10:09 2006
@@ -15,37 +15,37 @@
 "Content-Type: text/plain; charset=CHARSET\n"
 "Content-Transfer-Encoding: 8bit\n"
 
-#: lib/Jifty/Action/Record/Search.pm:96
+#: lib/Jifty/Action/Record/Search.pm:106
 #. ($label)
 msgid "%1 after"
 msgstr ""
 
-#: lib/Jifty/Action/Record/Search.pm:97
+#: lib/Jifty/Action/Record/Search.pm:107
 #. ($label)
 msgid "%1 before"
 msgstr ""
 
-#: lib/Jifty/Action/Record/Search.pm:93
+#: lib/Jifty/Action/Record/Search.pm:103
 #. ($label)
 msgid "%1 contains"
 msgstr ""
 
-#: lib/Jifty/Action/Record/Search.pm:100
+#: lib/Jifty/Action/Record/Search.pm:110
 #. ($label)
 msgid "%1 greater than"
 msgstr ""
 
-#: lib/Jifty/Action/Record/Search.pm:89
+#: lib/Jifty/Action/Record/Search.pm:99
 #. ($label)
 msgid "%1 is not"
 msgstr ""
 
-#: lib/Jifty/Action/Record/Search.pm:94
+#: lib/Jifty/Action/Record/Search.pm:104
 #. ($label)
 msgid "%1 lacks"
 msgstr ""
 
-#: lib/Jifty/Action/Record/Search.pm:101
+#: lib/Jifty/Action/Record/Search.pm:111
 #. ($label)
 msgid "%1 less than"
 msgstr ""
@@ -60,6 +60,10 @@
 msgid "%1 seconds"
 msgstr ""
 
+#: lib/Jifty/Action/Record/Search.pm:73
+msgid "(any)"
+msgstr ""
+
 #: lib/Jifty/Web/Form/Field.pm:521
 msgid "@{[$self->current_value]}"
 msgstr ""
@@ -80,7 +84,7 @@
 msgid "An error occurred.  Try again later"
 msgstr ""
 
-#: lib/Jifty/Action/Record/Search.pm:105
+#: lib/Jifty/Action/Record/Search.pm:115
 msgid "Any field contains"
 msgstr ""
 
@@ -176,7 +180,7 @@
 msgid "Next Page"
 msgstr ""
 
-#: lib/Jifty/Action/Record/Search.pm:106
+#: lib/Jifty/Action/Record/Search.pm:116
 msgid "No field contains"
 msgstr ""
 

Modified: jifty/branches/template-declare/share/po/fr.po
==============================================================================
--- jifty/branches/template-declare/share/po/fr.po	(original)
+++ jifty/branches/template-declare/share/po/fr.po	Sat Dec  2 23:10:09 2006
@@ -15,37 +15,37 @@
 "Content-Type: text/plain; charset=ISO8859-15\n"
 "Content-Transfer-Encoding: 8bit\n"
 
-#: lib/Jifty/Action/Record/Search.pm:96
+#: lib/Jifty/Action/Record/Search.pm:106
 #. ($label)
 msgid "%1 after"
 msgstr ""
 
-#: lib/Jifty/Action/Record/Search.pm:97
+#: lib/Jifty/Action/Record/Search.pm:107
 #. ($label)
 msgid "%1 before"
 msgstr ""
 
-#: lib/Jifty/Action/Record/Search.pm:93
+#: lib/Jifty/Action/Record/Search.pm:103
 #. ($label)
 msgid "%1 contains"
 msgstr ""
 
-#: lib/Jifty/Action/Record/Search.pm:100
+#: lib/Jifty/Action/Record/Search.pm:110
 #. ($label)
 msgid "%1 greater than"
 msgstr ""
 
-#: lib/Jifty/Action/Record/Search.pm:89
+#: lib/Jifty/Action/Record/Search.pm:99
 #. ($label)
 msgid "%1 is not"
 msgstr ""
 
-#: lib/Jifty/Action/Record/Search.pm:94
+#: lib/Jifty/Action/Record/Search.pm:104
 #. ($label)
 msgid "%1 lacks"
 msgstr ""
 
-#: lib/Jifty/Action/Record/Search.pm:101
+#: lib/Jifty/Action/Record/Search.pm:111
 #. ($label)
 msgid "%1 less than"
 msgstr ""
@@ -60,6 +60,10 @@
 msgid "%1 seconds"
 msgstr "%1 secondes"
 
+#: lib/Jifty/Action/Record/Search.pm:73
+msgid "(any)"
+msgstr ""
+
 #: lib/Jifty/Web/Form/Field.pm:521
 msgid "@{[$self->current_value]}"
 msgstr ""
@@ -80,7 +84,7 @@
 msgid "An error occurred.  Try again later"
 msgstr "Erreur. Ré-essayez plus tard"
 
-#: lib/Jifty/Action/Record/Search.pm:105
+#: lib/Jifty/Action/Record/Search.pm:115
 msgid "Any field contains"
 msgstr ""
 
@@ -176,7 +180,7 @@
 msgid "Next Page"
 msgstr ""
 
-#: lib/Jifty/Action/Record/Search.pm:106
+#: lib/Jifty/Action/Record/Search.pm:116
 msgid "No field contains"
 msgstr ""
 

Modified: jifty/branches/template-declare/share/po/ja.po
==============================================================================
--- jifty/branches/template-declare/share/po/ja.po	(original)
+++ jifty/branches/template-declare/share/po/ja.po	Sat Dec  2 23:10:09 2006
@@ -15,37 +15,37 @@
 "Content-Type: text/plain; charset=CHARSET\n"
 "Content-Transfer-Encoding: 8bit\n"
 
-#: lib/Jifty/Action/Record/Search.pm:96
+#: lib/Jifty/Action/Record/Search.pm:106
 #. ($label)
 msgid "%1 after"
 msgstr ""
 
-#: lib/Jifty/Action/Record/Search.pm:97
+#: lib/Jifty/Action/Record/Search.pm:107
 #. ($label)
 msgid "%1 before"
 msgstr ""
 
-#: lib/Jifty/Action/Record/Search.pm:93
+#: lib/Jifty/Action/Record/Search.pm:103
 #. ($label)
 msgid "%1 contains"
 msgstr ""
 
-#: lib/Jifty/Action/Record/Search.pm:100
+#: lib/Jifty/Action/Record/Search.pm:110
 #. ($label)
 msgid "%1 greater than"
 msgstr ""
 
-#: lib/Jifty/Action/Record/Search.pm:89
+#: lib/Jifty/Action/Record/Search.pm:99
 #. ($label)
 msgid "%1 is not"
 msgstr ""
 
-#: lib/Jifty/Action/Record/Search.pm:94
+#: lib/Jifty/Action/Record/Search.pm:104
 #. ($label)
 msgid "%1 lacks"
 msgstr ""
 
-#: lib/Jifty/Action/Record/Search.pm:101
+#: lib/Jifty/Action/Record/Search.pm:111
 #. ($label)
 msgid "%1 less than"
 msgstr ""
@@ -60,6 +60,10 @@
 msgid "%1 seconds"
 msgstr ""
 
+#: lib/Jifty/Action/Record/Search.pm:73
+msgid "(any)"
+msgstr ""
+
 #: lib/Jifty/Web/Form/Field.pm:521
 msgid "@{[$self->current_value]}"
 msgstr ""
@@ -80,7 +84,7 @@
 msgid "An error occurred.  Try again later"
 msgstr ""
 
-#: lib/Jifty/Action/Record/Search.pm:105
+#: lib/Jifty/Action/Record/Search.pm:115
 msgid "Any field contains"
 msgstr ""
 
@@ -176,7 +180,7 @@
 msgid "Next Page"
 msgstr ""
 
-#: lib/Jifty/Action/Record/Search.pm:106
+#: lib/Jifty/Action/Record/Search.pm:116
 msgid "No field contains"
 msgstr ""
 

Modified: jifty/branches/template-declare/share/po/zh_cn.po
==============================================================================
--- jifty/branches/template-declare/share/po/zh_cn.po	(original)
+++ jifty/branches/template-declare/share/po/zh_cn.po	Sat Dec  2 23:10:09 2006
@@ -14,37 +14,37 @@
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
 
-#: lib/Jifty/Action/Record/Search.pm:96
+#: lib/Jifty/Action/Record/Search.pm:106
 #. ($label)
 msgid "%1 after"
 msgstr "%1 晚于"
 
-#: lib/Jifty/Action/Record/Search.pm:97
+#: lib/Jifty/Action/Record/Search.pm:107
 #. ($label)
 msgid "%1 before"
 msgstr "%1 早于"
 
-#: lib/Jifty/Action/Record/Search.pm:93
+#: lib/Jifty/Action/Record/Search.pm:103
 #. ($label)
 msgid "%1 contains"
 msgstr "%1 包含"
 
-#: lib/Jifty/Action/Record/Search.pm:100
+#: lib/Jifty/Action/Record/Search.pm:110
 #. ($label)
 msgid "%1 greater than"
 msgstr "%1 大于"
 
-#: lib/Jifty/Action/Record/Search.pm:89
+#: lib/Jifty/Action/Record/Search.pm:99
 #. ($label)
 msgid "%1 is not"
 msgstr "%1 不等于"
 
-#: lib/Jifty/Action/Record/Search.pm:94
+#: lib/Jifty/Action/Record/Search.pm:104
 #. ($label)
 msgid "%1 lacks"
 msgstr "%1 不包含"
 
-#: lib/Jifty/Action/Record/Search.pm:101
+#: lib/Jifty/Action/Record/Search.pm:111
 #. ($label)
 msgid "%1 less than"
 msgstr "%1 小于"
@@ -59,6 +59,10 @@
 msgid "%1 seconds"
 msgstr "%1 秒"
 
+#: lib/Jifty/Action/Record/Search.pm:73
+msgid "(any)"
+msgstr "(不限)"
+
 #: lib/Jifty/Web/Form/Field.pm:521
 msgid "@{[$self->current_value]}"
 msgstr ""
@@ -79,7 +83,7 @@
 msgid "An error occurred.  Try again later"
 msgstr "系统无法执行此项操作, 请稍后再试"
 
-#: lib/Jifty/Action/Record/Search.pm:105
+#: lib/Jifty/Action/Record/Search.pm:115
 msgid "Any field contains"
 msgstr "任意字段包含"
 
@@ -179,7 +183,7 @@
 msgid "Next Page"
 msgstr "下一页"
 
-#: lib/Jifty/Action/Record/Search.pm:106
+#: lib/Jifty/Action/Record/Search.pm:116
 msgid "No field contains"
 msgstr "没有字段包含"
 
@@ -258,7 +262,7 @@
 
 #: share/web/templates/__jifty/admin/index.html:7
 msgid "To disable this administrative console, add \"AdminMode: 0\" under the \"framework:\" settings in the config file (etc/config.yml)."
-msgstr ""
+msgstr "如欲停用管理界面, 请在设定档 (etc/config.yml) 的 \"framework:\" 设定内加上 \"AdminMode: 0\" 即可."
 
 #: share/web/templates/__jifty/admin/fragments/list/list:38
 msgid "Toggle search"
@@ -291,4 +295,4 @@
 
 #: share/web/templates/_elements/sidebar:7
 msgid "You're not currently signed in."
-msgstr ""
+msgstr "您目前尚未登入."

Modified: jifty/branches/template-declare/share/po/zh_tw.po
==============================================================================
--- jifty/branches/template-declare/share/po/zh_tw.po	(original)
+++ jifty/branches/template-declare/share/po/zh_tw.po	Sat Dec  2 23:10:09 2006
@@ -14,37 +14,37 @@
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
 
-#: lib/Jifty/Action/Record/Search.pm:96
+#: lib/Jifty/Action/Record/Search.pm:106
 #. ($label)
 msgid "%1 after"
 msgstr "%1 晚於"
 
-#: lib/Jifty/Action/Record/Search.pm:97
+#: lib/Jifty/Action/Record/Search.pm:107
 #. ($label)
 msgid "%1 before"
 msgstr "%1 æ—©æ–¼"
 
-#: lib/Jifty/Action/Record/Search.pm:93
+#: lib/Jifty/Action/Record/Search.pm:103
 #. ($label)
 msgid "%1 contains"
 msgstr "%1 包含"
 
-#: lib/Jifty/Action/Record/Search.pm:100
+#: lib/Jifty/Action/Record/Search.pm:110
 #. ($label)
 msgid "%1 greater than"
 msgstr "%1 大於"
 
-#: lib/Jifty/Action/Record/Search.pm:89
+#: lib/Jifty/Action/Record/Search.pm:99
 #. ($label)
 msgid "%1 is not"
 msgstr "%1 不等於"
 
-#: lib/Jifty/Action/Record/Search.pm:94
+#: lib/Jifty/Action/Record/Search.pm:104
 #. ($label)
 msgid "%1 lacks"
 msgstr "%1 不包含"
 
-#: lib/Jifty/Action/Record/Search.pm:101
+#: lib/Jifty/Action/Record/Search.pm:111
 #. ($label)
 msgid "%1 less than"
 msgstr "%1 小於"
@@ -59,6 +59,10 @@
 msgid "%1 seconds"
 msgstr "%1 秒"
 
+#: lib/Jifty/Action/Record/Search.pm:73
+msgid "(any)"
+msgstr "(不限)"
+
 #: lib/Jifty/Web/Form/Field.pm:521
 msgid "@{[$self->current_value]}"
 msgstr ""
@@ -79,7 +83,7 @@
 msgid "An error occurred.  Try again later"
 msgstr "系統無法執行此項操作, 請稍後再試"
 
-#: lib/Jifty/Action/Record/Search.pm:105
+#: lib/Jifty/Action/Record/Search.pm:115
 msgid "Any field contains"
 msgstr "任意欄位包含"
 
@@ -179,7 +183,7 @@
 msgid "Next Page"
 msgstr "下一頁"
 
-#: lib/Jifty/Action/Record/Search.pm:106
+#: lib/Jifty/Action/Record/Search.pm:116
 msgid "No field contains"
 msgstr "沒有欄位包含"
 


More information about the Jifty-commit mailing list