Fix styles related to ratings and reviews when managing or viewing a repository in the tool shed.

This commit is contained in:
Greg Von Kuster
2013-02-07 13:26:42 -05:00
parent 45010fab19
commit dbb2ab4055
4 changed files with 75 additions and 73 deletions
@@ -66,3 +66,19 @@
<div style="clear: both"></div>
</div>
</%def>
<%def name="render_review_comment( comment_text )">
<style type="text/css">
#reviews_table{ table-layout:fixed;
width:100%;
overflow-wrap:normal;
overflow:hidden;
border:0px;
word-break:keep-all;
word-wrap:break-word;
line-break:strict; }
</style>
<table id="reviews_table">
<tr><td>${comment_text}</td></tr>
</table>
</%def>
@@ -48,7 +48,7 @@
<%def name="stylesheets()">
${parent.stylesheets()}
${h.css( "library" )}
${h.css('base','library','panel_layout','jquery.rating')}
</%def>
<%def name="javascripts()">
@@ -322,33 +322,38 @@ ${render_repository_items( metadata, containers_dict, can_set_metadata=True )}
<div class="form-row">
<a href="${h.url_for( controller='repository', action='view_repository', id=trans.security.encode_id( repository.id ), display_reviews=False )}"><label>Hide Reviews</label></a>
</div>
<table class="grid">
<thead>
<tr>
<th>Rating</th>
<th>Comments</th>
<th>Reviewed</th>
<th>User</th>
</tr>
</thead>
<% count = 0 %>
%for review in repository.ratings:
<%
count += 1
name = 'rating%d' % count
%>
<tr>
<td>${render_star_rating( name, review.rating, disabled=True )}</td>
<td><pre>${review.comment | h}</pre></td>
<td>${time_ago( review.update_time )}</td>
<td>${review.user.username | h}</td>
</tr>
%endfor
</table>
<div style="clear: both"></div>
<div class="form-row">
<table class="grid">
<thead>
<tr>
<th>Rating</th>
<th>Comments</th>
<th>Reviewed</th>
<th>User</th>
</tr>
</thead>
<% count = 0 %>
%for review in repository.ratings:
<%
count += 1
name = 'rating%d' % count
%>
<tr>
<td>${render_star_rating( name, review.rating, disabled=True )}</td>
<td>${render_review_comment( to_safe_string( review.comment, to_html=True ) )}</td>
<td>${time_ago( review.update_time )}</td>
<td>${review.user.username | h}</td>
</tr>
%endfor
</table>
</div>
<div style="clear: both"></div>
%else:
<div class="form-row">
<a href="${h.url_for( controller='repository', action='view_repository', id=trans.security.encode_id( repository.id ), display_reviews=True )}"><label>Display Reviews</label></a>
</div>
<div style="clear: both"></div>
%endif
</div>
</div>
@@ -33,31 +33,7 @@
<%def name="stylesheets()">
${parent.stylesheets()}
${h.css( "jquery.rating" )}
<style type="text/css">
ul.fileBrowser,
ul.toolFile {
margin-left: 0;
padding-left: 0;
list-style: none;
}
ul.fileBrowser {
margin-left: 20px;
}
.fileBrowser li,
.toolFile li {
padding-left: 20px;
background-repeat: no-repeat;
background-position: 0;
min-height: 20px;
}
.toolFile li {
background-image: url( ${h.url_for( '/static/images/silk/page_white_compressed.png' )} );
}
.fileBrowser li {
background-image: url( ${h.url_for( '/static/images/silk/page_white.png' )} );
}
</style>
${h.css('base','panel_layout','jquery.rating')}
</%def>
<%def name="javascripts()">
@@ -39,7 +39,7 @@
<%def name="stylesheets()">
${parent.stylesheets()}
${h.css( "library" )}
${h.css('base','library','panel_layout','jquery.rating')}
</%def>
<%def name="javascripts()">
@@ -251,33 +251,38 @@ ${render_repository_items( metadata, containers_dict, can_set_metadata=False )}
<div class="form-row">
<a href="${h.url_for( controller='repository', action='view_repository', id=trans.security.encode_id( repository.id ), display_reviews=False )}"><label>Hide Reviews</label></a>
</div>
<table class="grid">
<thead>
<tr>
<th>Rating</th>
<th>Comments</th>
<th>Reviewed</th>
<th>User</th>
</tr>
</thead>
<% count = 0 %>
%for review in repository.ratings:
<%
count += 1
name = 'rating%d' % count
%>
<tr>
<td>${render_star_rating( name, review.rating, disabled=True )}</td>
<td><pre>${review.comment}</pre></td>
<td>${time_ago( review.update_time )}</td>
<td>${review.user.username}</td>
</tr>
%endfor
</table>
<div style="clear: both"></div>
<div class="form-row">
<table class="grid">
<thead>
<tr>
<th>Rating</th>
<th>Comments</th>
<th>Reviewed</th>
<th>User</th>
</tr>
</thead>
<% count = 0 %>
%for review in repository.ratings:
<%
count += 1
name = 'rating%d' % count
%>
<tr>
<td>${render_star_rating( name, review.rating, disabled=True )}</td>
<td>${render_review_comment( to_safe_string( review.comment, to_html=True ) )}</td>
<td>${time_ago( review.update_time )}</td>
<td>${review.user.username}</td>
</tr>
%endfor
</table>
</div>
<div style="clear: both"></div>
%else:
<div class="form-row">
<a href="${h.url_for( controller='repository', action='view_repository', id=trans.security.encode_id( repository.id ), display_reviews=True )}"><label>Display Reviews</label></a>
</div>
<div style="clear: both"></div>
%endif
</div>
</div>