Skip to content

Commit

Permalink
Sec org: add button to toggle visibility of 'unassigned' section
Browse files Browse the repository at this point in the history
The other five sections grow to compensate for its absence.
  • Loading branch information
tjgrathwell committed Jul 6, 2013
1 parent 0455c08 commit 7f771a5
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 6 deletions.
14 changes: 12 additions & 2 deletions app/assets/javascripts/views/section_organizer_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ Bridgetroll.Views.SectionOrganizer = (function () {

events: {
'click .add-section': 'onAddSectionClick',
'click .show-os': 'onShowOSClick'
'click .show-os': 'onShowOSClick',
'click .show-unassigned': 'onShowUnassignedClick'
},

initialize: function (options) {
Expand Down Expand Up @@ -63,6 +64,15 @@ Bridgetroll.Views.SectionOrganizer = (function () {
} else {
this.$('.show-os').text('Show Student OS');
}
}
},

onShowUnassignedClick: function () {
this.$el.toggleClass('showing-unassigned');
if (this.$el.hasClass('showing-unassigned')) {
this.$('.show-unassigned').text('Hide Unassigned');
} else {
this.$('.show-unassigned').text('Show Unassigned');
}
},
});
})();
18 changes: 15 additions & 3 deletions app/assets/stylesheets/_section_organizer.css.scss
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,20 @@ $bridgetroll-section-border-color: #BBB;
.bridgetroll-section-level {
vertical-align: top;
display: inline-block;
width: 175px;
width: 215px;
margin-right: 10px;

.showing-unassigned & {
width: 175px;
}

&.level0 {
display: none;

.showing-unassigned & {
display: inline-block;
}
}
}

.bridgetroll-section-title {
Expand Down Expand Up @@ -73,7 +85,6 @@ $bridgetroll-section-border-color: #BBB;
border: 1px solid $bridgetroll-section-border-color;
margin-bottom: 20px;
border-radius: 5px;
width: 175px;
vertical-align: top;

.actions {
Expand Down Expand Up @@ -164,7 +175,8 @@ $bridgetroll-section-border-color: #BBB;
.name {
display: inline-block;
overflow: hidden;
width: 120px;
width: 70%;
width: calc(100% - 55px);
text-overflow: ellipsis;
white-space: nowrap;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<a class='btn' href='sections/arrange' data-method='post' data-confirm='This will remove all existing sections and recreate them using COMPUTERS. Are you sure?'>Auto-Arrange All</a>
<a class='btn' href='sections/arrange?checked_in=true' data-method='post' data-confirm='This will remove all existing sections and recreate them using COMPUTERS. Are you sure?'>Auto-Arrange Checked-In People</a>
<button class='btn show-os'>Show Student OS</button>
<button class='btn show-unassigned'>Hide Unassigned</button>
<div class='student-os-key'>
<div class='swatch linux'></div>Linux
<div class='swatch osx'></div>OSX
Expand Down
2 changes: 1 addition & 1 deletion app/views/events/organize_sections.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<h2>Super Secret Organizer Section Organizing Tool</h2>

<div id="section-organizer"></div>
<div id="section-organizer" class="showing-unassigned"></div>

<script>
$(document).ready(function () {
Expand Down

0 comments on commit 7f771a5

Please sign in to comment.