xsf / xeps

Hosts the markup for all XMPP Protocol Extensions.
https://xmpp.org/extensions/
Other
125 stars 121 forks source link

Document in attic should include disclaimer #1266

Open guusdk opened 1 year ago

guusdk commented 1 year ago

When content from the attic is looked at, it should be immediately clear that the content is archived, ideally with a reference to the non-archived equivalent.

This could, for example, be achieved by including a disclaimer.

guusdk commented 1 year ago

As a basic approach, I would suggest to use the webserver's capability to rewrite content on the fly, to replace the <body> tag with content that adds a simple HTML banner (and restores the body tag), like this:

<body>
<div style="padding: 2em; text-align: center; background: #ffeb3b; color: black; font-size: 1.5em;">
  <h1>This is an older version of this file!</h1>
  <p>Beware: the content that is displayed here is an archived version, that has been updated. The updated document 
  <a href="#" onclick="window.location=window.location.protocol + '//' + window.location.host + '/extensions/xep-' + window.location.pathname.split('/').pop().match(/\d{4}/)[0] + '.html'; return false">can be found here</a>.</p>
</div>
guusdk commented 1 year ago

I had never seen a similar banner on preview.xmpp.net.

Here's the solution above, modified to use the same style:

<body>
<div style="position: fixed;top: 0;background-color: #ff8f2c;width: 100%;height: 3.5rem; padding: 1rem;margin-bottom: 9em;opacity: 0.9;margin: 0;left: 0;"><strong>Beware: the content that is displayed here is an archived version of the document, that has been updated.</strong><br>
   The updated document <a href="#" onclick="window.location=window.location.protocol + '//' + window.location.host + '/extensions/xep-' + window.location.pathname.split('/').pop().match(/\d{4}/)[0] + '.html'; return false">can be found here</a>.
</div>