-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #34 from ilyasbozdemir/case-project
pages updated,added.
- Loading branch information
Showing
28 changed files
with
1,733 additions
and
101 deletions.
There are no files selected for viewing
2 changes: 0 additions & 2 deletions
2
LibraryTrackingApp/src/backend/Core/LibraryTrackingApp.Domain/Entities/Library/Shelf.cs
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
118 changes: 118 additions & 0 deletions
118
LibraryTrackingApp/src/frontend/components/AudioBookForm.jsx
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,118 @@ | ||
import { useState } from "react"; | ||
import { | ||
Box, | ||
FormControl, | ||
FormLabel, | ||
Input, | ||
Table, | ||
TableCaption, | ||
Tbody, | ||
Textarea, | ||
Th, | ||
Thead, | ||
Tr, | ||
} from "@chakra-ui/react"; | ||
import UploadForm from "./UploadForm"; | ||
|
||
const AudioBookForm = ({ onUpload }) => { | ||
const [title, setTitle] = useState(""); | ||
const [author, setAuthor] = useState(""); | ||
const [narrator, setNarrator] = useState(""); | ||
const [description, setDescription] = useState(""); | ||
const [audioFile, setAudioFile] = useState(null); | ||
const [audioFiles, setAudioFiles] = useState([]); | ||
|
||
const handleUpload = (file) => { | ||
// ayarlanacak.. | ||
}; | ||
const handleDelete = (id) => { | ||
setAudioFiles(eBooks.filter((audioFile) => audioFile.id !== id)); | ||
}; | ||
return ( | ||
<> | ||
<FormControl> | ||
<FormLabel htmlFor="title">Başlık</FormLabel> | ||
<Input | ||
type="text" | ||
id="title" | ||
value={title} | ||
onChange={(e) => setTitle(e.target.value)} | ||
/> | ||
</FormControl> | ||
<FormControl mt={4}> | ||
<FormLabel htmlFor="author">Yazar</FormLabel> | ||
<Input | ||
type="text" | ||
id="author" | ||
value={author} | ||
onChange={(e) => setAuthor(e.target.value)} | ||
/> | ||
</FormControl> | ||
<FormControl mt={4}> | ||
<FormLabel htmlFor="narrator">Anlatan</FormLabel> | ||
<Input | ||
type="text" | ||
id="narrator" | ||
value={narrator} | ||
onChange={(e) => setNarrator(e.target.value)} | ||
/> | ||
</FormControl> | ||
<FormControl mt={4}> | ||
<FormLabel htmlFor="description">Açıklama</FormLabel> | ||
<Textarea | ||
id="description" | ||
value={description} | ||
onChange={(e) => setDescription(e.target.value)} | ||
/> | ||
</FormControl> | ||
|
||
<UploadForm | ||
onUpload={handleUpload} | ||
//accept=".mp3, .wav" | ||
labelName={"Ses Dosyasını buraya bırakınız."} | ||
/> | ||
|
||
<Table variant="striped" colorScheme="blue" mt={8}> | ||
<TableCaption>{`${audioFiles.length} sesli kitap bulundu.`}</TableCaption> | ||
<Thead> | ||
<Tr> | ||
<Th>Ad</Th> | ||
<Th>Dosya Tipi</Th> | ||
<Th>Boyut (KB)</Th> | ||
<Th>İşlemler</Th> | ||
</Tr> | ||
</Thead> | ||
<Tbody> | ||
{audioFiles.map((file) => ( | ||
<Tr key={file.id}> | ||
<Td>{file.title}</Td> | ||
<Td>{file.author}</Td> | ||
<Td>{(file.size / 1024).toFixed(2)}</Td> | ||
<Td>{file.author}</Td> | ||
|
||
<Td> | ||
<Button | ||
colorScheme="teal" | ||
size="sm" | ||
mr={2} | ||
onClick={() => window.open(`/app/e-books/${file.id}`)} | ||
> | ||
Görüntüle | ||
</Button> | ||
<Button | ||
colorScheme="red" | ||
size="sm" | ||
onClick={() => handleDelete(file.id)} | ||
> | ||
Sil | ||
</Button> | ||
</Td> | ||
</Tr> | ||
))} | ||
</Tbody> | ||
</Table> | ||
</> | ||
); | ||
}; | ||
|
||
export default AudioBookForm; |
52 changes: 52 additions & 0 deletions
52
LibraryTrackingApp/src/frontend/components/GenreEditModal .jsx
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,52 @@ | ||
// GenreEditModal.jsx | ||
import { useState } from 'react'; | ||
import { | ||
Box, | ||
Button, | ||
FormControl, | ||
FormLabel, | ||
Input, | ||
Modal, | ||
ModalOverlay, | ||
ModalContent, | ||
ModalHeader, | ||
ModalCloseButton, | ||
ModalBody, | ||
ModalFooter, | ||
} from '@chakra-ui/react'; | ||
|
||
const GenreEditModal = ({ isOpen, onClose, genre, onUpdate }) => { | ||
const [name, setName] = useState(genre ? genre.name : ''); | ||
|
||
const handleSubmit = () => { | ||
onUpdate({ ...genre, name }); | ||
onClose(); | ||
}; | ||
|
||
return ( | ||
<Modal isOpen={isOpen} onClose={onClose}> | ||
<ModalOverlay /> | ||
<ModalContent> | ||
<ModalHeader>Tür Düzenle</ModalHeader> | ||
<ModalCloseButton /> | ||
<ModalBody> | ||
<FormControl> | ||
<FormLabel htmlFor="name">Ad</FormLabel> | ||
<Input | ||
type="text" | ||
id="name" | ||
value={name} | ||
onChange={(e) => setName(e.target.value)} | ||
/> | ||
</FormControl> | ||
</ModalBody> | ||
<ModalFooter> | ||
<Button colorScheme="blue" mr={3} onClick={handleSubmit}>Kaydet</Button> | ||
<Button variant="ghost" onClick={onClose}>İptal</Button> | ||
</ModalFooter> | ||
</ModalContent> | ||
</Modal> | ||
); | ||
}; | ||
|
||
export default GenreEditModal; |
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
125 changes: 125 additions & 0 deletions
125
LibraryTrackingApp/src/frontend/components/MagazineEditForm.jsx
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,125 @@ | ||
import { useState } from "react"; | ||
import { | ||
Box, | ||
Button, | ||
FormControl, | ||
FormLabel, | ||
Input, | ||
Textarea, | ||
Modal, | ||
ModalOverlay, | ||
ModalContent, | ||
ModalHeader, | ||
ModalCloseButton, | ||
ModalBody, | ||
ModalFooter, | ||
Text, | ||
} from "@chakra-ui/react"; | ||
|
||
const MagazineEditForm = ({ magazine, isOpen, onClose, onSubmit }) => { | ||
const [name, setName] = useState(magazine ? magazine.name : ""); | ||
const [publicationDate, setPublicationDate] = useState( | ||
magazine ? magazine.publicationDate : "" | ||
); | ||
const [coverImage, setCoverImage] = useState( | ||
magazine ? magazine.coverImage : "" | ||
); | ||
|
||
const [coverImageURL, setCoverImageURL] = useState( | ||
magazine ? magazine.coverImage : "" | ||
); | ||
|
||
|
||
const handleSubmit = () => { | ||
onSubmit({ name, publicationDate, coverImage }); | ||
}; | ||
|
||
const handleImageChange = (e) => { | ||
const selectedFile = e.target.files[0]; | ||
if (selectedFile) { | ||
setFile(selectedFile); | ||
setError(""); | ||
setCoverImageURL(URL.createObjectURL(selectedFile)); | ||
|
||
setMagazine((prevMagazine) => ({ | ||
...prevMagazine, | ||
coverImage: URL.createObjectURL(selectedFile), | ||
})); | ||
} else { | ||
setFile(null); | ||
setError("Lütfen bir dosya seçin."); | ||
setCoverImageURL(""); | ||
|
||
setMagazine((prevMagazine) => ({ | ||
...prevMagazine, | ||
coverImage: "", | ||
})); | ||
} | ||
}; | ||
|
||
|
||
return ( | ||
<Modal isOpen={isOpen} onClose={onClose}> | ||
<ModalOverlay /> | ||
<ModalContent> | ||
<ModalHeader>Dergi Düzenle</ModalHeader> | ||
<ModalCloseButton /> | ||
<ModalBody> | ||
<FormControl> | ||
<FormLabel htmlFor="name">Dergi Adı</FormLabel> | ||
<Input | ||
type="text" | ||
id="name" | ||
value={name} | ||
onChange={(e) => setName(e.target.value)} | ||
/> | ||
</FormControl> | ||
<FormControl mt={4}> | ||
<FormLabel htmlFor="publicationDate">Yayın Tarihi</FormLabel> | ||
<Input | ||
type="text" | ||
id="publicationDate" | ||
value={publicationDate} | ||
onChange={(e) => setPublicationDate(e.target.value)} | ||
/> | ||
</FormControl> | ||
<FormControl mt={4}> | ||
<FormLabel htmlFor="coverImage">Kapak Resmi</FormLabel> | ||
<Input | ||
type="file" | ||
id="coverImage" | ||
accept="image/*" | ||
onChange={handleImageChange} | ||
/> | ||
<Text mt={2} fontSize="sm" color="gray.500"> | ||
Veya kapak resmi URL'sini girin: | ||
</Text> | ||
<Input | ||
type="text" | ||
id="coverImageURL" | ||
value={coverImageURL} | ||
onChange={(e) => setCoverImageURL(e.target.value)} | ||
/> | ||
{coverImage && ( | ||
<img | ||
src={coverImage} | ||
alt="Kapak Resmi" | ||
style={{ marginTop: "10px", maxWidth: "100%" }} | ||
/> | ||
)} | ||
</FormControl> | ||
</ModalBody> | ||
<ModalFooter> | ||
<Button colorScheme="teal" mr={3} onClick={handleSubmit}> | ||
Kaydet | ||
</Button> | ||
<Button variant="ghost" onClick={onClose}> | ||
İptal | ||
</Button> | ||
</ModalFooter> | ||
</ModalContent> | ||
</Modal> | ||
); | ||
}; | ||
|
||
export default MagazineEditForm; |
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.