first cut at rating widget. The flaw is that it is limited because it requires local_channel() (formerly local_user()). We need to extend this to take you home like rpost does if you're logged in as remote_channel() - and/or we need zot to send the rating message to the source channel and target in addition to the directories.
This commit is contained in:
parent
1ceb0a7fba
commit
3988948516
@ -943,6 +943,11 @@ logger('online: ' . $profile['online']);
|
|||||||
|
|
||||||
$tpl = get_markup_template('profile_vcard.tpl');
|
$tpl = get_markup_template('profile_vcard.tpl');
|
||||||
|
|
||||||
|
// This isn't ideal here because it requires local_channel().
|
||||||
|
// We need the rating widget to recognise and take you home if you're remote.
|
||||||
|
// require_once('include/widgets.php');
|
||||||
|
// $z = widget_rating(array('target' => $profile['channel_hash']));
|
||||||
|
|
||||||
$o .= replace_macros($tpl, array(
|
$o .= replace_macros($tpl, array(
|
||||||
'$profile' => $profile,
|
'$profile' => $profile,
|
||||||
'$connect' => $connect,
|
'$connect' => $connect,
|
||||||
@ -954,6 +959,7 @@ logger('online: ' . $profile['online']);
|
|||||||
'$homepage' => $homepage,
|
'$homepage' => $homepage,
|
||||||
'$chanmenu' => $channel_menu,
|
'$chanmenu' => $channel_menu,
|
||||||
'$diaspora' => $diaspora,
|
'$diaspora' => $diaspora,
|
||||||
|
'$rating' => $z,
|
||||||
'$contact_block' => $contact_block,
|
'$contact_block' => $contact_block,
|
||||||
));
|
));
|
||||||
|
|
||||||
|
@ -903,3 +903,30 @@ function widget_random_block($arr) {
|
|||||||
|
|
||||||
return $o;
|
return $o;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function widget_rating($arr) {
|
||||||
|
$a = get_app();
|
||||||
|
if(! local_channel())
|
||||||
|
return;
|
||||||
|
|
||||||
|
$channel = $a->get_channel();
|
||||||
|
|
||||||
|
if($arr['target'])
|
||||||
|
$hash = $arr['target'];
|
||||||
|
else
|
||||||
|
$hash = $a->poi['xchan_hash'];
|
||||||
|
|
||||||
|
if(! $hash)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if($hash == $channel['channel_hash'])
|
||||||
|
return;
|
||||||
|
|
||||||
|
head_add_js('ratings.js');
|
||||||
|
|
||||||
|
$o = '<div class="widget rateme">';
|
||||||
|
$o .= '<div class="rateme fakelink" onclick="doRatings(\'' . $hash . '\'); return false;"><i class="icon-pencil"></i> ' . t('Rate Me') . '</div></div>';
|
||||||
|
return $o;
|
||||||
|
|
||||||
|
}
|
@ -1 +1 @@
|
|||||||
2015-02-01.934
|
2015-02-04.935
|
||||||
|
@ -6,27 +6,6 @@
|
|||||||
float: left;
|
float: left;
|
||||||
width: 250px;
|
width: 250px;
|
||||||
}
|
}
|
||||||
.directory-rating {
|
|
||||||
float: right;
|
|
||||||
margin-right: 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.slider-container {
|
|
||||||
padding: 15px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rating-text-label {
|
|
||||||
margin-top: 30px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.directory-rating-text {
|
|
||||||
width: 90%;
|
|
||||||
margin-left: 5%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.directory-rating-submit {
|
|
||||||
margin-top: 15px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.directory-photo {
|
.directory-photo {
|
||||||
margin-left: 25px;
|
margin-left: 25px;
|
||||||
|
@ -104,3 +104,27 @@ li:hover .group-edit-icon {
|
|||||||
.chatroomlist td {
|
.chatroomlist td {
|
||||||
padding: 0 5px 0;
|
padding: 0 5px 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* ratings */
|
||||||
|
|
||||||
|
.directory-rating {
|
||||||
|
float: right;
|
||||||
|
margin-right: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.slider-container {
|
||||||
|
padding: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.rating-text-label {
|
||||||
|
margin-top: 30px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.directory-rating-text {
|
||||||
|
width: 90%;
|
||||||
|
margin-left: 5%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.directory-rating-submit {
|
||||||
|
margin-top: 15px;
|
||||||
|
}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
[region=aside]
|
[region=aside]
|
||||||
[widget=vcard][/widget]
|
[widget=vcard][/widget]
|
||||||
|
[widget=rating][/widget]
|
||||||
[widget=suggestions][/widget]
|
[widget=suggestions][/widget]
|
||||||
[widget=findpeople][/widget]
|
[widget=findpeople][/widget]
|
||||||
[/region]
|
[/region]
|
||||||
|
@ -771,6 +771,19 @@ footer {
|
|||||||
clear: both;
|
clear: both;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
div.rateme {
|
||||||
|
display: block;
|
||||||
|
color: $nav_active_icon_colour;
|
||||||
|
background-color: $nav_bg;
|
||||||
|
-webkit-border-radius: $radiuspx ;
|
||||||
|
-moz-border-radius: $radiuspx;
|
||||||
|
border-radius: $radiuspx;
|
||||||
|
border: 1px solid $nav_bd;
|
||||||
|
padding: 5px;
|
||||||
|
font-weight: bold;
|
||||||
|
clear: both;
|
||||||
|
}
|
||||||
|
|
||||||
#pause {
|
#pause {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
bottom: 5px;
|
bottom: 5px;
|
||||||
@ -1442,16 +1455,22 @@ div.jGrowl div.jGrowl-notification {
|
|||||||
width: 90%;
|
width: 90%;
|
||||||
}
|
}
|
||||||
|
|
||||||
a.rconnect {
|
a.rconnect, div.rateme {
|
||||||
color: $nav_active_icon_colour;
|
color: $nav_active_icon_colour;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
|
font-weight: normal;
|
||||||
outline: none;
|
outline: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
a.rconnect:hover {
|
a.rconnect:hover, div.rateme:hover {
|
||||||
color: #0080FF;
|
color: #0080FF;
|
||||||
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.widget.rateme {
|
||||||
|
margin-top: 15px;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
/* header */
|
/* header */
|
||||||
header {
|
header {
|
||||||
|
@ -54,6 +54,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div id="vcard-end"></div>
|
<div id="vcard-end"></div>
|
||||||
|
|
||||||
|
|
||||||
{{$chanmenu}}
|
{{$chanmenu}}
|
||||||
|
|
||||||
{{$contact_block}}
|
{{$contact_block}}
|
||||||
|
Reference in New Issue
Block a user