Add basic upgrades support, remove 'better' theme references
This commit is contained in:
parent
fe19b5ae65
commit
8df12a1774
5 changed files with 47 additions and 8 deletions
|
@ -1,4 +1,4 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# -*- coding: utf-8; -*-
|
||||
"""
|
||||
Web views
|
||||
"""
|
||||
|
@ -11,6 +11,7 @@ def includeme(config):
|
|||
# core views
|
||||
config.include('rattail_demo.web.views.common')
|
||||
config.include('rattail_demo.web.views.auth')
|
||||
config.include('tailbone.views.progress')
|
||||
|
||||
# main table views
|
||||
config.include('tailbone.views.brands')
|
||||
|
@ -30,6 +31,7 @@ def includeme(config):
|
|||
config.include('tailbone.views.stores')
|
||||
config.include('tailbone.views.subdepartments')
|
||||
config.include('rattail_demo.web.views.tempmon')
|
||||
config.include('rattail_demo.web.views.upgrades')
|
||||
config.include('rattail_demo.web.views.users')
|
||||
config.include('tailbone.views.vendors')
|
||||
|
||||
|
|
35
rattail_demo/web/views/upgrades.py
Normal file
35
rattail_demo/web/views/upgrades.py
Normal file
|
@ -0,0 +1,35 @@
|
|||
# -*- coding: utf-8; -*-
|
||||
"""
|
||||
Upgrade views
|
||||
"""
|
||||
|
||||
from __future__ import unicode_literals, absolute_import
|
||||
|
||||
import re
|
||||
|
||||
from tailbone.views import upgrades as base
|
||||
|
||||
|
||||
class UpgradeView(base.UpgradeView):
|
||||
|
||||
def get_changelog_url(self, project, old_version, new_version):
|
||||
|
||||
if project == 'rattail-demo':
|
||||
if self.commit_hash_pattern.match(new_version):
|
||||
if new_version == old_version:
|
||||
return 'https://rattailproject.org/trac/log/rattail-demo/?rev={}&limit=100'.format(
|
||||
new_version)
|
||||
else:
|
||||
return 'https://rattailproject.org/trac/log/rattail-demo/?rev={}&stop_rev={}&limit=100'.format(
|
||||
new_version, old_version)
|
||||
elif re.match(r'^\d+\.\d+\.\d+$', new_version):
|
||||
return 'https://rattailproject.org/trac/browser/rattail-demo/CHANGES.rst?rev=v{}'.format(
|
||||
new_version)
|
||||
else:
|
||||
return 'https://rattailproject.org/trac/browser/rattail-demo/CHANGES.rst'
|
||||
|
||||
return super(UpgradeView, self).get_changelog_url(project, old_version, new_version)
|
||||
|
||||
|
||||
def includeme(config):
|
||||
UpgradeView.defaults(config)
|
Loading…
Add table
Add a link
Reference in a new issue