Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

movebuttons #274

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion saythanks/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,10 @@ def share_note(uuid):
abort(404)

note = storage.Note.fetch(uuid)
return render_template('share_note.htm.j2', note=note)
note_body = note.body
for i in ['<div>','<p>','</div>','</p>']:
note_body = note_body.replace(i,'')
return render_template('share_note.htm.j2', note=note,note_body=note_body)


@app.route('/inbox/archive/note/<uuid>', methods=['GET'])
Expand Down
12 changes: 2 additions & 10 deletions saythanks/templates/inbox.htm.j2
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
<table>
<thead>
<tr>
<th id="share">Share URL</th>
<th id="share">&nbsp</th>
<th id="message">Message</th>
<th id="from">From</th>
<th id="timestamp">Timestamp</th>
Expand All @@ -88,15 +88,7 @@
<tbody>
{% for note in notes %}
<tr>
<td class="ellipsis">
<span>
<a class="share" href="{{ url_for('share_note', uuid=note.uuid)}}">🔗</a>
<a class="twitter-share-button" target="_blank" href="https://twitter.com/intent/tweet?text={{ note.body|quote + "%0A%0A- " + note.byline + "%0A%0A" + request.base_url[0:-6] + url_for('share_note', uuid=note.uuid) + "%0A" }}" data-url=" "></a> </br>
<iframe src="https://www.facebook.com/plugins/share_button.php?href={{ request.base_url[0:-6] + url_for('share_note', uuid=note.uuid) }}&layout=button&size=small&width=67&height=20&appId" width="67" height="20" style="border:none;overflow:hidden" scrolling="no" frameborder="0" allowfullscreen="true" allow="autoplay; clipboard-write; encrypted-media; picture-in-picture; web-share">
</iframe>
</span>
</td>

<td class="ellipsis">&nbsp</td>
<td class="ellipsis"><a href="{{ url_for('share_note', uuid=note.uuid)}}"><span>{{ note.body }}</span></a></td>
<td class="ellipsis"><span>— {{ note.byline }}</span></td>
<td class="ellipsis">{{ note.timestamp.strftime('%d-%h-%Y %H:%M:%S') }}</td>
Expand Down
5 changes: 4 additions & 1 deletion saythanks/templates/share_note.htm.j2
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@
<h2>🝐</h2>
</fieldset>
</form>

<a class="share" href="{{ url_for('share_note', uuid=note.uuid)}}">🔗</a>
<br><a class="twitter-share-button" target="_blank" href="https://twitter.com/intent/tweet?text={{ note_body|quote + "%0A%0A- " + note.byline + "%0A%0A" + request.root_url + url_for('share_note', uuid=note.uuid)[1:] + "%0A" }}" data-url=" "></a> </br>
<iframe src="https://www.facebook.com/plugins/share_button.php?href={{ request.root_url + url_for('share_note', uuid=note.uuid)[1:] }}&layout=button&size=small&width=67&height=20&appId" width="67" height="20" style="border:none;overflow:hidden" scrolling="no" frameborder="0" allowfullscreen="true" allow="autoplay; clipboard-write; encrypted-media; picture-in-picture; web-share">
</iframe>
{# Have body auto-grow as users type. #}
<script>
$("#body").autoGrow();
Expand Down