Merge pull request #5215 from rabuzarus/20180614_-_frio_contact_suggestion_template
Frio: provide a template for received contact suggestions
This commit is contained in:
commit
f0c2b77157
8 changed files with 78 additions and 28 deletions
|
@ -2137,7 +2137,8 @@ ul.dropdown-menu li:hover {
|
|||
#adminpage, .delegate-content-wrapper, .uexport-content-wrapper,
|
||||
.viewcontacts-content-wrapper, .dfrn_request-content-wrapper,
|
||||
.friendica-content-wrapper, .credits-content-wrapper, .nogroup-content-wrapper,
|
||||
.profperm-content-wrapper, .invite-content-wrapper, .tos-content-wrapper {
|
||||
.profperm-content-wrapper, .invite-content-wrapper, .tos-content-wrapper,
|
||||
.fsuggest-content-wrapper {
|
||||
min-height: calc(100vh - 150px);
|
||||
padding: 15px;
|
||||
padding-bottom: 20px;
|
||||
|
@ -2815,7 +2816,7 @@ ul.notif-network-list > li:hover .intro-action-buttons {
|
|||
}
|
||||
.intro-desc-label, .intro-url-label, .intro-network-label,
|
||||
.intro-location-label, .intro-gender-label, .intro-keywords-label,
|
||||
.intro-about-label, .intro-knowyou-label {
|
||||
.intro-about-label, .intro-knowyou-label, .intro-madeby-label {
|
||||
font-weight: bold;
|
||||
}
|
||||
.intro-contact-info.xs .intro-url-label, .intro-contact-info.xs .intro-network-label,
|
||||
|
|
36
view/theme/frio/js/mod_notifications.js
Normal file
36
view/theme/frio/js/mod_notifications.js
Normal file
|
@ -0,0 +1,36 @@
|
|||
|
||||
/**
|
||||
* @brief Javascript for the notifications module
|
||||
*/
|
||||
|
||||
// Catch the intro ID from the URL
|
||||
var introID = location.pathname.split("/").pop();
|
||||
|
||||
$(document).ready(function(){
|
||||
// Since only the DIV's inside the notification-list are marked
|
||||
// with the class "unseen", we need some js to transfer this class
|
||||
// to the parent li list-elements.
|
||||
if($(".notif-item").hasClass("unseen")) {
|
||||
$(".notif-item.unseen").parent("li").addClass("unseen");
|
||||
}
|
||||
});
|
||||
|
||||
$(window).load(function(){
|
||||
// Scroll to the intro by its intro ID.
|
||||
if (isIntroID()) {
|
||||
scrollToItem('intro-' + introID);
|
||||
}
|
||||
});
|
||||
|
||||
// Check if it is a real introduction ID.
|
||||
function isIntroID() {
|
||||
// Check for the correct path.
|
||||
if (window.location.href.indexOf("/notifications/intros/") !== -1) {
|
||||
// Make sure the introID is a positive Integer value.
|
||||
var intVal = Number(introID);
|
||||
if (Math.floor(intVal) !== Infinity && String(intVal) === introID && intVal > 0) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
|
@ -1,15 +1,17 @@
|
|||
|
||||
<div class="intro-wrapper media" id="intro-{{$contact_id}}" >
|
||||
{{* template incomming contact request and suggested contacts *}}
|
||||
|
||||
<div class="intro-wrapper media" id="intro-{{$intro_id}}" >
|
||||
|
||||
{{* Contact Photo *}}
|
||||
<div class="intro-photo-wrapper dropdown pull-left" >
|
||||
<img id="photo-{{$contact_id}}" class="intro-photo media-object" src="{{$photo}}" title="{{$fullname|escape:'html'}}" alt="{{$fullname|escape:'html'}}" />
|
||||
<img id="photo-{{$intro_id}}" class="intro-photo media-object" src="{{$photo}}" title="{{$fullname|escape:'html'}}" alt="{{$fullname|escape:'html'}}" />
|
||||
</div>
|
||||
|
||||
<div class="media-body">
|
||||
{{* The intro actions like approve, ignore, discard intro*}}
|
||||
<div class="intro-actions pull-right nav-pills preferences">
|
||||
<button class="btn-link intro-action-link" onclick="addElmToModal('#intro-approve-wrapper-{{$contact_id}}');" aria-label="{{$approve|escape:'html'}}" title="{{$approve|escape:'html'}}" data-toggle="tooltip"><i class="fa fa-check" aria-hidden="true"></i></button>
|
||||
<button class="btn-link intro-action-link" onclick="addElmToModal('#intro-approve-wrapper-{{$intro_id}}');" aria-label="{{$approve|escape:'html'}}" title="{{$approve|escape:'html'}}" data-toggle="tooltip"><i class="fa fa-check" aria-hidden="true"></i></button>
|
||||
|
||||
<form class="intro-form" action="notifications/{{$intro_id}}" method="post">
|
||||
<button class="btn-link intro-submit-ignore intro-action-link" type="submit" name="submit" value="{{$ignore|escape:'html'}}" aria-label="{{$ignore|escape:'html'}}" title="{{$ignore|escape:'html'}}" data-toggle="tooltip"><i class="fa fa-ban" aria-hidden="true"></i></button>
|
||||
|
@ -17,7 +19,9 @@
|
|||
</form>
|
||||
</div>
|
||||
<div class='intro-enty-name'><h4 class="media-heading"><a href="{{$zrl}}">{{$fullname}}</a></h4></div>
|
||||
<div class="intro-desc"><span class="intro-desc-label">{{$str_notifytype}}</span>{{$notify_type}}</div>
|
||||
<div class="intro-desc"><span class="intro-desc-label">{{$str_notifytype}}</span> {{$notify_type}}</div>
|
||||
{{* if the contact was suggestested by another contact, the contact who made the suggestion is displayed*}}
|
||||
{{if $madeby}}<div class="intro-madeby"><span class="intro-madeby-label">{{$lbl_madeby}}</span> <a href="{{$madeby_zrl}}">{{$madeby}}</a></div>{{/if}}
|
||||
|
||||
{{* Additional information of the contact *}}
|
||||
<div class="intro-contact-info hidden-xs">
|
||||
|
@ -28,7 +32,7 @@
|
|||
{{if $keywords}}<div class="intro-keywords"><span class="intro-keywords-label">{{$lbl_keywords}}</span> {{$keywords}}</div>{{/if}}
|
||||
{{if $about}}<div class="intro-about"><span class="intro-about-label">{{$lbl_about}}</span> {{$about}}</div>{{/if}}
|
||||
<div class="intro-knowyou"><span class="intro-knowyou-label">{{$lbl_knowyou}}</span>{{$knowyou}}</div>
|
||||
<div class="intro-note intro-note-{{$contact_id}}">{{$note}}</div>
|
||||
<div class="intro-note intro-note-{{$intro_id}}">{{$note}}</div>
|
||||
</div>
|
||||
|
||||
{{* Additional information of the contact for mobile view *}}
|
||||
|
@ -40,19 +44,21 @@
|
|||
{{if $keywords}}<div class="intro-keywords"><span class="intro-keywords-label">{{$lbl_keywords}}</span>{{$keywords}}</div>{{/if}}
|
||||
{{if $about}}<div class="intro-about"><span class="intro-about-label">{{$lbl_about}}</span>{{$about}}</div>{{/if}}
|
||||
<div class="intro-knowyou"><span class="intro-knowyou-label">{{$lbl_knowyou}}</span>{{$knowyou}}</div>
|
||||
<div class="intro-note intro-note-{{$contact_id}}">{{$note}}</div>
|
||||
<div class="intro-note intro-note-{{$intro_id}}">{{$note}}</div>
|
||||
</div>
|
||||
|
||||
{{* This sections contains special settings for contact approval. We hide it by default and load this section in
|
||||
a bootstrap modal in the case of approval *}}
|
||||
<div id="intro-approve-wrapper-{{$contact_id}}" style="display: none;">
|
||||
<div id="intro-approve-wrapper-{{$intro_id}}" style="display: none;">
|
||||
|
||||
<h3 class="heading">{{$fullname}}{{if $addr}} ({{$addr}}){{/if}}</h3>
|
||||
<form class="intro-approve-form" action="dfrn_confirm" method="post">
|
||||
<form class="intro-approve-form" {{if $request}}action="{{$request}}" method="get"{{else}}action="dfrn_confirm" method="post"{{/if}}>
|
||||
{{include file="field_checkbox.tpl" field=$hidden}}
|
||||
{{if $type != "friend_suggestion"}}
|
||||
<input type="hidden" name="dfrn_id" value="{{$dfrn_id}}" >
|
||||
<input type="hidden" name="intro_id" value="{{$intro_id}}" >
|
||||
<input type="hidden" name="contact_id" value="{{$contact_id}}" >
|
||||
{{/if}}
|
||||
|
||||
{{$dfrn_text}}
|
||||
|
||||
|
@ -71,7 +77,7 @@
|
|||
<button class="btn btn-small btn-default intro-submit-ignore" type="submit" name="submit" value="{{$ignore|escape:'html'}}">{{$ignore|escape:'html'}}</button>
|
||||
{{if $discard}}<button class="btn btn-small btn-default intro-submit-discard" type="submit" name="submit" value="{{$discard|escape:'html'}}">{{$discard|escape:'html'}}</button> {{/if}}
|
||||
</form>
|
||||
<button class="btn btn-small btn-primary intro-submit-approve pull-right" onclick="addElmToModal('#intro-approve-wrapper-{{$contact_id}}')">{{$approve|escape:'html'}}</button>
|
||||
<button class="btn btn-small btn-primary intro-submit-approve pull-right" onclick="addElmToModal('#intro-approve-wrapper-{{$intro_id}}')">{{$approve|escape:'html'}}</button>
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
{{/if}}
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
<script type="text/javascript" src="view/theme/frio/frameworks/jquery-color/jquery.color.js"></script>
|
||||
<script type="text/javascript" src="view/theme/frio/js/mod_notifications.js"></script>
|
||||
|
||||
<div class="generic-page-wrapper">
|
||||
{{include file="section_title.tpl" title=$notif_header}}
|
||||
|
@ -26,13 +28,3 @@
|
|||
{{* The pager *}}
|
||||
{{$notif_paginate}}
|
||||
</div>
|
||||
|
||||
{{* Since only the DIV's inside the notification-list are marked with the class "unseen",
|
||||
we need some js to transfer this class to the parent li list-elements *}}
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
if( $(".notif-item").hasClass("unseen")) {
|
||||
$(".notif-item.unseen").parent("li").addClass("unseen");
|
||||
}
|
||||
});
|
||||
</script>
|
2
view/theme/frio/templates/suggestions.tpl
Normal file
2
view/theme/frio/templates/suggestions.tpl
Normal file
|
@ -0,0 +1,2 @@
|
|||
|
||||
{{include file="intros.tpl"}}
|
Loading…
Add table
Add a link
Reference in a new issue