start to tie ratings to the directory page

This commit is contained in:
friendica 2015-02-02 23:58:44 -08:00
parent 77379029f5
commit 6067274b51
2 changed files with 8 additions and 4 deletions

View File

@ -190,6 +190,9 @@ function directory_content(&$a) {
$page_type = ''; $page_type = '';
if($rr['total_ratings'])
$total_ratings = sprintf( tt("%d rating", "%d ratings", $rr['total_ratings']), $rr['total_ratings']);
$profile = $rr; $profile = $rr;
if ((x($profile,'locale') == 1) if ((x($profile,'locale') == 1)
@ -255,6 +258,7 @@ function directory_content(&$a) {
'nickname' => substr($rr['address'],0,strpos($rr['address'],'@')), 'nickname' => substr($rr['address'],0,strpos($rr['address'],'@')),
'location' => $location, 'location' => $location,
'gender' => $gender, 'gender' => $gender,
'total_ratings' => $total_ratings,
'pdesc' => $pdesc, 'pdesc' => $pdesc,
'marital' => $marital, 'marital' => $marital,
'homepage' => $homepage, 'homepage' => $homepage,

View File

@ -15,9 +15,9 @@
<div class='contact-info'> <div class='contact-info'>
<div class="contact-name" id="directory-name-{{$entry.id}}" ><a href='{{$entry.profile_link}}' >{{$entry.name}}</a>{{if $entry.online}} <i class="icon-asterisk online-now" title="{{$entry.online}}"></i>{{/if}}</div> <div class="contact-name" id="directory-name-{{$entry.id}}" ><a href='{{$entry.profile_link}}' >{{$entry.name}}</a>{{if $entry.online}} <i class="icon-asterisk online-now" title="{{$entry.online}}"></i>{{/if}}</div>
{{if $entry.rateme}} {{*if $entry.rateme*}}
<div id="dir-rating-wrapper-{{$entry.id}}" style="float:right; width: 20%;"> <div id="dir-rating-wrapper-{{$entry.id}}" style="float:right; width: 20%;">{{if $entry.total_ratings}}<a href="prep/{{$entry.hash}}">
62 ratings<br /> {{$entry.total_ratings}}</a>{{/if}}<br />
<div id="dir-rating-slider-{{$entry.id}}" class="dir-slider" style="height: 32px; margin-right:10px;"> <div id="dir-rating-slider-{{$entry.id}}" class="dir-slider" style="height: 32px; margin-right:10px;">
<input id="dir-rating-range-{{$entry.id}}" type="text" value="0" name="fake-rating-{{$entry.id}}" style="display: none;"> <input id="dir-rating-range-{{$entry.id}}" type="text" value="0" name="fake-rating-{{$entry.id}}" style="display: none;">
</div> </div>
@ -26,7 +26,7 @@
<script> <script>
$("#dir-rating-range-{{$entry.id}}").jRange({ from: -10, to: 10, step: 1, width:'100%', showLabels: false, showScale: true, scale : [ '-10','-5','0','5','10' ], onstatechange: function(v) { $("#contact-rating-mirror").val(v); } }); $("#dir-rating-range-{{$entry.id}}").jRange({ from: -10, to: 10, step: 1, width:'100%', showLabels: false, showScale: true, scale : [ '-10','-5','0','5','10' ], onstatechange: function(v) { $("#contact-rating-mirror").val(v); } });
</script> </script>
{{/if}} {{*/if*}}
{{if $entry.public_forum}} {{if $entry.public_forum}}
<div class="contact-forum"> <div class="contact-forum">
{{$entry.forum_label}} @{{$entry.nickname}}+ {{$entry.forum_label}} @{{$entry.nickname}}+