aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Zotlabs/Lib/ThreadItem.php7
-rw-r--r--include/conversation.php10
-rwxr-xr-xview/tpl/conv_item.tpl2
-rwxr-xr-xview/tpl/search_item.tpl88
4 files changed, 47 insertions, 60 deletions
diff --git a/Zotlabs/Lib/ThreadItem.php b/Zotlabs/Lib/ThreadItem.php
index a3c7f99b9..ed78ae00b 100644
--- a/Zotlabs/Lib/ThreadItem.php
+++ b/Zotlabs/Lib/ThreadItem.php
@@ -243,16 +243,9 @@ class ThreadItem {
// FIXME check this permission
if(($conv->get_profile_owner() == local_channel()) && (! array_key_exists('real_uid',$item))) {
-// FIXME we don't need all this stuff, some can be done in the template
-
$star = array(
- 'do' => t("Add Star"),
- 'undo' => t("Remove Star"),
'toggle' => t("Toggle Star Status"),
- 'classdo' => ((intval($item['item_starred'])) ? "hidden" : ""),
- 'classundo' => ((intval($item['item_starred'])) ? "" : "hidden"),
'isstarred' => ((intval($item['item_starred'])) ? true : false),
- 'starred' => t('starred'),
);
}
diff --git a/include/conversation.php b/include/conversation.php
index 61ca208b2..4997bc2b7 100644
--- a/include/conversation.php
+++ b/include/conversation.php
@@ -509,6 +509,7 @@ function conversation($items, $mode, $update, $page_mode = 'traditional', $prepa
. ((x($_GET,'cmax')) ? '&cmax=' . $_GET['cmax'] : '')
. ((x($_GET,'file')) ? '&file=' . $_GET['file'] : '')
. ((x($_GET,'uri')) ? '&uri=' . $_GET['uri'] : '')
+ . ((x($_GET,'pf')) ? '&pf=' . $_GET['pf'] : '')
. "'; var profile_page = " . App::$pager['page'] . "; </script>\r\n";
}
}
@@ -690,8 +691,10 @@ function conversation($items, $mode, $update, $page_mode = 'traditional', $prepa
'delete' => t('Delete'),
);
- $star = false;
- $isstarred = "unstarred fa-star-o";
+ $star = array(
+ 'toggle' => t("Toggle Star Status"),
+ 'isstarred' => ((intval($item['item_starred'])) ? true : false),
+ );
$lock = (($item['item_private'] || strlen($item['allow_cid']) || strlen($item['allow_gid']) || strlen($item['deny_cid']) || strlen($item['deny_gid']))
? t('Private Message')
@@ -773,8 +776,7 @@ function conversation($items, $mode, $update, $page_mode = 'traditional', $prepa
'owner_photo' => $owner_photo,
'plink' => get_plink($item,false),
'edpost' => false,
- 'isstarred' => $isstarred,
- 'star' => $star,
+ 'star' => ((feature_enabled(local_channel(),'star_posts')) ? $star : ''),
'drop' => $drop,
'vote' => $likebuttons,
'like' => '',
diff --git a/view/tpl/conv_item.tpl b/view/tpl/conv_item.tpl
index 6baf06dda..ac6af40e9 100755
--- a/view/tpl/conv_item.tpl
+++ b/view/tpl/conv_item.tpl
@@ -29,7 +29,7 @@
<div class="p-2 clearfix wall-item-head{{if $item.is_new && !$item.title && !$item.event && !$item.is_comment}} wall-item-head-new rounded-top{{/if}}">
<div class="wall-item-info " id="wall-item-info-{{$item.id}}" >
<div class="wall-item-photo-wrapper{{if $item.owner_url}} wwfrom{{/if}} h-card p-author" id="wall-item-photo-wrapper-{{$item.id}}">
- <img src="{{$item.thumb}}" class="fakelink wall-item-photo{{$item.sparkle}} u-photo p-name" id="wall-item-photo-{{$item.id}}" alt="{{$item.name}}" data-toggle="dropdown" />
+ <img src="{{$item.thumb}}" class="fakelink wall-item-photo{{$item.sparkle}} u-photo p-name" id="wall-item-photo-{{$item.id}}" alt="{{$item.name}}" data-toggle="dropdown" />
{{if $item.thread_author_menu}}
<i class="fa fa-caret-down wall-item-photo-caret cursor-pointer" data-toggle="dropdown"></i>
<div class="dropdown-menu">
diff --git a/view/tpl/search_item.tpl b/view/tpl/search_item.tpl
index ebfb6a256..018e98989 100755
--- a/view/tpl/search_item.tpl
+++ b/view/tpl/search_item.tpl
@@ -23,7 +23,15 @@
<div class="p-2 clearfix wall-item-head{{if $item.is_new && !$item.title && !$item.event && !$item.is_comment}} wall-item-head-new rounded-top{{/if}}">
<div class="wall-item-info" id="wall-item-info-{{$item.id}}" >
<div class="wall-item-photo-wrapper{{if $item.owner_url}} wwfrom{{/if}}" id="wall-item-photo-wrapper-{{$item.id}}">
- <a href="{{$item.profile_url}}" title="{{$item.linktitle}}" class="wall-item-photo-link" id="wall-item-photo-link-{{$item.id}}"><img src="{{$item.thumb}}" class="wall-item-photo{{$item.sparkle}}" id="wall-item-photo-{{$item.id}}" alt="{{$item.name}}" /></a>
+ <img src="{{$item.thumb}}" class="fakelink wall-item-photo{{$item.sparkle}} u-photo p-name" id="wall-item-photo-{{$item.id}}" alt="{{$item.name}}" data-toggle="dropdown" />
+ {{if $item.thread_author_menu}}
+ <i class="fa fa-caret-down wall-item-photo-caret cursor-pointer" data-toggle="dropdown"></i>
+ <div class="dropdown-menu">
+ {{foreach $item.thread_author_menu as $mitem}}
+ <a class="dropdown-item" {{if $mitem.href}}href="{{$mitem.href}}"{{/if}} {{if $mitem.action}}onclick="{{$mitem.action}}"{{/if}} {{if $mitem.title}}title="{{$mitem.title}}"{{/if}} >{{$mitem.title}}</a>
+ {{/foreach}}
+ </div>
+ {{/if}}
</div>
</div>
{{if $item.lock}}
@@ -54,69 +62,53 @@
<div class="body-tags">
<span class="tag">{{$item.mentions}} {{$item.tags}} {{$item.categories}} {{$item.folders}}</span>
</div>
- {{**
- {{if $item.mentions}}
- <div class="body-tags" id="item-mentions">
- <span class="tag">{{$item.mentions}}</span>
- </div>
- {{/if}}
- {{if $item.tags}}
- <div class="body-tags" id="item-tags">
- <span class="tag">{{$item.tags}}</span>
- </div>
- {{/if}}
- {{if $item.categories}}
- <div class="body-tags" id="item-categories">
- <span class="tag">{{$item.categories}}</span>
- </div>
- {{/if}}
- {{if $item.folders}}
- <div class="body-tags" id="item-folders">
- <span class="tag">{{$item.folders}}</span>
- </div>
- {{/if}}
- **}}
</div>
{{/if}}
<div class="p-2 clearfix wall-item-tools">
- <div class="wall-item-tools-right btn-group pull-right">
- <button type="button" class="btn btn-outline-secondary btn-sm dropdown-toggle" data-toggle="dropdown">
- <i class="fa fa-cog"></i>
- </button>
- <div class="dropdown-menu dropdown-menu-right">
- {{if $item.thread_action_menu}}
- {{foreach $item.thread_action_menu as $mitem}}
- <a class="dropdown-item" {{if $mitem.href}}href="{{$mitem.href}}"{{/if}} {{if $mitem.action}}onclick="{{$mitem.action}}"{{/if}} {{if $mitem.title}}title="{{$mitem.title}}"{{/if}} ><i class="fa fa-{{$mitem.icon}}"></i> {{$mitem.title}}</a></li>
- {{/foreach}}
- {{/if}}
- {{if $item.drop.dropping}}
- <a class="dropdown-item" href="item/drop/{{$item.id}}" onclick="return confirmDelete();" title="{{$item.drop.delete}}" ><i class="fa fa-trash-o"></i> {{$item.drop.delete}}</a></li>
- {{/if}}
- {{if $item.thread_author_menu}}
- <div class="dropdown-divider"></div>
- {{foreach $item.thread_author_menu as $mitem}}
- <a class="dropdown-item" {{if $mitem.href}}href="{{$mitem.href}}"{{/if}} {{if $mitem.action}}onclick="{{$mitem.action}}"{{/if}} {{if $mitem.title}}title="{{$mitem.title}}"{{/if}} >{{$mitem.title}}</a></li>
- {{/foreach}}
- {{/if}}
+ <div class="float-right wall-item-tools-right">
+ <div class="btn-group">
+ <div id="like-rotator-{{$item.id}}" class="spinner-wrapper">
+ <div class="spinner s"></div>
+ </div>
</div>
+ <div class="btn-group">
+ <button type="button" class="btn btn-outline-secondary btn-sm dropdown-toggle" data-toggle="dropdown">
+ <i class="fa fa-cog"></i>
+ </button>
+ <div class="dropdown-menu dropdown-menu-right">
+ {{if $item.star}}
+ <a class="dropdown-item" href="#" onclick="dostar({{$item.id}}); return false;"><i id="starred-{{$item.id}}" class="fa fa-fw{{if $item.star.isstarred}} starred fa-star{{else}} unstarred fa-star-o{{/if}} generic-icons-nav" title="{{$item.star.toggle}}"></i>{{$item.star.toggle}}</a>
+ {{/if}}
+ {{if $item.thread_action_menu}}
+ {{foreach $item.thread_action_menu as $mitem}}
+ <a class="dropdown-item" {{if $mitem.href}}href="{{$mitem.href}}"{{/if}} {{if $mitem.action}}onclick="{{$mitem.action}}"{{/if}} {{if $mitem.title}}title="{{$mitem.title}}"{{/if}} ><i class="fa fa-fw fa-{{$mitem.icon}} generic-icons-nav"></i>{{$mitem.title}}</a></li>
+ {{/foreach}}
+ {{/if}}
+ {{if $item.drop.dropping}}
+ <a class="dropdown-item" href="item/drop/{{$item.id}}" onclick="return confirmDelete();" title="{{$item.drop.delete}}" ><i class="fa fa-fw fa-trash-o generic-icons-nav"></i>{{$item.drop.delete}}</a></li>
+ {{/if}}
+ </div>
+ </div>
+ </div>
+ {{if $item.star && $item.star.isstarred}}
+ <div class="btn-group" id="star-button-{{$item.id}}">
+ <button type="button" class="btn btn-outline-secondary btn-sm wall-item-like" onclick="dostar({{$item.id}});"><i class="fa fa-star"></i></button>
</div>
+ {{/if}}
{{if $item.attachments}}
<div class="wall-item-tools-left btn-group">
<button type="button" class="btn btn-outline-secondary btn-sm wall-item-like dropdown-toggle" data-toggle="dropdown" id="attachment-menu-{{$item.id}}"><i class="fa fa-paperclip"></i></button>
<div class="dropdown-menu">{{$item.attachments}}</div>
</div>
{{/if}}
- {{if $item.mode === 'moderate'}}
- <div class="wall-item-tools-left btn-group">
+ <div class="wall-item-tools-left btn-group" id="wall-item-tools-left-{{$item.id}}">
+ {{if $item.mode === 'moderate'}}
<a href="moderate/{{$item.id}}/approve" class="btn btn-success btn-sm">{{$item.approve}}</a>
<a href="moderate/{{$item.id}}/drop" class="btn btn-danger btn-sm">{{$item.delete}}</a>
-
+ {{/if}}
</div>
-
-
- {{/if}}
</div>
</div>
{{if $item.conv}}