This repository has been archived by the owner on May 25, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into search-crn
- Loading branch information
Showing
27 changed files
with
450 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
core/db/migrate/20190326210039_alt_seats_and_seatstaken_to_nullable.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
class AltSeatsAndSeatstakenToNullable < ActiveRecord::Migration[5.1] | ||
def change | ||
change_column_null :sections, :seats, true | ||
change_column_default :sections, :seats, nil | ||
change_column_null :sections, :seats_taken, true | ||
change_column_default :sections, :seats_taken, nil | ||
end | ||
|
||
def down | ||
raise ActiveRecord::IrreversibleMigration | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<a class="nav-link"> | ||
<a (click)="previousTerm()"><i class="arrow left" [class.arrow_disabled]="isFirstTerm"></i></a> | ||
<span class="theme-text theme-text-heavy"> | ||
{{ internalName }} | ||
<img *ngIf="!isActiveTerm" src="assets/images/eye.svg" placement="bottom" ngbPopover="Term is currently is view-only mode." alt="View Only" /> | ||
</span> | ||
|
||
<a (click)="nextTerm()"><i class="arrow right" [class.arrow_disabled]="isLastTerm"></i></a> | ||
</a> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
|
||
.arrow { | ||
border: solid white; | ||
border-width: 0 3px 3px 0; | ||
display: inline-block; | ||
padding: 3px; | ||
cursor: pointer; | ||
} | ||
|
||
.arrow_disabled { | ||
border: solid grey; | ||
border-width: 0 3px 3px 0; | ||
cursor: not-allowed; | ||
} | ||
|
||
.right { | ||
transform: rotate(-45deg); | ||
-webkit-transform: rotate(-45deg); | ||
} | ||
|
||
.left { | ||
transform: rotate(135deg); | ||
-webkit-transform: rotate(135deg); | ||
} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import {Component, OnInit} from '@angular/core'; | ||
import {SelectedTermService} from '../../services/selected-term.service'; | ||
import {Term} from 'yacs-api-client'; | ||
|
||
@Component({ | ||
selector: 'term-selector', | ||
templateUrl: './component.html', | ||
styleUrls: ['./component.scss'] | ||
}) | ||
export class TermSelectorComponent implements OnInit { | ||
|
||
// cache the name of the term | ||
private internalName: string; | ||
|
||
constructor( | ||
private selectedTermService: SelectedTermService) { | ||
// default the name to 'loading' until it loads | ||
this.internalName = 'loading'; | ||
} | ||
|
||
ngOnInit(): void { | ||
this.selectedTermService.subscribeToTerm((term: Term) => { | ||
this.internalName = term.longname; | ||
}); | ||
} | ||
|
||
get isFirstTerm(): boolean { | ||
return this.selectedTermService.getCurrentOrdinal === 0; | ||
} | ||
|
||
get isLastTerm(): boolean { | ||
return this.selectedTermService.getCurrentOrdinal === this.selectedTermService.getMaximumOrdinal; | ||
} | ||
|
||
get isActiveTerm(): boolean { | ||
return this.selectedTermService.isCurrentTermActive; | ||
} | ||
|
||
/** | ||
* Move to the previous (more recent) Term | ||
*/ | ||
previousTerm() { | ||
const ord = this.selectedTermService.getCurrentOrdinal; | ||
if (ord > 0) { | ||
this.selectedTermService.setSelectedTermByOrdinal(ord - 1); | ||
} | ||
} | ||
|
||
/** | ||
* Move to the next (less recent) Term | ||
*/ | ||
nextTerm() { | ||
const ord = this.selectedTermService.getCurrentOrdinal; | ||
if (ord < this.selectedTermService.getMaximumOrdinal) { | ||
this.selectedTermService.setSelectedTermByOrdinal(ord + 1); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.