소스 검색

[style] cleanup tags

version-14
Rushabh Mehta 8 년 전
부모
커밋
3af5d51a41
8개의 변경된 파일32개의 추가작업 그리고 85개의 파일을 삭제
  1. +0
    -25
      frappe/core/page/desktop/desktop.js
  2. +6
    -4
      frappe/public/css/list.css
  3. +0
    -13
      frappe/public/css/sidebar.css
  4. +10
    -18
      frappe/public/js/frappe/list/list_sidebar.js
  5. +8
    -5
      frappe/public/js/frappe/list/list_sidebar_stat.html
  6. +2
    -1
      frappe/public/js/frappe/ui/tags.js
  7. +6
    -4
      frappe/public/less/list.less
  8. +0
    -15
      frappe/public/less/sidebar.less

+ 0
- 25
frappe/core/page/desktop/desktop.js 파일 보기

@@ -50,7 +50,6 @@ $.extend(frappe.desktop, {
desktop_items: all_icons,
}));

frappe.desktop.setup_help_messages();
frappe.desktop.setup_module_click();

// notifications
@@ -63,30 +62,6 @@ $.extend(frappe.desktop, {

},

setup_help_messages: function() {
// {
// title: 'Sign up for a Premium Plan',
// description: 'Sign up for a premium plan and add users, get more disk space and priority support',
// action: 'Select Plan',
// route: 'usage-info'
// }

// TEMP: test activiation without this message.
return;

// if(!frappe.user.has_role('System Manager')) {
// return;
// }

// frappe.call({
// method: 'frappe.core.page.desktop.desktop.get_help_messages',
// callback: function(r) {
// frappe.desktop.render_help_messages(r.message);
// }
// });

},

render_help_messages: function(help_messages) {
var wrapper = frappe.desktop.wrapper.find('.help-message-wrapper');
var $help_messages = wrapper.find('.help-messages');


+ 6
- 4
frappe/public/css/list.css 파일 보기

@@ -215,17 +215,19 @@
text-align: left;
}
.tag-row {
margin-top: 5px;
padding-left: 55px;
margin-bottom: 0px;
margin-top: -5px;
}
.taggle_placeholder {
top: 0;
left: 0;
left: 5px;
font-size: 11px;
color: #8D99A6;
}
.taggle_list {
padding-left: 0;
margin-bottom: 0;
padding-left: 5px;
margin-bottom: 3px;
}
.taggle_list .taggle {
font-size: 11px;


+ 0
- 13
frappe/public/css/sidebar.css 파일 보기

@@ -293,19 +293,6 @@ body[data-route^="Module"] .main-menu .form-sidebar {
.sidebar-left .list-sidebar .stat-label {
margin-bottom: -10px;
}
.list-sidebar .list-tag-preview {
padding: 5px !important;
margin-left: 5px;
display: inline !important;
}
.list-sidebar .list-tag-preview:hover,
a.close:hover,
.list-sidebar .list-tag-preview:active,
a.close:active,
.list-sidebar .list-tag-preview:focus,
a.close:focus {
border-color: transparent !important;
}
.layout-side-section .module-sidebar-nav {
margin-top: 15px;
}


+ 10
- 18
frappe/public/js/frappe/list/list_sidebar.js 파일 보기

@@ -195,7 +195,7 @@ frappe.views.ListSidebar = Class.extend({

var custom_column = values.custom_column !== undefined ?
values.custom_column : 1;
if(custom_column) {
var field_name = 'kanban_column';
} else {
@@ -350,43 +350,35 @@ frappe.views.ListSidebar = Class.extend({
var stats = []
var label = frappe.meta.docfield_map[this.doctype][field] ?
frappe.meta.docfield_map[this.doctype][field].label : field;
var show_tags = '<a class="list-tag-preview hidden-xs" title="' + __("Show tags")
+ '"><i class="octicon octicon-pencil"></i></a>';

stat = (stat || []).sort(function(a, b) { return b[1] - a[1] });
$.each(stat, function(i,v) { sum = sum + v[1]; })

if(tags)
{
if(tags) {
for (var t in tags) {
var nfound = -1;
for (var i in stat) {
if (tags[t] ===stat[i][0]) {
stats.push(stat[i]);
nfound = i;
break
break;
}
}
if (nfound<0)
{
stats.push([tags[t],0])
}
else
{
if (nfound<0) {
stats.push([tags[t],0]);
} else {
me.tempstats["_user_tags"].splice(nfound,1);
}
}
field = "_user_tags"
}
else
{
stats = stat
field = "_user_tags";
} else {
stats = stat;
}
var context = {
field: field,
stat: stats,
sum: sum,
label: field==='_user_tags' ? tags ? __(label)+ show_tags:(__("UnCategorised Tags") + show_tags): __(label),
label: field==='_user_tags' ? (tags ? __(label) : __("Tags")) : __(label),
};
var sidebar_stat = $(frappe.render_template("list_sidebar_stat", context))
.on("click", ".stat-link", function() {


+ 8
- 5
frappe/public/js/frappe/list/list_sidebar_stat.html 파일 보기

@@ -1,19 +1,22 @@
<ul class="list-unstyled sidebar-menu sidebar-stat">
<li class="divider"></li>
<li class="h6 stat-label">{%= label %}</li>
<li class="h6 stat-label">{{ label }}</li>
{% if(!stat.length) { %}
<li class="stat-no-records text-muted">{%= __("No records tagged.") %}</li>
<li class="stat-no-records text-muted">{{ __("No records tagged.") }}</li>
{% } else {
for (var i=0, l=stat.length; i < l; i++) {
var stat_label = stat[i][0];
var stat_count = stat[i][1];
%}
<li>
<a class="stat-link badge-hover" data-label="{%= stat_label %}" data-field="{%= field %}">
<span class="badge">{%= stat_count %}</span>
<span>{%= __(stat_label) %}</span>
<a class="stat-link badge-hover" data-label="{{ stat_label %}" data-field="{{ field %}">
<span class="badge">{{ stat_count }}</span>
<span>{{ __(stat_label) }}</span>
</a>
</li>
{% }
} %}
</ul>
<div style="margin-top: -10px;">
<a class="list-tag-preview hidden-xs text-muted">{{ __("Show tags") }}</a>
</div>

+ 2
- 1
frappe/public/js/frappe/ui/tags.js 파일 보기

@@ -77,7 +77,8 @@ frappe.ui.TagEditor = Class.extend({
args:{
doctype: me.frm.doctype,
txt: value.toLowerCase(),
cat_tags:JSON.stringify(me.list_sidebar.get_cat_tags())
cat_tags: me.list_sidebar ?
JSON.stringify(me.list_sidebar.get_cat_tags()) : '[]'
},
callback: function(r) {
me.awesomplete.list = r.message;


+ 6
- 4
frappe/public/less/list.less 파일 보기

@@ -273,19 +273,21 @@
// tags

.tag-row {
margin-top: 5px;
padding-left: 55px;
margin-bottom: 0px;
margin-top: -5px;
}

.taggle_placeholder {
top: 0;
left: 0;
left: 5px;
font-size: 11px;
color: @text-muted;
}

.taggle_list {
padding-left: 0;
margin-bottom: 0;
padding-left: 5px;
margin-bottom: 3px;

.taggle {
font-size: 11px;


+ 0
- 15
frappe/public/less/sidebar.less 파일 보기

@@ -378,21 +378,6 @@ body[data-route^="Module"] .main-menu {
}
}

.list-sidebar .list-tag-preview {
padding: 5px !important;
margin-left: 5px;
display: inline !important;
}

.list-sidebar .list-tag-preview&,
a.close {
&:hover,
&:active,
&:focus {
border-color: transparent !important;
}
}

// module sidebar
.layout-side-section .module-sidebar-nav {
margin-top: 15px;


불러오는 중...
취소
저장