added button to view as webpage

This commit is contained in:
sanj 2010-05-14 09:19:28 +05:30
parent edd3d86541
commit 35ca0dd682
5 changed files with 41 additions and 3 deletions

View File

@ -79,9 +79,13 @@ def add_srt(request):
def edit_article(request, id): def edit_article(request, id):
c = Category.objects.all() c = Category.objects.all()
a = Article.objects.get(pk=id) a = Article.objects.get(pk=id)
p = a.product
frontend_url = "/edit/article_frontend/%d/%d/" % (p.id, a.order)
rDict = { rDict = {
'categories': c, 'categories': c,
'article_id': id, 'article_id': id,
'frontend_url': frontend_url,
'article_width': a.view_size()[0], 'article_width': a.view_size()[0],
'article_height': a.view_size()[1], 'article_height': a.view_size()[1],
'rev_no': a.current_revision(), 'rev_no': a.current_revision(),

View File

@ -76,12 +76,23 @@
border-color: #666; border-color: #666;
border-bottom: 0px; border-bottom: 0px;
cursor: pointer; cursor: pointer;
margin-left: 10px;
background: #D0CDFF;
background: -moz-linear-gradient(top, #D0CDFF, #fff);
background: -webkit-gradient(linear, top, #D0CDFF, #fff);
}
.page_btn:hover {
background: #e5aeff;
background: -moz-linear-gradient(top, #e5aeff, #fff);
background: -webkit-gradient(linear, top, #e5aeff, #fff);
} }
.printMe { .printMe {
margin-left: 10px;
} }
.audio_video { .audio_video {
width: 100%; width: 100%;
height: 30px; height: 30px;

View File

@ -1592,6 +1592,14 @@ $('.printMe').live("click", function(e) {
window.open(url); window.open(url);
}); });
$(function() {
$('.viewFrontend').live("click", function(e) {
window.open(FRONTEND_URL);
e.preventDefault();
e.stopPropagation();
});
});
$('.upload_srts').live("click", function(e) { $('.upload_srts').live("click", function(e) {
var r = $(this).getResource(); var r = $(this).getResource();
var media_id = r.media_id; var media_id = r.media_id;

View File

@ -74,7 +74,11 @@ body, html {
{% endfor %} {% endfor %}
</style> </style>
<script type="text/javascript">
FRONTEND_URL = "{{frontend_url}}";
</script>
<script type="text/javascript" src="/static/js/jquery.js"></script> <script type="text/javascript" src="/static/js/jquery.js"></script>
<script type="text/javascript" src="/static/js/jquery.colorbox.js"></script> <script type="text/javascript" src="/static/js/jquery.colorbox.js"></script>
<script type="text/javascript" src="/static/js/jquery.srt.js"></script> <script type="text/javascript" src="/static/js/jquery.srt.js"></script>

View File

@ -43,6 +43,7 @@
ARTICLE_WIDTH = {{article_width}}; ARTICLE_WIDTH = {{article_width}};
ARTICLE_HEIGHT = {{article_height}}; ARTICLE_HEIGHT = {{article_height}};
REVISION_NO = {{rev_no}}; REVISION_NO = {{rev_no}};
FRONTEND_URL = "{{frontend_url}}";
{% endif %} {% endif %}
var UUID = parseInt(new Date().getTime() / (10000 * (Math.random() * 10))); var UUID = parseInt(new Date().getTime() / (10000 * (Math.random() * 10)));
USER_ID = {{ user.id }}; USER_ID = {{ user.id }};
@ -65,7 +66,17 @@
</div> </div>
<script type="text/html" id="tmpl_canvas"> <script type="text/html" id="tmpl_canvas">
<div id="canvas<%= index %>" class="canvas" data-index="<%= index %>"> <div id="canvas<%= index %>" class="canvas" data-index="<%= index %>">
<div class="page_btns"><div class="toggle_handle page_btn">Toggle Handle</div><div class="printMe page_btn">Get PDF</div></div> <div class="page_btns">
<div class="toggle_handle page_btn">
Toggle Handle
</div>
<div class="printMe page_btn">
Get PDF
</div>
<div class="viewFrontend page_btn">
View Webpage
</div>
</div>
<div class="ruler ruler_horiz"><div class="handle handle_horiz_left"></div><div class="handle handle_horiz_right"></div></div> <div class="ruler ruler_horiz"><div class="handle handle_horiz_left"></div><div class="handle handle_horiz_right"></div></div>
<div class="ruler ruler_vert"><div class="handle handle_vert_top"></div><div class="handle handle_vert_bottom"></div></div> <div class="ruler ruler_vert"><div class="handle handle_vert_top"></div><div class="handle handle_vert_bottom"></div></div>
<div class="audio_video"></div> <div class="audio_video"></div>