diff --git a/gen/__init__.py b/gen/__init__.py index a2cbf81..6442036 100644 --- a/gen/__init__.py +++ b/gen/__init__.py @@ -467,6 +467,10 @@ class Type: attributes that are based on the name of the Appy p_klass, and the application name (p_appName).''' self.name = name + # Recompute the ID (and derived attributes) that may have changed if + # we are in debug mode (because we recreate new Type instances). + self.id = id(self) + if self.slaves: self.master_css = 'appyMaster master_%s' % self.id # Determine ids of i18n labels for this field if not klass: prefix = appName else: prefix = getClassName(klass, appName) @@ -1381,9 +1385,9 @@ class Date(Type): default=None, optional=False, editDefault=False, format=WITH_HOUR, calendar=True, startYear=time.localtime()[0]-10, - endYear=time.localtime()[0]+10, show=True, page='main', - group=None, layouts=None, move=0, indexed=False, - searchable=False, specificReadPermission=False, + endYear=time.localtime()[0]+10, reverseYears=False, + show=True, page='main', group=None, layouts=None, move=0, + indexed=False, searchable=False, specificReadPermission=False, specificWritePermission=False, width=None, height=None, colspan=1, master=None, masterValue=None, focus=False, historized=False, mapping=None): @@ -1391,6 +1395,9 @@ class Date(Type): self.calendar = calendar self.startYear = startYear self.endYear = endYear + # If reverseYears is True, in the selection box, available years, from + # self.startYear to self.endYear will be listed in reverse order. + self.reverseYears = reverseYears Type.__init__(self, validator, multiplicity, index, default, optional, editDefault, show, page, group, layouts, move, indexed, searchable, specificReadPermission, @@ -1406,6 +1413,12 @@ class Date(Type): return ('jscalendar/calendar_stripped.js', 'jscalendar/calendar-en.js') + def getSelectableYears(self): + '''Gets the list of years one may select for this field.''' + res = range(self.startYear, self.endYear + 1) + if self.reverseYears: res.reverse() + return res + def validateValue(self, obj, value): DateTime = obj.getProductConfig().DateTime try: diff --git a/gen/plone25/mixins/__init__.py b/gen/plone25/mixins/__init__.py index ef7fbb8..2e6e6a0 100644 --- a/gen/plone25/mixins/__init__.py +++ b/gen/plone25/mixins/__init__.py @@ -1002,6 +1002,10 @@ class BaseMixin: # Compare the value return compValue == dateValue + def getSelectableYears(self, name): + '''Gets the list of selectable years for Date field named p_name.''' + return self.getAppyType(name).getSelectableYears() + def getPossibleValues(self, name, withTranslations, withBlankValue, className=None): '''Gets the possible values for field named p_name. This field must be a diff --git a/gen/plone25/skin/help.png b/gen/plone25/skin/help.png index 8afba6c..34dd1e9 100644 Binary files a/gen/plone25/skin/help.png and b/gen/plone25/skin/help.png differ diff --git a/gen/plone25/skin/page.pt b/gen/plone25/skin/page.pt index 099c7a0..e0f6077 100644 --- a/gen/plone25/skin/page.pt +++ b/gen/plone25/skin/page.pt @@ -649,7 +649,7 @@ // There are multiple values, split it var subValues = idField.substring(1, idField.length-1).split(','); for (var k=0; k < subValues.length; k++){ - var subValue = subValues[k].strip(); + var subValue = subValues[k].replace(' ',''); masterValue.push(subValue.substring(1, subValue.length-1)); } } diff --git a/gen/plone25/skin/widgets/date.pt b/gen/plone25/skin/widgets/date.pt index e6650e1..b7eab48 100644 --- a/gen/plone25/skin/widgets/date.pt +++ b/gen/plone25/skin/widgets/date.pt @@ -3,7 +3,7 @@ Edit macro for an Date. This field is not used but required by the Javascript popup. diff --git a/gen/plone25/templates/IEFixes.css.dtml b/gen/plone25/templates/IEFixes.css.dtml index b89bee3..9970dd5 100644 --- a/gen/plone25/templates/IEFixes.css.dtml +++ b/gen/plone25/templates/IEFixes.css.dtml @@ -1,17 +1,9 @@ /* Appy-specific IE-fixes */ -.portletSearch { - font-size: 85%; - border-left: 1px solid #8cacbb; - border-right: 1px solid #8cacbb; -} +.portletSearch { font-size: 85%; border-left: 1px solid #8cacbb; border-right: 1px solid #8cacbb; } /* Stylesheet with Internet Explorer-specific workarounds. */ -* html #portal-columns { - width: 100%; -} -* html*#portal-columns { - width: auto; -} +* html #portal-columns { width: 100%; } +* html*#portal-columns { width: auto; } /* */ #topIcons { right: 238px; } @@ -25,7 +17,6 @@ #portlet-hp-news .portletHeader { margin-top: 1px; } .section-ncp-home .portletHeader { font-size:110%; } input { margin-bottom: 1px; } - table.listing td.top { position: relative; left: -1px; top: -1px; } div#portal-columns div.portlet { text-align: left; } div#portal-columns div#portal-column-one, @@ -33,7 +24,6 @@ div#portal-columns div#portal-column-two { overflow: hidden; } textarea { width: 97%; } .visualOverflow { width: 88%; } .visualGhosted { filter:alpha(opacity=20); } - #portal-logo { height /**/: px; overflow: hidden; @@ -41,37 +31,26 @@ textarea { width: 97%; } #clear-space-before-wrapper-table { display: none }; /* Fix bottom margin on tabs in IE */ -#portal-globalnav li.selected a { -position: relative; -} - -#portal-colophon .colophonIcon { - height: 0px !important; - height /**/: 15px; -} - +#portal-globalnav li.selected a { position: relative; } +#portal-colophon .colophonIcon { height: 0px !important; height /**/: 15px; } .actionMenu .actionMenuHeader a { display: inline; } .actionMenu .actionMenuContent { top: 1.4em; } /* Calendar fixes */ -.ploneCalendar { - border-collapse:collapse; - width:auto; - height:1%; -} +.ploneCalendar { border-collapse:collapse; width:auto; height:1%; } .ploneCalendar td { width:1%; } .ploneCalendar .todaynoevent, .ploneCalendar .todayevent { position: relative; } .hiddenStructure { position: absolute; } body { /* These work in IE only, changes the look of the scrollbar + textareas */ - scrollbar-base-color: &dtml-globalBackgroundColor;; - scrollbar-highlight-color: &dtml-globalBackgroundColor;; - scrollbar-track-color: &dtml-evenRowBackgroundColor;; - scrollbar-darkshadow-color: &dtml-evenRowBackgroundColor;; - scrollbar-3dlight-color: &dtml-globalBorderColor;; - scrollbar-shadow-color: &dtml-globalBorderColor;; - scrollbar-arrow-color: &dtml-globalFontColor;; + scrollbar-base-color: &dtml-globalBackgroundColor;; + scrollbar-highlight-color: &dtml-globalBackgroundColor;; + scrollbar-track-color: &dtml-evenRowBackgroundColor;; + scrollbar-darkshadow-color: &dtml-evenRowBackgroundColor;; + scrollbar-3dlight-color: &dtml-globalBorderColor;; + scrollbar-shadow-color: &dtml-globalBorderColor;; + scrollbar-arrow-color: &dtml-globalFontColor;; } #floatholder, #float { height: 1%; } @@ -98,7 +77,6 @@ body { /* These work in IE only, changes the look of the scrollbar + textareas * * html p { position: relative; } * html h1.documentFirstHeading { height: auto; } * html #objectMenu.actionMenu .actionMenuContent li { height: auto; } - #portal-searchbox { overflow: hidden; } /* */