Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 64 additions & 2 deletions StepsToCare/CareDashboard.ascx
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,37 @@
overflow-y: auto;
}

.popover-content {
.js-person-popover-simple + .popover .popover-content {
text-align: center;
}

.js-person-popover-stepstocare + .popover {
max-width: 100%;
}

.js-person-popover-stepstocare + .popover .popover-content .person-image {
float: left;
width: 70px;
height: 70px;
margin-right: 8px;
background-position: 50%;
background-size: cover;
border: 1px solid #dfe0e1;
}

.js-person-popover-stepstocare + .popover .popover-content .contents {
float: left;
width: calc(100% - 78px);
}

.js-person-popover-stepstocare + .popover .popover-content .email {
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
width: 100%;
display: inline-block;
}

.hasParentNeed {
background-color: #ececec !important;
}
Expand Down Expand Up @@ -195,9 +222,44 @@
});

// person-link-popover
$('.js-person-popover').popover({
$('.js-person-popover-stepstocare').popover({
placement: 'right',
trigger: 'manual',
sanitize: false,
delay: 500,
html: true,
content: function ()
{
var dataUrl = Rock.settings.get( 'baseUrl' ) + 'api/People/GetSearchDetails?id=' + $( this ).attr( 'personid' ) + '';

var result = $.ajax( {
type: 'GET',
url: dataUrl,
dataType: 'text/html',
async: false
} ).responseText;

return result.replace( /^"/i, '' ).replace( /"$/i, '' ).replace( /\\"/ig, '"' ).replace( /<span class=['"]email['"]>(.*)<\/span>/ig, '<a href="/Communication?person=' + $( this ).attr( 'personid' ) + '" class="email">$1</a>' );

}
}).on('mouseenter', function () {
var _this = this;
$(this).popover('show');
$(this).siblings('.popover').on('mouseleave', function () {
$(_this).popover('hide');
});
}).on('mouseleave', function () {
var _this = this;
setTimeout(function () {
if (!$('.popover:hover').length) {
$(_this).popover('hide')
}
}, 100);
} );
$( '.js-person-popover-simple' ).popover( {
placement: 'right',
trigger: 'manual',
sanitize: false,
delay: 500,
html: true,
content: function () {
Expand Down
4 changes: 2 additions & 2 deletions StepsToCare/CareDashboard.ascx.cs
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ private static class ViewStateKey
/// </summary>
private bool _canViewCareWorker = false;

private readonly string _photoFormat = "<div class=\"photo-icon photo-round photo-round-xs pull-left margin-r-sm js-person-popover\" personid=\"{0}\" data-original=\"{1}&w=50\" style=\"background-image: url( '{2}' ); background-size: cover; background-repeat: no-repeat;\"></div>";
private readonly string _photoFormat = "<div class=\"photo-icon photo-round photo-round-xs pull-left margin-r-sm js-person-popover-simple\" personid=\"{0}\" data-original=\"{1}&w=50\" style=\"background-image: url( '{2}' ); background-size: cover; background-repeat: no-repeat;\"></div>";

private List<NoteTypeCache> _careNeedNoteTypes = new List<NoteTypeCache>();

Expand Down Expand Up @@ -1087,7 +1087,7 @@ public void gList_RowDataBound( object sender, System.Web.UI.WebControls.GridVie
}
if ( careNeed.PersonAlias != null )
{
lName.Text = string.Format( "{3} {4} <a href=\"{0}\" class=\"js-person-popover\" personid=\"{5}\">{1}</a> {2}", ResolveUrl( string.Format( "~/Person/{0}", careNeed.PersonAlias.PersonId ) ), careNeed.PersonAlias.Person.FullName ?? string.Empty, careNeedFlagStr, childNeedStr, parentNeedStr, careNeed.PersonAlias.PersonId );
lName.Text = string.Format( "{3} {4} <a href=\"{0}\" class=\"js-person-popover-stepstocare\" personid=\"{5}\">{1}</a> {2}", ResolveUrl( string.Format( "~/Person/{0}", careNeed.PersonAlias.PersonId ) ), careNeed.PersonAlias.Person.FullName ?? string.Empty, careNeedFlagStr, childNeedStr, parentNeedStr, careNeed.PersonAlias.PersonId );
}
}

Expand Down