forked from MarseyWorld/MarseyWorld
log urls
parent
d00e7a0414
commit
af99477fbe
|
@ -13,6 +13,7 @@ class PostEdit(Base):
|
|||
old_body_html = Column(String)
|
||||
old_title = Column(String)
|
||||
old_title_html = Column(String)
|
||||
old_url = Column(String)
|
||||
created_utc = Column(Integer)
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
|
|
|
@ -1139,6 +1139,7 @@ def edit_post(pid, v):
|
|||
old_title_html=p.title_html,
|
||||
old_body=p.body,
|
||||
old_body_html=p.body_html,
|
||||
old_url=p.url,
|
||||
)
|
||||
g.db.add(edit_log)
|
||||
|
||||
|
|
|
@ -17,6 +17,15 @@
|
|||
<hr class="chunky-hr">
|
||||
{% if obj.fullname.startswith('p_') %}
|
||||
<h3>{{edit.old_title_html | safe}}</h3>
|
||||
|
||||
{% if edit.old_url %}
|
||||
<a rel="noopener" href="{{edit.old_url}}" {% if not v or v.newtabexternal %}target="_blank"{% endif %}>
|
||||
<div class="d-flex justify-content-between align-items-center border rounded p-2 mb-3">
|
||||
<span>{{edit.old_url}}</span>
|
||||
<i class="fas fa-external-link-alt text-small"></i>
|
||||
</div>
|
||||
</a>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{{edit.old_body_html | safe}}
|
||||
{% endfor %}
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
alter table post_edits add column old_url character varying(2083);
|
Loading…
Reference in New Issue