diff options
author | luxagraf <sng@luxagraf.net> | 2023-06-30 15:10:01 -0500 |
---|---|---|
committer | luxagraf <sng@luxagraf.net> | 2023-06-30 15:10:01 -0500 |
commit | 3d2cc4ef62465699ccc09747c65fb117e11502e9 (patch) | |
tree | c74c781bcb04131595c5a5c3a42c6944a4aeb0ff /app/deals/templates | |
parent | 194eccad7db0c16c36c48e2e5958dd25c1154437 (diff) |
seperated out brands and made buttons to copy code
Diffstat (limited to 'app/deals/templates')
-rw-r--r-- | app/deals/templates/deals/deal_detail.html | 62 |
1 files changed, 61 insertions, 1 deletions
diff --git a/app/deals/templates/deals/deal_detail.html b/app/deals/templates/deals/deal_detail.html index 0d68d8a..804479f 100644 --- a/app/deals/templates/deals/deal_detail.html +++ b/app/deals/templates/deals/deal_detail.html @@ -1,5 +1,65 @@ {% load humanize %} - +<html> + <head> +<style> +body { + padding-top: 30px; +} +.button { + color: white; + padding: 1rem; + text-decoration: none; + background-color: #2ea44f; + border: 1px solid rgba(27, 31, 35, .15); + border-radius: 6px; + box-shadow: rgba(27, 31, 35, .1) 0 1px 0; + box-sizing: border-box; + color: #fff; + cursor: pointer; + display: inline-block; + font-family: -apple-system,system-ui,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji"; + font-size: 14px; + font-weight: 600; + line-height: 20px; + padding: 6px 16px; + position: relative; + text-align: center; + text-decoration: none; + user-select: none; + -webkit-user-select: none; + touch-action: manipulation; + vertical-align: middle; + white-space: nowrap; +} +</style> + </head> + <body> +<a class="button" href="#" onclick="CopyToClipboard('rich-text');return false;">Copy Rich Text</a> +<a class="button" href="#" onclick="CopyToClipboard('markdown');return false;">Copy Markdown</a> +<div id="rich-text"> <h4><a href="{{object.url}}">{{object.title|title}} for ${{object.get_deal_price_pretty|intcomma}} (${{object.dollars_off}} off)</a></h4> +</div> + +<textarea id="markdown" style="min-width: 35rem; height: 15rem;"> +#### [{{object.title|title}} for ${{object.get_deal_price_pretty|intcomma}} (${{object.dollars_off}} off)]({{object.url}}) + ++++button-group + +[Amazon]({{object.url}} "Amazon"){: target="_blank"} ++++ +</textarea> +<script> +function CopyToClipboard(id) +{ +var r = document.createRange(); +r.selectNode(document.getElementById(id)); +window.getSelection().removeAllRanges(); +window.getSelection().addRange(r); +document.execCommand('copy'); +window.getSelection().removeAllRanges(); +} +</script> +</body> +</html> |