Changeset 8d83180


Ignore:
Timestamp:
10/11/22 15:41:16 (21 months ago)
Author:
unknown <mlviktor23@…>
Branches:
main
Children:
c68150f
Parents:
cae16b5
Message:

forums/page nav

Files:
7 added
7 edited

Legend:

Unmodified
Added
Removed
  • reactapp/src/App.js

    rcae16b5 r8d83180  
    66import Home from "./Pages/Home";
    77import UserDashboard from "./Pages/UserDashboard";
     8import Subject from "./Pages/Subject";
     9import University from "./Pages/University";
     10import Faculty from "./Pages/Faculty";
    811import { useEffect, useState, useMemo } from "react";
    912import AuthApi from "./api/AuthApi";
     
    1114import axios from "./api/axios";
    1215import JSOG from "jsog";
     16import NotFound from "./Pages/NotFound";
    1317
    1418export default function App() {
     
    7781              />
    7882            </Route>
     83            <Route path="university/:universityId" element={<University />} />
     84            <Route path="faculty/:facultyId" element={<Faculty />} />
     85            <Route path="subject/:subjectId" element={<Subject />} />
    7986            <Route path="search" element={<SearchResults />}></Route>
    8087            <Route
     
    8794            ></Route>
    8895          </Route>
     96          <Route path="*" element={<NotFound />} />
    8997        </Routes>
    9098      </BrowserRouter>
  • reactapp/src/Components/Styled/Main.style.js

    rcae16b5 r8d83180  
    2222  color: black;
    2323`;
     24
     25export const CurrentPageNav = styled.div`
     26  font-style: italic;
     27  font-size: 14px;
     28`;
  • reactapp/src/Components/Styled/OpinionCard.style.js

    rcae16b5 r8d83180  
    88  margin-bottom: 20px;
    99  padding: 10px;
    10   border: 1px solid black;
     10  box-shadow: 2px 2px 10px #aaaaaa;
    1111`;
    1212
  • reactapp/src/Components/Styled/ProfessorCard.style.js

    rcae16b5 r8d83180  
    22
    33export const ProfessorCard = styled.div`
    4   background-color: papayawhip;
     4  background-color: cornsilk;
    55  width: auto;
    66  padding: 10px;
    77  margin-bottom: 30px;
    8   margin-top: 140px;
     8  margin-top: 40px;
    99`;
    1010
  • reactapp/src/Pages/Professor.js

    rcae16b5 r8d83180  
    2323import { useNavigate } from "react-router-dom";
    2424import axios from "../api/axios";
     25import { CurrentPageNav } from "../Components/Styled/Main.style";
    2526
    2627function Professor(user, userLoaded) {
     
    3435  const [postTitle, setPostTitle] = useState("");
    3536  const [postContent, setPostContent] = useState("");
     37  const [fetchError, setFetchError] = useState(false);
    3638
    3739  useEffect(() => {
     
    4749        setLoaded(true);
    4850      } catch (error) {
    49         console.log("Fetching error", error);
     51        setFetchError(true);
    5052      }
    5153    };
     
    9597    return (
    9698      <div>
     99        <CurrentPageNav>
     100          &#187;{" "}
     101          <a href={"/university/" + professor.faculty.university.universityId}>
     102            {professor.faculty.university.universityName}
     103          </a>{" "}
     104          &#187;{" "}
     105          <a href={"/faculty/" + professor.faculty.facultyId}>
     106            {professor.faculty.facultyName}
     107          </a>{" "}
     108          &#187; <a href="#">{professor.professorName}</a>
     109        </CurrentPageNav>
    97110        <ProfessorCard>
    98111          <ProfessorCardName>{professor.professorName}</ProfessorCardName>
     
    168181      </div>
    169182    );
    170   } else {
     183  } else if (!fetchError) {
    171184    return (
    172185      <div>
     
    175188      </div>
    176189    );
     190  } else {
     191    return (
     192      <div style={{ marginTop: "140px" }}>
     193        <h1 style={{ textAlign: "center" }}>Страницата не е пронајдена.</h1>
     194      </div>
     195    );
    177196  }
    178197}
  • springapp/src/main/java/mk/profesori/springapp/Model/StudyProgramme.java

    rcae16b5 r8d83180  
    1616
    1717import com.fasterxml.jackson.annotation.JsonIdentityInfo;
    18 import com.fasterxml.jackson.annotation.ObjectIdGenerators;
     18import com.voodoodyne.jackson.jsog.JSOGGenerator;
    1919
    2020@Entity
    2121@Table(name = "study_programme")
    22 @JsonIdentityInfo(generator = ObjectIdGenerators.PropertyGenerator.class, property = "studyProgrammeId")
     22@JsonIdentityInfo(generator = JSOGGenerator.class)
    2323public class StudyProgramme {
    2424
  • springapp/src/main/java/mk/profesori/springapp/Model/_Thread.java

    rcae16b5 r8d83180  
    11package mk.profesori.springapp.Model;
    22
     3import java.time.LocalDateTime;
    34import java.util.ArrayList;
    45import java.util.List;
     
    1516public class _Thread extends Post {
    1617
    17     @Column(name = "tags")
     18    @Column(name = "tags") // unused
    1819    @ElementCollection
    1920    private List<String> tags = new ArrayList<>();
     
    2728    private Subject targetSubject;
    2829
    29     // TODO threadovi
    30     /*
    31      * public _Thread(String title, String content, List<String> tags, Section
    32      * parentSection, Subject targetSubject) {
    33      * super(title, content);
    34      * this.tags = tags;
    35      * this.parentSection = parentSection;
    36      * this.targetSubject = targetSubject;
    37      * }
    38      */
     30    // konstruktor so parent (koga e reply)
     31    public _Thread(String title, String content, CustomUserDetails author, LocalDateTime timePosted,
     32            LocalDateTime timeLastEdited,
     33            Post parent, List<Post> children, Section parentSection, Subject targetSubject) {
     34        super(title, content, author, timePosted, timeLastEdited, parent, children);
     35        this.parentSection = parentSection;
     36        this.targetSubject = targetSubject;
     37    }
     38
     39    // konstruktor bez parent (koga NE e reply)
     40    public _Thread(String title, String content, CustomUserDetails author, LocalDateTime timePosted,
     41            LocalDateTime timeLastEdited, List<Post> children, Section parentSection, Subject targetSubject) {
     42        super(title, content, author, timePosted, timeLastEdited, children);
     43        this.parentSection = parentSection;
     44        this.targetSubject = targetSubject;
     45    }
    3946
    4047    // getters
Note: See TracChangeset for help on using the changeset viewer.