Skip to content

Commit

Permalink
add permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
mrothauer committed Apr 25, 2022
1 parent 495dd79 commit e6e081d
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 8 deletions.
23 changes: 19 additions & 4 deletions templates/Knowledges/all.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,20 @@
echo '<div class="knowledge-row '. join(' ', $knowledge->itemSkillClasses) .'">';

echo '<div id="' . $knowledge->uid . '" href="#collapse' . $knowledge->uid . '" class="box-toggle' . $knowledge->uid . ' box-toggle knowledge-item">';

echo $knowledge->title;

if ($appAuth->isAdmin()) {
echo '<a class="knowledge-edit-icon" href="' . $this->Html->urlKnowledgeEdit($knowledge->uid).'">';
echo '<i class="far fa-edit fa-border"></i>';
echo '</a>';
echo $this->Html->link(
'<i class="far fa-edit fa-border"></i>',
$this->Html->urlKnowledgeEdit($knowledge->uid),
[
'class' => 'knowledge-edit-icon',
'escape' => false,
]
);
}

echo '</div>';

echo '<div id="collapse' . $knowledge->uid . '" class="collapse">';
Expand All @@ -58,7 +66,14 @@
}
echo '<div class="sc"></div>';
}

echo $this->Html->link(
'Permalink',
$this->Html->urlKnowledgeDetail($knowledge->uid),
[
'class' => 'knowledge-permalink',
'escape' => false,
]
);
echo '</div>';

echo '</div>';
Expand Down
5 changes: 5 additions & 0 deletions webroot/css/frontend.css
Original file line number Diff line number Diff line change
Expand Up @@ -2671,6 +2671,11 @@ body.knowledges.all .knowledge-edit-icon {
position: absolute;
right: 10px;
}
body.knowledges.all .knowledge-permalink {
position: absolute;
bottom: 10px;
right: 10px;
}
body.knowledges.all .knowledge-edit-icon i {
padding-left: 1px;
padding-right: 4px;
Expand Down
4 changes: 0 additions & 4 deletions webroot/js/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -247,10 +247,6 @@ MappedRepairEvents.Helper = {
$(this).addClass('active');
}
});
var currentHash = $(this).attr('id');
if (window.location.hash != currentHash) {
window.location.hash = currentHash;
}
});

if (window.location.hash) {
Expand Down

0 comments on commit e6e081d

Please sign in to comment.