Skip to content
This repository has been archived by the owner on May 25, 2021. It is now read-only.

Added ability to copy schedule links #487

Open
wants to merge 20 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 19 additions & 19 deletions web/src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,31 @@ import { Component, Input } from '@angular/core';
import { NoticeService } from './services/notice.service';

@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss'],
providers: [
NoticeService
]
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss'],
providers: [
NoticeService
]

})
export class AppComponent {
constructor(private noticeService: NoticeService) {}
constructor(private noticeService: NoticeService) {}

public showingSidebar: boolean = true;
ngOnInit () {
this.showingSidebar = true;
}
public showingSidebar: boolean = true;
ngOnInit () {
this.showingSidebar = true;
}

public toggleSidebar (): void {
this.showingSidebar = !this.showingSidebar;
}
public toggleSidebar (): void {
this.showingSidebar = !this.showingSidebar;
}

//aids in moving contents of page down if notice bar is present
public hasNotice (): boolean {
return this.noticeService.hasNotice();
}
//aids in moving contents of page down if notice bar is present
public hasNotice (): boolean {
return this.noticeService.hasNotice();
}


}
4 changes: 2 additions & 2 deletions web/src/app/listing/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export class ListingComponent implements OnInit{
}

public clickCourse () {
this.selectionService.toggleCourse(this.listing);
this.selectionService.toggleCourse(this.listing, true);
}

public isCourseSelected () {
Expand All @@ -61,7 +61,7 @@ export class ListingComponent implements OnInit{
}

public clickSection (section: Section): void {
this.selectionService.toggleSection(section);
this.selectionService.toggleSection(section, true);
}

public doesConflict (section: Section): boolean {
Expand Down
9 changes: 7 additions & 2 deletions web/src/app/schedule-view/component.html
Original file line number Diff line number Diff line change
@@ -1,21 +1,26 @@
<div *ngIf="!isLoaded" class="loader"></div>
<div class="schedule-view">
<div *ngIf="!notTemporary">
<div class="alert alert-info" role="alert">
You are viewing a temporary schedule. <button class="alert-link temp-schedule-button" (click) = "replaceSelections()">Replace current selections</button> or <button class="alert-link temp-schedule-button" (click) = "keepSelections()">Keep current selections</button>.
</div>
</div>
<div class="schedule-menu">
<div class="switch">
<span class="schedule-switch" (click) = "scheduleSet.decrementActiveSchedule()">&#9664;</span>
<span class="schedule-index">{{activeScheduleIndex}} / {{scheduleSet.numSchedules}}</span>
<span class="schedule-switch" (click) = "scheduleSet.incrementActiveSchedule()">&#9654;</span>
</div>
<div>
<button class="schedule-button" (click) = "clearSelections()">Clear</button>
<button *ngIf="notTemporary" class="schedule-button" (click) = "clearSelections()">Clear</button>
<div ngbDropdown class="d-inline-block">
<button class="schedule-button" id="dropdownBasic1" ngbDropdownToggle>
Share
</button>
<div ngbDropdownMenu>
<button class="schedule-button dropdown-item" (click) = "downloadImage()">Save as Image</button>
<button class="schedule-button dropdown-item" (click) = "copyLink()">Copy Schedule Link</button>
<button class="schedule-button dropdown-item">Save as iCalendar (disabled)</button>
<button class="schedule-button dropdown-item" [disabled]="isTemporary">Copy Schedule Link (disabled)</button>
</div>
</div>
</div>
Expand Down
11 changes: 11 additions & 0 deletions web/src/app/schedule-view/component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,17 @@
background-color:#daa;
}

.temp-schedule-button {
background: none!important;
border: none;
padding: 0!important;
cursor: pointer;
}

.temp-schedule-button:hover {
text-decoration: underline;
}

.schedule-status {
margin: 0;
font-size: 90%;
Expand Down
Loading