From 78f91a259921fdb0c3cc2e7b2bdeee8976c4cc62 Mon Sep 17 00:00:00 2001 From: Avi Romanoff Date: Sat, 23 Mar 2013 15:12:04 -0400 Subject: [PATCH] Remove the "details by default" setting/feature, fixes #21 --- dal.coffee | 3 +-- static/js/models.js | 2 +- static/js/templates.min.js | 2 +- static/js/views.js | 5 ++--- test/jbha.test.coffee | 2 -- views/templates/settings.handlebars | 9 --------- 6 files changed, 5 insertions(+), 18 deletions(-) diff --git a/dal.coffee b/dal.coffee index 76d2c6c..f85879b 100644 --- a/dal.coffee +++ b/dal.coffee @@ -39,13 +39,12 @@ module.exports = Account .findOne() .where('_id', username) - .select('nickname details is_new firstrun updated migrate') + .select('nickname is_new firstrun updated migrate') .exec cb update_settings: (username, settings, cb) -> Account.update _id: username, nickname: settings.nickname - details: settings.details firstrun: settings.firstrun migrate: settings.migrate, cb diff --git a/static/js/models.js b/static/js/models.js index 3660990..c2b85bd 100644 --- a/static/js/models.js +++ b/static/js/models.js @@ -222,7 +222,7 @@ Status = Backbone.Model.extend({ }); -// Represents a user's account details and settings +// Represents a user's account settings // This model is a singleton -- there should be only // one instance of it per account. Settings = Backbone.Model.extend({ diff --git a/static/js/templates.min.js b/static/js/templates.min.js index 2c002f0..ee4351c 100644 --- a/static/js/templates.min.js +++ b/static/js/templates.min.js @@ -1 +1 @@ -(function(){var a=Handlebars.template,b=Handlebars.templates=Handlebars.templates||{};b.course=a(function(a,b,c,d,e){function l(a,b){return'\n \n \n \n '}function m(a,b){var d="",e,f;return d+='\n
\n

',f=c.exclamation,f?e=f.call(a,{hash:{}}):(e=a.exclamation,e=typeof e===i?e():e),d+=j(e)+" No work to do here!

\n
\n

\n You've completed ",f=c.archived,f?e=f.call(a,{hash:{}}):(e=a.archived,e=typeof e===i?e():e),d+=j(e)+" assignments in this course to date. Click Options > Show archived to show them.\n

\n Or just go outside and play or something.\n

\n
\n ",d}function n(a,b){return'\n \n \n \n \n \n \n \n \n \n \n \n \n
DoneTitleDue DateDetailsEdit
\n '}c=c||a.helpers;var f="",g,h,i="function",j=this.escapeExpression,k=this;f+='
\n

\n ',h=c.title,h?g=h.call(b,{hash:{}}):(g=b.title,g=typeof g===i?g():g),f+=j(g)+'\n \n ',h=c.teacher,h?g=h.call(b,{hash:{}}):(g=b.teacher,g=typeof g===i?g():g),f+=j(g)+'\n \n ',g=b.show_archive_button,g=c["if"].call(b,g,{hash:{},inverse:k.noop,fn:k.program(1,l,e)});if(g||g===0)f+=g;f+="\n

\n ",g=b.empty,g=c["if"].call(b,g,{hash:{},inverse:k.program(5,n,e),fn:k.program(3,m,e)});if(g||g===0)f+=g;return f+="\n
",f}),b.course_assignment=a(function(a,b,c,d,e){function m(a,b){return" checked "}function n(a,b){var d="",e,f;d+='\n \n \n ",d}function o(a,b){return"\n No additional information\n "}c=c||a.helpers;var f="",g,h,i="function",j=this.escapeExpression,k=this,l=c.helperMissing;f+='
\n\n\n \n\n\n\n ",g=b.title,h=c.keyword,g=h?h.call(b,g,{hash:{}}):l.call(b,"keyword",g,{hash:{}});if(g||g===0)f+=g;f+=" ",h=c.title,h?g=h.call(b,{hash:{}}):(g=b.title,g=typeof g===i?g():g),f+=j(g)+'\n \n\n\n\n ',g=b.date,h=c.format_date,g=h?h.call(b,g,{hash:{}}):l.call(b,"format_date",g,{hash:{}});if(g||g===0)f+=g;f+='\n\n\n\n ',g=b.details,g=c["if"].call(b,g,{hash:{},inverse:k.program(5,o,e),fn:k.program(3,n,e)});if(g||g===0)f+=g;return f+='\n\n\n\n \n',f}),b.date_assignment=a(function(a,b,c,d,e){function m(a,b){return" checked "}function n(a,b){var d="",e,f;d+='\n \n \n ",d}function o(a,b){return"\n No additional information\n "}c=c||a.helpers;var f="",g,h,i="function",j=this,k=c.helperMissing,l=this.escapeExpression;f+='\n\n ',g=b.title,h=c.keyword,g=h?h.call(b,g,{hash:{}}):k.call(b,"keyword",g,{hash:{}});if(g||g===0)f+=g;f+=" ",h=c.title,h?g=h.call(b,{hash:{}}):(g=b.title,g=typeof g===i?g():g),f+=l(g)+'\n \n\n\n ',h=c.course,h?g=h.call(b,{hash:{}}):(g=b.course,g=typeof g===i?g():g),f+=l(g)+'\n \n\n',g=b.date,h=c.format_date,g=h?h.call(b,g,{hash:{}}):k.call(b,"format_date",g,{hash:{}});if(g||g===0)f+=g;f+='\n\n\n ',g=b.details,g=c["if"].call(b,g,{hash:{},inverse:j.program(5,o,e),fn:j.program(3,n,e)});if(g||g===0)f+=g;return f+='\n\n\n\n \n',f}),b.dates=a(function(a,b,c,d,e){function m(a,b){var d="",e;d+="\n ",e=a.show_archive_button,e=c["if"].call(a,e,{hash:{},inverse:i.noop,fn:i.program(2,n,b)});if(e||e===0)d+=e;return d+="\n ",d}function n(a,b){var d="",e;d+='\n \n '}function q(a,b){var d="",e,f;return d+='\n
\n

',f=c.exclamation,f?e=f.call(a,{hash:{}}):(e=a.exclamation,e=typeof e===j?e():e),d+=k(e)+" No work to do here!

\n
\n

\n Go outside and play or something.\n

\n
\n ",d}function r(a,b){return'\n \n \n \n \n \n \n \n \n \n \n \n \n \n
DoneTitleCourseDue DateDetailsEdit
\n '}c=c||a.helpers;var f="",g,h,i=this,j="function",k=this.escapeExpression,l=c.helperMissing;f+='
\n

\n ',h=c.title,h?g=h.call(b,{hash:{}}):(g=b.title,g=typeof g===j?g():g),f+=k(g)+" ",g=b.range,h=c.range_date,g=h?h.call(b,g,{hash:{}}):l.call(b,"range_date",g,{hash:{}});if(g||g===0)f+=g;f+="\n ",g=b.empty,g=c.unless.call(b,g,{hash:{},inverse:i.noop,fn:i.program(1,m,e)});if(g||g===0)f+=g;f+="\n ",g=b.show_archive_button,g=c["if"].call(b,g,{hash:{},inverse:i.noop,fn:i.program(5,p,e)});if(g||g===0)f+=g;f+="\n

\n ",g=b.empty,g=c["if"].call(b,g,{hash:{},inverse:i.program(9,r,e),fn:i.program(7,q,e)});if(g||g===0)f+=g;return f+="\n
",f}),b.edit_assignment=a(function(a,b,c,d,e){function m(a,b){var d="",e;d+="\n ",e=a.details,e=c["if"].call(a,e,{hash:{},inverse:i.noop,fn:i.program(2,n,b)});if(e||e===0)d+=e;return d+="\n ",d}function n(a,b){return'\n \n note: This assignment came from the school website, so it contains HTML (a computer language). I didn't convert it to "normal text" because formatting would be lost. Feel free to replace it.\n \n '}function o(a,b){return'\n \n '}function p(a,b){var d="",e,f;d+='\n
\n \n
\n \n
\n
\n ",d}c=c||a.helpers;var f="",g,h,i=this,j=c.helperMissing,k="function",l=this.escapeExpression;f+='
\n
\n
\n \n
\n \n \n
\n
\n
\n \n
\n \n ",g=b.jbha_id,g=c["if"].call(b,g,{hash:{},inverse:i.program(4,o,e),fn:i.program(1,m,e)});if(g||g===0)f+=g;f+="\n
\n
\n ",g=b.hard_course,g=c.unless.call(b,g,{hash:{},inverse:i.noop,fn:i.program(6,p,e)});if(g||g===0)f+=g;return f+='\n
\n \n
\n \n \n
\n
\n
\n
',f}),b.edit_course=a(function(a,b,c,d,e){c=c||a.helpers;var f="",g,h,i="function",j=this.escapeExpression;return f+='
\n
\n
\n \n
\n \n \n
\n
\n
\n \n
\n \n \n
\n
\n
\n
\n \n
\n
\n
\n
',f}),b.home=a(function(a,b,c,d,e){c=c||a.helpers;var f="",g,h,i=c.helperMissing,j=this.escapeExpression;return f+='
\n

Miss me?


\n

\n ',h=c.personalize,g=h?h.call(b,"You know the drill %n, just click on a link to the left.",{hash:{}}):i.call(b,"personalize","You know the drill %n, just click on a link to the left.",{hash:{}}),f+=j(g)+"\n

\n

\n
",f}),b.settings=a(function(a,b,c,d,e){function l(a,b){return" checked "}c=c||a.helpers;var f="",g,h,i="function",j=this.escapeExpression,k=this;f+='
\n
\n
\n \n
\n \n This doesn’t affect anything other than your ego.\n
\n
\n
\n \n
\n
-
- -
-
-
\ No newline at end of file