Changeset d6c8f0 in indico
- Timestamp:
- 07/29/11 15:34:28 (22 months ago)
- Branches:
- master, hello-world-walkthrough, ipv6, v0.98-series, v0.98.2, v0.98.3, v0.98b2, v0.99, 051b2622c51afb171a1dedb46a0df4fbb0cbd02e, d9941f8582b36b24821a11ea5ba16fda6a457fb1
- Children:
- 9d8047
- Parents:
- df7898
- git-author:
- Adrian Moennich <jerome.ernst.monnich@…> (07/06/11 10:18:12)
- git-committer:
- Jose Benito <jose.benito.gonzalez@…> (07/29/11 15:34:28)
- Location:
- indico/MaKaC
- Files:
-
- 2 edited
-
registration.py (modified) (8 diffs)
-
webinterface/pages/registrationForm.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
indico/MaKaC/registration.py
rdf7898 rd6c8f0 1713 1713 tmp= """%s %s %s """%(tmp, price, currency) 1714 1714 if self.getParent().getPlacesLimit(): 1715 tmp += """ (%s left)""" % (self.getParent().getNoPlacesLeft())1715 tmp += """ <span style='color:green; font-style:italic;'>[%s place(s) left]</span>""" % (self.getParent().getNoPlacesLeft()) 1716 1716 tmp += """</td>""" 1717 1717 if description: … … 1739 1739 def _getSpecialOptionsHTML(self): 1740 1740 html = FieldInputType._getSpecialOptionsHTML(self) 1741 html += _("""<tr>1741 html += i18nformat("""<tr> 1742 1742 <td class="titleCellTD"><span class="titleCellFormat"> _("Places (0 for unlimited)")</span></td> 1743 1743 <td bgcolor="white" class="blacktext" width="100%%"> … … 1787 1787 elif v=="no": 1788 1788 checkedNo="selected" 1789 tmp = """%s <select id="%s" name="%s" %s><option value="">-- Choose a value --</option><option value="yes" %s>yes</option><option value="no" %s>no</option></select>%s""" % (caption, htmlName, htmlName, disable, checkedYes, checkedNo, param) 1789 placesInfo = "" 1790 if self.getParent().getPlacesLimit(): 1791 placesInfo = """ [%s place(s) left]""" % (self.getParent().getNoPlacesLeft()) 1792 if v != "yes" and not self.getParent().hasAvailablePlaces(): 1793 checkedYes += " disabled" 1794 tmp = """%s <select id="%s" name="%s" %s><option value="">-- Choose a value --</option><option value="yes" %s>yes%s</option><option value="no" %s>no</option></select>%s""" % (caption, htmlName, htmlName, disable, checkedYes, placesInfo, checkedNo, param) 1790 1795 tmp= """ <td>%s</td><td align="right" align="bottom">"""%tmp 1791 1796 if billable: … … 1821 1826 item.setMandatory(self.getParent().isMandatory()) 1822 1827 item.setHTMLName(self.getHTMLName()) 1828 1829 def _getSpecialOptionsHTML(self): 1830 html = FieldInputType._getSpecialOptionsHTML(self) 1831 html += i18nformat("""<tr> 1832 <td class="titleCellTD"><span class="titleCellFormat"> _("Places (0 for unlimited)")</span></td> 1833 <td bgcolor="white" class="blacktext" width="100%%"> 1834 <input type="text" name="placesLimit" size="60" value=%s> 1835 </td> 1836 </tr>""")%(self._parent.getPlacesLimit()) 1837 return html 1823 1838 1824 1839 class RadioItem(Persistent): … … 2125 2140 2126 2141 tmp = """%s""" % (caption) 2127 tmp = [""" <td>%s</td><td align="right" align="bottom">""" % tmp] 2128 tmp.append(""" </td> """) 2142 tmp = [""" <td>%s</td><td align="right" align="bottom" colspan="2"></td>""" % tmp] 2129 2143 2130 2144 counter = 0 … … 2144 2158 elif not value and val.getCaption() == self.getDefaultItem(): 2145 2159 checked = "checked" 2146 placesInfo = "" 2147 if val.getPlacesLimit(): 2148 placesInfo = """ (%s/%s left)""" % (val.getNoPlacesLeft(),val.getPlacesLimit()) 2149 tmp.append("""<tr><td></td><td><input type="radio" style="vertical-align:sub;" id="%s" name="%s" value="%s" %s %s> %s%s</td><td align="right" style="vertical-align: bottom;" >""" % (itemId, self.getHTMLName(), val.getId(), checked, disable, val.getCaption(), placesInfo)) 2160 tmp.append("""<tr><td></td><td><input type="radio" style="vertical-align:sub;" id="%s" name="%s" value="%s" %s %s> %s</td><td align="right" style="vertical-align: bottom;" >""" % (itemId, self.getHTMLName(), val.getId(), checked, disable, val.getCaption())) 2150 2161 if val.isBillable(): 2151 2162 tmp.append(""" %s %s""" % (val.getPrice(), currency)) 2163 tmp.append("""</td><td align="right" style="vertical-align: bottom;" >""") 2164 if val.getPlacesLimit(): 2165 tmp.append(""" <span style='color:green; font-style:italic;'>[%s place(s) left]</span>""" % (val.getNoPlacesLeft())) 2152 2166 tmp.append(""" </td></tr> """) 2153 2167 … … 2204 2218 placesInfo = "" 2205 2219 if radioItem.getPlacesLimit(): 2206 placesInfo = """ (%s/%s left)""" % (radioItem.getNoPlacesLeft(),radioItem.getPlacesLimit())2220 placesInfo = """ [%s place(s) left]""" % (radioItem.getNoPlacesLeft()) 2207 2221 2208 2222 disabled = "" … … 2666 2680 if self.getPlacesLimit() > 0 : 2667 2681 if self.getCurrentNoPlaces() >= self.getPlacesLimit(): 2668 raise FormValuesError( _("""The limit for the number of places is smaller than the current amount registered for this item. Please, set a higher limit."""))2682 raise FormValuesError( _("""The limit for the number of places is smaller than the current amount registered for this item.""")) 2669 2683 self._currentNoPlaces += 1 2670 2684 -
indico/MaKaC/webinterface/pages/registrationForm.py
r4bd7cb rd6c8f0 1937 1937 placesLeft = "" 1938 1938 if atype.getNoPlacesLeft() > 0: 1939 placesLeft = " < font color='green'><i>[%s place(s) left]</i></font>"%atype.getNoPlacesLeft()1939 placesLeft = " <span style='color:green; font-style:italic;'>[%s place(s) left]</span>"%atype.getNoPlacesLeft() 1940 1940 priceCol = "" 1941 1941 if atype.isBillable(): … … 2028 2028 placesLeft = "" 2029 2029 if seItem.getPlacesLimit() > 0: 2030 placesLeft = " <font color='green'><i>[%s place(s) left]</i></font>"%seItem.getNoPlacesLeft()2030 placesLeft = "<span style='color:green; font-style:italic;'>[%s place(s) left]</span>"%seItem.getNoPlacesLeft() 2031 2031 priceCol = "" 2032 2032 if seItem.isBillable():
Note: See TracChangeset
for help on using the changeset viewer.
