src/cm/templates/site/text_embed.html
author Simon Descarpentries <sid@sopinspace.com>
Mon, 21 Oct 2013 16:37:07 +0200
changeset 553 bf26fb47a14c
parent 484 5a8e83132898
permissions -rw-r--r--
To allow scrolling in Safari mobile, we set the content of text_view_comments frame in a jQuery UI layout. So the automated scrolling operations in c_sync.js must be adjustable to the right part to scroll. Also, if a comment have to be shown outside of the current viewport, we scroll the correct part to that viewport and then set the comment top Y offset to juste what it needs to avoid the "Add comment" button after scrolling operation. If not in Safari mobile, we add an offset here to avoid comment to display under the "Add comment" button.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
63
0a610af4033f split followup and embed
raph
parents:
diff changeset
     1
{% extends "site/layout/base_text.html" %}
0a610af4033f split followup and embed
raph
parents:
diff changeset
     2
{% load com %}
0a610af4033f split followup and embed
raph
parents:
diff changeset
     3
{% load i18n %}
0a610af4033f split followup and embed
raph
parents:
diff changeset
     4
{% load local_perms %}
0a610af4033f split followup and embed
raph
parents:
diff changeset
     5
0a610af4033f split followup and embed
raph
parents:
diff changeset
     6
{% block title %}
484
5a8e83132898 Preselect embeded code to copy.
gibus
parents: 476
diff changeset
     7
{% blocktrans %}Embed text{% endblocktrans %}
63
0a610af4033f split followup and embed
raph
parents:
diff changeset
     8
{% endblock %}
0a610af4033f split followup and embed
raph
parents:
diff changeset
     9
0a610af4033f split followup and embed
raph
parents:
diff changeset
    10
{% block main %}
0a610af4033f split followup and embed
raph
parents:
diff changeset
    11
{% get_local_perm request can_manage_workspace as can_manage_workspace %}
0a610af4033f split followup and embed
raph
parents:
diff changeset
    12
{% get_local_perm request can_view_unapproved_comment as can_view_unapproved_comment %}
126
b79d7ad83a8d embed for public texts
raph
parents: 63
diff changeset
    13
{% get_local_text_perm request text can_manage_text as can_manage_text %}
63
0a610af4033f split followup and embed
raph
parents:
diff changeset
    14
0a610af4033f split followup and embed
raph
parents:
diff changeset
    15
<script type="text/javascript">
0a610af4033f split followup and embed
raph
parents:
diff changeset
    16
<!--
0a610af4033f split followup and embed
raph
parents:
diff changeset
    17
tb_conf['current_tab'] = 'embed';
484
5a8e83132898 Preselect embeded code to copy.
gibus
parents: 476
diff changeset
    18
$(document).ready(function(){
5a8e83132898 Preselect embeded code to copy.
gibus
parents: 476
diff changeset
    19
  $("#embed_txt").focus();
5a8e83132898 Preselect embeded code to copy.
gibus
parents: 476
diff changeset
    20
  $("#embed_txt").select();
5a8e83132898 Preselect embeded code to copy.
gibus
parents: 476
diff changeset
    21
});
63
0a610af4033f split followup and embed
raph
parents:
diff changeset
    22
-->
0a610af4033f split followup and embed
raph
parents:
diff changeset
    23
</script>
0a610af4033f split followup and embed
raph
parents:
diff changeset
    24
0a610af4033f split followup and embed
raph
parents:
diff changeset
    25
<div id="text_embed" class="tab-meta">   
0a610af4033f split followup and embed
raph
parents:
diff changeset
    26
439
8994d24e4b2f Reverts to changeset 435, and just add {% csrf_token %} to template forgot_pw.html, since CSRF protection seems to be only here (surely because of django.contrib.auth.views).
gibus
parents: 438
diff changeset
    27
<form id="embed" enctype="multipart/form-data" action="." method="post">
63
0a610af4033f split followup and embed
raph
parents:
diff changeset
    28
0a610af4033f split followup and embed
raph
parents:
diff changeset
    29
<h2 class="title_first">{% blocktrans %}Embed text{% endblocktrans %}</h2>
484
5a8e83132898 Preselect embeded code to copy.
gibus
parents: 476
diff changeset
    30
<p>{% blocktrans %}Copy this code into your site to display text with comments.{% endblocktrans %} {% blocktrans %}Users will also be able to add comments from your site depending on anonymous users' roles.{% endblocktrans %}
5a8e83132898 Preselect embeded code to copy.
gibus
parents: 476
diff changeset
    31
(<a title="{% blocktrans %}Help{% endblocktrans %}" target="_blank" href="{% url help %}#embed">?</a>)</p>
5a8e83132898 Preselect embeded code to copy.
gibus
parents: 476
diff changeset
    32
<input id="embed_txt" class="copy_link" size="{{ embed_code|length}}" style="width:auto;background-color:#DDDDDD;" value="{{ embed_code }}" type="text" readonly="true"></input>
126
b79d7ad83a8d embed for public texts
raph
parents: 63
diff changeset
    33
63
0a610af4033f split followup and embed
raph
parents:
diff changeset
    34
{% if not anonymous_can_view_text %}
126
b79d7ad83a8d embed for public texts
raph
parents: 63
diff changeset
    35
{% if can_manage_text %}
484
5a8e83132898 Preselect embeded code to copy.
gibus
parents: 476
diff changeset
    36
<p><span style="color:#F00;">{% blocktrans %}Warning:{% endblocktrans %}</span>{% blocktrans %}You won't successfully embed the text before you give anonymous users a role allowing them to view the text.{% endblocktrans %}</span></p>
63
0a610af4033f split followup and embed
raph
parents:
diff changeset
    37
{% endif %}
126
b79d7ad83a8d embed for public texts
raph
parents: 63
diff changeset
    38
{% endif %}
63
0a610af4033f split followup and embed
raph
parents:
diff changeset
    39
</form>
0a610af4033f split followup and embed
raph
parents:
diff changeset
    40
</div>
0a610af4033f split followup and embed
raph
parents:
diff changeset
    41
0a610af4033f split followup and embed
raph
parents:
diff changeset
    42
0a610af4033f split followup and embed
raph
parents:
diff changeset
    43
{% endblock %}
0a610af4033f split followup and embed
raph
parents:
diff changeset
    44