misc: add get_admin_url to mail templates (#51685)
This commit is contained in:
parent
13923c5023
commit
93af4b0f10
|
@ -14,6 +14,8 @@
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, see <http://www.gnu.org/licenses/>.
|
# along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
from quixote import get_publisher
|
||||||
|
|
||||||
from wcs.qommon import get_logger, misc
|
from wcs.qommon import get_logger, misc
|
||||||
from wcs.qommon.xml_storage import XmlStorableObject
|
from wcs.qommon.xml_storage import XmlStorableObject
|
||||||
|
|
||||||
|
@ -43,6 +45,10 @@ class MailTemplate(XmlStorableObject):
|
||||||
XmlStorableObject.__init__(self)
|
XmlStorableObject.__init__(self)
|
||||||
self.name = name
|
self.name = name
|
||||||
|
|
||||||
|
def get_admin_url(self):
|
||||||
|
base_url = get_publisher().get_backoffice_url()
|
||||||
|
return '%s/workflows/mail-templates/%s/' % (base_url, self.id)
|
||||||
|
|
||||||
def store(self):
|
def store(self):
|
||||||
if self.slug is None:
|
if self.slug is None:
|
||||||
# set slug if it's not yet there
|
# set slug if it's not yet there
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
<h3>{% trans "Usage in workflows" %}</h3>
|
<h3>{% trans "Usage in workflows" %}</h3>
|
||||||
<ul class="objects-list single-links">
|
<ul class="objects-list single-links">
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<li><a href="../../{{ workflow.id }}/">{{ workflow.name }}</a></li>
|
<li><a href="{{ workflow.get_admin_url }}">{{ workflow.name }}</a></li>
|
||||||
{% if forloop.last %}
|
{% if forloop.last %}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue