css cleanups to form footer and time selector fixes
This commit is contained in:
parent
471c28a3d7
commit
fabc142ab9
13 changed files with 63 additions and 48 deletions
|
|
@ -1,11 +1,11 @@
|
|||
frappe.listview_settings['ToDo'] = {
|
||||
onload: function(me) {
|
||||
$(frappe.container.page)
|
||||
.find(".layout-main-section")
|
||||
.css({
|
||||
"background-color":"cornsilk",
|
||||
"min-height": "400px"
|
||||
})
|
||||
// $(frappe.container.page)
|
||||
// .find(".layout-main-section")
|
||||
// .css({
|
||||
// "background-color":"cornsilk",
|
||||
// "min-height": "400px"
|
||||
// })
|
||||
if(user_roles.indexOf("System Manager")!==-1) {
|
||||
frappe.route_options = {
|
||||
"owner": user
|
||||
|
|
|
|||
|
|
@ -5,16 +5,23 @@
|
|||
padding-bottom: 15px;
|
||||
}
|
||||
|
||||
.appframe-wrapper {
|
||||
background-color: #fff;
|
||||
min-height: 400px;
|
||||
box-shadow: 1px 0px 1px rgba(0,0,0,0.4);
|
||||
}
|
||||
|
||||
.appframe-titlebar {
|
||||
border-bottom: 1px solid #ddd;
|
||||
}
|
||||
|
||||
.appframe-footer {
|
||||
border-top: 1px solid #ddd;
|
||||
background-color: rgba(255,255,255,0.9);
|
||||
}
|
||||
|
||||
.appframe-titlebar, .appframe-footer {
|
||||
background-color: #e8e8e8;
|
||||
.appframe-titlebar, .appframe-iconbar {
|
||||
background-color: rgba(255,255,255,0.7);
|
||||
/*background: url(/assets/frappe/images/ui/sos.png) repeat;*/
|
||||
/*-webkit-box-shadow: inset 0 0 7px rgba(0, 0, 0, .07);
|
||||
box-shadow: inset 0 0 7px rgba(0, 0, 0, .07);*/
|
||||
|
|
@ -171,7 +178,7 @@ h2.titlebar-left-item {
|
|||
|
||||
|
||||
.appframe-footer {
|
||||
margin-top: 15px;
|
||||
padding-top: 15px;
|
||||
}
|
||||
|
||||
.workflow-button-area {
|
||||
|
|
|
|||
|
|
@ -293,12 +293,16 @@ ul.linked-with-list li {
|
|||
/* form footer */
|
||||
|
||||
.form-footer {
|
||||
padding-top: 15px;
|
||||
padding-bottom: 15px;
|
||||
color: #888;
|
||||
padding-bottom: 30px;
|
||||
/*box-shadow: 0px -1px 6px rgba(0,0,0,0.3);*/
|
||||
}
|
||||
|
||||
.form-footer h5 {
|
||||
margin: 15px 0px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
|
||||
.like-disabled-input {
|
||||
background-color: #f8f8f8;
|
||||
padding: 6px;
|
||||
|
|
|
|||
|
|
@ -41,18 +41,22 @@ frappe.ui.form.AssignTo = Class.extend({
|
|||
|
||||
if(d && d.length) {
|
||||
for(var i=0; i<d.length; i++) {
|
||||
var info = frappe.user_info(d[i]);
|
||||
var info = frappe.user_info(d[i].name);
|
||||
info.owner = d[i];
|
||||
info.avatar = frappe.avatar(d[i]);
|
||||
info.image = frappe.user_info(d[i].name).image;
|
||||
info.description = d[i].description || "";
|
||||
|
||||
$(repl('<div class="alert alert-success" style="margin-bottom: 7px;">\
|
||||
%(avatar)s %(fullname)s \
|
||||
<a class="close" href="#" style="top: 1px;"\
|
||||
data-owner="%(owner)s">×</a></div>', info))
|
||||
$(repl('<div class="media">\
|
||||
<span class="pull-left avatar avatar-small">\
|
||||
<img src="%(image)s" class="media-object"></span>\
|
||||
<div class="media-body">\
|
||||
%(fullname)s \
|
||||
<a class="close" href="#" style="top: 1px;"\
|
||||
data-owner="%(owner)s">×</a>\
|
||||
<div class="text-muted small">%(description)s</div>\
|
||||
</div>\
|
||||
</div>', info))
|
||||
.appendTo(this.$list);
|
||||
|
||||
this.$list.find(".avatar").css("margin-top", "-7px")
|
||||
this.$list.find('.avatar img').centerImage();
|
||||
}
|
||||
|
||||
// set remove
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ frappe.ui.form.Attachments = Class.extend({
|
|||
}
|
||||
|
||||
var me = this;
|
||||
var $attach = $(repl('<div class="alert alert-info" style="margin-bottom: 7px">\
|
||||
var $attach = $(repl('<div style="margin-bottom: 7px">\
|
||||
<span style="display: inline-block; width: 90%; \
|
||||
text-overflow: ellipsis; white-space: nowrap; overflow: hidden;">\
|
||||
<i class="icon-file"></i> <a href="%(file_url)s"\
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ frappe.ui.form.Comments = Class.extend({
|
|||
this.wrapper =this.parent;
|
||||
this.row = $("<div class='row'>").appendTo(this.parent);
|
||||
this.input = $('<div class="col-md-10" style="margin-top: 5px;">\
|
||||
<textarea rows="3" class="form-control"></textarea></div>')
|
||||
<textarea style="height: 80px" class="form-control"></textarea></div>')
|
||||
.appendTo(this.row)
|
||||
.find("textarea");
|
||||
this.button = $('<div class="col-md-1">\
|
||||
|
|
@ -47,17 +47,16 @@ frappe.ui.form.Comments = Class.extend({
|
|||
c.image = frappe.user_info(c.comment_by).image;
|
||||
c.comment_on = dateutil.comment_when(c.creation);
|
||||
c.fullname = frappe.user_info(c.comment_by).fullname;
|
||||
c.comment = frappe.markdown(c.comment);
|
||||
|
||||
$(repl('<div class="comment alert alert-warning col-md-10" data-name="%(name)s">\
|
||||
<div class="row">\
|
||||
<div class="col-xs-1">\
|
||||
<span class="avatar avatar-small"><img src="%(image)s"></span>\
|
||||
</div>\
|
||||
<div class="col-xs-11">%(delete)s\
|
||||
$(repl('<div class="media col-md-10" data-name="%(name)s">\
|
||||
<span class="pull-left avatar avatar-small">\
|
||||
<img class="media-object" src="%(image)s">\
|
||||
</span>\
|
||||
<div class="media-body">%(delete)s\
|
||||
<div>%(comment)s</div>\
|
||||
<span class="small text-muted">%(fullname)s / %(comment_on)s</span>\
|
||||
</div>\
|
||||
</div>\
|
||||
</div>', c))
|
||||
.appendTo(me.list)
|
||||
.on("click", ".close", function() {
|
||||
|
|
|
|||
|
|
@ -434,14 +434,14 @@ frappe.ui.form.ControlTime = frappe.ui.form.ControlData.extend({
|
|||
import_timepicker();
|
||||
this._super();
|
||||
this.$input.timepicker({
|
||||
timeFormat: 'hh:mm:ss',
|
||||
timeFormat: 'HH:mm:ss',
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
frappe.ui.form.ControlDatetime = frappe.ui.form.ControlDate.extend({
|
||||
set_datepicker: function() {
|
||||
this.datepicker_options.timeFormat = "hh:mm:ss";
|
||||
this.datepicker_options.timeFormat = "HH:mm:ss";
|
||||
this.datepicker_options.dateFormat =
|
||||
(frappe.boot.sysdefaults.date_format || 'yy-mm-dd').replace('yyyy','yy');
|
||||
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ frappe.ui.form.Footer = Class.extend({
|
|||
var me = this;
|
||||
this.wrapper = $('<div class="form-footer container">\
|
||||
<!--i class="icon-cut" style="margin-top: -23px; margin-bottom: 23px; \
|
||||
display: block; margin-left: 15px; color: #888;"></i-->\
|
||||
display: block; margin-left: 15px;"></i-->\
|
||||
<div>\
|
||||
<div class="help-area"></div>\
|
||||
</div>\
|
||||
|
|
@ -33,14 +33,14 @@ frappe.ui.form.Footer = Class.extend({
|
|||
<div class="form-tags">\
|
||||
<h5 style="display: inline-block"><i class="icon-tag"></i> '+__("Tags")+'</h5>\
|
||||
<span class="tag-area"></span><br>\
|
||||
</div><hr>\
|
||||
</div><br><br>\
|
||||
<div class="form-assignments" style="margin-bottom: 7px;">\
|
||||
<h5>\
|
||||
<i class="icon-flag"></i> '+__("Assigned To")+': \
|
||||
<button class="btn small btn-default pull-right"\
|
||||
style="margin-top:-7px;">'+__("Add")+'</button>\
|
||||
</h5>\
|
||||
</div><hr>\
|
||||
</div><br><br>\
|
||||
<div class="form-attachments">\
|
||||
<h5>\
|
||||
<i class="icon-paper-clip"></i> '+__("Attachments")+':\
|
||||
|
|
|
|||
|
|
@ -25,10 +25,12 @@ frappe.avatar = function(user, large, title) {
|
|||
}
|
||||
|
||||
frappe.ui.set_user_background = function(src, selector) {
|
||||
if(!selector) selector = "#page-desktop";
|
||||
if(!selector) selector = "body";
|
||||
if(!src) src = "assets/frappe/images/ui/random-polygons.jpg";
|
||||
frappe.dom.set_style(repl('%(selector)s { \
|
||||
background: url("%(src)s") center center; \
|
||||
background: url("%(src)s") center center;\
|
||||
background-attachment: fixed; \
|
||||
background-size: 100%; \
|
||||
}', {src:src, selector:selector}))
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -345,10 +345,12 @@ frappe.ui.make_app_page = function(opts) {
|
|||
<div class="container">\
|
||||
</div>\
|
||||
</div>\
|
||||
<div class="appframe container">\
|
||||
<div class="appframe-timestamp hide"></div>\
|
||||
<div class="workflow-button-area btn-group pull-right hide"></div>\
|
||||
<div class="clearfix"></div>\
|
||||
<div class="appframe-wrapper">\
|
||||
<div class="appframe container">\
|
||||
<div class="appframe-timestamp hide"></div>\
|
||||
<div class="workflow-button-area btn-group pull-right hide"></div>\
|
||||
<div class="clearfix"></div>\
|
||||
</div>\
|
||||
</div>\
|
||||
<div class="appframe-footer hide"></div>').appendTo($wrapper);
|
||||
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@ frappe.ui.Dialog = frappe.ui.FieldGroup.extend({
|
|||
init: function(opts) {
|
||||
this.display = false;
|
||||
this.is_dialog = true;
|
||||
if(!opts.width) opts.width = "600px";
|
||||
|
||||
$.extend(this, opts);
|
||||
this._super();
|
||||
|
|
@ -19,7 +18,6 @@ frappe.ui.Dialog = frappe.ui.FieldGroup.extend({
|
|||
make: function() {
|
||||
this.$wrapper = frappe.get_modal("", "");
|
||||
this.wrapper = this.$wrapper.find('.modal-dialog')
|
||||
.css("width", this.width)
|
||||
.get(0);
|
||||
this.make_head();
|
||||
this.body = this.$wrapper.find(".modal-body").get(0);
|
||||
|
|
|
|||
|
|
@ -16,9 +16,9 @@ def get(args=None):
|
|||
|
||||
get_docinfo(args.get("doctype"), args.get("name"))
|
||||
|
||||
return frappe.db.sql_list("""select owner from `tabToDo`
|
||||
return frappe.db.sql("""select owner, description from `tabToDo`
|
||||
where reference_type=%(doctype)s and reference_name=%(name)s and status="Open"
|
||||
order by modified desc limit 5""", args)
|
||||
order by modified desc limit 5""", args, as_dict=True)
|
||||
|
||||
@frappe.whitelist()
|
||||
def add(args=None):
|
||||
|
|
@ -135,5 +135,4 @@ def notify_assignment(assigned_by, owner, doc_type, doc_name, action='CLOSE',
|
|||
|
||||
arg["parenttype"] = "Assignment"
|
||||
from frappe.core.page.messages import messages
|
||||
import json
|
||||
messages.post(**arg)
|
||||
|
|
|
|||
|
|
@ -110,12 +110,12 @@ def add_comments(dt, dn, limit=20):
|
|||
return cl
|
||||
|
||||
def add_assignments(dt, dn):
|
||||
cl = frappe.db.sql_list("""select owner from `tabToDo`
|
||||
cl = frappe.db.sql("""select owner, description from `tabToDo`
|
||||
where reference_type=%(doctype)s and reference_name=%(name)s and status="Open"
|
||||
order by modified desc limit 5""", {
|
||||
"doctype": dt,
|
||||
"name": dn
|
||||
})
|
||||
}, as_dict=True)
|
||||
|
||||
return cl
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue