Skip to content

Commit

Permalink
adjust topic_detail template
Browse files Browse the repository at this point in the history
  • Loading branch information
MeirKriheli committed Jan 27, 2013
1 parent 113885a commit 009d1ab
Show file tree
Hide file tree
Showing 4 changed files with 86 additions and 56 deletions.
7 changes: 7 additions & 0 deletions static/css/app.css
Expand Up @@ -5534,6 +5534,13 @@ ol {
left: 27px;
width: 232px;
}
.card-main .object-actions {
position: absolute;
bottom: 0;
left: 27px;
width: 232px;
text-align: center;
}
#member-details {
padding-bottom: 40px;
}
Expand Down
2 changes: 1 addition & 1 deletion templates/base.html
Expand Up @@ -16,7 +16,7 @@
<meta property="og:image" content="/static/img/oknesset-logo-small.png"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />

<link rel="stylesheet" type="text/css" href="{% static "css/app.css" %}?v=8" />
<link rel="stylesheet" type="text/css" href="{% static "css/app.css" %}?v=9" />
<link rel="stylesheet" type="text/css" href="{% static "css/responsive.css" %}"/>

<!--
Expand Down
14 changes: 7 additions & 7 deletions templates/comments/object_comment_list.html
Expand Up @@ -3,9 +3,9 @@
{% load avatar_tags %}

{% get_comment_list for object as comment_list %}
<header><h2>{% trans 'User comments' %}</h2></header>
<ul>
{% if comment_list %}
<header><h2>{% trans 'User comments' %}</h2></header>
<ul>
{% for comment in comment_list %}
<li class="agenda-mini">
<a name="c{{ comment.id }}"></a>
Expand All @@ -25,17 +25,17 @@ <h3>
</div>
</li>
{% endfor %}
</ul>
{% else %}
<header><h2>{% trans 'No comments yet' %}</h2></header>
<li>{% trans 'No comments yet' %}</li>
{% endif %}

{% if user.is_authenticated %}
{% if perms.comments.add_comment %}
{% render_comment_form for object %}
<li>{% render_comment_form for object %}</li>
{% else %}
{% trans 'Please' %} <a class="bold-link" href="{% url edit-profile %}">{% trans 'validate your email' %}</a>{% trans ' to comment' %}
<li><div class="alert alert-block">{% trans "Please" %} <a href="{% url edit-profile %}">{% trans "validate your email" %}</a>{% trans " to comment" %}</div></li>
{% endif %}
{% else %}
<span class="please-register"><a href='{% url login %}?next={{request.get_full_path}}'>{% trans 'Please login to comment' %}</a><span>
<li><div class="alert alert-block"><a href='{% url login %}?next={{request.get_full_path}}'>{% trans 'Please login to comment' %}</a><div></li>
{% endif %}
</ul>
119 changes: 71 additions & 48 deletions templates/committees/topic_detail.html
Expand Up @@ -8,16 +8,17 @@
$(document).ready(function() {
$('#average_rating').raty({
number: 7,
start: {{topic.rating.get_rating}},
score: {{topic.rating.get_rating}},
readOnly: true,
path: '{% static "img" %}',
width: 150
});
{% if user.is_authenticated %}
{% rating_by_user user on topic.rating as vote %}
$('#your_rating').raty({
cancel: true,
number: 7,
start: {% if vote %}{{vote}}{% else %}0{%endif%},
score: {% if vote %}{{vote}}{% else %}0{%endif%},
path: '{% static "img" %}',
click: function(score, evt) {
$.post('/committee/topic/{{object.id}}/'+score+'/')
Expand Down Expand Up @@ -46,24 +47,6 @@
{% endblock %}

{% block subnav %}
<ul class="actions">
{% if not user.is_authenticated %}
<li><a href='{% url login %}?next={{request.get_full_path}}'>{% trans 'Login to rank this topic' %}</a></li>
{% else %}{% if user == topic.creator %}
<li>
<a href="{% url edit-committee-topic topic.committees.all.0.id topic.id %}">{% trans "Edit" %}</a>
</li>
<li>
<a href="{% url delete-committee-topic topic.id %}">{% trans "Delete" %}</a>
</li>
{% else %}
<li> {% trans "your rating" %}:
<div style="display:inline;" id="your_rating">
</div>
</li>
{% endif %}
{% endif %}
</ul>
{% endblock %}

{% block content %}
Expand All @@ -84,40 +67,80 @@ <h1>{{topic.title}}</h1>
<div class="spacer actions-panel">
{% include "auxiliary/_watch.html" with watched_id=topic.id watched_type="topic"%}
</div>
{% if user == topic.creator %}
<div class="object-actions">
<a class="btn" href="{% url edit-committee-topic topic.committees.all.0.id topic.id %}">{% trans "Edit" %}</a>
<a class="btn btn-danger" href="{% url delete-committee-topic topic.id %}">{% trans "Delete" %}</a>
</p>
{% endif %}
</div>
</div>
</section>

<div class="main-column">
<div style="padding: 0.5em; clear:both;"></div>
<h3>{% trans "Links" %}:</h3>
{% object_links topic %}
<div class="clear" style="padding-bottom:1em;"></div>
<h3>{% trans "share" %}:</h3>
<p style="padding-top:0.5em;">
<a href="https://twitter.com/share" class="twitter-share-button social-row" data-count="horizontal" data-via="oknesset" style="display:block;float:right;">צייץ</a><script type="text/javascript" src="//platform.twitter.com/widgets.js"></script>
<iframe src="http://www.facebook.com/plugins/like.php?href={{request.get_host|iriencode}}{{request.get_full_path|iriencode}}&amp;locale=he_IL&amp;layout=standard&amp;show_faces=true&amp;action=like&amp;colorscheme=light&amp;" scrolling="no" frameborder="0" allowTransparency="true" style="height:20px; width: 400px;" ></iframe>
<!-- Place this tag where you want the +1 button to render -->
<g:plusone size="medium" annotation="inline" width="120"></g:plusone>
<div class="row">
<div class="cards span9">
<section class="card card-list">
<header><h2>{% trans "Links" %}</h2></header>
<ul>
{% object_links topic %}
</ul>
</section>
<section class="card card-list">
{% include 'comments/object_comment_list.html' %}
</section>
</div>

<!-- Place this render call where appropriate -->
<script type="text/javascript">
window.___gcfg = {lang: 'iw'};
<div class="span3">
<aside class="sidebar">
<h2>{% trans "Rating" %}</h2>
<ul>
{% if user != topic.creator %}
<li>
{% if not user.is_authenticated %}
<div class="alert alert-block">
<a href="{% url login %}?next={{request.get_full_path}}">{% trans "Login to rank this topic" %}</a>
</div>
{% else %}
{% trans "your rating" %}:
<div style="display:inline;" id="your_rating"></div>
</li>
{% endif %}
</li>
{% endif %}
<li>
{% trans "average rating" %}:
<div style="display:inline;" id="average_rating"></div>
</li>
</ul>
</aside> <!-- rating -->

(function() {
var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
po.src = 'https://apis.google.com/js/plusone.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
})();
</script>
</p>
</div>
<div class="secondary-column">
<h3> {% trans "average rating" %}: </h3>
<div style="display:inline;" id="average_rating"></div>
<div class="clear"></div>
<div class="clear"></div>
{% include 'comments/object_comment_list.html' %}
<aside class="sidebar sidebar-agendas">
<h2>{% trans "share" %}</h2>
<ul>
<li>
<a href="https://twitter.com/share" class="twitter-share-button social-row" data-count="horizontal" data-via="oknesset" style="display:block;float:right;">צייץ</a><script type="text/javascript" src="//platform.twitter.com/widgets.js"></script>
</li>
<li>
<iframe src="http://www.facebook.com/plugins/like.php?href={{request.get_host|iriencode}}{{request.get_full_path|iriencode}}&amp;locale=he_IL&amp;layout=standard&amp;show_faces=true&amp;action=like&amp;colorscheme=light&amp;" scrolling="no" frameborder="0" allowTransparency="true" style="height:20px; width: 250px;" ></iframe>
</li>
<li>
<!-- Place this tag where you want the +1 button to render -->
<g:plusone size="medium" annotation="inline" width="120"></g:plusone>

<!-- Place this render call where appropriate -->
<script type="text/javascript">
window.___gcfg = {lang: 'iw'};

(function() {
var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
po.src = 'https://apis.google.com/js/plusone.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
})();
</script>
</li>
</ul>
</aside>
</div>
</div>
{% endblock %}
{% block social %}
Expand Down

0 comments on commit 009d1ab

Please sign in to comment.