edgware/edgware/templates/create_article.html
2011-05-16 19:51:52 +05:30

73 lines
1.9 KiB
HTML

{% extends 'base.html' %}
{% block head %}
<style type="text/css">
.templateArticle {
cursor: pointer;
font-family: sans-serif;
color: #393939;
}
.linkContainer {
margin-bottom: 6px;
margin-left: 12px;
}
.seeLink {
font-size: 0.8em;
font-style: italic;
}
.templateArticle:hover {
color: #000;
}
</style>
<script type="text/javascript">
$(function() {
$('.templateArticle').click(function() {
var id = $(this).attr("data-id");
$('#articleId').val(id);
if ($("#articleName").val().replace(" ", "") === '') {
alert("please enter a name for your article.");
} else {
$('#templateArticles').fadeOut("fast");
$('#newArticleForm').submit();
}
});
});
</script>
{% endblock %}
{% block body %}
<div id="articleInstructions">
<b>Instructions:</b> Give your article a name and then click on a template (or other article) you would like to use as a starting point for your new article. Have fun!
</div>
<br /><br />
<form id="newArticleForm" action="" method="POST">
<label for="article_name">Article Name:</label> <input type="text" id="articleName" name="article_name" /> <br />
<input type="hidden" id="articleId" name="article_id" />
</form>
<div id="templateArticles">
<h3>Templates:</h3>
{% for t in templates %}
<div class="linkContainer">
<span class="templateArticle" data-id="{{ t.id }}">{{ t.name }}</span>
<span class="seeLink">[<a href="article_web/{{ t.id }}/" title="See Article" target="_blank">see</a>]</span>
</div>
{% endfor %}
<h3>Other Articles:</h3>
{% for o in others %}
<div class="linkContainer">
<span class="templateArticle" data-id="{{ o.id }}">{{ o.name }}</span>
<span class="seeLink">[<a href="article_web/{{ o.id }}/" title="See Article" target="_blank">see</a>]</span>
</div>
{% endfor %}
</div>
{% endblock %}