Merge branch 'main' of github.com:Central-University-IT-prod/PROD-Animulichki-SkillHub
This commit is contained in:
+52
@@ -0,0 +1,52 @@
|
|||||||
|
# Generated by Django 4.2.11 on 2024-04-02 11:00
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
("events", "0001_initial"),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AddField(
|
||||||
|
model_name="event",
|
||||||
|
name="description",
|
||||||
|
field=models.TextField(default=""),
|
||||||
|
),
|
||||||
|
migrations.AddField(
|
||||||
|
model_name="event",
|
||||||
|
name="end_date",
|
||||||
|
field=models.DateField(blank=True, null=True),
|
||||||
|
),
|
||||||
|
migrations.AddField(
|
||||||
|
model_name="event",
|
||||||
|
name="is_online",
|
||||||
|
field=models.BooleanField(default=True, verbose_name="оффлайн или онлайн"),
|
||||||
|
),
|
||||||
|
migrations.AddField(
|
||||||
|
model_name="event",
|
||||||
|
name="limitation",
|
||||||
|
field=models.CharField(
|
||||||
|
choices=[
|
||||||
|
("Everyone", "everyone"),
|
||||||
|
("School", "school"),
|
||||||
|
("Student", "student"),
|
||||||
|
("Professional", "professional"),
|
||||||
|
],
|
||||||
|
default="everyone",
|
||||||
|
max_length=64,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
migrations.AddField(
|
||||||
|
model_name="event",
|
||||||
|
name="location",
|
||||||
|
field=models.CharField(default="", max_length=512),
|
||||||
|
),
|
||||||
|
migrations.AddField(
|
||||||
|
model_name="event",
|
||||||
|
name="start_date",
|
||||||
|
field=models.DateField(blank=True, null=True),
|
||||||
|
),
|
||||||
|
]
|
||||||
@@ -4,12 +4,52 @@ from api.core.models import BaseModel
|
|||||||
|
|
||||||
|
|
||||||
class Event(BaseModel):
|
class Event(BaseModel):
|
||||||
title = models.CharField(max_length=255)
|
LIMITATIONS = (
|
||||||
|
("Everyone", "everyone"),
|
||||||
|
("School", "school"),
|
||||||
|
("Student", "student"),
|
||||||
|
("Professional", "professional"),
|
||||||
|
)
|
||||||
|
|
||||||
|
title = models.CharField(
|
||||||
|
max_length=255,
|
||||||
|
)
|
||||||
|
|
||||||
users = models.ManyToManyField(
|
users = models.ManyToManyField(
|
||||||
"users.User",
|
"users.User",
|
||||||
related_name="events",
|
related_name="events",
|
||||||
blank=True,
|
blank=True,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
start_date = models.DateField(
|
||||||
|
null=True,
|
||||||
|
blank=True,
|
||||||
|
)
|
||||||
|
|
||||||
|
end_date = models.DateField(
|
||||||
|
null=True,
|
||||||
|
blank=True,
|
||||||
|
)
|
||||||
|
|
||||||
|
description = models.TextField(
|
||||||
|
default="",
|
||||||
|
)
|
||||||
|
|
||||||
|
is_online = models.BooleanField(
|
||||||
|
default=True,
|
||||||
|
verbose_name="оффлайн или онлайн",
|
||||||
|
)
|
||||||
|
|
||||||
|
location = models.CharField(
|
||||||
|
max_length=512,
|
||||||
|
default="",
|
||||||
|
)
|
||||||
|
|
||||||
|
limitation = models.CharField(
|
||||||
|
max_length=64,
|
||||||
|
choices=LIMITATIONS,
|
||||||
|
default="everyone",
|
||||||
|
)
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return self.title
|
return self.title
|
||||||
|
|||||||
Generated
+6
@@ -8,6 +8,7 @@
|
|||||||
"name": "skill-hub",
|
"name": "skill-hub",
|
||||||
"version": "0.0.0",
|
"version": "0.0.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@balkangraph/orgchart.js": "^8.14.19",
|
||||||
"@hookform/resolvers": "^3.3.4",
|
"@hookform/resolvers": "^3.3.4",
|
||||||
"@radix-ui/react-accordion": "^1.1.2",
|
"@radix-ui/react-accordion": "^1.1.2",
|
||||||
"@radix-ui/react-avatar": "^1.0.4",
|
"@radix-ui/react-avatar": "^1.0.4",
|
||||||
@@ -505,6 +506,11 @@
|
|||||||
"node": ">=6.9.0"
|
"node": ">=6.9.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/@balkangraph/orgchart.js": {
|
||||||
|
"version": "8.14.19",
|
||||||
|
"resolved": "https://registry.npmjs.org/@balkangraph/orgchart.js/-/orgchart.js-8.14.19.tgz",
|
||||||
|
"integrity": "sha512-pa4km/5mTWmMcVLBIsHcuC73s4y1La9BOx4AU9ilGetQwlAbWfrFcSU7hf8FO49otmk1AysfBhPrcBoRl2i46w=="
|
||||||
|
},
|
||||||
"node_modules/@babel/template": {
|
"node_modules/@babel/template": {
|
||||||
"version": "7.24.0",
|
"version": "7.24.0",
|
||||||
"resolved": "https://registry.npmjs.org/@babel/template/-/template-7.24.0.tgz",
|
"resolved": "https://registry.npmjs.org/@babel/template/-/template-7.24.0.tgz",
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
"preview": "vite preview"
|
"preview": "vite preview"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@balkangraph/orgchart.js": "^8.14.19",
|
||||||
"@hookform/resolvers": "^3.3.4",
|
"@hookform/resolvers": "^3.3.4",
|
||||||
"@radix-ui/react-dialog": "^1.0.5",
|
"@radix-ui/react-dialog": "^1.0.5",
|
||||||
"@radix-ui/react-dropdown-menu": "^2.0.6",
|
"@radix-ui/react-dropdown-menu": "^2.0.6",
|
||||||
|
|||||||
@@ -7,8 +7,6 @@ import {
|
|||||||
} from "react-router-dom";
|
} from "react-router-dom";
|
||||||
import Landing from "./components/pages/Landing/Landing";
|
import Landing from "./components/pages/Landing/Landing";
|
||||||
import Main from "./components/pages/Main/Main";
|
import Main from "./components/pages/Main/Main";
|
||||||
import Teams from "./components/pages/Teams/Teams";
|
|
||||||
import MyTeams from "./components/pages/MyTeams/MyTeams";
|
|
||||||
import Successful from "./components/pages/Successful/Successful";
|
import Successful from "./components/pages/Successful/Successful";
|
||||||
import AdminPage from "./components/pages/Admin/Admin";
|
import AdminPage from "./components/pages/Admin/Admin";
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,21 @@
|
|||||||
|
import React, { Component } from "react";
|
||||||
|
import OrgChart from "../../../mytree.jsx";
|
||||||
|
|
||||||
|
const Tree = () => {
|
||||||
|
return (
|
||||||
|
<div style={{ height: "100%" }}>
|
||||||
|
<OrgChart
|
||||||
|
nodes={[
|
||||||
|
{ id: 1, name: "Denny Curtis", title: "CEO", img: "https://cdn.balkan.app/shared/2.jpg" },
|
||||||
|
{ id: 2, pid: 1, name: "Ashley Barnett", title: "Sales Manager", img: "https://cdn.balkan.app/shared/3.jpg" },
|
||||||
|
{ id: 3, pid: 1, name: "Caden Ellison", title: "Dev Manager", img: "https://cdn.balkan.app/shared/4.jpg" },
|
||||||
|
{ id: 4, pid: 2, name: "Elliot Patel", title: "Sales", img: "https://cdn.balkan.app/shared/5.jpg" },
|
||||||
|
{ id: 5, pid: 2, name: "Lynn Hussain", title: "Sales", img: "https://cdn.balkan.app/shared/6.jpg" },
|
||||||
|
{ id: 6, pid: 3, name: "Tanner May", title: "Developer", img: "https://cdn.balkan.app/shared/7.jpg" },
|
||||||
|
{ id: 7, pid: 3, name: "Fran Parsons", title: "Developer", img: "https://cdn.balkan.app/shared/8.jpg" },
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
export default Tree;
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
import React, { Component } from "react";
|
||||||
|
import OrgChart from "@balkangraph/orgchart.js";
|
||||||
|
|
||||||
|
export default class Chart extends Component {
|
||||||
|
constructor(props) {
|
||||||
|
super(props);
|
||||||
|
this.divRef = React.createRef();
|
||||||
|
}
|
||||||
|
|
||||||
|
shouldComponentUpdate() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
componentDidMount() {
|
||||||
|
this.chart = new OrgChart(this.divRef.current, {
|
||||||
|
nodes: this.props.nodes,
|
||||||
|
|
||||||
|
nodeBinding: {
|
||||||
|
field_0: "name",
|
||||||
|
img_0: "img",
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
render() {
|
||||||
|
return <div id="tree" ref={this.divRef}></div>;
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user