def process_request(self, req): req.perm.require('VERSION_VIEW') showall = req.args.get('show') == 'all' versions = [] resources = [] is_released = [] for v in Version.select(self.env): r = Resource('version', v.name) ir = v.time and v.time.date() < date.today() # apply more visibiity if (showall or not ir) and 'VERSION_VIEW' in req.perm(r): versions.append(v) resources.append(r) is_released.append(v.time and v.time.date() < date.today()) versions.reverse(), resources.reverse(), is_released.reverse(), data = { 'versions': versions, 'resources': resources, 'is_released': is_released, 'showall': showall, } add_stylesheet(req, 'common/css/roadmap.css') return 'versions.html', data, None
def _render_editor(self, req, db, version): resource = Resource('version', version.name) data = { 'version': version, 'resource': resource, 'versions': [ver.name for ver in Version.select(self.env)], 'datetime_hint': get_datetime_format_hint(), 'version_groups': [], } if version.exists: req.perm(resource).require('VERSION_MODIFY') #versions = [m for m in Version.select(self.env, db=db) # if m.name != version.name # and 'VERSION_VIEW' in req.perm(m.resource)] else: req.perm(resource).require('VERSION_CREATE') if parse_version(trac_version) >= parse_version('1.0'): Chrome(self.env).add_jquery_ui(req) Chrome(self.env).add_wiki_toolbars(req) return 'version_edit.html', data, None
def getVersions( self, component, req ): versions = [] for v in Version.select(component.env) : versions.append(v.name) return versions