Skip to content

Commit

Permalink
SAK-41727 Improved styling on ConnectionManger (sakaiproject#6864)
Browse files Browse the repository at this point in the history
Also, improved portal profile popup and tool integrations. Made it
all more consistent.
  • Loading branch information
adrianfish authored Apr 30, 2019
1 parent 9228c1e commit 9d31d91
Show file tree
Hide file tree
Showing 10 changed files with 944 additions and 993 deletions.
2 changes: 1 addition & 1 deletion commons/tool/src/webapp/WEB-INF/templates/comment.hbs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div class="commons-comment-photo" style="background-image:url(/direct/profile/{{creatorId}}/image/thumb)"></div>
<div class="commons-comment-body">
<span id="commons-comment-author-name-{{id}}"><a id="commons-author-name-{{id}}" href="javascript:;" class="commons-comment-author-name">{{creatorDisplayName}}</a></span>
<span id="commons-comment-author-name-{{id}}"><a id="commons-author-name-{{id}}" href="javascript:;" class="commons-comment-author-name profile-popup-trigger" data-user-id="{{creatorId}}">{{creatorDisplayName}}</a></span>
<span id="commons-comment-content-{{id}}" class="commons-comment-content">{{{content}}}</span>
<div id="commons-comment-options-{{id}}" class="commons-comment-options">
{{#if canEdit}}
Expand Down
2 changes: 1 addition & 1 deletion commons/tool/src/webapp/WEB-INF/templates/post.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<div class="commons-photo" style="background-image:url(/direct/profile/{{creatorId}}/image/thumb)"></div>
<div class="commons-post-text-container">
<div class="commons-post-body">
<div class="commons-post-content"><a id="commons-author-name-{{id}}" class="commons-post-author-name" href="javascript:;">{{creatorDisplayName}}</a><span id="commons-post-content-{{id}}">{{{content}}}<span></div>
<div class="commons-post-content"><a id="commons-author-name-{{id}}" class="commons-post-author-name profile-popup-trigger" data-user-id="{{creatorId}}" href="javascript:;">{{creatorDisplayName}}</a><span id="commons-post-content-{{id}}">{{{content}}}<span></div>
<div id="commons-post-options-{{id}}" class="commons-post-options">
{{#if canComment}}
<a href="javascript:;" id="commons-create-comment-link-{{id}}" class="commons-create-comment-link" data-post-id="{{id}}">{{tr 'commons' 'comment'}}</a>
Expand Down
27 changes: 4 additions & 23 deletions commons/tool/src/webapp/js/commons_utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ commons.utils = {

$('#commons-comment-edit-link-' + comment.id).click(commons.utils.editCommentHandler);
$('#commons-comment-delete-link-' + comment.id).click(commons.utils.deleteCommentHandler);
commons.utils.attachProfilePopup(comment.id, comment.creatorId);
profile.attachPopups($("#commons-author-name-" + comment.id));
},
editPostHandler: function (e) {

Expand Down Expand Up @@ -266,27 +266,6 @@ commons.utils = {

return false;
},
attachProfilePopup: function (contentId, userId) {

$('#commons-author-name-' + contentId).qtip({
position: { viewport: $(window), adjust: { method: 'flipinvert none'} },
show: { event: 'click', delay: 0 },
style: { classes: 'commons-qtip qtip-shadow' },
hide: { event: 'click unfocus' },
content: {
text: function (event, api) {

// Need https://jira.sakaiproject.org/browse/SAK-31355 for this to work
return $.ajax( { url: "/direct/portal/" + userId + "/formatted", cache: false })
.then(function (html) {
return html;
}, function (xhr, status, error) {
api.set('content.text', status + ': ' + error);
});
}
}
});
},
formatDate: function (millis) {

if (millis <= 0) {
Expand Down Expand Up @@ -455,7 +434,7 @@ commons.utils = {

$(document).ready(function () {

self.attachProfilePopup(post.id, post.creatorId);
profile.attachPopups($("#commons-author-name-" + post.id));

$('#commons-post-edit-link-' + post.id).click(self.editPostHandler);
$('#commons-post-delete-link-' + post.id).click(self.deletePostHandler);
Expand Down Expand Up @@ -575,6 +554,8 @@ commons.utils = {
// Now render them into their placeholders
posts.forEach(function (p) { commons.utils.renderPost(p, 'commons-post-' + p.id); });

profile.attachPopups($('.profile-popup-trigger'));

loadImage.hide();
try {
if (window.frameElement) {
Expand Down
Loading

0 comments on commit 9d31d91

Please sign in to comment.