-
Notifications
You must be signed in to change notification settings - Fork 2
Upload files of admin panel #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| Copyright 2020 David Baruch Klein a.k.a Polarts | ||
|
|
||
| Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: | ||
|
|
||
| 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. | ||
|
|
||
| 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. | ||
|
|
||
| 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. | ||
|
|
||
| THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,16 @@ | ||
| # haifa-dev-admin-panel | ||
| An admin panel to manage data for the Haifa:Dev website | ||
| # Haifa-dev-admin-panel | ||
|
|
||
| An admin panel to manage data for the Haifa:Dev website. | ||
|
|
||
| ## Prerequisites | ||
|
|
||
| - You need haifa-dev-backend project | ||
|
|
||
| ## Getting started | ||
|
|
||
| - Open the terminal at the project directory and run the command: | ||
|
|
||
| ```sh | ||
| npm install (shortened: npm i ) | ||
| npm start | ||
| ``` |
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| { | ||
| "name": "haifa-dev-admin-panel", | ||
| "version": "0.1.0", | ||
| "private": true, | ||
| "dependencies": { | ||
| "@fullcalendar/core": "^4.4.0", | ||
| "@fullcalendar/daygrid": "^4.4.2", | ||
| "@fullcalendar/react": "^4.4.2", | ||
| "@material-ui/core": "^4.10.2", | ||
| "@testing-library/jest-dom": "^4.2.4", | ||
| "@testing-library/react": "^9.5.0", | ||
| "@testing-library/user-event": "^7.2.1", | ||
| "axios": "^0.19.2", | ||
| "bootstrap": "^4.5.0", | ||
| "faker": "^4.1.0", | ||
| "fontawesome-4.7": "^4.7.0", | ||
| "react": "^16.13.1", | ||
| "react-bootstrap": "^1.0.1", | ||
| "react-dom": "^16.13.1", | ||
| "react-router-dom": "^5.1.2", | ||
| "react-scripts": "3.4.1" | ||
| }, | ||
| "scripts": { | ||
| "start": "react-scripts start", | ||
| "build": "react-scripts build", | ||
| "test": "react-scripts test", | ||
| "eject": "react-scripts eject" | ||
| }, | ||
| "eslintConfig": { | ||
| "extends": "react-app" | ||
| }, | ||
| "browserslist": { | ||
| "production": [ | ||
| ">0.2%", | ||
| "not dead", | ||
| "not op_mini all" | ||
| ], | ||
| "development": [ | ||
| "last 1 chrome version", | ||
| "last 1 firefox version", | ||
| "last 1 safari version" | ||
| ] | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| <!DOCTYPE html> | ||
| <html lang="en"> | ||
| <head> | ||
| <meta charset="utf-8" /> | ||
| <link rel="icon" href="%PUBLIC_URL%/favicon.ico" /> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
| <meta name="theme-color" content="#000000" /> | ||
| <meta | ||
| name="description" | ||
| content="Web site created using create-react-app" | ||
| /> | ||
| <link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" /> | ||
| <!-- | ||
| manifest.json provides metadata used when your web app is installed on a | ||
| user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/ | ||
| --> | ||
| <link rel="manifest" href="%PUBLIC_URL%/manifest.json" /> | ||
| <!-- | ||
| Notice the use of %PUBLIC_URL% in the tags above. | ||
| It will be replaced with the URL of the `public` folder during the build. | ||
| Only files inside the `public` folder can be referenced from the HTML. | ||
|
|
||
| Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will | ||
| work correctly both with client-side routing and a non-root public URL. | ||
| Learn how to configure a non-root public URL by running `npm run build`. | ||
| --> | ||
| <title>React App</title> | ||
| </head> | ||
| <body> | ||
| <noscript>You need to enable JavaScript to run this app.</noscript> | ||
| <div id="root"></div> | ||
| <!-- | ||
| This HTML file is a template. | ||
| If you open it directly in the browser, you will see an empty page. | ||
|
|
||
| You can add webfonts, meta tags, or analytics to this file. | ||
| The build step will place the bundled scripts into the <body> tag. | ||
|
|
||
| To begin the development, run `npm start` or `yarn start`. | ||
| To create a production bundle, use `npm run build` or `yarn build`. | ||
| --> | ||
| </body> | ||
| </html> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| { | ||
| "short_name": "React App", | ||
| "name": "Create React App Sample", | ||
| "icons": [ | ||
| { | ||
| "src": "favicon.ico", | ||
| "sizes": "64x64 32x32 24x24 16x16", | ||
| "type": "image/x-icon" | ||
| }, | ||
| { | ||
| "src": "logo192.png", | ||
| "type": "image/png", | ||
| "sizes": "192x192" | ||
| }, | ||
| { | ||
| "src": "logo512.png", | ||
| "type": "image/png", | ||
| "sizes": "512x512" | ||
| } | ||
| ], | ||
| "start_url": ".", | ||
| "display": "standalone", | ||
| "theme_color": "#000000", | ||
| "background_color": "#ffffff" | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| # https://www.robotstxt.org/robotstxt.html | ||
| User-agent: * | ||
| Disallow: |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,120 @@ | ||
| import React, { Component } from 'react'; | ||
| import { Route, Switch, BrowserRouter } from "react-router-dom"; | ||
|
|
||
| // var Navbar = ReactBootstrap.Navbar; | ||
| // import { Navbar } from 'react-bootstrap'; | ||
| // import Navbar from 'react-bootstrap/Navbar'; | ||
| import Navbar from 'react-bootstrap/Navbar'; | ||
| import Nav from 'react-bootstrap/Nav'; | ||
| // import NavDropdown from 'react-bootstrap/NavDropdown'; | ||
|
|
||
| import Home from "./pages/Home/Home"; | ||
| import Profile from "./pages/Profile/View"; | ||
| import ProfileCreate from "./pages/Profile/Create"; | ||
| // import ProfileEdit from "./pages/Profile/Edit"; | ||
| import Event from "./pages/Event/Event"; | ||
| import Project from "./pages/Project/Project"; | ||
| import Request from "./pages/Request/Request"; | ||
| // import { render } from "@testing-library/react"; | ||
|
|
||
| const navItems = [ | ||
| { displayName: "Home", href: "/Home", className: "fa fa-home" }, | ||
| { displayName: "Profile", href: "/Profile", className: "fa fa-user" }, | ||
| { displayName: "Events", href: "/Event", className: "fa fa-calendar" }, | ||
| { displayName: "Projects", href: "/Project", className: "fa fa-diamond" }, | ||
| { displayName: "Requests", href: "/Request", className: "fa fa-paper-plane-o" } | ||
| ]; | ||
|
|
||
|
|
||
| const MyNav = (props) => { | ||
| const navItems = props.navItems; | ||
|
Comment on lines
+29
to
+30
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If you only use 1 property of props, use deconstruction instead. |
||
| const listItems = navItems.map((navItem) => | ||
| <a className="list-group-item list-group-item-action bg-black" href={navItem.href} key={navItem.displayName}> | ||
| <i className={navItem.className} aria-hidden="true"></i> | ||
| {navItem.displayName} | ||
| </a> | ||
| ); | ||
| return ( | ||
| <div className="list-group list-group-flush"> | ||
| {listItems} | ||
| </div> | ||
|
|
||
| ); | ||
| } | ||
|
Comment on lines
+20
to
+43
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could be a good idea to move it to a separated file |
||
|
|
||
|
|
||
|
|
||
| class App extends Component { | ||
|
|
||
| constructor(props) { | ||
| super(props); | ||
| this.state = { isToggleOn: true }; | ||
| // This binding is necessary to make `this` work in the callback | ||
| this.handleClick = this.handleClick.bind(this); | ||
| } | ||
|
|
||
| handleClick() { | ||
| this.setState(prevState => ({ | ||
| isToggleOn: !prevState.isToggleOn | ||
| })); | ||
| } | ||
| render() { | ||
| return (<BrowserRouter> | ||
| <div id="wrapper" className={this.state.isToggleOn ? 'd-flex toggled' : 'd-flex'}> | ||
| {/* <!-- Sidebar --> */} | ||
| <div className="" id="sidebar-wrapper"> | ||
| <div className="sidebar-heading "> | ||
| <div className="logo small"> | ||
| <span>:dev</span> | ||
| {/* <span className='d-block' style={{ fontSize: '0.8rem' }}>community</span> */} | ||
| </div> | ||
| {/* <div className="logo big"> | ||
| haifa<span>:dev</span> | ||
| <span className='d-block' style={{ fontSize: '0.8rem' }}>developers community</span> | ||
| </div> */} | ||
| </div> | ||
| <MyNav navItems={navItems} /> | ||
| </div > | ||
| {/* <!-- /#sidebar-wrapper --> */} | ||
| {/* <!-- Page Content --> */} | ||
| <div id="page-content-wrapper"> | ||
|
|
||
| <Navbar collapseOnSelect expand="lg" bg="" variant="dark" className="border-bottom"> | ||
| <button className="navbar-toggler navbar-toggler-dark btn-circle m-1" id="menu-toggle" onClick={this.handleClick}> | ||
| {/* <i className="fa fa-bars" aria-hidden="true"></i> | ||
| <span className="sr-only">Toggle Menu</span> */} | ||
| <span className="navbar-toggler-icon"></span> | ||
| </button> | ||
| <Navbar.Brand href="#home">React-Bootstrap</Navbar.Brand> | ||
| <Navbar.Toggle aria-controls="responsive-navbar-nav" className=" btn-circle m-1" /> | ||
| <Navbar.Collapse id="responsive-navbar-nav"> | ||
| <Nav className="ml-auto"> | ||
| <Nav.Link href="#User">User</Nav.Link> | ||
| </Nav> | ||
| </Navbar.Collapse> | ||
| </Navbar> | ||
|
|
||
| <div className="container-fluid"> | ||
|
|
||
| <Switch> | ||
| <Route exact path="/" component={Home} /> | ||
| <Route exact path="/Home" component={Home} /> | ||
| <Route exact path="/Profile" component={Profile} /> | ||
| <Route exact path="/Profile/Create" component={ProfileCreate} /> | ||
| {/* <Route exact path="/Profile/Edit" component={ProfileEdit} /> */} | ||
| <Route exact path="/Event" component={Event} /> | ||
| <Route exact path="/Project" component={Project} /> | ||
| <Route exact path="/Request" component={Request} /> | ||
| </Switch> | ||
| {/* <script src="lib/bootstrap/dist/js/bootstrap.bundle.js"></script> */} | ||
| </div> | ||
| </div> | ||
| {/* <!-- /#page-content-wrapper --> */} | ||
| </div> | ||
|
|
||
| </BrowserRouter > | ||
| ) | ||
| } | ||
| }; | ||
|
|
||
| export default App; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| import axios from 'axios'; | ||
|
|
||
| export const baseURL = 'http://localhost:5000'; | ||
| export const serverURL = `${baseURL}/api/v1`; | ||
|
|
||
| export default axios.create({ | ||
| baseURL: serverURL | ||
| }); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| import React from 'react'; | ||
| import { baseURL } from '../api/server'; | ||
|
|
||
| export const Image = ({ image }) => ( | ||
| <div style={{ margin: '.0rem' }}> | ||
| <img style={{ width: '1rem' }} src={`${baseURL}/${image}`} alt="developer profile" /> | ||
| </div> | ||
| ); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| import React from 'react'; | ||
| import PropTypes from 'prop-types'; | ||
|
|
||
| const Socials = ({ socials }) => | ||
| socials && socials.map(social => ( | ||
| <a style={{ marginRight: '1em', padding: '.50em 0.50em' }} | ||
| key={social.id} | ||
| href={'/users/' + social.id} | ||
| target="_blank" | ||
| rel="noopener noreferrer" className="badge badge-warning"> | ||
|
|
||
| {social.name} | ||
| {/* <span className="float-right"><i className="fa fa-circle" aria-hidden="true"></i> online</span> */} | ||
| </a> | ||
| )); | ||
|
|
||
| Socials.propTypes = { | ||
| socials: PropTypes.array.isRequired | ||
| }; | ||
|
|
||
| export default Socials; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't you make a model class for this? It will be much easier