Merge branch 'rebrand-ui' of https://github.com/frappe/frappe into rebrand-ui
This commit is contained in:
commit
f3eb9fda70
5 changed files with 64 additions and 19 deletions
|
|
@ -657,4 +657,7 @@
|
|||
<path fill-rule="evenodd" clip-rule="evenodd" d="M19 0a1 1 0 011 1v10a3 3 0 003 3h12a2 2 0 012 2v26a4 4 0 01-4 4H4a4 4 0 01-4-4V3a3 3 0 013-3h16zM8 37a1 1 0 100 2h21a1 1 0 100-2H8zm-1-7a1 1 0 011-1h21a1 1 0 110 2H8a1 1 0 01-1-1zm1-9a1 1 0 100 2h6a1 1 0 100-2H8z"></path>
|
||||
</g>
|
||||
</symbol>
|
||||
<svg viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" id="icon-comment">
|
||||
<path d="M14.2222 7.17042C14.2222 4.19205 11.4363 1.77783 7.99999 1.77783C4.56367 1.77783 1.77777 4.19205 1.77777 7.17042C1.77777 10.1488 4.56367 12.563 7.99999 12.563C8.43555 12.563 8.86032 12.5232 9.27099 12.4494L12.563 14.2223V10.8283C13.59 9.86672 14.2222 8.58411 14.2222 7.17042Z" stroke="#74808B" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</svg>
|
||||
</svg>
|
||||
|
|
|
|||
|
Before Width: | Height: | Size: 81 KiB After Width: | Height: | Size: 81 KiB |
|
|
@ -139,8 +139,11 @@ frappe.ui.form.Sidebar = class {
|
|||
return;
|
||||
}
|
||||
|
||||
let tags_parent = this.sidebar.find(".form-tags")
|
||||
|
||||
this.frm.tags = new frappe.ui.TagEditor({
|
||||
parent: this.sidebar.find(".form-tags"),
|
||||
parent: tags_parent,
|
||||
add_button: tags_parent.find(".add-tags-btn"),
|
||||
frm: this.frm,
|
||||
on_change: function(user_tags) {
|
||||
this.frm.tags && this.frm.tags.refresh(user_tags);
|
||||
|
|
|
|||
|
|
@ -133,7 +133,30 @@
|
|||
<ul class="list-unstyled sidebar-menu">
|
||||
<a><li class="auto-repeat-status"><li></a>
|
||||
</ul>
|
||||
<ul class="list-unstyled sidebar-menu">
|
||||
<ul class="list-unstyled sidebar-menu form-sidebar-stats">
|
||||
<li class="flex">
|
||||
<div class="form-stats">
|
||||
<span class="liked-by like-action">
|
||||
<svg class="icon icon-sm">
|
||||
<use href="#icon-heart" class="like-icon"></use>
|
||||
</svg>
|
||||
<span class="like-count">65</span>
|
||||
</span>
|
||||
<span class="mx-1">·</span>
|
||||
<span class="comments">
|
||||
<svg class="icon icon-sm">
|
||||
<use href="#icon-comment" class="like-icon"></use>
|
||||
</svg>
|
||||
<span class="comments-count">32</span>
|
||||
</span>
|
||||
</div>
|
||||
<div class="form-follow text-sm">
|
||||
Follow
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
<hr>
|
||||
<!-- <ul class="list-unstyled sidebar-menu">
|
||||
<li class="liked-by-parent">
|
||||
<span class="liked-by like-action">
|
||||
<svg class="icon icon-sm">
|
||||
|
|
@ -142,7 +165,7 @@
|
|||
<span class="likes-count"></span>
|
||||
</span>
|
||||
</li>
|
||||
</ul>
|
||||
</ul> -->
|
||||
<ul class="list-unstyled sidebar-menu text-muted">
|
||||
<li class="pageview-count"></li>
|
||||
<li class="modified-by"></li>
|
||||
|
|
|
|||
|
|
@ -5,39 +5,44 @@ frappe.provide("frappe.help");
|
|||
|
||||
frappe.help.youtube_id = {};
|
||||
|
||||
frappe.help.has_help = function(doctype) {
|
||||
frappe.help.has_help = function (doctype) {
|
||||
return frappe.help.youtube_id[doctype];
|
||||
}
|
||||
|
||||
frappe.help.show = function(doctype) {
|
||||
if(frappe.help.youtube_id[doctype]) {
|
||||
frappe.help.show = function (doctype) {
|
||||
if (frappe.help.youtube_id[doctype]) {
|
||||
frappe.help.show_video(frappe.help.youtube_id[doctype]);
|
||||
}
|
||||
}
|
||||
|
||||
frappe.help.show_video = function(youtube_id, title) {
|
||||
frappe.help.show_video = function (youtube_id, title) {
|
||||
if (frappe.utils.is_url(youtube_id)) {
|
||||
const expression = '(?:youtube.com/(?:[^/]+/.+/|(?:v|e(?:mbed)?)/|.*[?&]v=)|youtu.be/)([^"&?\\s]{11})';
|
||||
youtube_id = youtube_id.match(expression)[1];
|
||||
}
|
||||
|
||||
if($("body").width() > 768) {
|
||||
var size = [670, 377];
|
||||
} else {
|
||||
var size = [560, 315];
|
||||
}
|
||||
var dialog = frappe.msgprint({
|
||||
message: `<iframe width="${size[0]}" height="${size[1]}"
|
||||
src="https://www.youtube.com/embed/${youtube_id}"
|
||||
frameborder="0" allowfullscreen></iframe>` + (frappe.help_feedback_link || ""),
|
||||
// (frappe.help_feedback_link || "")
|
||||
let dialog = new frappe.ui.Dialog({
|
||||
title: title || __("Help"),
|
||||
wide: true
|
||||
});
|
||||
|
||||
let video = $(`<div class="video-player" data-plyr-provider="youtube" data-plyr-embed-id="${youtube_id}"></div>`);
|
||||
video.appendTo(dialog.body);
|
||||
|
||||
dialog.show();
|
||||
dialog.$wrapper.addClass("video-modal");
|
||||
|
||||
let plyr = new frappe.Plyr(video[0], {
|
||||
hideControls: true,
|
||||
resetOnEnd: true,
|
||||
});
|
||||
|
||||
dialog.onhide = () => {
|
||||
plyr.destroy();
|
||||
};
|
||||
}
|
||||
|
||||
$("body").on("click", "a.help-link", function() {
|
||||
$("body").on("click", "a.help-link", function () {
|
||||
var doctype = $(this).attr("data-doctype");
|
||||
doctype && frappe.help.show(doctype);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -118,6 +118,17 @@ body[data-route^="Module"] .main-menu {
|
|||
margin-left: -4px;
|
||||
}
|
||||
|
||||
.form-sidebar-stats {
|
||||
li:first-child {
|
||||
@include flex(flex, space-between, center, null);
|
||||
|
||||
.form-follow {
|
||||
text-transform: uppercase;
|
||||
font-size: var(--text-xs, 11px);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.sidebar-image-section {
|
||||
cursor: pointer;
|
||||
|
||||
|
|
@ -420,7 +431,7 @@ button.data-pill {
|
|||
color: var(--text-color);
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
max-width: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.add-attachment-btn,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue