url(r'^(?P<slug>[-\w]+)/$', views.full_slug, name='full'),
url(r'^category/(?P<slug>\d+)/$', views.category, name='category'),
CKEDITOR_CONFIGS = {
"default": {
'skin': 'moonocolor',
"removePlugins": "stylesheetparser",
'allowedContent': True,
'toolbar_Full': [
['Styles', 'Format', 'Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript', '-', 'RemoveFormat' ],
['Image', 'Flash', 'Table', 'HorizontalRule'],
['TextColor', 'BGColor'],
['Smiley','sourcearea', 'SpecialChar'],
[ 'Link', 'Unlink', 'Anchor' ],
[ 'NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', '-', 'Blockquote', 'CreateDiv', '-', 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock', '-', 'BidiLtr', 'BidiRtl', 'Language' ],
[ 'Source', '-', 'Save', 'NewPage', 'Preview', 'Print', '-', 'Templates' ],
[ 'Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo' ],
[ 'Find', 'Replace', '-', 'SelectAll', '-', 'Scayt' ],
[ 'Maximize', 'ShowBlocks' ]
],
}
}
def full(reguest, slug):
post = get_object_or_404(BlogPost, slug=slug)
return render_to_response('full.html', {'post': post, 'username': auth.get_user(reguest).username})
{% for post in post %}
<div class="panel panel-success">
<div class="panel-heading">
<a href="{{ post.get_absolute_url }}">{{ post.title }}</a>
</div>
<div class="panel-body">
<p>{{ post.text_redactor|safe }}</p>
<a href="{{ post.get_absolute_url }}"><button type="button" class="btn btn-default btn-xs">Читать далее >>></button></a>
</div>
<div class="panel-footer">
<div class="row">
<div class="col-xs-6 col-md-4"><a href="/blog/addlike/{{ post.pk }}/"><img src="{% static "img/4594371.png" %}" width="30px" height="30px"></a> {{ post.likes }}</div>
<div class="col-md-4 col-md-pull-1"><!--Соц.кнопки -->
<script type="text/javascript">(function(w,doc) {
if (!w.__utlWdgt ) {
w.__utlWdgt = true;
var d = doc, s = d.createElement('script'), g = 'getElementsByTagName';
s.type = 'text/javascript'; s.charset='UTF-8'; s.async = true;
s.src = ('https:' == w.location.protocol ? 'https' : 'http') + '://w.uptolike.com/widgets/v1/uptolike.js';
var h=d[g]('body')[0];
h.appendChild(s);
}})(window,document);
</script>
<div data-background-alpha="0.0" data-buttons-color="#FFFFFF" data-counter-background-color="#ffffff" data-share-counter-size="12" data-top-button="false" data-share-counter-type="common" data-share-style="1" data-mode="share" data-like-text-enable="false" data-mobile-view="true" data-icon-color="#ffffff" data-orientation="horizontal" data-text-color="#000000" data-share-shape="round-rectangle" data-sn-ids="fb.vk.tw.ok.gp.mr.lj.ln." data-share-size="30" data-background-color="#ffffff" data-preview-mobile="false" data-mobile-sn-ids="fb.vk.tw.wh.ok.gp.mr.lj.ln." data-pid="1430623" data-counter-background-alpha="1.0" data-following-enable="false" data-exclude-show-more="false" data-selection-enable="true" class="uptolike-buttons" ></div>
</div>
<div class="col-xs-6 col-md-4"><h6>Дата публикации: {{ post.timestamp }}</h6></div>
</div>
</div>
</div>
{% endfor %}