From 94f737b69912a32b5ae693f5aab3da0df7956926 Mon Sep 17 00:00:00 2001 From: friendica Date: Sun, 4 Nov 2012 16:57:09 -0800 Subject: some cleanup of main item template --- images/icons.png | Bin 12574 -> 12638 bytes include/ItemObject.php | 75 +++++++++++++-------- include/features.php | 1 + version.inc | 2 +- view/theme/duepuntozero/css/style.css | 50 ++------------ view/tpl/conv_item.tpl | 121 ++++++++++++++++++++++++++++++++++ 6 files changed, 175 insertions(+), 74 deletions(-) create mode 100644 view/tpl/conv_item.tpl diff --git a/images/icons.png b/images/icons.png index 7294bad07..34d77a136 100644 Binary files a/images/icons.png and b/images/icons.png differ diff --git a/include/ItemObject.php b/include/ItemObject.php index bb507fe00..e55c61433 100644 --- a/include/ItemObject.php +++ b/include/ItemObject.php @@ -11,7 +11,7 @@ require_once('boot.php'); */ class Item extends BaseObject { private $data = array(); - private $template = 'wall_thread.tpl'; + private $template = 'conv_item.tpl'; private $comment_box_template = 'comment_item.tpl'; private $toplevel = false; private $writable = false; @@ -104,19 +104,31 @@ class Item extends BaseObject { ? t('Private Message') : false); $shareable = ((($conv->get_profile_owner() == local_user()) && ($item['private'] != 1)) ? true : false); + if(local_user() && link_compare($a->contact['url'],$item['author-link'])) $edpost = array($a->get_baseurl($ssl_state)."/editpost/".$item['id'], t("Edit")); else $edpost = false; - if(($this->get_data_value('uid') == local_user()) || $this->is_visiting()) + +// FIXME - this is wrong. +// if(($this->get_data_value('uid') == local_user()) || $this->is_visiting()) + + if($this->get_data_value('uid') == local_user()) $dropping = true; - $drop = array( - 'dropping' => $dropping, - 'select' => t('Select'), - 'delete' => t('Delete'), - ); - + if($dropping) { + $drop = array( + 'dropping' => $dropping, + 'delete' => t('Delete'), + ); + } + + if($observer_is_pageowner) { + $multidrop = array( + 'select' => t('Select'), + ); + } + $filer = (($conv->get_profile_owner() == local_user()) ? t("save to folder") : false); $diff_author = ((link_compare($item['url'],$item['author-link'])) ? false : true); @@ -158,8 +170,8 @@ class Item extends BaseObject { if ($tag!="") $tags[] = bbcode($tag); } - $like = ((x($alike,$item['uri'])) ? format_like($alike[$item['uri']],$alike[$item['uri'] . '-l'],'like',$item['uri']) : ''); - $dislike = ((x($dlike,$item['uri']) && feature_enabled($conv->get_profile_owner(),'dislike')) ? format_like($dlike[$item['uri']],$dlike[$item['uri'] . '-l'],'dislike',$item['uri']) : ''); + $showlike = ((x($alike,$item['uri'])) ? format_like($alike[$item['uri']],$alike[$item['uri'] . '-l'],'like',$item['uri']) : ''); + $showdislike = ((x($dlike,$item['uri']) && feature_enabled($conv->get_profile_owner(),'dislike')) ? format_like($dlike[$item['uri']],$dlike[$item['uri'] . '-l'],'dislike',$item['uri']) : ''); /* * We should avoid doing this all the time, but it depends on the conversation mode @@ -173,7 +185,8 @@ class Item extends BaseObject { if($this->is_toplevel()) { if($conv->get_profile_owner() == local_user()) { - $isstarred = (($item['item_flags'] & ITEM_STARRED) ? "starred" : "unstarred"); + +// FIXME we don't need all this stuff, some can be done in the template $star = array( 'do' => t("add star"), @@ -181,8 +194,12 @@ class Item extends BaseObject { 'toggle' => t("toggle star status"), 'classdo' => (($item['item_flags'] & ITEM_STARRED) ? "hidden" : ""), 'classundo' => (($item['item_flags'] & ITEM_STARRED) ? "" : "hidden"), + 'isstarred' => (($item['item_flags'] & ITEM_STARRED) ? "starred" : "unstarred"), 'starred' => t('starred'), - 'tagger' => t("add tag"), + ); + + $tagger = array( + 'tagit' => t("add tag"), 'classtagger' => "", ); } @@ -191,11 +208,10 @@ class Item extends BaseObject { } if($conv->is_writable()) { - $buttons = array( - 'like' => array( t("I like this \x28toggle\x29"), t("like")), - 'dislike' => array( t("I don't like this \x28toggle\x29"), t("dislike")), - ); - if ($shareable) $buttons['share'] = array( t('Share this'), t('share')); + $like = array( t("I like this \x28toggle\x29"), t("like")); + $dislike = array( t("I don't like this \x28toggle\x29"), t("dislike")); + if ($shareable) + $share = array( t('Share this'), t('share')); } if(strcmp(datetime_convert('UTC','UTC',$item['created']),datetime_convert('UTC','UTC','now - 12 hours')) > 0) @@ -233,17 +249,22 @@ class Item extends BaseObject { 'owner_url' => $this->get_owner_url(), 'owner_photo' => $this->get_owner_photo(), 'owner_name' => template_escape($this->get_owner_name()), - 'plink' => get_plink($item), - 'edpost' => $edpost, - 'isstarred' => $isstarred, - 'star' => $star, - 'filer' => $filer, - 'drop' => $drop, - 'vote' => $buttons, - 'like' => $like, - 'dislike' => $dislike, - 'nolike' => ((feature_enabled($conv->get_profile_owner(),'dislike')) ? '1' : ''), +// Item toolbar buttons + 'like' => $like, + 'dislike' => ((feature_enabled($conv->get_profile_owner(),'dislike')) ? $dislike : ''), + 'share' => $share, + 'plink' => get_plink($item), + 'edpost' => ((feature_enabled($conv->get_profile_owner(),'edit_posts')) ? $edpost : ''), + 'star' => $star, + 'tagger' => ((feature_enabled($conv->get_profile_owner(),'commtag')) ? $tagger : ''), + 'filer' => ((feature_enabled($conv->get_profile_owner(),'filing')) ? $filer : ''), + 'drop' => $drop, + 'multidrop' => ((feature_enabled($conv->get_profile_owner(),'multi_delete')) ? $multidrop : ''), +// end toolbar buttons + + 'showlike' => $showlike, + 'showdislike' => $showdislike, 'comment' => $this->get_comment_box($indent), 'previewing' => ($conv->is_preview() ? ' preview ' : ''), 'wait' => t('Please wait'), diff --git a/include/features.php b/include/features.php index c4fe0df55..efd9c3455 100644 --- a/include/features.php +++ b/include/features.php @@ -25,6 +25,7 @@ array('archives', t('Search by Date'), t('Select posts by date ranges')) array('dislike', t('Dislike Posts'), t('Ability to dislike posts/comments')), array('savedsearch', t('Saved Searches'), t('Save search terms for re-use')), array('preview', t('Post Preview'), t('Preview posts and comments before publishing them')), +array('edit_posts', t('Edit Sent Posts'), t('Edit/correct posts and comments after sending')), ); diff --git a/version.inc b/version.inc index 6e327b8ef..986400c00 100644 --- a/version.inc +++ b/version.inc @@ -1 +1 @@ -2012-11-03.127 +2012-11-04.128 diff --git a/view/theme/duepuntozero/css/style.css b/view/theme/duepuntozero/css/style.css index 40941c890..4ea58fb4a 100644 --- a/view/theme/duepuntozero/css/style.css +++ b/view/theme/duepuntozero/css/style.css @@ -342,6 +342,7 @@ div.wall-item-content-wrapper.shiny { cursor: pointer; } + #group-sidebar { margin-bottom: 10px; } @@ -1091,57 +1092,15 @@ input#dfrn-url { width: 100%; } -.wall-item-like-buttons { + +.item-tool { float: left; -/* margin-right: 10px; */ -/* padding-right: 10px; */ -/* border-right: 2px solid #fff; */ + margin-right: 8px; } .like-rotator { margin-left: 5px; } -.icon.dislike { - margin-left: 3px; -} -.icon.remote-link { - margin-left: 10px; -} - -.wall-item-like-buttons > a, -.wall-item-like-buttons > img { - float: left; -} - -.wall-item-like-buttons img { - cursor: pointer; -} - -.wall-item-share-buttons { - margin-left: 10px; -} - -.editpost { - margin-left: 10px; - float: left; -} -.star-item { - margin-left: 10px; - float: left; -} -.tag-item { - margin-left: 10px; - float: left; -} - -.filer-item { - margin-left: 10px; - float: left; -} - -.wall-item-links-wrapper { - float: left; -} .wall-item-delete-wrapper { float: right; @@ -1155,7 +1114,6 @@ input#dfrn-url { border: none; } - .wall-item-wrapper-end { clear: both; } diff --git a/view/tpl/conv_item.tpl b/view/tpl/conv_item.tpl new file mode 100644 index 000000000..a5a3c4958 --- /dev/null +++ b/view/tpl/conv_item.tpl @@ -0,0 +1,121 @@ +{{if $item.comment_firstcollapsed}} +
+ $item.num_comments $item.hide_text +
+ {{endif}} -- cgit v1.2.3