]> git.mxchange.org Git - friendica.git/commitdiff
[frio] Add share dropdown to mobile post view
authorHypolite Petovan <hypolite@mrpetovan.com>
Thu, 7 Jan 2021 15:13:40 +0000 (10:13 -0500)
committerHypolite Petovan <hypolite@mrpetovan.com>
Thu, 7 Jan 2021 15:13:40 +0000 (10:13 -0500)
- This should prevent accidental taps from resharing content unwittingly

src/Object/Post.php
view/theme/frio/templates/wall_thread.tpl

index 12d8067423c14948062a9ce64058af27d01b8f98..21b2e4ce14555c8171a9f471a99026d2a04cc4be 100644 (file)
@@ -351,10 +351,11 @@ class Post
                        $buttons['like']    = [DI::l10n()->t("I like this \x28toggle\x29")      , DI::l10n()->t("like")];
                        $buttons['dislike'] = [DI::l10n()->t("I don't like this \x28toggle\x29"), DI::l10n()->t("dislike")];
                        if ($shareable) {
-                               $buttons['share'] = [DI::l10n()->t('Quote and share this'), DI::l10n()->t('Quote Share')];
+                               $buttons['share'] = [DI::l10n()->t('Quote share this'), DI::l10n()->t('Quote Share')];
                        }
                        if ($announceable) {
-                               $buttons['announce'] = [DI::l10n()->t('Share this'), DI::l10n()->t('Share')];
+                               $buttons['announce'] = [DI::l10n()->t('Reshare this'), DI::l10n()->t('Reshare')];
+                               $buttons['unannounce'] = [DI::l10n()->t('Cancel your Reshare'), DI::l10n()->t('Unshare')];
                        }
                }
 
index 8bd5faa300fbcf21ab0dd8627cc9c5740a4acf55..99316fce3e702a3aa62161999be10ee61c6d7aed 100644 (file)
@@ -440,17 +440,33 @@ as the value of $top_child_total (this is done at the end of this file)
                                </div>
                        {{/if}}
 
-                       {{* Button for announcing the item *}}
-                       {{if $item.vote.announce}}
-                               <div class="btn-group" role="group">
-                                       <button type="button" class="btn btn-sm button-votes{{if $item.responses.announce.self}} active" aria-pressed="true{{/if}}" id="announce-{{$item.id}}" title="{{$item.vote.announce.0}}" onclick="doLikeAction({{$item.id}}, 'announce'{{if $item.responses.announce.self}}, true{{/if}});" data-toggle="button"><i class="fa fa-retweet" aria-hidden="true"></i></button>
-                               </div>
-                       {{/if}}
-
-                       {{* Button for sharing the item *}}
-                       {{if $item.vote.share}}
-                               <div class="btn-group" role="group">
-                                       <button type="button" class="btn btn-sm button-votes" id="share-{{$item.id}}" title="{{$item.vote.share.0}}" onclick="jotShare({{$item.id}});"><i class="fa fa-share" aria-hidden="true"></i></button>
+                       {{if $item.vote.announce OR $item.vote.share}}
+                               <div class="share-links btn-group{{if $item.thread_level > 1}} dropup{{/if}}">
+                                       <button type="button" class="btn btn-sm dropdown-toggle{{if $item.responses.announce.self}} active{{/if}}" data-toggle="dropdown" id="shareMenuOptions-{{$item.id}}" aria-haspopup="true" aria-expanded="false" title="{{$item.menu}}">
+                                               <i class="fa fa-share" aria-hidden="true"></i>
+                                       </button>
+                                       <ul class="dropdown-menu dropdown-menu-left" role="menu" aria-labelledby="shareMenuOptions-{{$item.id}}">
+                                               {{if $item.vote.announce}} {{* edit the posting *}}
+                                               <li role="menuitem">
+                                                       {{if $item.responses.announce.self}}
+                                                       <a class="btn-link" id="announce-{{$item.id}}" href="javascript:doLikeAction({{$item.id}}, 'announce', true);" title="{{$item.vote.unannounce.0}}">
+                                                               <i class="fa fa-ban" aria-hidden="true"></i> {{$item.vote.unannounce.1}}
+                                                       </a>
+                                                       {{else}}
+                                                       <a class="btn-link" id="announce-{{$item.id}}" href="javascript:doLikeAction({{$item.id}}, 'announce');" title="{{$item.vote.announce.0}}">
+                                                               <i class="fa fa-retweet" aria-hidden="true"></i> {{$item.vote.announce.1}}
+                                                       </a>
+                                                       {{/if}}
+                                               </li>
+                                               {{/if}}
+                                               {{if $item.vote.share}}
+                                               <li role="menuitem">
+                                                       <a class="btn-link" id="share-{{$item.id}}" href="javascript:jotShare({{$item.id}});" title="{{$item.vote.share.0}}">
+                                                               <i class="fa fa-share" aria-hidden="true"></i> {{$item.vote.share.1}}
+                                                       </a>
+                                               </li>
+                                               {{/if}}
+                                       </ul>
                                </div>
                        {{/if}}