templates

This commit is contained in:
emilyliublair 2021-09-12 15:08:49 -04:00
parent 4f9a69707c
commit ed59b3f47b
28 changed files with 1366 additions and 268 deletions

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}/>}

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'
} })

View File

@ -28,7 +28,8 @@ class ChallengeWeek extends React.Component {
super(props)
this.state = {
isLoading: true,
flip: true
flip: true,
data:[]
}
}
@ -40,76 +41,33 @@ 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 {
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'}}>{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>
<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>
)
}
}
}
}
export default ChallengeWeek;

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))
}

File diff suppressed because one or more lines are too long

View File

@ -54,7 +54,8 @@ export default {
},
lunch: {
information: "Information",
location: "Location"
location: "Location",
time: "Time of Event"
},
ssl: {
information: "Information",

View File

@ -54,7 +54,8 @@ export default {
},
lunch: {
information: "ESInformation",
location: "ESLocation"
location: "ESLocation",
time:"ES TIME OF EVENT"
},
ssl: {
information: "ESInformation",

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))
}

View File

@ -80,22 +80,55 @@ 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() {
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: 'https://docs.google.com/forms/d/e/1FAIpQLSfR0XP2yo3TV3egz7aMok56wnP9kG4FQt2v3rHrrayf8uC7Vw/viewform?usp=sf_link'}}
source = {{uri: this.state.data[this.state.data.length-1].url}}
javaScriptEnabled={true}
domStorageEnabled={true}
startInLoadingState={true}
style={{marginTop: 0}}
cacheEnabled={true}
/>
)
}
}
}
}
export default Poll;

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))

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>
);
);}
}
}

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)}>

View File

@ -1 +1 @@
{"url":"https://blazerappcms.ml/"}
{"url":"http://127.0.0.1:8080"}

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;

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
)
);

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),
}
}

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,
],
)
}

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>

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>

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">

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>

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>

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>

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>

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,47 +82,20 @@
<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>

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>

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>

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>