templates done (i think)

This commit is contained in:
emilyliublair 2021-09-12 17:29:07 -04:00
parent f20773c49a
commit 3eaa975560
12 changed files with 289 additions and 307 deletions

File diff suppressed because one or more lines are too long

View File

@ -68,56 +68,64 @@ class StudentWeek extends React.Component {
if (this.state.isLoading) {
return <View/>
} else {
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}} />
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 student of the week</Text>
</View>
<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)}>
<View style={{display:'flex', flexDirection: 'row'}}>
<Image source = {require('./assets/hobbies.png')} />
<View style = {{display: 'flex', flexDirection: 'row', width: '85%', justifyContent: 'space-between', paddingHorizontal:'2%',}}>
<Text style={{fontSize: 20, alignSelf: 'center'}}>{I18n.t('student.Hobbies')}</Text>
{this.state.hobbyExpanded?<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'}}/>}
)
} else {
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[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)}>
<View style={{display:'flex', flexDirection: 'row'}}>
<Image source = {require('./assets/hobbies.png')} />
<View style = {{display: 'flex', flexDirection: 'row', width: '85%', justifyContent: 'space-between', paddingHorizontal:'2%',}}>
<Text style={{fontSize: 20, alignSelf: 'center'}}>{I18n.t('student.Hobbies')}</Text>
{this.state.hobbyExpanded?<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>
</View>
{this.state.hobbyExpanded?hobbyText:<></>}
</TouchableOpacity>
<TouchableOpacity onPress = {this.clickAchievements.bind(this)}>
<View style={{display: 'flex', borderTopWidth: 1, borderTopColor: '#8D8D8D', shadowColor: 'black', flexDirection: 'row'}}>
<Image source = {require('./assets/achievements.png')} />
<View style = {{display: 'flex', flexDirection: 'row', width: '85%', justifyContent: 'space-between', paddingHorizontal:'2%',}}>
<Text style={{fontSize: 20, alignSelf: 'center'}}>{I18n.t('student.Achievements')}</Text>
{this.state.achievementExpanded?<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'}}/>}
{this.state.hobbyExpanded?hobbyText:<></>}
</TouchableOpacity>
<TouchableOpacity onPress = {this.clickAchievements.bind(this)}>
<View style={{display: 'flex', borderTopWidth: 1, borderTopColor: '#8D8D8D', shadowColor: 'black', flexDirection: 'row'}}>
<Image source = {require('./assets/achievements.png')} />
<View style = {{display: 'flex', flexDirection: 'row', width: '85%', justifyContent: 'space-between', paddingHorizontal:'2%',}}>
<Text style={{fontSize: 20, alignSelf: 'center'}}>{I18n.t('student.Achievements')}</Text>
{this.state.achievementExpanded?<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>
</View>
{this.state.achievementExpanded?achievementText:<></>}
</TouchableOpacity>
<TouchableOpacity onPress = {this.clickMessages.bind(this)}>
<View style={{display: 'flex', borderTopWidth: 1, borderTopColor: '#8D8D8D', shadowColor: 'black', flexDirection: 'row'}}>
<Image source = {require('./assets/message.png')} />
<View style = {{display: 'flex', flexDirection: 'row', width: '85%', justifyContent: 'space-between', paddingHorizontal:'2%',}}>
<Text style={{fontSize: 20, alignSelf: 'center'}}>{I18n.t('student.Messages')}</Text>
{this.state.messageExpanded?<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'}}/>}
{this.state.achievementExpanded?achievementText:<></>}
</TouchableOpacity>
<TouchableOpacity onPress = {this.clickMessages.bind(this)}>
<View style={{display: 'flex', borderTopWidth: 1, borderTopColor: '#8D8D8D', shadowColor: 'black', flexDirection: 'row'}}>
<Image source = {require('./assets/message.png')} />
<View style = {{display: 'flex', flexDirection: 'row', width: '85%', justifyContent: 'space-between', paddingHorizontal:'2%',}}>
<Text style={{fontSize: 20, alignSelf: 'center'}}>{I18n.t('student.Messages')}</Text>
{this.state.messageExpanded?<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>
</View>
{this.state.messageExpanded?messageText:<></>}
</TouchableOpacity>
{this.state.messageExpanded?messageText:<></>}
</TouchableOpacity>
</View>
</View>
</View>
</ScrollView>
)
</ScrollView>
)
}
}
}
}

View File

@ -49,7 +49,7 @@
<form action="announcements/add" method="post">
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<select name="lang", id="lang">
<select name="lang", id="lang" required>
<option value="" disabled selected>Select Language</option>
<option value="en">English</option>
<option value="es">Spanish</option>
@ -62,7 +62,7 @@
<p class="my-0">Teacher</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="teacher" name="teacher">
<input type="text" class="form-control form-control-sm" id="teacher" name="teacher" required>
</div>
</div>
@ -71,7 +71,7 @@
<p class="my-0">Message</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="message" name="message">
<input type="text" class="form-control form-control-sm" id="message" name="message" required>
</div>
</div>
@ -80,7 +80,7 @@
<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">
<input type="text" class="form-control form-control-sm" id="date" name="date" required>
</div>
</div>
@ -89,7 +89,7 @@
<p class="my-0">Time of Submission</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="time" name="time">
<input type="text" class="form-control form-control-sm" id="time" name="time" required>
</div>
</div>
@ -105,13 +105,13 @@
<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">
<input type="number" class="form-control form-control-sm" id="id" name="id" required>
</div>
</div>
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<select name="lang", id="lang">
<select name="lang", id="lang" required>
<option value="" disabled selected>Select Language</option>
<option value="en">English</option>
<option value="es">Spanish</option>
@ -124,7 +124,7 @@
<p class="my-0">Teacher</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="teacher" name="teacher">
<input type="text" class="form-control form-control-sm" id="teacher" name="teacher" required>
</div>
</div>
@ -133,7 +133,7 @@
<p class="my-0">Message</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="message" name="message">
<input type="text" class="form-control form-control-sm" id="message" name="message" required>
</div>
</div>
@ -142,7 +142,7 @@
<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">
<input type="text" class="form-control form-control-sm" id="date" name="date" required>
</div>
</div>
@ -151,7 +151,7 @@
<p class="my-0">Time of Submission</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="time" name="time">
<input type="text" class="form-control form-control-sm" id="time" name="time" required>
</div>
</div>
<input type="submit", value="Submit">

View File

@ -49,7 +49,7 @@
<form action="challenge/add" method="post">
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<select name="lang", id="lang">
<select name="lang", id="lang" required>
<option value="" disabled selected>Select Language</option>
<option value="en">English</option>
<option value="es">Spanish</option>
@ -62,7 +62,7 @@
<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">
<input type="text" class="form-control form-control-sm" id="title" name="title" required>
</div>
</div>
@ -71,7 +71,7 @@
<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">
<input type="text" class="form-control form-control-sm" id="text" name="text" required>
</div>
</div>
@ -80,7 +80,7 @@
<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">
<input type="text" class="form-control form-control-sm" id="link" name="link" required>
</div>
</div>
@ -96,13 +96,13 @@
<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">
<input type="number" class="form-control form-control-sm" id="id" name="id" required>
</div>
</div>
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<select name="lang", id="lang">
<select name="lang", id="lang" required>
<option value="" disabled selected>Select Language</option>
<option value="en">English</option>
<option value="es">Spanish</option>
@ -115,7 +115,7 @@
<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">
<input type="text" class="form-control form-control-sm" id="title" name="title" required>
</div>
</div>
@ -124,7 +124,7 @@
<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">
<input type="text" class="form-control form-control-sm" id="text" name="text" required>
</div>
</div>
@ -133,7 +133,7 @@
<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">
<input type="text" class="form-control form-control-sm" id="link" name="link" required>
</div>
</div>

View File

@ -50,7 +50,7 @@
<form action="clubs/add" method="post">
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<select name="lang", id="lang">
<select name="lang", id="lang" required>
<option value="" disabled selected>Select Language</option>
<option value="en">English</option>
<option value="es">Spanish</option>
@ -63,7 +63,7 @@
<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">
<input type="text" class="form-control form-control-sm" id="name" name="name" required>
</div>
</div>
@ -72,7 +72,7 @@
<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">
<input type="text" class="form-control form-control-sm" id="meeting" name="meeting" required>
</div>
</div>
@ -81,7 +81,7 @@
<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">
<input type="text" class="form-control form-control-sm" id="link" name="link" required>
</div>
</div>
@ -90,7 +90,7 @@
<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="sponsor" name="sponsor" required>
</div>
</div>
@ -106,13 +106,13 @@
<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">
<input type="number" class="form-control form-control-sm" id="id" name="id" required>
</div>
</div>
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<select name="lang", id="lang">
<select name="lang", id="lang" required>
<option value="" disabled selected>Select Language</option>
<option value="en">English</option>
<option value="es">Spanish</option>
@ -125,7 +125,7 @@
<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">
<input type="text" class="form-control form-control-sm" id="name" name="name" required>
</div>
</div>
@ -134,7 +134,7 @@
<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">
<input type="text" class="form-control form-control-sm" id="meeting" name="meeting" required>
</div>
</div>
@ -143,7 +143,7 @@
<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">
<input type="text" class="form-control form-control-sm" id="link" name="link" required>
</div>
</div>
@ -152,7 +152,7 @@
<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="sponsor" name="sponsor" required>
</div>
</div>

View File

@ -50,7 +50,7 @@
<form action="events/add" method="post">
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<select name="lang", id="lang">
<select name="lang", id="lang" required>
<option value="" disabled selected>Select Language</option>
<option value="en">English</option>
<option value="es">Spanish</option>
@ -63,7 +63,7 @@
<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">
<input type="text" class="form-control form-control-sm" id="title" name="title" required>
</div>
</div>
@ -72,7 +72,7 @@
<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">
<input type="text" class="form-control form-control-sm" id="location" name="location" required>
</div>
</div>
@ -81,7 +81,7 @@
<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">
<input type="text" class="form-control form-control-sm" id="text" name="text" required>
</div>
</div>
@ -90,7 +90,7 @@
<p class="my-0">Date</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="event_date" name="event_date">
<input type="text" class="form-control form-control-sm" id="event_date" name="event_date" required>
</div>
</div>
@ -99,7 +99,7 @@
<p class="my-0">Teacher/Organizer</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="name" name="name">
<input type="text" class="form-control form-control-sm" id="name" name="name" required>
</div>
</div>
@ -108,7 +108,7 @@
<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">
<input type="text" class="form-control form-control-sm" id="emails" name="emails" required>
</div>
</div>
@ -124,13 +124,13 @@
<p class="my-0">ID of event to update</p>
</div>
<div style="flex: 1; align: center;">
<input type="number" class="form-control form-control-sm" id="id" name="id">
<input type="number" class="form-control form-control-sm" id="id" name="id" required>
</div>
</div>
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<select name="lang", id="lang">
<select name="lang", id="lang" required>
<option value="" disabled selected>Select Language</option>
<option value="en">English</option>
<option value="es">Spanish</option>
@ -143,7 +143,7 @@
<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">
<input type="text" class="form-control form-control-sm" id="title" name="title" required>
</div>
</div>
@ -152,7 +152,7 @@
<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">
<input type="text" class="form-control form-control-sm" id="location" name="location" required>
</div>
</div>
@ -161,7 +161,7 @@
<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">
<input type="text" class="form-control form-control-sm" id="text" name="text" required>
</div>
</div>
@ -170,7 +170,7 @@
<p class="my-0">Date</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="event_date" name="event_date">
<input type="text" class="form-control form-control-sm" id="event_date" name="event_date" required>
</div>
</div>
@ -179,7 +179,7 @@
<p class="my-0">Teacher/Organizer</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="name" name="name">
<input type="text" class="form-control form-control-sm" id="name" name="name" required>
</div>
</div>
@ -188,7 +188,7 @@
<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">
<input type="text" class="form-control form-control-sm" id="emails" name="emails" required>
</div>
</div>
<input type="submit", value="Submit">

View File

@ -1,167 +0,0 @@
{{! 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>

View File

@ -28,7 +28,7 @@
<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">
<form action="lunch_events/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>
@ -50,7 +50,7 @@
<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">
<select name="lang", id="lang" required>
<option value="" disabled selected>Select Language</option>
<option value="en">English</option>
<option value="es">Spanish</option>
@ -63,7 +63,7 @@
<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">
<input type="text" class="form-control form-control-sm" id="title" name="title" required>
</div>
</div>
@ -72,7 +72,7 @@
<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">
<input type="text" class="form-control form-control-sm" id="text" name="text" required>
</div>
</div>
@ -81,7 +81,7 @@
<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">
<input type="text" class="form-control form-control-sm" id="location" name="location" required>
</div>
</div>
@ -90,7 +90,7 @@
<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">
<input type="text" class="form-control form-control-sm" id="time" name="time" required>
</div>
</div>
@ -106,12 +106,12 @@
<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">
<input type="number" class="form-control form-control-sm" id="id" name="id" required>
</div>
</div>
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<div style="flex: 1; justify-content: center;" required>
<select name="lang", id="lang">
<option value="" disabled selected>Select Language</option>
<option value="en">English</option>
@ -125,7 +125,7 @@
<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">
<input type="text" class="form-control form-control-sm" id="title" name="title" required>
</div>
</div>
@ -134,7 +134,7 @@
<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">
<input type="text" class="form-control form-control-sm" id="text" name="text" required>
</div>
</div>
@ -143,7 +143,7 @@
<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">
<input type="text" class="form-control form-control-sm" id="location" name="location" required>
</div>
</div>
@ -152,7 +152,7 @@
<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">
<input type="text" class="form-control form-control-sm" id="time" name="time" required>
</div>
</div>

View File

@ -3,9 +3,148 @@
<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>
<form onsubmit="forwardForImage('new_f', 'new/add')" id="new_f" name="new_f">
<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;">What's New</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">{{image}}</p>
<p class="mb-2">{{new_date}}</p>
<form action="new/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;">What's New Actions</h1>
<hr/>
<div class="my-4">
<h2 style="font-size: 20px;">Add New Item</h2>
<form onsubmit="forwardForImage('new_f', 'new/add')" id="new_f" name="new_f" method="post" enctype="multipart/form-data">
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<select name="lang", id="lang" required>
<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">What's New Item Image</p>
</div>
<div style="flex: 1; align: center;">
<input type="file" name="image", id="image", accept="image/png" required>
</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" required>
</div>
</div>
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<p class="my-0">Date of What's New Item</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="new_date" name="new_date" required>
</div>
</div>
<input type="submit" value="Submit">
</form>
</div>
<div class="my-4">
<h2 style="font-size: 20px;">Update What's New Item</h2>
<form action="new/upd" method="post">
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<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">
</div>
</div>
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<select name="lang", id="lang" required>
<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">What's New Item Image</p>
</div>
<div style="flex: 1; align: center;">
<input type="file" name="image", id="image", accept="image/png" required>
</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" required>
</div>
</div>
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<p class="my-0">Date of What's New Item</p>
</div>
<div style="flex: 1; align: center;">
<input type="text" class="form-control form-control-sm" id="new_date" name="new_date" required>
</div>
</div>
<input type="submit", value="Submit">
</form>
</div>
<hr/>
</div>
</div>
<!-- <form onsubmit="forwardForImage('new_f', 'new/add')" id="new_f" name="new_f" method="post" enctype="multipart/form-data">
{{!<form action="new/add" method="post" enctype="multipart/form-data">}}
<select name="lang", id="lang">
<option value="en">en</option>
<option value="es">es</option>
@ -14,7 +153,7 @@
<input type="text", id="name", name="name">
<input type="text", id="new_date", name="new_date">
<input type="submit", value="Submit">
</form>
</form>-->
</body>
<!-- <script src="/static/jquery.min.js"></script> -->
<script src="/static/utils.js"></script>

View File

@ -47,7 +47,7 @@
<form action="polls/add" method="post">
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<select name="lang", id="lang">
<select name="lang", id="lang" required>
<option value="" disabled selected>Select Language</option>
<option value="en">English</option>
<option value="es">Spanish</option>
@ -60,7 +60,7 @@
<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="url" name="url">
<input type="text" class="form-control form-control-sm" id="url" name="url" required>
</div>
</div>
@ -76,13 +76,13 @@
<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">
<input type="number" class="form-control form-control-sm" id="id" name="id" required>
</div>
</div>
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<select name="lang", id="lang">
<select name="lang", id="lang" required>
<option value="" disabled selected>Select Language</option>
<option value="en">English</option>
<option value="es">Spanish</option>
@ -95,7 +95,7 @@
<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="url" name="url">
<input type="text" class="form-control form-control-sm" id="url" name="url" required>
</div>
</div>

View File

@ -29,7 +29,7 @@
<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">
<form action="student/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>
@ -51,7 +51,7 @@
<form action="student/add" method="post">
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<select name="lang", id="lang">
<select name="lang", id="lang" required>
<option value="" disabled selected>Select Language</option>
<option value="en">English</option>
<option value="es">Spanish</option>
@ -64,7 +64,7 @@
<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">
<input type="text" class="form-control form-control-sm" id="name" name="name" required>
</div>
</div>
@ -73,7 +73,7 @@
<p class="my-0">Student Picture</p>
</div>
<div style="flex: 1; align: center;">
<input type="file" name="image", id="image", accept="image/png">
<input type="file" name="image", id="image", accept="image/png" required>
</div>
</div>
@ -82,7 +82,7 @@
<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">
<input type="text" class="form-control form-control-sm" id="grade" name="grade" required>
</div>
</div>
@ -91,7 +91,7 @@
<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">
<input type="text" class="form-control form-control-sm" id="messages" name="messages" required>
</div>
</div>
@ -100,7 +100,7 @@
<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">
<input type="text" class="form-control form-control-sm" id="hobbies" name="hobbies" required>
</div>
</div>
@ -109,7 +109,7 @@
<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">
<input type="text" class="form-control form-control-sm" id="achievements" name="achievements" required>
</div>
</div>
@ -125,13 +125,13 @@
<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">
<input type="number" class="form-control form-control-sm" id="id" name="id" required>
</div>
</div>
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<select name="lang", id="lang">
<select name="lang", id="lang" required>
<option value="" disabled selected>Select Language</option>
<option value="en">English</option>
<option value="es">Spanish</option>
@ -144,7 +144,7 @@
<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">
<input type="text" class="form-control form-control-sm" id="name" name="name" required>
</div>
</div>
@ -153,7 +153,7 @@
<p class="my-0">Student Picture</p>
</div>
<div style="flex: 1; align: center;">
<input type="file" name="image", id="image", accept="image/png">
<input type="file" name="image", id="image", accept="image/png" required>
</div>
</div>
@ -162,7 +162,7 @@
<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">
<input type="text" class="form-control form-control-sm" id="grade" name="grade" required>
</div>
</div>
@ -171,7 +171,7 @@
<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">
<input type="text" class="form-control form-control-sm" id="messages" name="messages" required>
</div>
</div>
@ -180,7 +180,7 @@
<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">
<input type="text" class="form-control form-control-sm" id="hobbies" name="hobbies" required>
</div>
</div>
@ -189,7 +189,7 @@
<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">
<input type="text" class="form-control form-control-sm" id="achievements" name="achievements" required>
</div>
</div>

View File

@ -49,7 +49,7 @@
<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;">
<div style="flex: 1; justify-content: center;" required>
<select name="lang", id="lang">
<option value="" disabled selected>Select Language</option>
<option value="en">English</option>
@ -63,7 +63,7 @@
<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">
<input type="text" class="form-control form-control-sm" id="name" name="name" required>
</div>
</div>
@ -72,7 +72,7 @@
<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">
<input type="text" class="form-control form-control-sm" id="email" name="email" required>
</div>
</div>
@ -81,7 +81,7 @@
<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">
<input type="text" class="form-control form-control-sm" id="phone" name="phone" required>
</div>
</div>
@ -90,7 +90,7 @@
<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">
<input type="text" class="form-control form-control-sm" id="position" name="position" required>
</div>
</div>
@ -99,7 +99,7 @@
<p class="my-0">Staff Picture</p>
</div>
<div style="flex: 1; align: center;">
<input type="file" name="image", id="image", accept="image/png">
<input type="file" name="image", id="image", accept="image/png" required>
</div>
</div>
@ -115,13 +115,13 @@
<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">
<input type="number" class="form-control form-control-sm" id="id" name="id" required>
</div>
</div>
<div class="d-flex mt-3">
<div style="flex: 1; justify-content: center;">
<select name="lang", id="lang">
<select name="lang", id="lang" required>
<option value="" disabled selected>Select Language</option>
<option value="en">English</option>
<option value="es">Spanish</option>
@ -134,7 +134,7 @@
<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">
<input type="text" class="form-control form-control-sm" id="name" name="name" required>
</div>
</div>
@ -143,7 +143,7 @@
<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">
<input type="text" class="form-control form-control-sm" id="email" name="email" required>
</div>
</div>
@ -152,7 +152,7 @@
<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">
<input type="text" class="form-control form-control-sm" id="phone" name="phone" required>
</div>
</div>
@ -161,7 +161,7 @@
<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">
<input type="text" class="form-control form-control-sm" id="position" name="position" required>
</div>
</div>
@ -170,7 +170,7 @@
<p class="my-0">Staff Picture</p>
</div>
<div style="flex: 1; align: center;">
<input type="file" name="image", id="image", accept="image/png">
<input type="file" name="image", id="image", accept="image/png" required>
</div>
</div>