Skip to content

Commit

Permalink
Remove the "details by default" setting/feature, fixes #21
Browse files Browse the repository at this point in the history
  • Loading branch information
aroman committed Mar 23, 2013
1 parent 515c39b commit 78f91a2
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 18 deletions.
3 changes: 1 addition & 2 deletions dal.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion static/js/models.js
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down
2 changes: 1 addition & 1 deletion static/js/templates.min.js

Large diffs are not rendered by default.

5 changes: 2 additions & 3 deletions static/js/views.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ SettingsView = Backbone.View.extend({
var that = this;
this.model.save({
nickname: this.$("#nickname").val(),
details: this.$("#details").is(':checked')
},
{
error: function (model, errors) {
Expand All @@ -102,7 +101,6 @@ SettingsView = Backbone.View.extend({

render: function () {
var context = {
details: this.model.get('details'),
nickname: this.model.get('nickname')
};
this.$(".modal-body").html(this.template(context));
Expand Down Expand Up @@ -475,11 +473,12 @@ AssignmentView = Backbone.View.extend({
}

// Only show details if we should be
// TODO: Recheck this logic
if (this.showing_details !== null) {
if (this.showing_details === true) {
this.showDetails();
}
} else if (settings.get('details') || app.showing_details) {
} else if (app.showing_details) {
this.showDetails();
}

Expand Down
2 changes: 0 additions & 2 deletions test/jbha.test.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ describe "dal", ->
_id: String(Math.random())
nickname: "Dr. " + Math.random()
firstrun: false
details: true

describe "create", ->
it 'should create without error', (done) ->
Expand All @@ -65,7 +64,6 @@ describe "dal", ->
should.not.exist err
settings.nickname.should.equal mock_settings.nickname
settings.firstrun.should.equal mock_settings.firstrun
settings.details.should.equal mock_settings.details
settings.is_new.should.equal true
done()

Expand Down
9 changes: 0 additions & 9 deletions views/templates/settings.handlebars
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,5 @@
<span class="help-inline">This doesn&rsquo;t affect anything other than your ego.</span>
</div>
</div>
<div class="control-group">
<label class="control-label">Details by default</label>
<div class="controls">
<label class="checkbox">
<input type="checkbox" id="details" {{#if details}} checked {{/if}}>
<p class="help-inline">This is the just the default when you log in. You can toggle details from the Options menu whenever you want.</span>
</label>
</div>
</div>
</fieldset>
</form>

0 comments on commit 78f91a2

Please sign in to comment.