Merge branch 'master' of https://git.wmi.amu.edu.pl/s416178/Punktonerzy into wejscieDoTestu
This commit is contained in:
commit
b1eee19e95
@ -157,6 +157,8 @@ public class TestController {
|
|||||||
TestOwnerDTO testDTO = modelMapper.map(test.get(), TestOwnerDTO.class);
|
TestOwnerDTO testDTO = modelMapper.map(test.get(), TestOwnerDTO.class);
|
||||||
testDTO.setOwner(user.getUsername());
|
testDTO.setOwner(user.getUsername());
|
||||||
if (test.get().getPermission().equals("GROUP")) {
|
if (test.get().getPermission().equals("GROUP")) {
|
||||||
|
testDTO.setDateFrom(test.get().getAvailableFrom());
|
||||||
|
testDTO.setDateTo(test.get().getAvailableTo());
|
||||||
List<StudyGroupMember> groupUsers = test.get().getGroup().getMembers();
|
List<StudyGroupMember> groupUsers = test.get().getGroup().getMembers();
|
||||||
for (StudyGroupMember studyGroupMember : groupUsers) {
|
for (StudyGroupMember studyGroupMember : groupUsers) {
|
||||||
if (studyGroupMember.getIsGroupLeader()) {
|
if (studyGroupMember.getIsGroupLeader()) {
|
||||||
@ -183,6 +185,7 @@ public class TestController {
|
|||||||
if (testDTO.getAttempted() == null){
|
if (testDTO.getAttempted() == null){
|
||||||
testDTO.setAttempted(false);
|
testDTO.setAttempted(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
return testDTO;
|
return testDTO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -32,6 +32,9 @@ public class TestOwnerDTO {
|
|||||||
private String permission;
|
private String permission;
|
||||||
private int grade;
|
private int grade;
|
||||||
|
|
||||||
|
private Long dateFrom;
|
||||||
|
private Long dateTo;
|
||||||
|
|
||||||
private Boolean attempted = null;
|
private Boolean attempted = null;
|
||||||
|
|
||||||
@JsonProperty("body")
|
@JsonProperty("body")
|
||||||
|
@ -4,6 +4,7 @@ import { AuthenticationService } from '../authentication.service';
|
|||||||
import { HttpClientModule } from '@angular/common/http';
|
import { HttpClientModule } from '@angular/common/http';
|
||||||
import { HttpModule } from '@angular/http';
|
import { HttpModule } from '@angular/http';
|
||||||
import { MatSnackBar } from '@angular/material/snack-bar';
|
import { MatSnackBar } from '@angular/material/snack-bar';
|
||||||
|
import { environment } from '../../environments/environment';
|
||||||
@Component({
|
@Component({
|
||||||
moduleId: module.id,
|
moduleId: module.id,
|
||||||
templateUrl: 'login.component.html',
|
templateUrl: 'login.component.html',
|
||||||
@ -34,7 +35,7 @@ export class LoginComponent implements OnInit {
|
|||||||
if (result === true) {
|
if (result === true) {
|
||||||
// login successful
|
// login successful
|
||||||
this.isLogin = true;
|
this.isLogin = true;
|
||||||
this.router.navigate(['home']);
|
this.router.navigate(['/my-groups']);
|
||||||
this.snackBar.open('Zalogowano pomyślnie.', null,
|
this.snackBar.open('Zalogowano pomyślnie.', null,
|
||||||
{ duration: 3000, verticalPosition: 'top', panelClass: ['snackbar-success'] });
|
{ duration: 3000, verticalPosition: 'top', panelClass: ['snackbar-success'] });
|
||||||
} else {
|
} else {
|
||||||
@ -64,7 +65,7 @@ export class LoginComponent implements OnInit {
|
|||||||
this.outh_token_secret = this.outh_token_secret.replace('oauth_token_secret=', '');
|
this.outh_token_secret = this.outh_token_secret.replace('oauth_token_secret=', '');
|
||||||
localStorage.setItem('outh_token', array[0].replace('oauth_token=', ''));
|
localStorage.setItem('outh_token', array[0].replace('oauth_token=', ''));
|
||||||
localStorage.setItem('outh_token_secret', array[1].replace('oauth_token_secret=', ''));
|
localStorage.setItem('outh_token_secret', array[1].replace('oauth_token_secret=', ''));
|
||||||
window.location.href = el.url;
|
window.location.href = environment.frontend + 'my-groups';
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -77,6 +77,14 @@ a:hover{
|
|||||||
width: 4rem;
|
width: 4rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.mobile-logo-wrapper, .mobile-off-on-btn {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wrapper .logo-and-name {
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
|
||||||
@media screen and (max-width: 1200px) {
|
@media screen and (max-width: 1200px) {
|
||||||
.study-cave{
|
.study-cave{
|
||||||
font-size: 32px;
|
font-size: 32px;
|
||||||
@ -108,6 +116,19 @@ a:hover{
|
|||||||
{
|
{
|
||||||
font-size: large;
|
font-size: large;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.mobile-off-on-btn {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mobile-logo-wrapper {
|
||||||
|
display: flex;
|
||||||
|
width: 100%;
|
||||||
|
background-color: black;
|
||||||
|
height: 55px;
|
||||||
|
padding-bottom: 5px;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,5 +1,13 @@
|
|||||||
<div class="wrapper" id="header">
|
<div class="mobile-logo-wrapper">
|
||||||
<div class="logo-and-name" routerLink="/home">
|
<a class="mobile-off-on-btn button" style="height: 27px; margin-top: 14px; margin-left: 8px;" (click)="onOffMenuMobile()">Pokaż menu</a>
|
||||||
|
<div class="logo-and-name" routerLink="/my-groups">
|
||||||
|
<img class="logo" src="./assets/logo-punktonerzy.PNG" alt="error" style="width: 70px; height: 50px;">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<a #btn class="mobile-off-on-btn button" style="position: absolute; z-index: 9999; top: 14px; margin-left: 8px;" (click)="onOffMenuMobile()">Ukryj menu</a>
|
||||||
|
<div #menu class="wrapper" id="header">
|
||||||
|
<div class="logo-and-name" routerLink="/my-groups">
|
||||||
<img class="logo" src="./assets/logo-punktonerzy.PNG" alt="error" style="width: 100px; height: 70px;">
|
<img class="logo" src="./assets/logo-punktonerzy.PNG" alt="error" style="width: 100px; height: 70px;">
|
||||||
</div>
|
</div>
|
||||||
<div class="menu">
|
<div class="menu">
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
import { Component, OnInit, Input, OnChanges, SimpleChanges, SimpleChange } from '@angular/core';
|
import { Component, OnInit, Input, OnChanges, SimpleChanges, SimpleChange, ViewChild, ElementRef } from '@angular/core';
|
||||||
import { Router } from '@angular/router';
|
import { Router } from '@angular/router';
|
||||||
import { AuthenticationService } from '../authentication.service';
|
import { AuthenticationService } from '../authentication.service';
|
||||||
|
|
||||||
|
import * as $ from 'jquery';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-main-navigation',
|
selector: 'app-main-navigation',
|
||||||
templateUrl: './main-navigation.component.html',
|
templateUrl: './main-navigation.component.html',
|
||||||
@ -10,11 +12,41 @@ import { AuthenticationService } from '../authentication.service';
|
|||||||
export class MainNavigationComponent implements OnInit {
|
export class MainNavigationComponent implements OnInit {
|
||||||
currentUser;
|
currentUser;
|
||||||
isLogin: Boolean;
|
isLogin: Boolean;
|
||||||
|
@ViewChild('menu') menu: ElementRef;
|
||||||
|
@ViewChild('btn') btn: ElementRef;
|
||||||
|
|
||||||
constructor(private router: Router, private authenticationService: AuthenticationService) {
|
constructor(private router: Router, private authenticationService: AuthenticationService) {
|
||||||
authenticationService.getLoggedInName.subscribe(name => this.isLoggedIn());
|
authenticationService.getLoggedInName.subscribe(name => this.isLoggedIn());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onOffMenuMobile() {
|
||||||
|
console.log(this.menu.nativeElement.style.display)
|
||||||
|
if (this.menu.nativeElement.style.display === '') {
|
||||||
|
this.menu.nativeElement.style.display = 'none';
|
||||||
|
this.btn.nativeElement.style.display = 'none';
|
||||||
|
$('app-main-navigation ~ div.content').each(function () {
|
||||||
|
$(this).css('position', 'static');
|
||||||
|
$(this).css('margin-top', '0');
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
if (this.menu.nativeElement.style.display === 'none') {
|
||||||
|
this.menu.nativeElement.style.display = 'flex';
|
||||||
|
this.btn.nativeElement.style.display = 'block';
|
||||||
|
$('app-main-navigation ~ div.content').each(function () {
|
||||||
|
$(this).css('position', 'fixed');
|
||||||
|
$(this).css('margin-top', '250px');
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.menu.nativeElement.style.display = 'none';
|
||||||
|
this.btn.nativeElement.style.display = 'none';
|
||||||
|
$('app-main-navigation ~ div.content').each(function () {
|
||||||
|
$(this).css('position', 'position');
|
||||||
|
$(this).css('margin-top', '0');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
navToProfile() {
|
navToProfile() {
|
||||||
const currentUser = JSON.parse(localStorage.getItem('currentUser'));
|
const currentUser = JSON.parse(localStorage.getItem('currentUser'));
|
||||||
this.router.navigate(['/profile', currentUser.username]);
|
this.router.navigate(['/profile', currentUser.username]);
|
||||||
|
Loading…
Reference in New Issue
Block a user