templates

This commit is contained in:
emilyliublair committed 2021-09-12 15:08:49 -04:00
1 parent 4f9a69707c
commit ed59b3f47b
28 files changed
+1366 -268

No files matched your search

+13 -6
View File
@@ -40,14 +40,22 @@ const getCurrentDate=()=>{
const Announcement = ({item}) => {
const todayDate = getCurrentDate()
const itemDate = new Date(item.item.date)
const dateInfo = todayDate.getTime()===itemDate.getTime()&&item.item.time!==undefined?item.item.time:(item.item.date+", " + item.item.time)
var time_array = item.item.time.split(':')
if (time_array[0]>12) {
var time = String(parseInt(time_array[0])-12) + ':' + String(time_array[1]) + ' PM'
}
else {
var time = String(time_array[0])+':'+String(time_array[1]) + ' AM'
}
const dateInfo = todayDate.getTime()===itemDate.getTime()&&item.item.time!==undefined?item.item.time:(item.item.date+", " + time)
return (
<View style={{borderWidth: 1, borderColor: '#323232', padding: '2%', marginHorizontal: '2%', marginBottom: '2%', borderRadius: 12}}>
<View style = {{display: 'flex', flexDirection: 'column', justifyContent: 'space-between'}}>
<View style = {{width: '100%'}}>
<Text style={styles.title}>{item.item.message}</Text>
</View>
{dateInfo!==undefined?<Text style={{fontSize: 12, fontWeight: '200'}}>{dateInfo}</Text>:<></>}
{dateInfo!==undefined?<Text style={{fontSize: 12, fontWeight: '200'}}>Posted {dateInfo}</Text>:<></>}
</View>
</View>
)
@@ -84,7 +92,7 @@ export const TeacherList = ({route}) => {
var futureBoolean = true
for (var i = 0; i < route.params.data.length; i++) {
const itemDate = new Date(route.params.data[i].date)
const itemDate = new Date(parseInt(String(route.params.data[i].date).split('-')[0]), parseInt(String(route.params.data[i].date).split('-')[1])-1, parseInt(String(route.params.data[i].date).split('-')[2]))
if (itemDate.getTime() == todayDate.getTime()) {
today.push(route.params.data[i])
}
@@ -173,8 +181,8 @@ class Announcements extends React.Component {
return response.text()
})
.then((txt) => {
const data = JSON.parse(txt).data;
console.log(data)
const data = JSON.parse(txt);
data.sort((a,b)=>a.id-b.id)
const teacherNames = [...new Set(data.filter(x=>x.teacher!=null&&x.teacher.trim()!=='').map(x=>x.teacher))];
teacherNames.sort()
this.setState({data: data, teacherNames: teacherNames.map(x=>({name:x})),isLoading:false});
@@ -185,7 +193,6 @@ class Announcements extends React.Component {
render() {
return (
<ScrollView style={styles.moreDefault}>
<TeacherButton data={this.state.data.filter(x=>x.teacher==null||x.teacher.trim()==='')} name="No Teacher" navigation={this.props.navigation} />
<FlatList
data={this.state.favoriteNames.concat(this.state.teacherNames.filter(x=>this.state.favoriteNames.map(({name})=>name).indexOf(x.name) < 0))}
renderItem={({item})=><TeacherButton color={this.state.favoriteNames.indexOf(item) >= 0?'red':'lightgrey'} item={item} data={this.state.data.filter(x=>x.teacher===item.name)} name={item.name} navigation={this.props.navigation} icon={true} addFavorite={this.addFavorite}/>}
+1 -1
View File
@@ -174,7 +174,7 @@ class Calendar extends React.Component {
}
getData() {
fetch(`http://127.0.0.1:8080/api/en/events`,{
fetch(`${url}/api/`+String(I18n.locale).split('-')[0]+`/events`,{
headers: {
'Cache-Control': 'no-cache'
} })
+20 -62
View File
@@ -28,7 +28,8 @@ class ChallengeWeek extends React.Component {
super(props)
this.state = {
isLoading: true,
flip: true
flip: true,
data:[]
}
}
@@ -40,74 +41,31 @@ class ChallengeWeek extends React.Component {
).then((response) => {
return response.text();
}).then((json) => {
this.setState({data: JSON.parse(json),isLoading:false});
const data = JSON.parse(json)
data.sort((a,b)=>a.id-b.id)
this.setState({data: data,isLoading:false});
}).catch((error) => console.error(error))
/*this.animatedValue=new Animated.Value(0);
this.value=0;
this.animatedValue.addListener(({value}) => {
this.value=value;
})
this.frontInterpolate = this.animatedValue.interpolate({
inputRange:[0,180],
outputRange:['0deg', '180deg'],
})
this.backInterpolate = this.animatedValue.interpolate({
inputRange:[0,180],
outputRange: ['180deg','360deg']
})*/
}
/*flipCard() {
if (this.value >= 90) {
Animated.spring(this.animatedValue, {
toValue:0,
friction:8,
tension: 10
}).start();
}
else {
Animated.spring(this.animatedValue, {
toValue:180,
friction: 8,
tension: 10
}).start();
}
this.setState({flip:!this.state.flip})
}*/
render() {
{/*const frontAnimatedStyle = {
transform: [
{rotateY:this.frontInterpolate}
]
}
const backAnimatedStyle = {
transform: [
{rotateY:this.backInterpolate}
]
}
var styling={}
var styling2={}
if (this.state.flip) {
styling=({height: '100%', width: '100%', backgroundColor: 'white', borderRadius: 20, textAlign: 'center', display: 'flex', alignContent: 'center', padding: '5%', paddingTop: '15%', borderColor: 'red', borderWidth: 1})
styling2=({display:'none'})
}
else {
styling=({display:'none'})
styling2=({height: '100%', width: '100%', backgroundColor: 'white', borderRadius: 20, textAlign: 'center', display: 'flex', alignContent: 'center', padding: '5%', paddingTop: '15%', borderColor: 'red', borderWidth: 1})
}*/}
if (this.state.isLoading) {
return <View/>
} else {
return (
<View style={{alignItems:'center',paddingiorizontal:'10%', height: '100%', backgroundColor: 'white', justifyContent: 'center', padding: '2%'}}>
<Text style={{fontSize: 32, fontWeight: 'bold', marginBottom: '10%', color: 'red', textAlign: 'center'}}>{this.state.data.title}</Text>
<Text style={{textAlign:'center', fontSize: 24, marginBottom: '5%', textAlign: 'center', fontWeight: '200'}}>{this.state.data.text}</Text>
<Text style={{textAlign:'center', fontSize: 20, textDecorationLine: 'underline', textDecorationStyle: "solid", textDecorationColor: "#000"}} onPress={() => Linking.openURL(this.state.data.link)}>{I18n.t("challenge.link")}</Text>
</View>
)
if (this.state.data[this.state.data.length-1]==undefined) {
return (
<View style={{alignItems:'center',paddingiorizontal:'10%', height: '100%', backgroundColor: 'white', justifyContent: 'center', padding: '2%'}}>
<Text style={{fontSize: 32, fontWeight: 'bold', marginBottom: '10%', color: 'red', textAlign: 'center'}}>No challenge</Text>
</View>
)
} else {
return (
<View style={{alignItems:'center',paddingiorizontal:'10%', height: '100%', backgroundColor: 'white', justifyContent: 'center', padding: '2%'}}>
<Text style={{fontSize: 32, fontWeight: 'bold', marginBottom: '10%', color: 'red', textAlign: 'center'}}>{this.state.data[this.state.data.length-1].title}</Text>
<Text style={{textAlign:'center', fontSize: 24, marginBottom: '5%', textAlign: 'center', fontWeight: '200'}}>{this.state.data[this.state.data.length-1].text}</Text>
<Text style={{textAlign:'center', fontSize: 20, textDecorationLine: 'underline', textDecorationStyle: "solid", textDecorationColor: "#000"}} onPress={() => Linking.openURL(this.state.data[this.state.data.length-1].link)}>{I18n.t("challenge.link")}</Text>
</View>
)
}
}
}
}
+5 -1
View File
@@ -148,8 +148,12 @@ class Clubs extends React.Component {
return response.text();
})
.then((json) => {
this.setState({data: JSON.parse(json).clubs,dataSearch:JSON.parse(json).clubs });
const data = JSON.parse(json)
data.sort((a,b)=>a.id-b.id)
this.setState({data: data,dataSearch:data });
console.log(this.state.data)
})
.catch((error) => console.error(error))
}
+51 -21
View File
@@ -54,14 +54,22 @@ const getCurrentDate=()=>{
const Announcement = ({item}) => {
const todayDate = getCurrentDate()
const itemDate = new Date(item.item.date)
const dateInfo = todayDate.getTime()===itemDate.getTime()&&item.item.time!==undefined?item.item.time:(item.item.date+", " + item.item.time)
var time_array = item.item.time.split(':')
if (time_array[0]>12) {
var time = String(parseInt(time_array[0])-12) + ':' + String(time_array[1]) + ' PM'
}
else {
var time = String(time_array[0])+':'+String(time_array[1]) + ' AM'
}
const dateInfo = todayDate.getTime()===itemDate.getTime()&&item.item.time!==undefined?item.item.time:(item.item.date+", " + time)
return (
<View style={{borderWidth: 1, borderColor: '#323232', padding: '2%', marginHorizontal: '2%', marginBottom: '2%', borderRadius: 12}}>
<View style = {{display: 'flex', flexDirection: 'column', justifyContent: 'space-between'}}>
<View style = {{width: '100%'}}>
<Text style={liststyles.title}>{item.item.message}</Text>
</View>
{dateInfo!==undefined?<Text style={{fontSize: 12, fontWeight: '200'}}>{dateInfo}</Text>:<></>}
{dateInfo!==undefined?<Text style={{fontSize: 12, fontWeight: '200'}}>Posted {dateInfo}</Text>:<></>}
</View>
</View>
)
@@ -98,7 +106,7 @@ export const TeacherList = ({route}) => {
var futureBoolean = true
for (var i = 0; i < route.params.data.length; i++) {
const itemDate = new Date(route.params.data[i].date)
const itemDate = new Date(parseInt(String(route.params.data[i].date).split('-')[0]), parseInt(String(route.params.data[i].date).split('-')[1])-1, parseInt(String(route.params.data[i].date).split('-')[2]))
if (itemDate.getTime() == todayDate.getTime()) {
today.push(route.params.data[i])
}
@@ -116,11 +124,11 @@ export const TeacherList = ({route}) => {
var noAnn = (todayBoolean||pastBoolean||futureBoolean)
return (
<ScrollView style={{flex: 1, backgroundColor: 'white'}}>
<ScrollView style={{flex:1, backgroundColor: 'white'}}>
{todayBoolean?<NewTeacherList name = 'today' list = {today} />:<></>}
{pastBoolean?<NewTeacherList name = 'past' list = {past} />:<></>}
{futureBoolean?<NewTeacherList name = 'future' list = {future} />:<></>}
{!noAnn?<Text style={{textAlign: 'center', fontSize: 20, paddingTop: '2%'}}>{I18n.t('home.noAnnouncements')}</Text>:<></>}
{!noAnn?<Text style={{textAlign: 'center', fontSize: 20, paddingTop: '2%'}}>{I18n.t('announcements.noAnnouncements')}</Text>:<></>}
</ScrollView>
)
}
@@ -188,7 +196,7 @@ export const whatsNew = ({route}) => {
export const NewItem = ({route}) => {
const item = route.params.data
const iconURI = item.icon !== undefined?`data:image/png;charset=utf-8;base64,${item.icon}`:''
const iconURI = item.image !== undefined?`data:image/png;charset=utf-8;base64,${item.image}`:''
return (
<ScrollView style={{height: '100%', backgroundColor: 'white'}}>
@@ -204,13 +212,21 @@ export const NewItem = ({route}) => {
}
const AnnouncementToday = ({item}) => {
const teacher = item.item.teacher !==""?item.item.teacher:"No Teacher"
const teacher = item.item.teacher
var time_array = item.item.time.split(':')
if (time_array[0]>12) {
var time = String(parseInt(time_array[0])-12) + ':' + String(time_array[1]) + ' PM'
}
else {
var time = String(time_array[0])+':'+String(time_array[1]) + ' AM'
}
return (
<View style = {{display: 'flex', flexDirection: 'row', alignItems: 'center', padding: '2%', paddingVertical: '2.5%', justifyContent: 'space-between', borderBottomWidth: 1, borderColor: "#b2b2b2"}}>
<View style = {{width: '72%'}}>
<Text style={{fontSize: 18}}>{item.item.message}</Text>
<Text style={{fontSize: 12, fontWeight: '200', paddingTop: '1%'}}>{item.item.time}</Text>
<Text style={{fontSize: 12, fontWeight: '200', paddingTop: '1%'}}>{time}</Text>
</View>
<View style = {{width: '25%', display: 'flex', flexDirection: 'row', justifyContent: 'flex-end'}}>
<Text style={{fontSize: 14, alignSelf: 'center', fontWeight: '200'}}>{teacher}</Text>
@@ -364,7 +380,9 @@ function HomeStack() {
}
function HomeScreen (props) {
const iconURI = props.studentData.icon !== undefined?`data:image/png;charset=utf-8;base64,${props.studentData.icon}`:`data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAYAAAA6/NlyAAAMZWlDQ1BJQ0MgUHJvZmlsZQAASImVlwdck0cbwO8dmSSsQARkhL1EkRlARggrgoBMQVRCEkgYMSYEETe1VMG6RRRHRasiFq1WQOpAxDqL4raOxoFKpRaruFD5LgNq7Td+3/1+994/zz333PM8uXvfOwAMVHyZrBA1BKBIWixPig5nTcrIZJEeAhowABhwBCP5AoWMk5gYB2AZav9eXl0DiLq97KG29c/+/1qMhSKFAAAkC3KOUCEogtwGAF4ukMmLASBGQLn9zGKZmsWQTeTQQchz1Jyn5RVqztHydo1OShIXcgsAZBqfL88DQL8DylklgjxoR/8hZE+pUCIFwMAEcohAzBdCToE8qqhoupoXQHaB+jLIuyCzcz6xmfc3+znD9vn8vGHWxqUp5AiJQlbIn/V/puZ/l6JC5dAcTrDSxPKYJHX8MIc3CqbHqpkGuVeaE5+gzjXkNxKhNu8AoFSxMiZVq49aChRcmD/AhOwp5EfEQraEHCUtjI/TyXNyJVE8yHC1oKWSYl6KbuxikSIyWWdzo3x6UsIQ58q5HN3YRr5cM69av0NZkMrR2b8hFvGG7L8sE6ekQ6YCgFFLJGnxkPUhmygKkmO1OphdmZgbP6QjVyap/XeAzBZJo8O19rGsXHlUkk5fVqQYiherEEt48TquKRanxGjzg+0W8DX+m0FuEkk5qUN2RIpJcUOxCEURkdrYsU6RNFUXL3ZXVhyepBvbJytM1OnjZ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z54J9LX5i/2PnS52V7f2L/3VdFrwZeV74xf7PrLfvtqXfp7x4PzHxPel/zwfVD68fYj7cHiwYHZXw5X3MUwGBFc+G54c+dANAzAGBchOeHydo7n6Yg2nuqhsB/Yu29UFP8AGiEjfq4zm0DYB+sTrDqLwBAfVRPCQOot/dw1RVFrreX1hYN3ngIbwYHX1gBQGoF4IN8cHBg0+DgB3hHxW4C0DZDe9dUFyK8G3zjo6ZLzNIF4LOivYd+EuPnLVB7oBn+t/Zf+Z2KUSELugwAAACKZVhJZk1NACoAAAAIAAQBGgAFAAAAAQAAAD4BGwAFAAAAAQAAAEYBKAADAAAAAQACAACHaQAEAAAAAQAAAE4AAAAAAAAAkAAAAAEAAACQAAAAAQADkoYABwAAABIAAAB4oAIABAAAAAEAAAA8oAMABAAAAAEAAAA8AAAAAEFTQ0lJAAAAU2NyZWVuc2hvdEzNjqkAAAAJcEhZcwAAFiUAABYlAUlSJPAAAAHUaVRYdFhNTDpjb20uYWRvYmUueG1wAAAAAAA8eDp4bXBtZXRhIHhtbG5zOng9ImFkb2JlOm5zOm1ldGEvIiB4OnhtcHRrPSJYTVAgQ29yZSA1LjQuMCI+CiAgIDxyZGY6UkRGIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyI+CiAgICAgIDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIiCiAgICAgICAgICAgIHhtbG5zOmV4aWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20vZXhpZi8xLjAvIj4KI Line truncated
console.log(props.studentData)
const iconURI = null
//const iconURI = props.studentData.image !== undefined?`data:image/png;charset=utf-8;base64,${props.studentData.image}`:`data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAYAAAA6/NlyAAAMZWlDQ1BJQ0MgUHJvZmlsZQAASImVlwdck0cbwO8dmSSsQARkhL1EkRlARggrgoBMQVRCEkgYMSYEETe1VMG6RRRHRasiFq1W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TQ0lJAAAAU2NyZWVuc2hvdEzNjqkAAAAJcEhZcwAAFiUAABYlAUlSJPAAAAHUaVRYdFhNTDpjb20uYWRvYmUueG1wAAAAAAA8eDp4bXBtZXRhIHhtbG5zOng9ImFkb2JlOm5zOm1ldGEvIiB4OnhtcHRrPSJYTVAgQ29yZSA1LjQuMCI+CiAgIDxyZGY6UkRGIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyI+CiAgICAgIDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIiCiAgICAgICAgICAgIHhtbG5zOmV4aWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20vZXhpZi8xLjAvI Line truncated
global.headerHeight = useHeaderHeight();
const todayDate = getCurrentDate()
var todayAnn = []
@@ -450,10 +468,10 @@ function HomeScreen (props) {
<Image source = {{iconURI}} style = {{height:'100%', width: '100%', borderTopRightRadius: 8, borderTopLeftRadius:8}}/>
</View>
<View style ={{width: windowWidth*.60, display: 'flex', paddingLeft: '5%', paddingHorizontal: '2%', alignItems: 'center', justifyContent: 'space-around'}}>
<Text style={{fontSize: 18, textAlign: 'center'}}>{props.studentData.name}, <Text style={{fontWeight: '200', textAlign: 'center'}}>Grade {props.studentData.year}</Text></Text>
<Text style={{fontSize: 18, textAlign: 'center'}}>{props.studentData[props.studentData.length-1].name}, <Text style={{fontWeight: '200', textAlign: 'center'}}>Grade {props.studentData[props.studentData.length-1].grade}</Text></Text>
<TouchableOpacity onPress={()=>props.navigation.navigate(StudentWeek)}>
<View style={{padding: '5%', borderRadius: 16, borderWidth: 1, borderColor: 'red'}}>
<Text style={{fontWeight: '200', color: 'red', textAlign: 'center'}}>{I18n.t('home.moreOn')} {props.studentData.name}</Text>
<Text style={{fontWeight: '200', color: 'red', textAlign: 'center'}}>{I18n.t('home.moreOn')} {props.studentData[props.studentData.length-1].name}</Text>
</View>
</TouchableOpacity>
</View>
@@ -467,7 +485,7 @@ class Home extends React.Component {
constructor(props) {
super(props)
this.state = {
studentData: [],
studentData:[],
annData:[],
data:[],
lunchData:[],
@@ -489,25 +507,30 @@ class Home extends React.Component {
this.setState({favoriteNames:favoriteNames.map(name=>({name:name}))})
AsyncStorage.setItem(STORAGE_KEY,JSON.stringify(favoriteNames)).catch(console.log).done()
}
componentDidMount() {
fetch(`${url}/api/`+String(I18n.locale).split('-')[0]+`/student`,{
headers: {
'Cache-Control': 'no-cache'
}}
).then((response) => {
return response.text();list
return response.text();
}).then((json) => {
this.setState({studentData: JSON.parse(json),isLoading:false});
}).catch((error) => console.error(error))
const data = JSON.parse(json)
data.sort((a,b)=>a.id-b.id)
this.setState({studentData: data,isLoading:false});
}).catch((error) => console.error(error))
fetch(`${url}/api/`+String(I18n.locale).split('-')[0]+`/lunchEvents`,{
fetch(`${url}/api/`+String(I18n.locale).split('-')[0]+`/lunch_events`,{
headers: {
'Cache-Control': 'no-cache'
}}
).then((response) => {
return response.text();
}).then((json) => {
this.setState({lunchData: JSON.parse(json)});
const data = JSON.parse(json)
data.sort((a,b)=>a.id-b.id)
this.setState({lunchData: data});
}).catch((error) => console.error(error))
this.getData()
@@ -535,8 +558,8 @@ class Home extends React.Component {
return response.text();
})
.then((json) => {
console.log(json)
const data = JSON.parse(json).data
data.sort((a,b)=>a.id-b.id)
data.sort((a,b)=>new Date(b.date).getTime()-new Date(a.date).getTime())
this.setState({data: data});
})
@@ -552,20 +575,27 @@ class Home extends React.Component {
return response.text()
})
.then((txt) => {
const data = JSON.parse(txt).data;
const data = JSON.parse(txt);
data.sort((a,b)=>a.id-b.id)
const teacherNames = [...new Set(data.filter(x=>x.teacher!=null&&x.teacher.trim()!=='').map(x=>x.teacher))];
teacherNames.sort()
this.setState({annData: data, teacherNames: teacherNames.map(x=>({name:x})),isLoading:false});
console.log(annData)
}).catch((error) => console.error(error))
}
render() {
if (this.state.isLoading) {
return<View/>
} else {
return (
<View>
<Home1></Home1>
<HomeScreen navigation={this.props.navigation} annData={this.state.annData} studentData={this.state.studentData} data={this.state.data} challengeData = {this.state.challengeData}></HomeScreen>
<HomeScreen navigation={this.props.navigation} annData={this.state.annData} studentData={this.state.studentData} data={this.state.data}></HomeScreen>
</View>
)
)}
}
}
export default HomeStack;
+2 -1
View File
@@ -54,7 +54,8 @@ export default {
},
lunch: {
information: "Information",
location: "Location"
location: "Location",
time: "Time of Event"
},
ssl: {
information: "Information",
+2 -1
View File
@@ -54,7 +54,8 @@ export default {
},
lunch: {
information: "ESInformation",
location: "ESLocation"
location: "ESLocation",
time:"ES TIME OF EVENT"
},
ssl: {
information: "ESInformation",
+21 -3
View File
@@ -55,6 +55,14 @@ const Stack = createStackNavigator();
function LunchEvent (props) {
const item = props.item
const [expand, setExpand] = useState(false);
var time_array = item.time.split(':')
if (time_array[0]>12) {
var time = String(parseInt(time_array[0])-12) + ':' + String(time_array[1]) + ' PM'
}
else {
var time = String(time_array[0])+':'+String(time_array[1]) + ' AM'
}
return(
<View>
<TouchableOpacity style={styles.listItem} onPress={()=>setExpand(!expand)}>
@@ -65,7 +73,15 @@ function LunchEvent (props) {
{expand?<LinearGradient start={{x: 0, y: 0.25}} end={{x: .5, y: 1}} colors={['red', '#FF7373']} style={{borderRadius: 24, alignSelf: 'center'}}><Image source = {require('./assets/collapse.png')} style={{tintColor: 'white'}}/></LinearGradient>:<Image source = {require('./assets/expand.png')} style={{tintColor: '#b2b2b2', alignSelf: 'center'}}/>}
</View>
</View>
{expand?<View style={{marginLeft: 50}}><Text style={styles.accordianHeader}>{I18n.t('lunch.information')}</Text><Text style={styles.accordianText}>{item.text}</Text><Text style={styles.accordianHeader}>{'\n'}{I18n.t('lunch.location')}</Text><Text style={[styles.accordianText, {paddingBottom: '4%'}]}>{item.loc}</Text></View>:<></>}
{expand?
<View style={{marginLeft: 50}}>
<Text style={styles.accordianHeader}>{I18n.t('lunch.information')}</Text>
<Text style={styles.accordianText}>{item.text}</Text>
<Text style={styles.accordianHeader}>{'\n'}{I18n.t('lunch.location')}</Text>
<Text style={[styles.accordianText, {paddingBottom: '4%'}]}>{item.location}</Text>
<Text syle={styles.accordianHeader}>{'\n'}{I18n.t('lunch.time')}</Text>
<Text style={[styles.accordianText, {paddingBottom: '4%'}]}>{time}</Text>
</View>:<></>}
</TouchableOpacity>
</View>
)
@@ -81,7 +97,7 @@ class LunchEvents extends React.Component {
}
componentDidMount() {
fetch(`${url}/api/`+String(I18n.locale).split('-')[0]+`/lunchEvents`,{
fetch(`${url}/api/`+String(I18n.locale).split('-')[0]+`/lunch_events`,{
headers: {
'Cache-Control': 'no-cache'
}
@@ -91,7 +107,9 @@ class LunchEvents extends React.Component {
return response.text();
})
.then((json) => {
this.setState({data: JSON.parse(json)});
const data = JSON.parse(json)
data.sort((a,b)=>a.id-b.id)
this.setState({data: data});
})
.catch((error) => console.error(error))
}
+45 -12
View File
@@ -80,21 +80,54 @@ import {
DebugInstructions,
ReloadInstructions,
} from 'react-native/Libraries/NewAppScreen';
import { url } from './resources/fetchInfo.json'
import {WebView} from 'react-native-webview';
import I18n from 'i18n-js';
class Poll extends React.Component {
constructor(props) {
super(props)
this.state = {
data:[]
}
}
componentDidMount() {
fetch(`${url}/api/`+String(I18n.locale).split('-')[0]+`/polls`,{
headers: {
'Cache-Control': 'no-cache'
}}
).then((response) => {
return response.text();
}).then((json) => {
const data = JSON.parse(json)
data.sort((a,b)=>a.id-b.id)
this.setState({data: data});
}).catch((error) => console.error(error))
}
render() {
return (
<WebView
source = {{uri: 'https://docs.google.com/forms/d/e/1FAIpQLSfR0XP2yo3TV3egz7aMok56wnP9kG4FQt2v3rHrrayf8uC7Vw/viewform?usp=sf_link'}}
javaScriptEnabled={true}
domStorageEnabled={true}
startInLoadingState={true}
style={{marginTop: 0}}
cacheEnabled={true}
/>
)
if (this.state.isLoading) {
return <View/>
} else {
if (this.state.data.length==0) {
return (
<View style={{alignItems:'center',paddingiorizontal:'10%', height: '100%', backgroundColor: 'white', justifyContent: 'center', padding: '2%'}}>
<Text style={{fontSize: 32, fontWeight: 'bold', marginBottom: '10%', color: 'red', textAlign: 'center'}}>No Poll</Text>
</View>
)
} else {
return (
<WebView
source = {{uri: this.state.data[this.state.data.length-1].url}}
javaScriptEnabled={true}
domStorageEnabled={true}
startInLoadingState={true}
style={{marginTop: 0}}
cacheEnabled={true}
/>
)
}
}
}
}
+2
View File
@@ -102,6 +102,8 @@ class SSLOps extends React.Component {
return response.text();
})
.then((json) => {
const data = JSON.parse(json)
data.sort((a,b)=>a.id-b.id)
this.setState({data: JSON.parse(json)});
})
.catch((error) => console.error(error))
+8 -4
View File
@@ -179,8 +179,10 @@ class Staffs extends React.Component {
return response.text();
})
.then((json) => {
this.setState({data: JSON.parse(json).data});
this.setState({dataSearch:JSON.parse(json).data});
const data = JSON.parse(json)
data.sort((a,b)=>a.id-b.id)
this.setState({data: data});
this.setState({dataSearch: data});
})
.catch((error) => console.error(error))
}
@@ -197,7 +199,9 @@ class Staffs extends React.Component {
}
render() {
const { data , dataSearch,search} = this.state;
if (this.state.isLoading) {
return <View/>
} else {
return (
<SafeAreaView style={styles.moreDefault}>
<SearchBar
@@ -214,7 +218,7 @@ class Staffs extends React.Component {
/>
</SafeAreaView>
);
);}
}
}
+10 -8
View File
@@ -57,8 +57,9 @@ class StudentWeek extends React.Component {
).then((response) => {
return response.text();
}).then((json) => {
this.setState({data: JSON.parse(json),isLoading:false});
const data = JSON.parse(json)
data.sort((a,b)=>a.id-b.id)
this.setState({data: data,isLoading:false});
console.log(this.state.data)
}).catch((error) => console.error(error))
}
@@ -67,17 +68,18 @@ class StudentWeek extends React.Component {
if (this.state.isLoading) {
return <View/>
} else {
const iconURI = this.state.data.icon !== undefined?`data:image/png;charset=utf-8;base64,${this.state.data.icon}`:'';
const hobbyText = (<Text style = {{marginLeft: 50, paddingHorizontal: '2%', paddingBottom: '2%'}}>{this.state.data.hobbies}</Text>)
const achievementText = (<Text style = {{marginLeft: 50, paddingHorizontal: '2%', paddingBottom: '2%'}}>{this.state.data.achievements}</Text>)
const messageText = (<Text style = {{marginLeft: 50, paddingHorizontal: '2%', paddingBottom: '2%'}}>{this.state.data.messages}</Text>)
console.log(this.state.data[this.state.data.length-1].image)
const iconURI = this.state.data[this.state.data.length-1].image !== undefined?`data:image/png;charset=utf-8;base64,${this.state.data[this.state.data.length-1].image}`:'';
const hobbyText = (<Text style = {{marginLeft: 50, paddingHorizontal: '2%', paddingBottom: '2%'}}>{this.state.data[this.state.data.length-1].hobbies}</Text>)
const achievementText = (<Text style = {{marginLeft: 50, paddingHorizontal: '2%', paddingBottom: '2%'}}>{this.state.data[this.state.data.length-1].achievements}</Text>)
const messageText = (<Text style = {{marginLeft: 50, paddingHorizontal: '2%', paddingBottom: '2%'}}>{this.state.data[this.state.data.length-1].messages}</Text>)
return (
<ScrollView style={{paddingTop:'5%',paddingHorizontal:'10%', backgroundColor: 'white', height: '100%'}}>
<View style={{backgroundColor: 'white',borderRadius: 150, height: 300, width: 300, alignSelf: 'center', shadowColor: 'red', shadowOffset: {width: 0, height: 2}, shadowOpacity: 0.5, shadowRadius: 7}}>
<Image style={{resizeMode: 'cover',borderRadius: 150, height: 300, width: 300, alignSelf: 'center'}} source = {{iconURI}} />
</View>
<Text style={{fontSize:28,marginTop:'5%',textAlign:'center'}}>{this.state.data.name}</Text>
<Text style={{fontSize:20,textAlign:'center', fontWeight: '200'}}>{I18n.t('student.Grade')} {this.state.data.year}</Text>
<Text style={{fontSize:28,marginTop:'5%',textAlign:'center'}}>{this.state.data[this.state.data.length-1].name}</Text>
<Text style={{fontSize:20,textAlign:'center', fontWeight: '200'}}>{I18n.t('student.Grade')} {this.state.data[this.state.data.length-1].grade}</Text>
<View>
<View style={{display: 'flex', padding:'2%', borderRadius: 8, marginTop:'5%'}}>
<TouchableOpacity onPress = {this.clickHobby.bind(this)}>
+1 -1
View File
@@ -1 +1 @@
{"url":"https://blazerappcms.ml/"}
{"url":"http://127.0.0.1:8080"}
+3 -1
View File
@@ -1,11 +1,13 @@
DROP TABLE auth_val;
DROP TABLE student;
DROP TABLE events;
DROP TABLE teachers;
DROP TABLE announcements;
DROP TABLE clubs;
DROP TABLE lunch_events;
DROP TABLE ssl_opps;
DROP TABLE ssl_ops;
DROP TABLE polls;
DROP TABLE new;
DROP TABLE important;
DROP TABLE challenge;
+28 -4
View File
@@ -21,7 +21,10 @@ CREATE TABLE teachers (
id SERIAL PRIMARY KEY,
lang VARCHAR,
name VARCHAR NOT NULL,
emails VARCHAR NOT NULL
email VARCHAR NOT NULL,
phone VARCHAR NOT NULL,
position VARCHAR NOT NULL,
image VARCHAR
);
CREATE TABLE announcements (
@@ -51,14 +54,14 @@ CREATE TABLE lunch_events (
time TIME
);
CREATE TABLE ssl_opps (
CREATE TABLE ssl_ops (
id SERIAL PRIMARY KEY,
lang VARCHAR,
title VARCHAR NOT NULL,
text VARCHAR NOT NULL,
location VARCHAR NOT NULL,
teacher VARCHAR NOT NULL,
time TIME
date DATE
);
CREATE TABLE polls (
@@ -75,9 +78,30 @@ CREATE TABLE new (
new_date DATE
);
CREATE TABLE challenge (
id SERIAL PRIMARY KEY,
lang VARCHAR,
title VARCHAR NOT NULL,
text VARCHAR NOT NULL,
link VARCHAR NOT NULL
);
CREATE TABLE student (
id SERIAL PRIMARY KEY,
lang VARCHAR,
name VARCHAR NOT NULL,
image VARCHAR,
grade VARCHAR NOT NULL,
messages VARCHAR NOT NULL,
hobbies VARCHAR NOT NULL,
achievements VARCHAR NOT NULL
);
CREATE TABLE important (
id SERIAL PRIMARY KEY,
lang VARCHAR,
image VARCHAR,
text VARCHAR NOT NULL
)
);
+24 -10
View File
@@ -144,6 +144,17 @@ pub mod defs {
}
api_route! {
student {
name: (Text, String, String),
image: (Text, String, Image),
grade: (Text, String, String),
messages: (Text, String, String),
hobbies: (Text, String, String),
achievements: (Text, String, String),
}
}
api_route! {
events {
title: (Text, String, String),
@@ -158,7 +169,10 @@ api_route! {
api_route! {
teachers {
name: (Text, String, String),
emails: (Text, String, String),
email: (Text, String, String),
phone: (Text, String, String)
position: (Text, String, String),
image: (Text, String, Image)
}
}
@@ -171,15 +185,6 @@ api_route! {
}
}
api_route! {
student {
name: (Text, String, String),
meeting: (Text, String, String),
link: (Text, String, String),
sponsor: (Text, String, String),
}
}
api_route! {
clubs {
name: (Text, String, String),
@@ -228,9 +233,18 @@ api_route! {
}
}
api_route! {
challenge {
title: (Text, String, String),
text: (Text, String, String),
link: (Text, String, String),
}
}
api_route! {
important {
image: (Text, String, Image),
text: (Text, String, String),
}
}
+7 -5
View File
@@ -76,6 +76,7 @@ fn rocket(port: u16, address: String, env: Environment, pg: PgConnection, sa: Se
routes![home, home_not_logged_in, login, auth::callback, auth::oauth, static_files],
)
.mount("/api", routes![
data::student::api,
data::events::api,
data::teachers::api,
data::announcements::api,
@@ -85,15 +86,16 @@ fn rocket(port: u16, address: String, env: Environment, pg: PgConnection, sa: Se
data::calendar::api,
data::polls::api,
data::new::api,
data::important::api
data::important::api,
data::challenge::api,
])
.mount(
"/ui",
routes![
data::events::eui, data::teachers::eui, data::announcements::eui, data::clubs::eui, data::lunch_events::eui, data::ssl_ops::eui, data::calendar::eui, data::polls::eui, data::new::eui, data::important::eui,
data::events::upd, data::teachers::upd, data::announcements::upd, data::clubs::upd, data::lunch_events::upd, data::ssl_ops::upd, data::calendar::upd, data::polls::upd, data::new::upd, data::important::upd,
data::events::del, data::teachers::del, data::announcements::del, data::clubs::del, data::lunch_events::del, data::ssl_ops::del, data::calendar::del, data::polls::del, data::new::del, data::important::del,
data::events::add, data::teachers::add, data::announcements::add, data::clubs::add, data::lunch_events::add, data::ssl_ops::add, data::calendar::add, data::polls::add, data::new::add, data::important::add,
data::student::eui, data::events::eui, data::teachers::eui, data::announcements::eui, data::clubs::eui, data::lunch_events::eui, data::ssl_ops::eui, data::calendar::eui, data::polls::eui, data::new::eui, data::challenge::eui, data::important::eui,
data::student::upd, data::events::upd, data::teachers::upd, data::announcements::upd, data::clubs::upd, data::lunch_events::upd, data::ssl_ops::upd, data::calendar::upd, data::polls::upd, data::new::upd, data::challenge::upd, data::important::upd,
data::student::del, data::events::del, data::teachers::del, data::announcements::del, data::clubs::del, data::lunch_events::del, data::ssl_ops::del, data::calendar::del, data::polls::del, data::new::del, data::challenge::del, data::important::del,
data::student::add, data::events::add, data::teachers::add, data::announcements::add, data::clubs::add, data::lunch_events::add, data::ssl_ops::add, data::calendar::add, data::polls::add, data::new::add, data::challenge::add, data::important::add,
],
)
}
+16 -25
View File
@@ -45,15 +45,15 @@
<hr/>
<div class="my-4">
<h2 style="font-size: 20px;">Add Event</h2>
<h2 style="font-size: 20px;">Add Announcement</h2>
<form action="announcements/add" method="post">
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<p class="my-0">Lang</p>
<label for="lang" class="form-label"><small>'en' for English, 'es' for Spanish</small></label>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="lang" name="lang">
<select name="lang", id="lang">
<option value="" disabled selected>Select Language</option>
<option value="en">English</option>
<option value="es">Spanish</option>
</select>
</div>
</div>
@@ -77,7 +77,7 @@
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<p class="my-0">Date</p>
<p class="my-0">Date of Submission</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="date" name="date">
@@ -98,11 +98,11 @@
</div>
<div class="my-4">
<h2 style="font-size: 20px;">Update Event</h2>
<form action="anouncements/upd" method="post">
<h2 style="font-size: 20px;">Update Announcement</h2>
<form action="announcements/upd" method="post">
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<p class="my-0">ID of event to update</p>
<p class="my-0">ID of announcement to update</p>
</div>
<div style="flex: 1; align: center;">
<input type="number" class="form-control form-control-sm" id="id" name="id">
@@ -111,11 +111,11 @@
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<p class="my-0">Lang</p>
<label for="lang" class="form-label"><small>'en' for English, 'es' for Spanish</small></label>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="lang" name="lang">
<select name="lang", id="lang">
<option value="" disabled selected>Select Language</option>
<option value="en">English</option>
<option value="es">Spanish</option>
</select>
</div>
</div>
@@ -139,7 +139,7 @@
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<p class="my-0">Date</p>
<p class="my-0">Date of Submission</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="date" name="date">
@@ -154,15 +154,6 @@
<input type="text" class="form-control form-control-sm" id="time" name="time">
</div>
</div>
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<p class="my-0">Teacher/Organizer Email</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="emails" name="emails">
</div>
</div>
<input type="submit", value="Submit">
</form>
</div>
+148
View File
@@ -0,0 +1,148 @@
{{! vim: set ft=html: }}
<html>
<head>
<link rel="stylesheet" href="/static/style.css">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-F3w7mX95PdgyTmZZMECAngseQB83DfGTowi0iMjiWaeVhAn4FJkqJByhZMI3AhiU" crossorigin="anonymous">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Rubik:wght@400;600;700&display=swap" rel="stylesheet">
</head>
<body>
<div class="container-md p-3" style="">
<h2 style="font-size: 24px; font-weight: bold">
Admin Panel
</h2>
</div>
<div class="container-md d-flex gap-4" style="">
<!-- announcements list -->
<div class="p-3" style="flex: 1;">
<h1 style="font-size: 28px;">Challenge of the Week</h1>
<div class="vstack gap-3 mt-4">
{{#each ctx}}
<div class="bg-light border rounded-3 p-2">
<small>ID: {{id}} | LANG: {{lang}}</small>
<h3 class="my-2" style="font-size: 18px;">{{title}}</h3>
<p class="mb-2">{{text}}</p>
<p class="mb-2">{{link}}</p>
<form action="challenge/del" method="post">
<div class="d-flex mt-3">
<input type="number" class="form-control form-control-sm" id="id" name="id" value = {{id}} style="display: none">
</div>
<input type="submit" value="Delete">
</form>
</div>
{{/each}}
</div>
</div>
<!-- announcements actions -->
<div class="p-3" style="flex: 1;">
<h1 style="font-size: 28px;">COTW Actions</h1>
<hr/>
<div class="my-4">
<h2 style="font-size: 20px;">Add Announcement</h2>
<form action="challenge/add" method="post">
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<select name="lang", id="lang">
<option value="" disabled selected>Select Language</option>
<option value="en">English</option>
<option value="es">Spanish</option>
</select>
</div>
</div>
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<p class="my-0">Title</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="title" name="title">
</div>
</div>
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<p class="my-0">Information</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="text" name="text">
</div>
</div>
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<p class="my-0">Link to Challenge</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="link" name="link">
</div>
</div>
<input type="submit" value="Submit">
</form>
</div>
<div class="my-4">
<h2 style="font-size: 20px;">Update Challenge</h2>
<form action="challenge/upd" method="post">
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<p class="my-0">ID of challenge to update</p>
</div>
<div style="flex: 1; align: center;">
<input type="number" class="form-control form-control-sm" id="id" name="id">
</div>
</div>
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<select name="lang", id="lang">
<option value="" disabled selected>Select Language</option>
<option value="en">English</option>
<option value="es">Spanish</option>
</select>
</div>
</div>
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<p class="my-0">Title</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="title" name="title">
</div>
</div>
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<p class="my-0">Information</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="text" name="text">
</div>
</div>
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<p class="my-0">Link to Challenge</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="link" name="link">
</div>
</div>
<input type="submit", value="Submit">
</form>
</div>
<hr/>
</div>
</div>
</body>
</html>
+15 -15
View File
@@ -50,11 +50,11 @@
<form action="clubs/add" method="post">
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<p class="my-0">Lang</p>
<label for="lang" class="form-label"><small>'en' for English, 'es' for Spanish</small></label>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="lang" name="lang">
<select name="lang", id="lang">
<option value="" disabled selected>Select Language</option>
<option value="en">English</option>
<option value="es">Spanish</option>
</select>
</div>
</div>
@@ -69,7 +69,7 @@
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<p class="my-0">Meeting</p>
<p class="my-0">Meeting Date and Time</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="meeting" name="meeting">
@@ -78,7 +78,7 @@
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<p class="my-0">Link</p>
<p class="my-0">Meeting Location</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="link" name="link">
@@ -100,7 +100,7 @@
<div class="my-4">
<h2 style="font-size: 20px;">Update Club</h2>
<form action="anouncements/upd" method="post">
<form action="clubs/upd" method="post">
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<p class="my-0">ID of club to update</p>
@@ -112,11 +112,11 @@
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<p class="my-0">Lang</p>
<label for="lang" class="form-label"><small>'en' for English, 'es' for Spanish</small></label>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="lang" name="lang">
<select name="lang", id="lang">
<option value="" disabled selected>Select Language</option>
<option value="en">English</option>
<option value="es">Spanish</option>
</select>
</div>
</div>
@@ -131,7 +131,7 @@
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<p class="my-0">Meeting</p>
<p class="my-0">Meeting Date and Time</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="meeting" name="meeting">
@@ -140,7 +140,7 @@
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<p class="my-0">Link</p>
<p class="my-0">Meeting Location</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="link" name="link">
+10 -10
View File
@@ -50,11 +50,11 @@
<form action="events/add" method="post">
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<p class="my-0">Lang</p>
<label for="lang" class="form-label"><small>'en' for English, 'es' for Spanish</small></label>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="lang" name="lang">
<select name="lang", id="lang">
<option value="" disabled selected>Select Language</option>
<option value="en">English</option>
<option value="es">Spanish</option>
</select>
</div>
</div>
@@ -130,11 +130,11 @@
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<p class="my-0">Lang</p>
<label for="lang" class="form-label"><small>'en' for English, 'es' for Spanish</small></label>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="lang" name="lang">
<select name="lang", id="lang">
<option value="" disabled selected>Select Language</option>
<option value="en">English</option>
<option value="es">Spanish</option>
</select>
</div>
</div>
+6
View File
@@ -6,5 +6,11 @@
<body>
<a href="/ui/events">Events</a>
<a href="/ui/new">New</a>
<a href="/ui/announcements">Announcements</a>
<a href="/ui/clubs">Clubs</a>
<a href="/ui/lunch_events">Lunch Events</a>
<a href="/ui/polls">Polls</a>
<a href="/ui/ssl_ops">SSL Opportunities</a>
<a href="/ui/polls">Polls</a>
</body>
</html>
+167
View File
@@ -0,0 +1,167 @@
{{! vim: set ft=html: }}
<html>
<head>
<link rel="stylesheet" href="/static/style.css">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-F3w7mX95PdgyTmZZMECAngseQB83DfGTowi0iMjiWaeVhAn4FJkqJByhZMI3AhiU" crossorigin="anonymous">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Rubik:wght@400;600;700&display=swap" rel="stylesheet">
</head>
<body>
<div class="container-md p-3" style="">
<h2 style="font-size: 24px; font-weight: bold">
Admin Panel
</h2>
</div>
<div class="container-md d-flex gap-4" style="">
<!-- clubs list -->
<div class="p-3" style="flex: 1;">
<h1 style="font-size: 28px;">Important</h1>
<div class="vstack gap-3 mt-4">
{{#each ctx}}
<div class="bg-light border rounded-3 p-2">
<small>ID: {{id}} | LANG: {{lang}}</small>
<h3 class="my-2" style="font-size: 18px;">{{name}}</h3>
<p class="mb-2">{{meeting}}</p>
<p class="mb-2">{{link}}</p>
<p class="mt-2 mb-0">Sponsor: {{sponsor}}</p>
<form action="clubs/del" method="post">
<div class="d-flex mt-3">
<input type="number" class="form-control form-control-sm" id="id" name="id" value = {{id}} style="display: none">
</div>
<input type="submit" value="Delete">
</form>
</div>
{{/each}}
</div>
</div>
<!-- clubs actions -->
<div class="p-3" style="flex: 1;">
<h1 style="font-size: 28px;">Clubs Actions</h1>
<hr/>
<div class="my-4">
<h2 style="font-size: 20px;">Add Club</h2>
<form action="clubs/add" method="post">
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<p class="my-0">Lang</p>
<label for="lang" class="form-label"><small>'en' for English, 'es' for Spanish</small></label>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="lang" name="lang">
</div>
</div>
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<p class="my-0">Name</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="name" name="name">
</div>
</div>
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<p class="my-0">Meeting</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="meeting" name="meeting">
</div>
</div>
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<p class="my-0">Link</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="link" name="link">
</div>
</div>
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<p class="my-0">Sponsor</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="sponsor" name="sponsor">
</div>
</div>
<input type="submit" value="Submit">
</form>
</div>
<div class="my-4">
<h2 style="font-size: 20px;">Update Club</h2>
<form action="anouncements/upd" method="post">
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<p class="my-0">ID of club to update</p>
</div>
<div style="flex: 1; align: center;">
<input type="number" class="form-control form-control-sm" id="id" name="id">
</div>
</div>
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<p class="my-0">Lang</p>
<label for="lang" class="form-label"><small>'en' for English, 'es' for Spanish</small></label>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="lang" name="lang">
</div>
</div>
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<p class="my-0">Name</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="name" name="name">
</div>
</div>
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<p class="my-0">Meeting</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="meeting" name="meeting">
</div>
</div>
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<p class="my-0">Link</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="link" name="link">
</div>
</div>
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<p class="my-0">Sponsor</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="sponsor" name="sponsor">
</div>
</div>
<input type="submit", value="Submit">
</form>
</div>
<hr/>
</div>
</div>
</body>
</html>
+167
View File
@@ -0,0 +1,167 @@
{{! vim: set ft=html: }}
<html>
<head>
<link rel="stylesheet" href="/static/style.css">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-F3w7mX95PdgyTmZZMECAngseQB83DfGTowi0iMjiWaeVhAn4FJkqJByhZMI3AhiU" crossorigin="anonymous">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Rubik:wght@400;600;700&display=swap" rel="stylesheet">
</head>
<body>
<div class="container-md p-3" style="">
<h2 style="font-size: 24px; font-weight: bold">
Admin Panel
</h2>
</div>
<div class="container-md d-flex gap-4" style="">
<!-- lunch events list -->
<div class="p-3" style="flex: 1;">
<h1 style="font-size: 28px;">Lunch Events</h1>
<div class="vstack gap-3 mt-4">
{{#each ctx}}
<div class="bg-light border rounded-3 p-2">
<small>ID: {{id}} | LANG: {{lang}}</small>
<h3 class="my-2" style="font-size: 18px;">{{title}}</h3>
<p class="mb-2">{{text}}</p>
<p class="mb-2">{{location}}</p>
<p class="mt-2 mb-0">{{time}}</p>
<form action="clubs/del" method="post">
<div class="d-flex mt-3">
<input type="number" class="form-control form-control-sm" id="id" name="id" value = {{id}} style="display: none">
</div>
<input type="submit" value="Delete">
</form>
</div>
{{/each}}
</div>
</div>
<!-- clubs actions -->
<div class="p-3" style="flex: 1;">
<h1 style="font-size: 28px;">Lunch Events Actions</h1>
<hr/>
<div class="my-4">
<h2 style="font-size: 20px;">Add Lunch Event</h2>
<form action="lunch_events/add" method="post">
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<select name="lang", id="lang">
<option value="" disabled selected>Select Language</option>
<option value="en">English</option>
<option value="es">Spanish</option>
</select>
</div>
</div>
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<p class="my-0">Title</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="title" name="title">
</div>
</div>
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<p class="my-0">Information</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="text" name="text">
</div>
</div>
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<p class="my-0">Location</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="location" name="location">
</div>
</div>
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<p class="my-0">Time of event</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="time" name="time">
</div>
</div>
<input type="submit" value="Submit">
</form>
</div>
<div class="my-4">
<h2 style="font-size: 20px;">Update Lunch Event</h2>
<form action="lunch_events/upd" method="post">
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<p class="my-0">ID of lunch event to update</p>
</div>
<div style="flex: 1; align: center;">
<input type="number" class="form-control form-control-sm" id="id" name="id">
</div>
</div>
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<select name="lang", id="lang">
<option value="" disabled selected>Select Language</option>
<option value="en">English</option>
<option value="es">Spanish</option>
</select>
</div>
</div>
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<p class="my-0">Title</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="title" name="title">
</div>
</div>
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<p class="my-0">Information</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="text" name="text">
</div>
</div>
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<p class="my-0">Location</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="location" name="location">
</div>
</div>
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<p class="my-0">Time of event</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="time" name="time">
</div>
</div>
<input type="submit", value="Submit">
</form>
</div>
<hr/>
</div>
</div>
</body>
</html>
+20 -77
View File
@@ -24,10 +24,7 @@
{{#each ctx}}
<div class="bg-light border rounded-3 p-2">
<small>ID: {{id}} | LANG: {{lang}}</small>
<h3 class="my-2" style="font-size: 18px;">{{url}}</h3>
<p class="mb-2">{{meeting}}</p>
<p class="mb-2">{{link}}</p>
<p class="mt-2 mb-0">Sponsor: {{sponsor}}</p>
<h3 class="my-2" style="font-size: 18px;">Poll: {{url}}</h3>
<form action="polls/del" method="post">
<div class="d-flex mt-3">
<input type="number" class="form-control form-control-sm" id="id" name="id" value = {{id}} style="display: none">
@@ -46,51 +43,24 @@
<hr/>
<div class="my-4">
<h2 style="font-size: 20px;">Add Club</h2>
<h2 style="font-size: 20px;">Add Poll</h2>
<form action="polls/add" method="post">
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<p class="my-0">Lang</p>
<label for="lang" class="form-label"><small>'en' for English, 'es' for Spanish</small></label>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="lang" name="lang">
<select name="lang", id="lang">
<option value="" disabled selected>Select Language</option>
<option value="en">English</option>
<option value="es">Spanish</option>
</select>
</div>
</div>
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<p class="my-0">Name</p>
<p class="my-0">URL of poll</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="name" name="name">
</div>
</div>
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<p class="my-0">Meeting</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="meeting" name="meeting">
</div>
</div>
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<p class="my-0">Link</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="link" name="link">
</div>
</div>
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<p class="my-0">Sponsor</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="sponsor" name="sponsor">
<input type="text" class="form-control form-control-sm" id="url" name="url">
</div>
</div>
@@ -99,11 +69,11 @@
</div>
<div class="my-4">
<h2 style="font-size: 20px;">Update Club</h2>
<form action="anouncements/upd" method="post">
<h2 style="font-size: 20px;">Update Poll</h2>
<form action="polls/upd" method="post">
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<p class="my-0">ID of club to update</p>
<p class="my-0">ID of Poll to update</p>
</div>
<div style="flex: 1; align: center;">
<input type="number" class="form-control form-control-sm" id="id" name="id">
@@ -112,49 +82,22 @@
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<p class="my-0">Lang</p>
<label for="lang" class="form-label"><small>'en' for English, 'es' for Spanish</small></label>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="lang" name="lang">
<select name="lang", id="lang">
<option value="" disabled selected>Select Language</option>
<option value="en">English</option>
<option value="es">Spanish</option>
</select>
</div>
</div>
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<p class="my-0">Name</p>
<p class="my-0">URL of poll</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="name" name="name">
</div>
</div>
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<p class="my-0">Meeting</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="meeting" name="meeting">
</div>
</div>
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<p class="my-0">Link</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="link" name="link">
</div>
</div>
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<p class="my-0">Sponsor</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="sponsor" name="sponsor">
</div>
<input type="text" class="form-control form-control-sm" id="url" name="url">
</div>
</div>
<input type="submit", value="Submit">
</form>
+185
View File
@@ -0,0 +1,185 @@
{{! vim: set ft=html: }}
<html>
<head>
<link rel="stylesheet" href="/static/style.css">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-F3w7mX95PdgyTmZZMECAngseQB83DfGTowi0iMjiWaeVhAn4FJkqJByhZMI3AhiU" crossorigin="anonymous">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Rubik:wght@400;600;700&display=swap" rel="stylesheet">
</head>
<body>
<div class="container-md p-3" style="">
<h2 style="font-size: 24px; font-weight: bold">
Admin Panel
</h2>
</div>
<div class="container-md d-flex gap-4" style="">
<!-- clubs list -->
<div class="p-3" style="flex: 1;">
<h1 style="font-size: 28px;">SSL Opportunities</h1>
<div class="vstack gap-3 mt-4">
{{#each ctx}}
<div class="bg-light border rounded-3 p-2">
<small>ID: {{id}} | LANG: {{lang}}</small>
<h3 class="my-2" style="font-size: 18px;">{{name}}</h3>
<p class="mb-2">{{meeting}}</p>
<p class="mb-2">{{link}}</p>
<p class="mt-2 mb-0">Sponsor: {{sponsor}}</p>
<form action="clubs/del" method="post">
<div class="d-flex mt-3">
<input type="number" class="form-control form-control-sm" id="id" name="id" value = {{id}} style="display: none">
</div>
<input type="submit" value="Delete">
</form>
</div>
{{/each}}
</div>
</div>
<!-- clubs actions -->
<div class="p-3" style="flex: 1;">
<h1 style="font-size: 28px;">SSL Opps Actions</h1>
<hr/>
<div class="my-4">
<h2 style="font-size: 20px;">Add SSL Op</h2>
<form action="ssl_ops/add" method="post">
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<select name="lang", id="lang">
<option value="" disabled selected>Select Language</option>
<option value="en">English</option>
<option value="es">Spanish</option>
</select>
</div>
</div>
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<p class="my-0">Title</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="title" name="title">
</div>
</div>
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<p class="my-0">Information</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="text" name="text">
</div>
</div>
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<p class="my-0">Location</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="location" name="location">
</div>
</div>
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<p class="my-0">Organizer</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="teacher" name="teacher">
</div>
</div>
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<p class="my-0">Date of Event</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="date" name="date">
</div>
</div>
<input type="submit" value="Submit">
</form>
</div>
<div class="my-4">
<h2 style="font-size: 20px;">Update SSL Opps</h2>
<form action="ssl_ops/upd" method="post">
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<p class="my-0">ID of club to update</p>
</div>
<div style="flex: 1; align: center;">
<input type="number" class="form-control form-control-sm" id="id" name="id">
</div>
</div>
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<select name="lang", id="lang">
<option value="" disabled selected>Select Language</option>
<option value="en">English</option>
<option value="es">Spanish</option>
</select>
</div>
</div>
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<p class="my-0">Title</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="title" name="title">
</div>
</div>
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<p class="my-0">Information</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="text" name="text">
</div>
</div>
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<p class="my-0">Location</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="location" name="location">
</div>
</div>
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<p class="my-0">Organizer</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="teacher" name="teacher">
</div>
</div>
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<p class="my-0">Date of Event</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="date" name="date">
</div>
</div>
<input type="submit", value="Submit">
</form>
</div>
<hr/>
</div>
</div>
</body>
</html>
+204
View File
@@ -0,0 +1,204 @@
{{! vim: set ft=html: }}
<html>
<head>
<link rel="stylesheet" href="/static/style.css">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-F3w7mX95PdgyTmZZMECAngseQB83DfGTowi0iMjiWaeVhAn4FJkqJByhZMI3AhiU" crossorigin="anonymous">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Rubik:wght@400;600;700&display=swap" rel="stylesheet">
</head>
<body>
<div class="container-md p-3" style="">
<h2 style="font-size: 24px; font-weight: bold">
Admin Panel
</h2>
</div>
<div class="container-md d-flex gap-4" style="">
<!-- announcements list -->
<div class="p-3" style="flex: 1;">
<h1 style="font-size: 28px;">Student of the Week</h1>
<div class="vstack gap-3 mt-4">
{{#each ctx}}
<div class="bg-light border rounded-3 p-2">
<small>ID: {{id}} | LANG: {{lang}}</small>
<h3 class="my-2" style="font-size: 18px;">{{name}} | Grade {{grade}}</h3>
<p class="mb-2">{{image}}</p>
<p class="mb-2">Message: {{messages}}</p>
<p class="mb-2">Hobbies: {{hobbies}}</p>
<p class="mb-2">Achievements: {{achievements}}</p>
<form action="announcements/del" method="post">
<div class="d-flex mt-3">
<input type="number" class="form-control form-control-sm" id="id" name="id" value = {{id}} style="display: none">
</div>
<input type="submit" value="Delete">
</form>
</div>
{{/each}}
</div>
</div>
<!-- announcements actions -->
<div class="p-3" style="flex: 1;">
<h1 style="font-size: 28px;">SOTW Actions</h1>
<hr/>
<div class="my-4">
<h2 style="font-size: 20px;">Add SOTW</h2>
<form action="student/add" method="post">
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<select name="lang", id="lang">
<option value="" disabled selected>Select Language</option>
<option value="en">English</option>
<option value="es">Spanish</option>
</select>
</div>
</div>
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<p class="my-0">Student Name</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="name" name="name">
</div>
</div>
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<p class="my-0">Student Picture</p>
</div>
<div style="flex: 1; align: center;">
<input type="file" name="image", id="image", accept="image/png">
</div>
</div>
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<p class="my-0">Grade</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="grade" name="grade">
</div>
</div>
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<p class="my-0">Message</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="messages" name="messages">
</div>
</div>
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<p class="my-0">Hobbies</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="hobbies" name="hobbies">
</div>
</div>
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<p class="my-0">Achievements</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="achievements" name="achievements">
</div>
</div>
<input type="submit" value="Submit">
</form>
</div>
<div class="my-4">
<h2 style="font-size: 20px;">Update SOTW</h2>
<form action="student/upd" method="post">
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<p class="my-0">ID of SOTW to update</p>
</div>
<div style="flex: 1; align: center;">
<input type="number" class="form-control form-control-sm" id="id" name="id">
</div>
</div>
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<select name="lang", id="lang">
<option value="" disabled selected>Select Language</option>
<option value="en">English</option>
<option value="es">Spanish</option>
</select>
</div>
</div>
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<p class="my-0">Student Name</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="name" name="name">
</div>
</div>
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<p class="my-0">Student Picture</p>
</div>
<div style="flex: 1; align: center;">
<input type="file" name="image", id="image", accept="image/png">
</div>
</div>
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<p class="my-0">Grade</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="grade" name="grade">
</div>
</div>
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<p class="my-0">Message</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="messages" name="messages">
</div>
</div>
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<p class="my-0">Hobbies</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="hobbies" name="hobbies">
</div>
</div>
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<p class="my-0">Achievements</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="achievements" name="achievements">
</div>
</div>
<input type="submit", value="Submit">
</form>
</div>
<hr/>
</div>
</div>
</body>
</html>
+185
View File
@@ -0,0 +1,185 @@
{{! vim: set ft=html: }}
<html>
<head>
<link rel="stylesheet" href="/static/style.css">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-F3w7mX95PdgyTmZZMECAngseQB83DfGTowi0iMjiWaeVhAn4FJkqJByhZMI3AhiU" crossorigin="anonymous">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Rubik:wght@400;600;700&display=swap" rel="stylesheet">
</head>
<body>
<div class="container-md p-3" style="">
<h2 style="font-size: 24px; font-weight: bold">
Admin Panel
</h2>
</div>
<div class="container-md d-flex gap-4" style="">
<!-- clubs list -->
<div class="p-3" style="flex: 1;">
<h1 style="font-size: 28px;">Staff</h1>
<div class="vstack gap-3 mt-4">
{{#each ctx}}
<div class="bg-light border rounded-3 p-2">
<small>ID: {{id}} | LANG: {{lang}}</small>
<h3 class="my-2" style="font-size: 18px;">{{name}}</h3>
<p class="mb-2">{{meeting}}</p>
<p class="mb-2">{{link}}</p>
<p class="mt-2 mb-0">Sponsor: {{sponsor}}</p>
<form action="teachers/del" method="post">
<div class="d-flex mt-3">
<input type="number" class="form-control form-control-sm" id="id" name="id" value = {{id}} style="display: none">
</div>
<input type="submit" value="Delete">
</form>
</div>
{{/each}}
</div>
</div>
<!-- clubs actions -->
<div class="p-3" style="flex: 1;">
<h1 style="font-size: 28px;">Staff Actions</h1>
<hr/>
<div class="my-4">
<h2 style="font-size: 20px;">Add Staff</h2>
<form action="teachers/add" method="post">
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<select name="lang", id="lang">
<option value="" disabled selected>Select Language</option>
<option value="en">English</option>
<option value="es">Spanish</option>
</select>
</div>
</div>
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<p class="my-0">Name</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="name" name="name">
</div>
</div>
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<p class="my-0">Email</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="email" name="email">
</div>
</div>
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<p class="my-0">Phone</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="phone" name="phone">
</div>
</div>
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<p class="my-0">Position</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="position" name="position">
</div>
</div>
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<p class="my-0">Staff Picture</p>
</div>
<div style="flex: 1; align: center;">
<input type="file" name="image", id="image", accept="image/png">
</div>
</div>
<input type="submit" value="Submit">
</form>
</div>
<div class="my-4">
<h2 style="font-size: 20px;">Update Staff</h2>
<form action="teachers/upd" method="post">
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<p class="my-0">ID of staff to update</p>
</div>
<div style="flex: 1; align: center;">
<input type="number" class="form-control form-control-sm" id="id" name="id">
</div>
</div>
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<select name="lang", id="lang">
<option value="" disabled selected>Select Language</option>
<option value="en">English</option>
<option value="es">Spanish</option>
</select>
</div>
</div>
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<p class="my-0">Name</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="name" name="name">
</div>
</div>
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<p class="my-0">Email</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="email" name="email">
</div>
</div>
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<p class="my-0">Phone</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="phone" name="phone">
</div>
</div>
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<p class="my-0">Position</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="position" name="position">
</div>
</div>
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<p class="my-0">Staff Picture</p>
</div>
<div style="flex: 1; align: center;">
<input type="file" name="image", id="image", accept="image/png">
</div>
</div>
<input type="submit", value="Submit">
</form>
</div>
<hr/>
</div>
</div>
</body>
</html>