diff --git a/core/doctype/control_panel/control_panel.py b/core/doctype/control_panel/control_panel.py index d0c843ab70..ceafbc2014 100644 --- a/core/doctype/control_panel/control_panel.py +++ b/core/doctype/control_panel/control_panel.py @@ -13,18 +13,4 @@ class DocType: def on_update(self): # clear cache on save - webnotes.clear_cache() - - def upload_many(self,form): - pass - - def upload_callback(self,form): - pass - - def execute_test(self, arg=''): - if webnotes.user.name=='Guest': - raise Exception, 'Guest cannot call execute test!' - out = '' - exec(arg and arg or self.doc.test_code) - webnotes.msgprint('that worked!') - return out + webnotes.clear_cache() \ No newline at end of file diff --git a/core/doctype/custom_script/custom_script.py b/core/doctype/custom_script/custom_script.py index 581e624557..4f520bc9a7 100644 --- a/core/doctype/custom_script/custom_script.py +++ b/core/doctype/custom_script/custom_script.py @@ -17,9 +17,11 @@ class DocType: def on_update(self): webnotes.clear_cache(doctype=self.doc.dt) + webnotes.cache().delete_value("_server_script:" + self.doc.dt) def on_trash(self): webnotes.clear_cache(doctype=self.doc.dt) + webnotes.cache().delete_value("_server_script:" + self.doc.dt) def get_custom_server_script(doctype): custom_script = webnotes.cache().get_value("_server_script:" + doctype) diff --git a/core/doctype/doctype/doctype.py b/core/doctype/doctype/doctype.py index 9c5c642375..0cd919aa4f 100644 --- a/core/doctype/doctype/doctype.py +++ b/core/doctype/doctype/doctype.py @@ -228,8 +228,8 @@ def validate_permissions(permissions, for_remove=False): doctype = permissions and permissions[0].parent issingle = issubmittable = False if doctype: - issingle = webnotes.conn.get_value("DocType", doctype, "issingle") - issubmittable = webnotes.conn.get_value("DocType", doctype, "is_submittable") + issingle = cint(webnotes.conn.get_value("DocType", doctype, "issingle")) + issubmittable = cint(webnotes.conn.get_value("DocType", doctype, "is_submittable")) def get_txt(d): return "For %s (level %s) in %s row %s:" % (d.role, d.permlevel, d.parent, d.idx) @@ -279,6 +279,9 @@ def validate_permissions(permissions, for_remove=False): if d.submit and not issubmittable: webnotes.msgprint(doctype + " is not Submittable, cannot assign submit rights.", raise_exception=True) + elif d.amend and not issubmittable: + webnotes.msgprint(doctype + " is not Submittable, cannot assign amend rights.", + raise_exception=True) for d in permissions: if not d.permlevel: diff --git a/core/doctype/event/event.py b/core/doctype/event/event.py index 0d20dc5c87..fc87ce2b05 100644 --- a/core/doctype/event/event.py +++ b/core/doctype/event/event.py @@ -80,7 +80,8 @@ def get_events(start, end, user=None, for_reminder=False): def add_event(e, date): new_event = e.copy() new_event.starts_on = date + " " + e.starts_on.split(" ")[1] - new_event.ends_on = date + " " + e.ends_on.split(" ")[1] + if e.ends_on: + new_event.ends_on = date + " " + e.ends_on.split(" ")[1] add_events.append(new_event) for e in events: @@ -151,4 +152,4 @@ def get_events(start, end, user=None, for_reminder=False): for w in weekdays: del e[w] - return events \ No newline at end of file + return events diff --git a/core/page/messages/messages.js b/core/page/messages/messages.js index e8e49f91aa..3d6cc6c93e 100644 --- a/core/page/messages/messages.js +++ b/core/page/messages/messages.js @@ -27,7 +27,7 @@ wn.pages.messages.onload = function(wrapper) {

Everyone

\
\
\ - \ + \

\
\
').appendTo($(wrapper).find('.layout-main-section')); @@ -198,8 +198,8 @@ erpnext.Messages = Class.extend({ p.status = p.has_session ? "Online" : "Offline"; $(repl('

\ \ + title="%(status)s">\ %(fullname)s\

', p)) .appendTo($body); diff --git a/core/page/permission_manager/permission_manager.js b/core/page/permission_manager/permission_manager.js index ac601133e4..07479176e4 100644 --- a/core/page/permission_manager/permission_manager.js +++ b/core/page/permission_manager/permission_manager.js @@ -93,14 +93,12 @@ wn.PermissionEngine = Class.extend({ me.doctype_select = me.wrapper.appframe.add_select("doctypes", [wn._("Select Document Type")+"..."].concat(r.message.doctypes)) - .css("width", "200px") .change(function() { wn.set_route("permission-manager", $(this).val()) }); me.role_select = me.wrapper.appframe.add_select("roles", [wn._("Select Role")+"..."].concat(r.message.roles)) - .css("width", "200px") .change(function() { me.refresh(); }); diff --git a/public/css/common.css b/public/css/common.css index fc4d5c3e8e..9278654283 100644 --- a/public/css/common.css +++ b/public/css/common.css @@ -72,7 +72,6 @@ div#freeze { .alert-badge { padding-right: 15px; - margin-bottom: 0px; } .alert-badge a, .alert-badge a:hover { @@ -329,24 +328,27 @@ div#freeze { .avatar { display: inline-block; vertical-align: middle; + border-radius: 50%; overflow: hidden; + background-color: #ddd; + border: 1px solid #eee; } .avatar img { - background-color: #ddd; - border: 1px solid #eee; - border-radius: 50%; - width: 100%; + width: 100%; + height: auto; } .avatar-small { margin-right: 5px; width: 30px; + height: 30px; } .avatar-large { margin-right: 10px; width: 72px; + height: 30px; } /* slickgrid */ @@ -375,8 +377,11 @@ div#freeze { .missing-image { background-color: #eee; - padding: 40px; - width: 112px; + display: table-cell; + vertical-align: middle; + text-align: center; + width: 140px; + height: 140px; font-size: 32px; color: #888; } @@ -446,14 +451,17 @@ textarea[data-fieldtype="Small Text"] { display: inline; } -.hidden-sm-inline { +.hidden-xs-inline, .hidden-xs-inline-block { display: none; } @media (min-width: 768px) { - .hidden-sm-inline { + .hidden-xs-inline { display: inline; } + .hidden-xs-inline-block { + display: inline-block; + } } .modal-backdrop { @@ -527,5 +535,4 @@ fieldset[disabled] .btn-default.active { .form-group { margin-bottom: 7px; -} - +} \ No newline at end of file diff --git a/public/html/web.py b/public/html/web.py index 5b28424905..2a5a13bdd5 100755 --- a/public/html/web.py +++ b/public/html/web.py @@ -28,7 +28,7 @@ session_stopped = """
- Upgrading... + %(app_name)s Upgrading...

We will be back in a few moments.

@@ -41,12 +41,21 @@ def init(): def respond(): import webnotes import webnotes.webutils + import MySQLdb + try: return webnotes.webutils.render(webnotes.form_dict.get('page')) except webnotes.SessionStopped: print "Content-type: text/html" print print session_stopped + except MySQLdb.ProgrammingError, e: + if e.args[0]==1146: + print "Content-type: text/html" + print + print session_stopped % {"app_name": webnotes.get_config().app_name} + else: + raise e if __name__=="__main__": init() diff --git a/public/js/legacy/form.js b/public/js/legacy/form.js index 14589883c4..09bb860aea 100644 --- a/public/js/legacy/form.js +++ b/public/js/legacy/form.js @@ -101,7 +101,7 @@ _f.Frm.prototype.setup = function() { }); this.frm_head = this.toolbar; - // create area for print fomrat + // create area for print format this.setup_print_layout(); // 2 column layout @@ -278,7 +278,7 @@ _f.Frm.prototype.set_footnote = function(txt) { _f.Frm.prototype.add_custom_button = function(label, fn, icon) { - this.appframe.add_button(label, fn, icon || "icon-arrow-right"); + return this.appframe.add_button(label, fn, icon || "icon-arrow-right"); } _f.Frm.prototype.clear_custom_buttons = function() { this.toolbar.refresh() diff --git a/public/js/legacy/print_format.js b/public/js/legacy/print_format.js index a7521117b1..0bb902b12c 100644 --- a/public/js/legacy/print_format.js +++ b/public/js/legacy/print_format.js @@ -63,7 +63,7 @@ $.extend(_p, { \

'}, ] - }) + }); dialog.$wrapper.find(".btn-print").click(function() { var args = dialog.get_values(); @@ -85,7 +85,7 @@ $.extend(_p, { dialog.onshow = function() { var $print = dialog.fields_dict.print_format.$input; - $print.add_options(cur_frm.print_formats); + $print.empty().add_options(cur_frm.print_formats); if(cur_frm.$print_view_select && cur_frm.$print_view_select.val()) $print.val(cur_frm.$print_view_select.val()); diff --git a/public/js/lib/markdown.js b/public/js/lib/markdown.js new file mode 100644 index 0000000000..65ee602359 --- /dev/null +++ b/public/js/lib/markdown.js @@ -0,0 +1,62 @@ +// +// showdown.js -- A javascript port of Markdown. +// +// Copyright (c) 2007 John Fraser. +// +// Original Markdown Copyright (c) 2004-2005 John Gruber +// +// +// Redistributable under a BSD-style open source license. +// See license.txt for more information. +// +// The full source distribution is at: +// +// A A L +// T C A +// T K B +// +// +// +// +// Wherever possible, Showdown is a straight, line-by-line port +// of the Perl version of Markdown. +// +// This is not a normal parser design; it's basically just a +// series of string substitutions. It's hard to read and +// maintain this way, but keeping Showdown close to the original +// design makes it easier to port new features. +// +// More importantly, Showdown behaves like markdown.pl in most +// edge cases. So web applications can do client-side preview +// in Javascript, and then build identical HTML on the server. +// +// This port needs the new RegExp functionality of ECMA 262, +// 3rd Edition (i.e. Javascript 1.5). Most modern web browsers +// should do fine. Even with the new regular expression features, +// We do a lot of work to emulate Perl's regex functionality. +// The tricky changes in this file mostly have the "attacklab:" +// label. Major or self-explanatory changes don't. +// +// Smart diff tools like Araxis Merge will be able to match up +// this file with markdown.pl in a useful way. A little tweaking +// helps: in a copy of markdown.pl, replace "#" with "//" and +// replace "$text" with "text". Be sure to ignore whitespace +// and line endings. +// +// +// Showdown usage: +// +// var text = "Markdown *rocks*."; +// +// var converter = new Showdown.converter(); +// var html = converter.makeHtml(text); +// +// alert(html); +// +// Note: move the sample code to the bottom of this +// file before uncommenting it. +// +// +// Showdown namespace +// +var Showdown={extensions:{}},forEach=Showdown.forEach=function(a,b){if(typeof a.forEach=="function")a.forEach(b);else{var c,d=a.length;for(c=0;c?[ \t]*\n?[ \t]*(?:(\n*)["(](.+?)[")][ \t]*)?(?:\n+|(?=~0))/gm,function(a,d,e,f,g){return d=d.toLowerCase(),b[d]=G(e),f?f+g:(g&&(c[d]=g.replace(/"/g,""")),"")}),a=a.replace(/~0/,""),a},m=function(a){a=a.replace(/\n/g,"\n\n");var b="p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math|ins|del|style|section|header|footer|nav|article|aside",c="p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math|style|section|header|footer|nav|article|aside";return a=a.replace(/^(<(p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math|ins|del)\b[^\r]*?\n<\/\2>[ \t]*(?=\n+))/gm,n),a=a.replace(/^(<(p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math|style|section|header|footer|nav|article|aside)\b[^\r]*?<\/\2>[ \t]*(?=\n+)\n)/gm,n),a=a.replace(/(\n[ ]{0,3}(<(hr)\b([^<>])*?\/?>)[ \t]*(?=\n{2,}))/g,n),a=a.replace(/(\n\n[ ]{0,3}[ \t]*(?=\n{2,}))/g,n),a=a.replace(/(?:\n\n)([ ]{0,3}(?:<([?%])[^\r]*?\2>)[ \t]*(?=\n{2,}))/g,n),a=a.replace(/\n\n/g,"\n"),a},n=function(a,b){var c=b;return c=c.replace(/\n\n/g,"\n"),c=c.replace(/^\n/,""),c=c.replace(/\n+$/g,""),c="\n\n~K"+(d.push(c)-1)+"K\n\n",c},o=function(a){a=v(a);var b=A("
");return a=a.replace(/^[ ]{0,2}([ ]?\*[ ]?){3,}[ \t]*$/gm,b),a=a.replace(/^[ ]{0,2}([ ]?\-[ ]?){3,}[ \t]*$/gm,b),a=a.replace(/^[ ]{0,2}([ ]?\_[ ]?){3,}[ \t]*$/gm,b),a=x(a),a=y(a),a=E(a),a=m(a),a=F(a),a},p=function(a){return a=B(a),a=q(a),a=H(a),a=t(a),a=r(a),a=I(a),a=G(a),a=D(a),a=a.replace(/ +\n/g,"
\n"),a},q=function(a){var b=/(<[a-z\/!$]("[^"]*"|'[^']*'|[^'">])*>|)/gi;return a=a.replace(b,function(a){var b=a.replace(/(.)<\/?code>(?=.)/g,"$1`");return b=N(b,"\\`*_"),b}),a},r=function(a){return a=a.replace(/(\[((?:\[[^\]]*\]|[^\[\]])*)\][ ]?(?:\n[ ]*)?\[(.*?)\])()()()()/g,s),a=a.replace(/(\[((?:\[[^\]]*\]|[^\[\]])*)\]\([ \t]*()?[ \t]*((['"])(.*?)\6[ \t]*)?\))/g,s),a=a.replace(/(\[([^\[\]]+)\])()()()()()/g,s),a},s=function(a,d,e,f,g,h,i,j){j==undefined&&(j="");var k=d,l=e,m=f.toLowerCase(),n=g,o=j;if(n==""){m==""&&(m=l.toLowerCase().replace(/ ?\n/g," ")),n="#"+m;if(b[m]!=undefined)n=b[m],c[m]!=undefined&&(o=c[m]);else{if(!(k.search(/\(\s*\)$/m)>-1))return k;n=""}}n=N(n,"*_");var p='",p},t=function(a){return a=a.replace(/(!\[(.*?)\][ ]?(?:\n[ ]*)?\[(.*?)\])()()()()/g,u),a=a.replace(/(!\[(.*?)\]\s?\([ \t]*()?[ \t]*((['"])(.*?)\6[ \t]*)?\))/g,u),a},u=function(a,d,e,f,g,h,i,j){var k=d,l=e,m=f.toLowerCase(),n=g,o=j;o||(o="");if(n==""){m==""&&(m=l.toLowerCase().replace(/ ?\n/g," ")),n="#"+m;if(b[m]==undefined)return k;n=b[m],c[m]!=undefined&&(o=c[m])}l=l.replace(/"/g,"""),n=N(n,"*_");var p=''+l+''+p(c)+"")}),a=a.replace(/^(.+)[ \t]*\n-+[ \t]*\n+/gm,function(a,c){return A('

'+p(c)+"

")}),a=a.replace(/^(\#{1,6})[ \t]*(.+?)[ \t]*\#*\n+/gm,function(a,c,d){var e=c.length;return A("'+p(d)+"")}),a},w,x=function(a){a+="~0";var b=/^(([ ]{0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(~0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm;return e?a=a.replace(b,function(a,b,c){var d=b,e=c.search(/[*+-]/g)>-1?"ul":"ol";d=d.replace(/\n{2,}/g,"\n\n\n");var f=w(d);return f=f.replace(/\s+$/,""),f="<"+e+">"+f+"\n",f}):(b=/(\n\n|^\n?)(([ ]{0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(~0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/g,a=a.replace(b,function(a,b,c,d){var e=b,f=c,g=d.search(/[*+-]/g)>-1?"ul":"ol",f=f.replace(/\n{2,}/g,"\n\n\n"),h=w(f);return h=e+"<"+g+">\n"+h+"\n",h})),a=a.replace(/~0/,""),a};w=function(a){return e++,a=a.replace(/\n{2,}$/,"\n"),a+="~0",a=a.replace(/(\n)?(^[ \t]*)([*+-]|\d+[.])[ \t]+([^\r]+?(\n{1,2}))(?=\n*(~0|\2([*+-]|\d+[.])[ \t]+))/gm,function(a,b,c,d,e){var f=e,g=b,h=c;return g||f.search(/\n{2,}/)>-1?f=o(L(f)):(f=x(L(f)),f=f.replace(/\n$/,""),f=p(f)),"
  • "+f+"
  • \n"}),a=a.replace(/~0/g,""),e--,a};var y=function(a){return a+="~0",a=a.replace(/(?:\n\n|^)((?:(?:[ ]{4}|\t).*\n+)+)(\n*[ ]{0,3}[^ \t\n]|(?=~0))/g,function(a,b,c){var d=b,e=c;return d=C(L(d)),d=M(d),d=d.replace(/^\n+/g,""),d=d.replace(/\n+$/g,""),d="
    "+d+"\n
    ",A(d)+e}),a=a.replace(/~0/,""),a},z=function(a){return a+="~0",a=a.replace(/(?:^|\n)```(.*)\n([\s\S]*?)\n```/g,function(a,b,c){var d=b,e=c;return e=C(e),e=M(e),e=e.replace(/^\n+/g,""),e=e.replace(/\n+$/g,""),e="
    "+e+"\n
    ",A(e)}),a=a.replace(/~0/,""),a},A=function(a){return a=a.replace(/(^\n+|\n+$)/g,""),"\n\n~K"+(d.push(a)-1)+"K\n\n"},B=function(a){return a=a.replace(/(^|[^\\])(`+)([^\r]*?[^`])\2(?!`)/gm,function(a,b,c,d,e){var f=d;return f=f.replace(/^([ \t]*)/g,""),f=f.replace(/[ \t]*$/g,""),f=C(f),b+""+f+""}),a},C=function(a){return a=a.replace(/&/g,"&"),a=a.replace(//g,">"),a=N(a,"*_{}[]\\",!1),a},D=function(a){return a=a.replace(/(\*\*|__)(?=\S)([^\r]*?\S[*_]*)\1/g,"$2"),a=a.replace(/(\*|_)(?=\S)([^\r]*?\S)\1/g,"$2"),a},E=function(a){return a=a.replace(/((^[ \t]*>[ \t]?.+\n(.+\n)*\n*)+)/gm,function(a,b){var c=b;return c=c.replace(/^[ \t]*>[ \t]?/gm,"~0"),c=c.replace(/~0/g,""),c=c.replace(/^[ \t]+$/gm,""),c=o(c),c=c.replace(/(^|\n)/g,"$1 "),c=c.replace(/(\s*
    [^\r]+?<\/pre>)/gm,function(a,b){var c=b;return c=c.replace(/^  /mg,"~0"),c=c.replace(/~0/g,""),c}),A("
    \n"+c+"\n
    ")}),a},F=function(a){a=a.replace(/^\n+/g,""),a=a.replace(/\n+$/g,"");var b=a.split(/\n{2,}/g),c=[],e=b.length;for(var f=0;f=0?c.push(g):g.search(/\S/)>=0&&(g=p(g),g=g.replace(/^([ \t]*)/g,"

    "),g+="

    ",c.push(g))}e=c.length;for(var f=0;f=0){var h=d[RegExp.$1];h=h.replace(/\$/g,"$$$$"),c[f]=c[f].replace(/~K\d+K/,h)}return c.join("\n\n")},G=function(a){return a=a.replace(/&(?!#?[xX]?(?:[0-9a-fA-F]+|\w+);)/g,"&"),a=a.replace(/<(?![a-z\/?\$!])/gi,"<"),a},H=function(a){return a=a.replace(/\\(\\)/g,O),a=a.replace(/\\([`*_{}\[\]()>#+-.!])/g,O),a},I=function(a){return a=a.replace(/<((https?|ftp|dict):[^'">\s]+)>/gi,'
    $1'),a=a.replace(/<(?:mailto:)?([-.\w]+\@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)>/gi,function(a,b){return J(K(b))}),a},J=function(a){var b=[function(a){return"&#"+a.charCodeAt(0)+";"},function(a){return"&#x"+a.charCodeAt(0).toString(16)+";"},function(a){return a}];return a="mailto:"+a,a=a.replace(/./g,function(a){if(a=="@")a=b[Math.floor(Math.random()*2)](a);else if(a!=":"){var c=Math.random();a=c>.9?b[2](a):c>.45?b[1](a):b[0](a)}return a}),a=''+a+"",a=a.replace(/">.+:/g,'">'),a},K=function(a){return a=a.replace(/~E(\d+)E/g,function(a,b){var c=parseInt(b);return String.fromCharCode(c)}),a},L=function(a){return a=a.replace(/^(\t|[ ]{1,4})/gm,"~0"),a=a.replace(/~0/g,""),a},M=function(a){return a=a.replace(/\t(?=\t)/g," "),a=a.replace(/\t/g,"~A~B"),a=a.replace(/~B(.+?)~A/g,function(a,b,c){var d=b,e=4-d.length%4;for(var f=0;f') .appendTo(this.parent); @@ -48,7 +48,7 @@ wn.ui.form.Comments = Class.extend({ c.comment_on = dateutil.comment_when(c.creation); c.fullname = wn.user_info(c.comment_by).fullname; - $(repl('
    \ + $(repl('
    \
    \
    \ \ @@ -68,7 +68,7 @@ wn.ui.form.Comments = Class.extend({ }); }, - add_comment: function() { + add_comment: function(btn) { var me = this, txt = me.input.val(); @@ -86,6 +86,7 @@ wn.ui.form.Comments = Class.extend({ args: { doclist:[comment] }, + btn: btn, callback: function(r) { if(!r.exc) { me.frm.get_docinfo().comments = diff --git a/public/js/wn/form/control.js b/public/js/wn/form/control.js index 3d14264b2b..6f7c41371c 100644 --- a/public/js/wn/form/control.js +++ b/public/js/wn/form/control.js @@ -40,7 +40,7 @@ wn.ui.form.Control = Class.extend({ // returns "Read", "Write" or "None" // as strings based on permissions get_status: function(explain) { - if(!this.doctype) + if(!this.doctype) return "Write"; return wn.perm.get_field_display_status(this.df, locals[this.doctype][this.docname], this.perm, explain); diff --git a/public/js/wn/form/grid.js b/public/js/wn/form/grid.js index 590c10d9c0..fd23d6011c 100644 --- a/public/js/wn/form/grid.js +++ b/public/js/wn/form/grid.js @@ -201,11 +201,14 @@ wn.ui.form.GridRow = Class.extend({ } }, remove: function() { - var me = this; - me.wrapper.toggle(false); - wn.model.clear_doc(me.doc.doctype, me.doc.name); - me.frm.dirty(); - me.grid.refresh(); + if(this.grid.is_editable()) { + var me = this; + me.wrapper.toggle(false); + wn.model.clear_doc(me.doc.doctype, me.doc.name); + me.frm.script_manager.trigger(me.grid.df.fieldname + "_remove", me.doc.doctype, me.doc.name); + me.frm.dirty(); + me.grid.refresh(); + } }, insert: function(show) { var idx = this.doc.idx; diff --git a/public/js/wn/misc/tools.js b/public/js/wn/misc/tools.js index 73aa6776e4..75bd3e969a 100644 --- a/public/js/wn/misc/tools.js +++ b/public/js/wn/misc/tools.js @@ -46,7 +46,7 @@ wn.tools.downloadify = function(data, roles, me) { wn.markdown = function(txt) { if(!wn.md2html) { - wn.require('lib/js/lib/showdown.js'); + wn.require('lib/js/lib/markdown.js'); wn.md2html = new Showdown.converter(); } diff --git a/public/js/wn/ui/appframe.js b/public/js/wn/ui/appframe.js index a21e6ea127..297617d959 100644 --- a/public/js/wn/ui/appframe.js +++ b/public/js/wn/ui/appframe.js @@ -23,7 +23,7 @@ wn.ui.AppFrame = Class.extend({
    \
    \
    \ - \ + \ \
    ').prependTo(parent); @@ -212,7 +212,7 @@ wn.ui.AppFrame = Class.extend({ var append_or_prepend = is_title ? "prependTo" : "appendTo"; this.buttons[label] = $(repl('', args)) + %(icon)s %(label)s', args)) [append_or_prepend](this.toolbar.find(".btn-group").css({"margin-right": "5px"})) .attr("title", wn._(label)) .click(click); diff --git a/public/js/wn/views/listview.js b/public/js/wn/views/listview.js index 4723851163..aca2e8d52d 100644 --- a/public/js/wn/views/listview.js +++ b/public/js/wn/views/listview.js @@ -159,16 +159,20 @@ wn.views.ListView = Class.extend({ // row #2 var row2 = $('
    \
    \ -
    \ -
    \ -
    \ +
    \ +
    \ + \ +
    \ +
    \ +
    \
    \
    \
    ').appendTo(row); // modified row2.find(".timestamp").html(comment_when(data.modified)); + row2.find(".list-last-modified").html(wn._("Last updated by") + ": " + wn.user_info(data.modified_by).fullname); // add tags var tag_editor = new wn.ui.TagEditor({ @@ -241,6 +245,7 @@ wn.views.ListView = Class.extend({ + wn.user_info(data.modified_by).fullname)) .appendTo($(parent).css({"margin-top": "-5px"})) .css({"max-width": "100%"}) + .addClass("hidden-xs-inline-block") } else if(opts.content=='check') { } diff --git a/public/js/wn/views/moduleview.js b/public/js/wn/views/moduleview.js index b7899bbe0c..02fcf174c5 100644 --- a/public/js/wn/views/moduleview.js +++ b/public/js/wn/views/moduleview.js @@ -78,7 +78,8 @@ wn.views.moduleview.ModuleView = Class.extend({ var module_top = $(this.wrapper).find(".module-top"); var list_group = $('
    ') .appendTo(module_top); - $('
    ').insertAfter(module_top); + $('
    ').css({"margin-top": "0px"}) + .insertAfter(module_top); } else { var list_group = $('
      \
    • \ diff --git a/public/js/wn/views/query_report.js b/public/js/wn/views/query_report.js index 318dd356d5..e1664969fb 100644 --- a/public/js/wn/views/query_report.js +++ b/public/js/wn/views/query_report.js @@ -227,15 +227,17 @@ wn.views.QueryReport = Class.extend({ }, make_data: function(result, columns) { var me = this; - this.data = $.map(result, function(row, row_idx) { + this.data = []; + for(var row_idx=0, l=result.length; row_idx < l; row_idx++) { + var row = result[row_idx]; var newrow = {}; - for(var i=1, j=me.columns.length; i - #login_wrapper { - width: 330px; - margin: 70px auto; - } - - #login_wrapper, - #login_wrapper h3 { - color: #333; - } - - #login_wrapper a { - color: #0088cc; - } - - .layout-wrapper { - background-color: #fff; - padding: 10px; - box-shadow: 1px 1px 3px 3px #ccc; - font-size: 12px; - min-height: 100px; - border-radius: 5px; - } - - #login_wrapper h3 { - text-align: center; - } - - .login-banner { - margin-bottom: 20px; - } - - .login-box td { - padding: 8px; - } - .login-box td input { - margin-bottom: 0px; - } - .login-footer { - text-align: center; - padding: 15px; - } - \ No newline at end of file diff --git a/templates/js/login.js b/templates/js/login.js index 7f50c83540..155f8225fd 100644 --- a/templates/js/login.js +++ b/templates/js/login.js @@ -6,12 +6,9 @@ $(document).ready(function(wrapper) { $('#login_btn').click(login.do_login); - $('#password').keypress(function(ev){ - if(ev.which==13 && $('#password').val()) { - $('form').submit(function() { - login.do_login(); - return false; - }); + $('#pass').keypress(function(ev){ + if(ev.which==13 && $('#pass').val()) { + $("#login_btn").click(); } }); $(document).trigger('login_rendered'); @@ -41,7 +38,7 @@ login.do_login = function(){ } else { args.cmd = "login" args.usr = ($("#login_id").val() || "").trim(); - args.pwd = $("#password").val(); + args.pwd = $("#pass").val(); if(!args.usr || !args.pwd) { login.set_message("Both login and password required."); @@ -85,7 +82,7 @@ login.show_login = function() { $("#password-row").toggle(true); $("#full-name-row, #login_message").toggle(false); $("#login_btn").html("Login").removeClass("btn-success"); - $("#switch-view").html('Forgot Password?'); if(!disable_signup) { diff --git a/templates/pages/login.html b/templates/pages/login.html index 70762dcec4..26c44f7275 100644 --- a/templates/pages/login.html +++ b/templates/pages/login.html @@ -4,58 +4,56 @@ - {% include "lib/templates/css/login.css" %} + {% endblock %} {% set title="Login" %} {% block body %} -
      -
      - -

      Login

      -
      - - - - - - - - - - - - - - - - - - - - -
      -
      - -

      +
      +
      +
      +
      +
      +

      Login

      +
      +
      + +
      + +
      + +
      + +
      +
      + + +
      +

      +
      +
      -