Merge branch 'master' into Borges_march

# Conflicts:
#	App/app/Router.js
#	App/app/screens/Eventos.js
This commit is contained in:
João Borges 2019-03-14 18:46:17 +00:00
commit c2b7539e2f
31 changed files with 2433 additions and 1683 deletions

View File

@ -39,6 +39,7 @@ const SCREEN_HEIGHT = Dimensions.get("window").height;
const SCREEN_WIDTH = Dimensions.get("window").width;
import Swiper from "react-native-swiper";
import resetPassword from "./screens/resetPassword";
var TimerMixin = require("react-timer-mixin");
function handleConnectivityChange() {
@ -46,6 +47,9 @@ function handleConnectivityChange() {
}
class App extends Component {
handleConnectivityChange = isConnected => {
this.setState({ isConnected });
};
@ -83,7 +87,9 @@ class App extends Component {
UI_loginScannerActive: false,
userDetails: { username: "", password: "" },
isConnected: true,
modalOpen: false
modalOpen: false,
modalResetPassword:false,
resetText:''
};
}
_print = () => {
@ -123,6 +129,16 @@ class App extends Component {
this.handleConnectivityChange
);
}
_toggle=()=>{
this.setState({modalResetPassword:false})
}
//faz call
_reset=()=>{
//fecha modal
this.props.resetPassword(this.props.userDetails.token,this.state.resetText),
this.setState({modalResetPassword:false})
//faz call
}
_keyboardDidShow() {
//alert('Keyboard Shown');
@ -142,7 +158,10 @@ class App extends Component {
};
render() {
if (!this.props.logged && this.props.onHold) {
return (
<View style={UtilStyles.containerLoading}>
@ -158,6 +177,7 @@ class App extends Component {
return <Router />;
}
return (
<View style={styles.slide2}>
<Modal isVisible={this.props.UI_loginScannerActive}>
<View style={{ flex: 1, backgroundColor: "white" }}>
@ -174,12 +194,48 @@ class App extends Component {
/>
</View>
</Modal>
<Modal
isVisible={this.state.modalResetPassword}
onBackdropPress={this._toggle}
onBackButtonPress={this._toggle}
animationInTiming={1100}
animationOutTiming={1100}
>
<View style={{ backgroundColor: "white" , padding:20,paddingBottom:0, alignItems:'center'}}>
<View>
<Text style={{textAlign:'center',fontSize:23, fontWeight:'bold', color:'#CC1A17', margin:30}}>Reset Password</Text>
<Text style={{textAlign:'center', }}>Deves introduzir o email com o qual efectuaste a compra do bilhete.</Text>
<TextInput
style={styles.resetPassword}
onFocus={this._print}
maxLength={50}
blurOnSubmit={true}
onChangeText={r => this.setState({ resetText:r })}
clearButtonMode="always"
value={this.state.resetText}
clearTextOnFocus={true}
onSubmitEditing={Keyboard.dismiss}
placeholder="Email ou Qr code"
/>
<Button
onPress={this._reset}
title={"Enviar"}
color={"#CC1A17"}
></Button>
<Text style={{textAlign:'center', fontSize:12, margin:10,marginBottom:5}}> Caso tenhas problemas com este processo deves contactar a comissão organizadora atravês do email geral.</Text>
</View>
</View>
</Modal>
<View
style={{
width: "100%",
justifyContent: "center",
alignItems: "center"
alignItems: "center",
margin:20
}}
>
<Image
@ -203,10 +259,10 @@ class App extends Component {
<Icon
style={styles.searchIcon}
name="ios-qr-scanner"
size={30}
size={40}
color="#000"
/>
<Text>Scan QR</Text>
</View>
</TouchableOpacity>
</View>
@ -225,13 +281,11 @@ class App extends Component {
placeholder="Password"
/>
{ !this.props.loadingLogin &&
<RkButton
rkType="dark"
style={styles.loginBtn}
onPress={this._tryLogin}
>
Entrar
</RkButton>
<View style={{alignItems:'center', margin:20}}>
<TouchableOpacity onPress={this._tryLogin} style={{backgroundColor:'#CC1A17',borderRadius:3}}>
<Text style={{color:'white', fontSize:20, margin:10, width:150,textAlign:'center',}}>Login</Text>
</TouchableOpacity>
</View>
}
{this.props.alignItems &&
<ActivityIndicator size="large" color="#0000ff" />
@ -253,9 +307,9 @@ class App extends Component {
<View style={styles.textRow}>
<RkText rkType="primary3">Não sabes a password?</RkText>
<RkButton rkType="clear" onPress={this.onSignUpButtonPressed}>
<TouchableOpacity>
<RkText style={{ color: "red" }} kType="header6">
Recuperar Password
<TouchableOpacity onPress={() => {this.setState({modalResetPassword:true})}}>
<RkText style={{ color: "#CC1A17", fontWeight:'bold' }} kType="header6">
Reset Password
</RkText>
</TouchableOpacity>
</RkButton>
@ -282,10 +336,30 @@ const overlayColor = "rgba(0,0,0,0.30)";
const styles = {
cameraContainer: {
// height: Dimensions.get('window').height ,
height: Dimensions.get('window').height ,
},
resetPassword:{
borderColor: "#bfbdbd",
borderWidth: 1,
margin:20,
marginTop: 60,
marginBottom: 60,
width: SCREEN_WIDTH * 0.8,
backgroundColor: "white",
borderRadius: 3,
height: SCREEN_HEIGHT * 0.08,
borderColor: "#bfbdbd",
borderWidth: 1,
paddingLeft: SCREEN_WIDTH * 0.05
},
passwordInput: {
borderRadius: 90,
borderColor: "#bfbdbd",
borderWidth: 1,
@ -295,7 +369,7 @@ const styles = {
backgroundColor: "white",
borderRadius: 90,
borderRadius: 3,
height: SCREEN_HEIGHT * 0.08,
borderColor: "#bfbdbd",
borderWidth: 1,
@ -307,15 +381,19 @@ const styles = {
},
scanQR: {
//flexDirection: 'row',
paddingTop: 5,
flex:1,
//paddingTop: 5,
backgroundColor: 10,
alignItems:'center',
padding:5,
paddingRight:15,
width: 80,
paddingLeft: 10,
backgroundColor: "#f24b4b",
borderBottomRightRadius: 90,
borderTopRightRadius: 90,
height: "100%"
//width: 80,
// paddingLeft: 10,
backgroundColor: "#CC1A17",
borderBottomRightRadius: 3,
borderTopRightRadius: 3,
// height: "100%"
},
inputSection: {
flexDirection: "row",
@ -323,7 +401,7 @@ const styles = {
backgroundColor: "white",
borderRadius: 90,
borderRadius: 3,
height: SCREEN_HEIGHT * 0.08,
borderColor: "#bfbdbd",
borderWidth: 1
@ -382,7 +460,8 @@ const styles = {
justifyContent: "center",
alignItems: "center",
marginTop: 200
marginTop: 200,
},
logo2: {

View File

@ -36,7 +36,8 @@ import Profile from "./screens/Profile";
import editCalendar from './screens/editCalendar';
import choosePath from './screens/choosePath';
import calendarDetail from './screens/calendarDetail';
import FebradaDetail from './screens/FebradaDetail';
import resetPassword from './screens/resetPassword';
const navigationOptions = ({navigation}) => ({
headerLeft: <HeaderBackButton onPress={() => navigation.goBack(null)}/>,
@ -104,11 +105,8 @@ const AppStack = createBottomTabNavigator(
},
{
//initialRouteName: 'Home',
initialRouteName: 'Eventos',
//initialRouteName: 'Calendário',
tabBarOptions: {
showLabel: true, // hide labels
activeTintColor: '#CC1A17', // active icon color
@ -125,7 +123,8 @@ const Stack = createStackNavigator({
screen: AppStack,
navigationOptions: ({navigation}) => {
const index = navigation.state.index;
if (navigation.state.routes[index].routeName == 'Home') {
return {
headerTitle: `${navigation.state.routes[index].routeName}`,
@ -205,7 +204,13 @@ const Stack = createStackNavigator({
calendarDetail: {
screen: calendarDetail,
},
FebradaDetail: {
screen: FebradaDetail,
},
resetPassword:{
screen:resetPassword
}
});

View File

@ -19,7 +19,7 @@ import * as Progress from "react-native-progress";
import { connect } from "react-redux";
import { bindActionCreators } from "redux";
import PTRView from 'react-native-pull-to-refresh';
import * as Actions from "../store/actions"; //Import your actionss
const formatObj = obj => {
@ -72,7 +72,7 @@ class Calendar extends React.Component {
<View style={styles.details}>
<Progress.Bar
color={"#000000"}
progress={item.Enrolled / item.MaxAttendees}
progress={0}
unfilledColor={"white"}
width={210}
/>
@ -140,6 +140,10 @@ class Calendar extends React.Component {
constructor() {
super();
}
_refresh=()=>{
this.props.getEvents(this.props.user);
//this.props.getSessions(this.props.userDetails.token);
}
render() {
const ThirdRoute = () => (
@ -275,7 +279,9 @@ class Calendar extends React.Component {
);
return (
<View style={{ flex: 1 }}>
<View>
{this.props.careerPath != undefined && (
<Text
@ -292,6 +298,7 @@ class Calendar extends React.Component {
</Text>
)}
</View>
<TabView
navigationState={this.state}
renderScene={SceneMap({
@ -310,7 +317,11 @@ class Calendar extends React.Component {
style={{ backgroundColor: "#F2F2F2" }}
indicatorStyle={{ backgroundColor: "pink" }}
/>
<Button onPress={this._refresh} title="Refresh" color="#841584"
/>
</View>
);
}
}
@ -412,4 +423,4 @@ function mapDispatchToProps(dispatch) {
export default connect(
mapStateToProps,
mapDispatchToProps
)(Calendar);
)(Calendar);

View File

@ -1,5 +1,7 @@
import * as React from "react";
import {View, StyleSheet, Dimensions, Text, Button, ScrollView, ImageBackground} from "react-native";
import {View, StyleSheet, Dimensions, Text, Button, ScrollView, Image, TouchableOpacity} from "react-native";
import {TabView, TabBar, SceneMap} from "react-native-tab-view";
import rallyImg from '../assets/rallyTascas.jpg';
@ -36,32 +38,23 @@ export default class Eventos extends React.Component {
};
renderFebrada = () => {
renderFebrada = (navigate) => {
return (
<View>
<View styles={styles.cardContainer}>
<ImageBackground
<TouchableOpacity onPress={() => navigate('FebradaDetail')}>
<View style={styles.cardContainer}>
<Image
style={{
flex: 1,
width: '100%',
height: '100%',
width: undefined,
height: undefined
}}
source={require('../assets/rallyTascas.jpg')}
/>
resizeMode="contain"
source={require('../assets/altice_logo.png')}
>
</Image>
</View>
<View styles={styles.cardContainer}>
<Text>Ola</Text>
<Text style={{color: "black"}}>Local: 1</Text>
</View>
<View styles={styles.cardContainer}>
<Text>Ola</Text>
<Text style={{color: "black"}}>Local: 1</Text>
</View>
</TouchableOpacity>
</View>
);
@ -69,25 +62,54 @@ export default class Eventos extends React.Component {
renderRally = () => {
return (
<View>
<View style={styles.cardContainer}>
<Image
style={{
flex: 1,
width: undefined,
height: undefined
}}
resizeMode="contain"
source={require('../assets/altice_logo.png')}
>
</Image>
</View>
</View>
);
};
renderCaching = () => {
return (
<View>
<View style={styles.cardContainer}>
<Image
style={{
flex: 1,
width: undefined,
height: undefined
}}
resizeMode="contain"
source={require('../assets/altice_logo.png')}
>
</Image>
</View>
</View>
);
};
render() {
const {navigate} = this.props.navigation;
return (
<View>
<ScrollView>
<View style={styles.cardContainer}>
{this.renderFebrada()}
</View>
<View styles={styles.cardContainer}>
</View>
<View styles={styles.cardContainer}>
</View>
<View style={styles.container}>
<ScrollView styles={styles.scroll}>
{this.renderFebrada(navigate)}
{this.renderRally()}
{this.renderCaching()}
</ScrollView>
</View>
);
@ -98,8 +120,11 @@ const styles = StyleSheet.create({
container: {
backgroundColor: '#eee',
flex: 1,
flexGrow: 1,
flexDirection: 'column',
},
scroll: {
flex: 1,
},
@ -110,11 +135,9 @@ const styles = StyleSheet.create({
padding: 10,
margin: 20,
backgroundColor: '#fff',
height: SCREEN_WIDTH * (1 / 2),
borderRadius: 5,
elevation: 2,
height: (SCREEN_WIDTH * (1 / 2)),
borderWidth: 2,
color: "#000"
//borderWidth: 2,
},
scene: {

View File

@ -0,0 +1,246 @@
import * as React from 'react';
import {
View,
StyleSheet,
Dimensions,
ScrollView,
Text,
ImageBackground
} from 'react-native';
import {Divider} from 'react-native-elements'
import AppIntroSlider from 'react-native-app-intro-slider';
import NavAbsolute from '../components/Nav';
import * as Actions from "../store/actions";
import {connect} from "react-redux";
import {bindActionCreators} from "redux";
const SCREEN_HEIGHT = Dimensions.get("window").height;
const SCREEN_WIDTH = Dimensions.get("window").width;
class FebradaDetail extends React.Component {
static navigationOptions = ({navigation}) => ({
header: (
<NavAbsolute
navigation={navigation}
// title={navigation.state.params.info.name}
/>
),
});
renderHeader = () => {
return (
<View style={styles.headerContainer}>
<View style={styles.coverContainer}>
<ImageBackground
source={{
uri: 'https://upload.wikimedia.org/wikipedia/commons/9/94/Logo_TvAAC_2014.png',
}}
style={styles.coverImage}
>
</ImageBackground>
</View>
</View>
)
};
renderDescription = () => {
return (
<View style={{height: SCREEN_HEIGHT * (1 / 3)}}>
<View
style={{flexDirection: "row"}}>
<View style={styles.header}>
<View style={styles.nameText}>
<Text
style={{color: '#CC1A17', fontSize: 20}}>Febrada</Text>
</View>
<View style={styles.timeText}>
<Text style={{color: "#CC1A17", fontSize: 15}}>
<Text style={{color: "#CC1A17", fontSize: 15}}>
Sexta 12 -
</Text>
14h00{/*{info.time === info.timeEnd ? info.time : `${info.time} - ${info.timeEnd}`}*/}
</Text>
</View>
</View>
</View>
<View style={styles.descContainer}>
<Text style={{fontSize: 20, color: '#CC1A17'}}>Descrição</Text>
<Divider style={{backgroundColor: '#000'}}/>
<Text style={{paddingRight: 10, paddingTop: 10}}>g</Text>
</View>
</View>
)
};
renderSlider = () => {
const slides = [
{
key: 'somethun',
title: 'Title 1',
titleStyle: '',
text: 'blblbalbalba',
textStyle: '',
backgroundColor: '#59b2ab',
},
{
key: 'somethun-dos',
title: 'Title 2',
titleStyle: '',
text: 'blblbalbalba',
textStyle: '',
backgroundColor: '#febe29',
},
{
key: 'somethun1',
title: 'Rocket guy',
titleStyle: '',
text: 'blblbalbalba',
textStyle: '',
backgroundColor: '#22bcb5',
}
];
return (
<AppIntroSlider
slides={slides}
style={{height: SCREEN_WIDTH * 0.54}}
activeDotStyle={{backgroundColor:'#CC1A17'}}
renderDoneButton={this._buyFinosOrBifanas()}
renderNextButton={this._renderNextButton}
/>
)
};
_buyFinosOrBifanas = () => {
//Modal
};
render() {
return (
<View style={styles.mainViewStyle}>
<ScrollView style={styles.scroll}>
<View style={styles.container}>
<View style={styles.headerContainer}>
{this.renderHeader()}
</View>
<View style={{backgroundColor: "#fff"}}>
{this.renderDescription()}
{this.renderSlider()}
</View>
</View>
</ScrollView>
</View>
)
}
}
const styles = StyleSheet.create({
mainContent: {
flex: 1,
alignItems: 'center',
justifyContent: 'space-around',
},
text: {
//color: 'rgba(255, 255, 255, 0.8)',
backgroundColor: 'transparent',
textAlign: 'center',
color:'#000',
paddingHorizontal: 16,
},
title: {
fontSize: 22,
color: 'white',
backgroundColor: 'transparent',
textAlign: 'center',
marginBottom: 16,
},
header: {
flex: 1,
flexDirection: 'row',
padding: 10,
backgroundColor: 'white',
//height: SCREEN_HEIGHT * (1 / 3),
},
nameText: {
alignSelf: 'flex-start',
flex: 1,
},
timeText: {
alignItems: 'flex-end',
flex: 1,
marginRight: 4,
},
mainViewStyle: {
flex: 1,
flexGrow: 1,
flexDirection: 'column',
},
scroll: {
backgroundColor: '#eee',
flex: 1,
//marginBottom: 55,
},
descContainer: {
padding: 10,
},
headerContainer: {
flex: 1,
},
container: {
flex: 1,
flexDirection: 'column',
},
coverContainer: {
position: 'relative',
},
coverImage: {
height: Dimensions.get('window').width * (2 / 4),
width: Dimensions.get('window').width,
},
});
function mapStateToProps(state, props) {
return {
token: state.apiReducer.token,
user: state.apiReducer.user,
logged: state.apiReducer.logged,
events: state.apiReducer.events,
careerPath: state.apiReducer.careerPath,
}
}
function mapDispatchToProps(dispatch) {
return bindActionCreators(Actions, dispatch);
}
export default connect(mapStateToProps, mapDispatchToProps)(FebradaDetail);

View File

@ -1,338 +1,429 @@
import React, {Component} from 'react';
import React, { Component } from "react";
import {
Button,
View,
Text,
TouchableOpacity,
FlatList,
ActivityIndicator,
Dimensions,
StyleSheet,
Image,
ImageBackground,
NetInfo,
AppState
} from 'react-native';
Button,
View,
Text,
TouchableOpacity,
FlatList,
ActivityIndicator,
Dimensions,
StyleSheet,
Image,
ImageBackground,
NetInfo,
AppState
} from "react-native";
import {Shadow} from 'react-native-shadow'
import Icon from "react-native-vector-icons/Ionicons"
import {
RkButton,
RkTheme
} from 'react-native-ui-kitten';
import { Shadow } from "react-native-shadow";
import Icon from "react-native-vector-icons/Ionicons";
import { RkButton, RkTheme } from "react-native-ui-kitten";
import { connect } from "react-redux";
import {connect} from 'react-redux';
import { bindActionCreators } from "redux";
import {bindActionCreators} from 'redux';
import * as Actions from '../store/actions'; //Import your actionss
import * as Actions from "../store/actions"; //Import your actionss
import ImageOverlay from "react-native-image-overlay";
import {createStore} from 'redux';
import PTRView from 'react-native-pull-to-refresh';
import {Provider} from 'react-redux'
import { ScrollView } from 'react-native-gesture-handler';
import { createStore } from "redux";
import PTRView from "react-native-pull-to-refresh";
import { Provider } from "react-redux";
import { ScrollView } from "react-native-gesture-handler";
const SCREEN_HEIGHT = Dimensions.get("window").height;
const SCREEN_WIDTH = Dimensions.get("window").width;
import {Card, Divider} from 'react-native-elements'
import RNMaterialShadows from 'react-native-material-shadows';
import { Card, Divider } from "react-native-elements";
import RNMaterialShadows from "react-native-material-shadows";
import IconFA from "react-native-vector-icons/FontAwesome5";
class Home extends Component {
_handleConnectionChange = (isConnected) => {
// this.props.dispatch(connectionState({ status: isConnected }));
console.log("fck that")
};
_refresh() {
return new Promise((resolve) => {
setTimeout(()=>{resolve()}, 2000)
});
}
_callApi(){
this.props.getUserInfo(this.props.token);
}
constructor(props) {
_handleConnectionChange = isConnected => {
// this.props.dispatch(connectionState({ status: isConnected }));
console.log("fck that");
};
_refresh() {
return new Promise(resolve => {
setTimeout(() => {
resolve();
}, 2000);
});
}
_callApi() {
this.props.getUserInfo(this.props.token);
}
constructor(props) {
super(props);
super(props);
this.state = {
token: { valid: false },
logged: true,
onHold: true,
user: { Name: "" },
userDetails: {},
appState: AppState.currentState
};
}
handleConnectivityChange = () => {
console.log("asdasdasdasdasd");
};
this.state = {
componentDidMount() {
// NetInfo.isConnected.addEventListener('connectionChange', this.handleConnectivityChange);
token: {valid: false},
logged: true,
onHold: true,
user: {Name: ''},
userDetails:{},
appState: AppState.currentState,
};
}
handleConnectivityChange = () => {
console.log("asdasdasdasdasd");
}
// this.props.hold();
console.log("hold" + this.props.onHold);
//this.props.logoutUser();
componentDidMount() {
// NetInfo.isConnected.addEventListener('connectionChange', this.handleConnectivityChange);
//console.log(this.props.token);
// this.props.hold();
console.log("hold"+ this.props.onHold)
//this.props.logoutUser();
//console.log(this.props.token);
this.props.getUserInfo(this.props.userDetails.token);
//console.log('logged:'+this.props.logged);
//console.log(th2is.props)
}
componentWillUnmount() {
}
bClick() {
//this.props.logoutUser();
let a = {};
// this.setState({ user: this.props.user });
// console.log(this.props.user)
//
//var navigate = this.props.navigation.navigate
}
_update=()=>{
this.props.getUserInfo(this.props.userDetails.token);
}
render() {
//console.log('logged:'+this.props.logged);
const {navigate} = this.props.navigation;
//console.log(th2is.props)
}
componentWillUnmount() {}
if (this.props.onHold) {
bClick() {
//this.props.logoutUser();
return (
<View>
<Text>lollsss {this.props.onHold}</Text>
<ActivityIndicator size="large" color="#0000ff"/>
</View>
)
}
if (this.props.logged) {
let a = {};
// this.setState({ user: this.props.user });
// console.log(this.props.user)
//
return (
<PTRView onRefresh={this._update} >
<ScrollView style={{backgroundColor:'#eeeeee'}}>
<View>
<ImageBackground
opacity={0.9}
source={require('../assets/img/bg_3.jpg')}
style={{
width: '100%',
// marginTop:150,
backgroundColor: 'rgba(255,255,255,1)' ,
}
}>
<View style={styles.homeHeader}>
<View style={styles.userImageContainer}>
<Image style={styles.userImage} source={{uri: 'https://i.imgur.com/XXJ7LxV.jpg'}}/>
</View>
<Text style={styles.userText}>{this.props.user.Name}</Text>
<Text style={styles.userTextSub}>{this.props.user.Company}</Text>
</View>
</ImageBackground>
<View style={styles.userStats}>
<Text style={styles.userStatsTitle}>O meu saldo:</Text>
<View style={styles.userStatsBox}>
<View style={styles.userBox}>
<Icon name="ios-beer" style={styles.userStatsBoxIcon} size={50}/>
<Text style={styles.userBoxText}>0 Fino(s)</Text>
</View>
<View style={styles.userBox}>
<Icon name="ios-beer" style={styles.userStatsBoxIcon} size={50}/>
<Text style={styles.userBoxText}>0 Fino(s)</Text>
</View>
<View style={styles.userBox}>
<Icon name="ios-beer" style={styles.userStatsBoxIcon} size={50}/>
<Text style={styles.userBoxText}>0 Fino(s)</Text>
</View>
</View>
</View>
</View>
</ScrollView>
</PTRView>
);
}
else {
return (
<View>
<Text>sem permissões para aceder aqui</Text>
</View>
);
}
//var navigate = this.props.navigation.navigate
}
_update = () => {
this.props.getUserInfo(this.props.userDetails.token);
};
render() {
const { navigate } = this.props.navigation;
if (this.props.onHold) {
return (
<View>
<Text>lollsss {this.props.onHold}</Text>
<ActivityIndicator size="large" color="#0000ff" />
</View>
);
}
if (this.props.logged) {
return (
<PTRView onRefresh={this._update}>
<ScrollView style={{ backgroundColor: "#eeeeee" }}>
<View>
<ImageBackground
opacity={0.9}
source={require("../assets/img/bg_3.jpg")}
style={{
width: "100%",
// marginTop:150,
backgroundColor: "rgba(255,255,255,1)"
}}
>
<View style={styles.homeHeader}>
<View style={styles.userImageContainer}>
<Image
style={styles.userImage}
source={{ uri: "https://i.imgur.com/XXJ7LxV.jpg" }}
/>
</View>
{this.props.user != undefined && (
<Text style={styles.userText}>{this.props.user.Name}</Text>
)}
<Text style={styles.userTextSub}>
{this.props.user.Company}
</Text>
</View>
</ImageBackground>
<View style={styles.userStats}>
<View style={{backgroundColor:'orange'}}>
<Text style={styles.userStatsTitle}>Informações Importantes</Text>
</View>
<View style={styles.userStatsBox}>
<Text style={{margin:10}}>Grupo de ....</Text>
<Text style={{margin:10}}>Alojamento</Text>
</View>
</View>
<View>
<View
style={{
margin: 10,
marginTop: 20,
backgroundColor: "white",
borderRadius: 3
}}
>
<View style={{ backgroundColor: "#CC1A17" , flex:1, flexDirection:'row'}}>
<View style={{width:'79%'}}>
<Text
style={{
fontSize: 25,
color: "white",
margin: 10,
fontWeight: "bold",
marginBottom: 0
}}
>
Os tones
</Text>
<Text
style={{
color: "white",
marginLeft: 10,
marginBottom: 5
}}
>
5/6 elementos
</Text>
</View>
<View style={{alignItems:'center', alignContent:'center',alignSelf:'center'}}>
<IconFA name="plus" color={'white'} size={30} />
<Text style={{color:'white'}}>Adicionar</Text>
</View>
</View>
<View>
<View style={{ flex: 1 }}>
<View style={styles.user}>
<View style={styles.userLogo}>
<IconFA name="user" size={40} />
</View>
<View style={styles.userT}>
<Text style={styles.userName}>Henrique Dias</Text>
<Text>AFFJASDXZ</Text>
</View>
<TouchableOpacity style={styles.userRemove}>
<Text style={{fontWeight:'bold'}}>rm equipa</Text>
</TouchableOpacity>
</View>
<Divider style={{ backgroundColor: "black" }} />
<View style={styles.user}>
<View style={styles.userLogo}>
<IconFA name="user" size={40} />
</View>
<View style={styles.userT}>
<Text style={styles.userName}>Henrique Dias</Text>
<Text>AFFJASDXZ</Text>
</View>
<TouchableOpacity style={styles.userRemove}>
<IconFA name="times" color={"#CC1A17"} size={30} />
<Text>remover</Text>
</TouchableOpacity>
</View>
<Divider style={{ backgroundColor: "black" }} />
<View style={styles.user}>
<View style={styles.userLogo}>
<IconFA name="user" size={40} />
</View>
<View style={styles.userT}>
<Text style={styles.userName}>Henrique Dias</Text>
<Text>AFFJASDXZ</Text>
</View>
<TouchableOpacity style={styles.userRemove}>
<IconFA name="times" color={"#CC1A17"} size={30} />
<Text>remover</Text>
</TouchableOpacity>
</View>
<Divider style={{ backgroundColor: "black" }} />
<View style={styles.user}>
<View style={styles.userLogo}>
<IconFA name="user" size={40} />
</View>
<View style={styles.userT}>
<Text style={styles.userName}>Henrique Dias</Text>
<Text>AFFJASDXZ</Text>
</View>
<TouchableOpacity style={styles.userRemove}>
<IconFA name="times" color={"#CC1A17"} size={30} />
<Text>remover</Text>
</TouchableOpacity>
</View>
<Divider style={{ backgroundColor: "black" }} />
<View style={styles.user}>
<View style={styles.userLogo}>
<IconFA name="user" size={40} />
</View>
<View style={styles.userT}>
<Text style={styles.userName}>Henrique Dias</Text>
<Text>AFFJASDXZ</Text>
</View>
<TouchableOpacity style={styles.userRemove}>
<IconFA name="times" color={"#CC1A17"} size={30} />
<Text>remover</Text>
</TouchableOpacity>
</View>
</View>
</View>
</View>
</View>
</View>
</ScrollView>
</PTRView>
);
} else {
return (
<View>
<Text>sem permissões para aceder aqui</Text>
</View>
);
}
}
}
const styles = StyleSheet.create({
userBoxText:{
color:'white',
userName:{
fontSize:16,
fontWeight:'bold'
},
userStatsBoxIcon:{
color:'white'
},
userStatsBox:{
flex:1,
flexDirection:'row'
userRemove: {
alignContent: "center",
alignItems: "center",
alignSelf:'center'
},
userBox:{
alignItems:'center',
justifyContent:'center',
width:'33%',
userT: {
margin: 10,
},
userCurriculum:{
paddingTop:5,
color:'red',
fontWeight:'bold',
fontSize:15
},
userBioRow:{
flex:1,
flexDirection:'row',
padding:10,
},
userBioText:{
width: "55%",
// backgroundColor: "red"
},
userLogo: {
paddingLeft: 10,
},
userBioLogo:{
marginLeft: SCREEN_WIDTH*0.05,
width: SCREEN_WIDTH*0.15,
},
margin: 10
},
user: {
alignSelf: "center",
flex: 1,
flexDirection: "row",
userTextSub:{
backgroundColor: 'rgba(0,0,0,0.7)' ,
color:'white',
},
userText:{
backgroundColor: 'rgba(0,0,0,0.7)' ,
color:'white',
fontWeight:'bold',
fontSize:20,
},
homeHeader:{
flex:1,
height: SCREEN_HEIGHT*0.3,
justifyContent: 'center',
alignItems:'center' ,
},
userImage:{
width:110,
height:110,
borderWidth: 1,
borderRadius: 5,
borderWidth:2,
borderColor: 'white',
},
userBio:{
flex:1,
padding:10,
margin:9,
backgroundColor:'white',
// height: SCREEN_HEIGHT*0.20,
color:'black',
borderRadius:5,
},
userStats:{
backgroundColor:'#CC1A17',
height: SCREEN_HEIGHT*0.2,
padding:10,
margin:10,
borderRadius:5,
marginTop:10,
marginBottom:0
margin: 10,
},
userStatsTitle:{
color:'white',
fontSize:17,
fontWeight:'bold',
padding:1
},
userImageContainer:{
alignSelf: 'center',
// transform: [{ rotate: '-15deg'}],
}
marginTop: 5,
width: "100%"
},
userBoxText: {
color: "white",
fontWeight: "bold"
},
userStatsBoxIcon: {
color: "white"
},
userStatsBox: {
flex: 1,
backgroundColor:'white',
flexDirection: "row"
},
userBox: {
alignItems: "center",
justifyContent: "center",
width: "33%"
},
userCurriculum: {
paddingTop: 5,
color: "red",
fontWeight: "bold",
fontSize: 15
},
userBioRow: {
flex: 1,
flexDirection: "row",
padding: 10
},
userBioText: {},
userBioLogo: {
marginLeft: SCREEN_WIDTH * 0.05,
width: SCREEN_WIDTH * 0.15
},
userTextSub: {
backgroundColor: "rgba(0,0,0,0.7)",
color: "white"
},
userText: {
backgroundColor: "rgba(0,0,0,0.7)",
color: "white",
fontWeight: "bold",
fontSize: 20
},
homeHeader: {
flex: 1,
height: SCREEN_HEIGHT * 0.3,
justifyContent: "center",
alignItems: "center"
},
userImage: {
width: 110,
height: 110,
borderWidth: 1,
borderRadius: 5,
borderWidth: 2,
borderColor: "white"
},
userBio: {
flex: 1,
padding: 10,
margin: 9,
backgroundColor: "white",
// height: SCREEN_HEIGHT*0.20,
color: "black",
borderRadius: 5
},
userStats: {
backgroundColor: "white",
height: SCREEN_HEIGHT * 0.2,
// padding: 10,
margin: 10,
borderRadius: 5,
marginTop: 10,
marginBottom: 0
},
userStatsTitle: {
margin:10,
color: "white",
fontSize: 17,
fontWeight: "bold",
padding: 1
},
userImageContainer: {
alignSelf: "center"
// transform: [{ rotate: '-15deg'}],
}
});
function mapStateToProps(state, props) {
return {
token: state.apiReducer.token,
user: state.apiReducer.user,
logged: state.apiReducer.logged,
userDetails: state.apiReducer.userDetails,
onHold: state.apiReducer.onHold
}
return {
token: state.apiReducer.token,
user: state.apiReducer.user,
logged: state.apiReducer.logged,
userDetails: state.apiReducer.userDetails,
onHold: state.apiReducer.onHold
};
}
function mapDispatchToProps(dispatch) {
return bindActionCreators(Actions, dispatch);
return bindActionCreators(Actions, dispatch);
}
export default connect(mapStateToProps, mapDispatchToProps)(Home);
export default connect(
mapStateToProps,
mapDispatchToProps
)(Home);

View File

@ -64,7 +64,7 @@ class Profile extends Component {
email: this.props.user.Email,
emailError: false,
emailErrorMessage: '',
emailErrorMessage: '',
phone: this.props.user.Mobile,
phoneError: false,
@ -78,9 +78,25 @@ class Profile extends Component {
cityError: false,
cityErrorMessage: '',
oldPass:'',
new1:'',
new2:'',
url:this.props.user.Url,
curso:this.props.user.LastName,
};
}
_press=()=>{
this.props.changePassword(
this.props.userDetails.token,
this.state.oldPass,
this.state.new1,
this.state.new2
)
}
_logout = () => {
this.props.logoutUser();
@ -138,9 +154,9 @@ class Profile extends Component {
saveData() {
const {name, jobs, email, phone, address, city, formValid} = this.state;
const {name, jobs, email, phone, address, city, formValid, url,curso} = this.state;
this._validateData(name, jobs, email, phone, address, city);
// this._validateData(name, jobs, email, phone, address, city,curso);
console.log(formValid);
@ -149,17 +165,16 @@ class Profile extends Component {
this.props.updateUser(this.props.userDetails.token, {
Name: this.state.name,
// LastName: "Último",
Company: jobs,
// Job: jobs,
LastName: curso,
Address: address,
City: city,
// PostalCode: "3000-010",
Mobile: phone,
Avatar: "base64"
Avatar: "base64",
Url:url,
});
this.props.getUserInfo(this.props.userDetails.token);
}
@ -176,17 +191,13 @@ class Profile extends Component {
<View style={styles.container}>
<View style={styles.userBioRowHeader}>
<View style={styles.userBioRowTitle}>
<Text style={{color: '#CC1A17', fontWeight: 'bold', fontSize: 20}}>User Bio</Text>
</View>
<View>
<TouchableOpacity onPress={() => this.saveData()}>
<Icon name="ios-save" size={30}/><Text>Save</Text>
</TouchableOpacity>
<Text style={{color: '#CC1A17', fontWeight: 'bold', fontSize: 20}}>Informações Pessoais</Text>
</View>
</View>
<View style={styles.userBio}>
<View style={styles.userBioRow}>
<Icon name="ios-person" style={styles.userBioLogo} size={25}/>
<Text style={styles.userBioLogo} >Nome</Text>
<TextInput style={styles.userBioText}
onChangeText={(n) => {
@ -196,7 +207,18 @@ class Profile extends Component {
</View>
<Divider style={{backgroundColor: 'black'}}/>
<View style={styles.userBioRow}>
<Icon name="ios-laptop" style={styles.userBioLogo} size={25}/>
<Text style={styles.userBioLogo} >Curso</Text>
<TextInput style={styles.userBioText}
onChangeText={(cu) => {
this.setState({curso: cu})
}}
value={this.state.curso}/>
</View>
<Divider style={{backgroundColor: 'black'}}/>
<View style={styles.userBioRow}>
<Text style={styles.userBioLogo} >Faculdade</Text>
<TextInput style={styles.userBioText}
onChangeText={(job) => {
@ -208,7 +230,7 @@ class Profile extends Component {
<View style={styles.userBioRow}>
<Icon name="ios-phone-portrait" style={styles.userBioLogo} size={25}/>
<Text style={styles.userBioLogo} >Telemóvel</Text>
<TextInput style={styles.userBioText}
onChangeText={(phone) => {
@ -220,7 +242,7 @@ class Profile extends Component {
<View style={styles.userBioRow}>
<Icon name="ios-map" style={styles.userBioLogo} size={25}/>
<Text style={styles.userBioLogo} >Morada</Text>
<TextInput style={styles.userBioText}
onChangeText={(add) => {
@ -232,22 +254,19 @@ class Profile extends Component {
<Divider style={{backgroundColor: 'black'}}/>
<View style={styles.userBioRow}>
<Icon name="ios-map" style={styles.userBioLogo} size={25}/>
<Text style={styles.userBioLogo} >LinkedIn</Text>
<TextInput style={styles.userBioText}
onChangeText={(city) => {
this.setState({city: city})
onChangeText={(u) => {
this.setState({url: u})
}}
value={this.state.city}/>
value={this.state.url}/>
</View>
<Divider style={{backgroundColor: 'black'}}/>
<View style={styles.userBioRow}>
<Icon name="ios-person" style={styles.userBioLogo} size={25}/>
<TouchableOpacity>
<Text style={styles.userCurriculum}>O meu Curriculo</Text>
</TouchableOpacity>
</View>
<Button onPress={() => this.saveData() } title="Guardar Alterações" color="#CC1A17"
/>
</View>
</View>
@ -255,51 +274,77 @@ class Profile extends Component {
<View style={styles.container}>
<View style={styles.userBioRowHeader}>
<View style={styles.userBioRowTitle}>
<Text style={{color: '#CC1A17', fontWeight: 'bold', fontSize: 20}}>Nova Password:</Text>
<Text style={{color: '#CC1A17', fontWeight: 'bold', fontSize: 20}}>Alterar Password</Text>
</View>
</View>
<View style={styles.userBio}>
<View style={styles.userBioRow}>
<Text style={styles.userPassText} size={20}>
Old Password:
</Text>
<View style={styles.userBioRow}>
<TextInput style={styles.userBioText}
placeholder='Antiga Password' secureTextEntry={true}
placeholder='Antiga Password'
onChangeText={(old => {
this.setState({oldPass: old})
})}
value={this.state.oldPass}
maxLength = {20}
secureTextEntry={true}
/>
</View>
<Divider style={{backgroundColor: 'black'}}/>
<View style={styles.userBioRow}>
<Text style={styles.userPassText} size={20}>
Nova Password:
</Text>
<TextInput style={styles.userBioText}
placeholder='Nova Password' secureTextEntry={true}
placeholder='Nova Password'
secureTextEntry={true}
onChangeText={(newz => {
this.setState({new1: newz})
})}
value={this.state.new1}
maxLength = {20}
/>
</View>
<Divider style={{backgroundColor: 'black'}}/>
<View style={styles.userBioRow}>
<Text style={styles.userPassText} size={20}>
Repetir Password:
</Text>
<TextInput style={styles.userBioText}
placeholder='Repetir Password' secureTextEntry={true}
placeholder='Repetir Password'
secureTextEntry={true}
onChangeText={(newzz => {
this.setState({new2: newzz})
})}
value={this.state.new2}
maxLength = {20}
/>
</View>
<Button onPress={this._press} title="Alterar Password" color="#CC1A17"
/>
</View>
</View>
<TouchableOpacity onPress={this._logout} style={{
height: 50,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: 'black',
marginTop:30
}}>
<Text style={{color: "#fff", fontWeight: 'bold'}}>Logout</Text>
</TouchableOpacity>
</ScrollView>
<TouchableOpacity onPress={this._logout} style={{
height: 50,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#CC1A17'
}}>
<Text style={{color: "#fff", fontWeight: 'bold'}}>Logout</Text>
</TouchableOpacity>
</View>
@ -335,14 +380,14 @@ const styles = StyleSheet.create({
flexDirection: 'row',
justifyContent: 'flex-start',
padding: 10,
borderWidth: 2,
// borderWidth: 2,
alignItems: 'center',
},
userBioText: {
width: SCREEN_WIDTH * 0.40,
flex: 2,
borderWidth: 2,
// borderWidth: 2,
},
userPassText: {
@ -353,8 +398,8 @@ const styles = StyleSheet.create({
},
userBioLogo: {
marginLeft: SCREEN_WIDTH * 0.05,
width: SCREEN_WIDTH * 0.15,
marginLeft: 10,
width:80,
},
bottomLogOut: {

View File

@ -32,7 +32,9 @@ import Swiper from 'react-native-swiper';
const SCREEN_HEIGHT = Dimensions.get("window").height;
const SCREEN_WIDTH = Dimensions.get("window").width;
import FitImage from 'react-native-fit-image';
import MapView, {PROVIDER_GOOGLE} from 'react-native-maps';
const formatObj = (obj) => {
@ -48,11 +50,12 @@ const formatObj = (obj) => {
class calendarDetail extends React.Component {
static navigationOptions = ({navigation}) => ({
header: (
<NavAbsolute
navigation={navigation}
title={navigation.state.params.info.name}
// title={navigation.state.params.info.name}
/>
),
});
@ -65,6 +68,11 @@ class calendarDetail extends React.Component {
this.props.getEvents(this.props.user);
console.log('didMount');
console.log(this.props.events);
const {navigation} = this.props;
const info = navigation.getParam('info', 'error');
console.log("putas")
console.log(info)
}
@ -101,29 +109,35 @@ class calendarDetail extends React.Component {
renderDescription = (info) => {
return (
<View>
<View style={styles.cardContainer}>
<View style={styles.header}>
<View style={{flexDirection: "row", alignItems: 'center', alignSelf:'center'}}>
<Text style={styles.ramoText}>Onde está o ramo? xD </Text>
<View style={styles.timeText}>
<Text style={{color: "#CC1A17", fontSize: 15}}>
{info.time === info.timeEnd ? info.time : `${info.time} - ${info.timeEnd}`}
</Text>
</View>
</View>
<View style={styles.details}>
<Text style={styles.nameAttendee}>Attendee Name</Text>
<View><Text style={{margin:10,marginTop:0, fontSize:20, color:'#CC1A17'}}>{info.name}</Text></View>
<View style={{margin:10}}>
<Progress.Bar color={'#000000'} progress={info.Enrolled / info.MaxAttendees} height={10}
unfilledColor={'white'} width={210}/>
<Text style={{alignSelf: "center"}}>{info.Enrolled} / {info.MaxAttendees}</Text>
<Text >{info.Enrolled} / {info.MaxAttendees}</Text>
</View>
<Divider style={{backgroundColor: '#000'}}/>
<View>
<Text style={{fontSize:15, color:'#CC1A17', padding:10}}>Descrição</Text>
<Text style={{paddingLeft:10, paddingRigh:10}}></Text>
</View>
</View>
<View style={styles.cardContainer}>
<View style={styles.block}>
<Text style={{fontSize: 20, color: "#CC1A17"}}>Descrição</Text>
<Divider style={{backgroundColor: '#000'}}/>
<View style={{marginTop: 10}}>
<Text style={{fontSize: 10}}>
<Text>
{info.description}
</Text>
</View>
@ -131,7 +145,7 @@ class calendarDetail extends React.Component {
</View>
)
};
/*
renderMap = () => {
return (
@ -153,7 +167,7 @@ class calendarDetail extends React.Component {
/>
)
};
*/
renderAttendee = () => {
return (
<View style={{backgroundColor: '#fff', height: SCREEN_HEIGHT * 0.1}}>
@ -195,7 +209,7 @@ class calendarDetail extends React.Component {
render() {
const {navigation} = this.props;
const info = navigation.getParam('info', 'error');
console.log(info);
return (
@ -207,15 +221,15 @@ class calendarDetail extends React.Component {
</View>
{this.renderDescription(info)}
</View>
<View style={styles.cardContainer}>
<View style={styles.block}>
<Text style={{fontSize: 20, color: "#CC1A17"}}>Localização</Text>
<Divider style={{backgroundColor: '#000', marginBottom: 10}}/>
{this.renderMap()}
</View>
</ScrollView>
<Divider style={{backgroundColor: 'black'}}/>
{this.renderAttendee()}
</View>
)
@ -225,6 +239,12 @@ class calendarDetail extends React.Component {
const styles = StyleSheet.create({
block:{
marginTop:15,
backgroundColor:'white',
padding:20
},
AttendeeContainer: {
flexDirection: 'row',
height: 55,
@ -284,8 +304,8 @@ const styles = StyleSheet.create({
ramoText: {
alignSelf: 'flex-start',
marginBottom: 5,
color: '#000',
fontSize: 20,
color: 'white',
fontSize: 17,
fontWeight: '400',
},
@ -308,10 +328,17 @@ const styles = StyleSheet.create({
//marginBottom: 55,
},
header:{
flex: 1,
padding: 10,
backgroundColor: 'white',
borderRadius: 0,
},
cardContainer: {
flex: 1,
padding: 10,
margin: 20,
// margin: 20,
backgroundColor: 'white',
borderRadius: 5,
},
@ -410,7 +437,8 @@ function mapStateToProps(state, props) {
token: state.apiReducer.token,
user: state.apiReducer.user,
logged: state.apiReducer.logged,
events: state.apiReducer.events
events: state.apiReducer.events,
careerPath: state.apiReducer.careerPath,
}
}

View File

@ -261,7 +261,7 @@ class choosePath extends React.Component {
style={{ width: "100%" }}
onValueChange={(itemValue, itemIndex) => {
this.setState({ guest: itemValue });
this.props.timerChangeGuest();
// this.props.timerChangeGuest();
this.props.waitChangeGuest();
this.props.changeGuestList(
@ -324,7 +324,14 @@ class choosePath extends React.Component {
<View style={styles.session}>
{this._verifySession(item[index].Id) && (
<TouchableOpacity
onPress={() => {}}
onPress={() => {
this.props.removeSession(
this.props.user,
this.props.userDetails.token,
item[index].Id
);
}}
style={{ flex: 1, alignSelf: "center" }}
>
<View>
@ -339,11 +346,14 @@ class choosePath extends React.Component {
{!this._verifySession(item[index].Id) && (
<TouchableOpacity
onPress={() => {
this.props.waitChangeGuest()
//this.props.waitChangeGuest()
this.props.signSession(
this.props.user,
this.props.userDetails.token,
item[index].Id
);
}}
style={{ flex: 1, alignSelf: "center" }}
>
@ -395,11 +405,12 @@ class choosePath extends React.Component {
</View>
{(this.props.changingGuest || this.props.Blocks == true) && (
<View style={{ flex:1, height:SCREEN_HEIGHT*0.6, alignSelf:'center',}}>
<ActivityIndicator
size="large"
color="red"
style={{ flex: 1, alignContent: "center" }}
/>
style={{ alignContent: "center" , alignSelf:'center', marginTop:SCREEN_HEIGHT*0.2}}
/></View>
)}
</ScrollView>
</View>

View File

@ -0,0 +1,29 @@
import React, {Component} from 'react';
import {
ActivityIndicator,
AsyncStorage,
Button,
StatusBar,
StyleSheet,
View,
} from 'react-native';
import {UtilStyles} from '../assets/styles'
export default class resetPassword extends Component {
constructor() {
super();
this._bootstrapAsync();
}
// Render Loading
render() {
return (
<View style={UtilStyles.containerLoading}>
<Text>Reset Password</Text>
</View>
);
}
}

View File

@ -9,6 +9,12 @@ export const LOGOUT_USER= 'LOGOUT_USER';
export const USER_INFO= 'USER_INFO'
export const HOLD='HOLD'
export const GET_EVENTS='GET_EVENTS'
export const UPDATE_USER='UPDATE_USER'
export const RESET_PASSWORD='RESET_PASSWORD'
export const CHECK_AND_RENEW='CHECK_AND_RENEW'
//API BLUETREND CALENDÁRIO
@ -17,7 +23,7 @@ export const CHANGE_GUEST = 'CHANGE_GUEST'
export const GET_SESSIONS= 'GET_SESSIONS'
export const SIGN_SESSION= 'SIGN_SESSION'
export const WAIT_CHANGE='WAIT_CHANGE'
export const REMOVE_SESSION = 'REMOVE_SESSION'
//UI

View File

@ -1,6 +1,6 @@
import { AsyncStorage } from "react-native";
import { NetInfo , Alert} from "react-native";
import { NetInfo, Alert } from "react-native";
var _ = require("lodash");
@ -20,7 +20,9 @@ import {
WAIT_CHANGE,
SIGN_SESSION,
OPEN_MODAL,
LOADINGLOGIN
LOADINGLOGIN,
REMOVE_SESSION,
UPDATE_USER
} from "./actionTypes"; //Import the actions types constant we defined in our actions
import moment from "moment";
@ -39,43 +41,64 @@ axios.defaults.baseURL = "http://enei2019.uingress.com/internal/api";
const map = require("lodash/fp/map").convert({ cap: false });
export function waitLogin(){
return dispatch=>{
dispatch({
type: LOADINGLOGIN,
});
}
}
//faz autenticação com API interna
export function loginInternal(userDetails){
axios.defaults.baseURL = "http://127.0.0.1:5000";
export function waitLogin() {
return dispatch => {
axios.post('/api/login',{
"username": "cena",
"password": "password"
}).then(a=>{
console.log("sucesso!")
console.log(a)
}).catch(p=>{
console.log(p)
})
dispatch({
type: OPEN_MODAL,
type: LOADINGLOGIN
});
};
}
export function changePassword(token, old, new1, new2) {
axios.defaults.headers.common = {
Authorization: `bearer ${token.access_token}`
};
axios.defaults.baseURL = "http://enei2019.uingress.com/internal/api";
return dispatch => {
if (new1 != new2) {
Alert.alert("ERRO!", "As passords são diferentes...");
} else {
axios
.post("/User/ChangePassword", {
OldPassword: old,
NewPassword: new1
})
.then(a => {
Alert.alert("Sucesso!", "Password alterada com sucesso")
})
.catch(p => {
Alert.alert("ERRO!", "Erro a alterar a password.\nA palavra original é inválida...\nCaso o erro persista verifica a tua conexão à internet e tenta novamente")
});
dispatch({
type: OPEN_MODAL
});
}
};
}
//faz autenticação com API interna
export function loginInternal(userDetails) {
axios.defaults.baseURL = "http://127.0.0.1:5000";
return dispatch => {
axios
.post("/api/login", {
username: "cena",
password: "password"
})
.then(a => {
console.log("sucesso!");
console.log(a);
})
.catch(p => {
console.log(p);
});
dispatch({
type: OPEN_MODAL
});
};
}
export function openModal(info, t) {
return dispatch => {
@ -97,23 +120,29 @@ export function closeModal() {
}
export function updateUser(token, user) {
axios.defaults.baseURL = "http://enei2019.uingress.com/internal/api";
axios.defaults.headers.common = {
Authorization: `bearer ${token.access_token}`
};
return dispatch => {
axios
.post("/Attendee/Edit", user)
.post("/Attendee/Edit", user)
.then(a => {
console.log(a);
alert("guardado com sucesso");
Alert.alert("Sucesso", "As informações pessoais foram guardadas com sucesso.")
console.log(a.data)
dispatch({
type: UPDATE_USER
// guests: response.data
type: UPDATE_USER,
user:a.data
});
})
.catch(b => {
alert("Erro a guardar os dados");
Alert.alert("ERRO!","Ocorreu um erro a guardar os dados pessoais.")
alert(b)
});
};
}
@ -124,27 +153,27 @@ function getCareerPath(sessions) {
for (let key in sessions) {
if (sessions[key].Name == "IA") {
careerPath = "Artificial Inteligence";
careerColor='#CC1A17'
careerColor = "#CC1A17";
}
if (sessions[key].Name == "IOT") {
careerPath = "Internet of Things";
careerColor= "green"
careerColor = "green";
}
if (sessions[key].Name == "WEB") {
careerPath = "Web Development";
careerColor="purple"
careerColor = "purple";
}
if (sessions[key].Name == "NET") {
careerPath = "Networking and Security";
careerColor="blue"
careerColor = "blue";
}
if (sessions[key].Name == "MOB") {
careerPath = "Mobile Development";
careerColor="orange"
careerColor = "orange";
}
if(sessions[key].Name=="DS"){
careerPath="Data Science"
careerColor="yellow"
if (sessions[key].Name == "DS") {
careerPath = "Data Science";
careerColor = "yellow";
}
}
return { name: careerPath, color: careerColor };
@ -169,8 +198,7 @@ export const connectionState = status => {
return { type: "CHANGE_CONNECTION_STATUS", isConnected: status };
};
//inscrição em palestra através de ID
export function signSession(token, idSession) {
export function removeSession(user, token, idSession) {
axios.defaults.headers.common = {
Authorization: `bearer ${token.access_token}`
};
@ -183,9 +211,10 @@ export function signSession(token, idSession) {
return dispatch => {
//adiciona participante a uma palestra
axios
.post("/Session/AddAttendee", obj)
.post("/Session/RemoveAttendee", obj)
//se não existir erro na chamada...
.then(a => {
console.log(a);
if (a.data.Success) {
axios
.get("/Attendee/AvailableSessions")
@ -204,7 +233,10 @@ export function signSession(token, idSession) {
cenas.push(result[key]);
}
alert("Inscrição efectuada com sucesso");
Alert.alert(
"Sucesso",
"A inscrição na sessão foi removida com sucesso!"
);
//obter informações pessoais:
axios
@ -215,13 +247,14 @@ export function signSession(token, idSession) {
})
.then(sucess => {
dispatch({
type: SIGN_SESSION,
type: REMOVE_SESSION,
sessions: response.data,
Blocks: cenas,
changeGuestList: false,
careerPath: careerPath,
user: sucess.data
});
getEvents(user);
});
})
.catch(function(error) {
@ -232,7 +265,7 @@ export function signSession(token, idSession) {
} else {
alert("Erro a inscrever na palestra");
dispatch({
type: SIGN_SESSION,
type: REMOVE_SESSION,
waitChangeGuest: false
});
}
@ -243,6 +276,91 @@ export function signSession(token, idSession) {
};
}
//inscrição em palestra através de ID
export function signSession(user, token, idSession) {
axios.defaults.headers.common = {
Authorization: `bearer ${token.access_token}`
};
var obj = {
IdSession: idSession,
Direction: 0
};
return dispatch => {
//adiciona participante a uma palestra
axios
.post("/Session/AddAttendee", obj)
//se não existir erro na chamada...
.then(a => {
if (a.data.Success) {
axios.defaults.headers.common = {
Authorization: `bearer ${token.access_token}`
};
axios
.get("/Attendee/AvailableSessions")
.then(function(response) {
console.log(response);
var sessions = response.data;
var careerPath = getCareerPath(sessions);
var cenas = [];
const result = flow(groupBy("SessionStart"))(response.data);
for (let key in result) {
result[key].option = 0;
cenas.push(result[key]);
}
Alert.alert(
"Sucesso",
"Inscrição na sessão efectuada com sucesso"
);
console.log("aqui1")
//obter informações pessoais:
axios
.get("/Attendee/Detail")
.catch(error => {
alert(error);
})
.then(sucess => {
console.log("aqui2")
var result = getE(user);
dispatch({
type: SIGN_SESSION,
sessions: response.data,
Blocks: cenas,
changeGuestList: false,
careerPath: careerPath,
user: sucess.data,
events: result.a,
day1: result.a,
day2: result.b,
day3: result.c,
day4: result.d
});
});
})
.catch(function(error) {
console.log(error);
});
} else {
Alert.alert("ERRO!!", a.data.Error);
dispatch({
type: SIGN_SESSION,
waitChangeGuest: false
});
}
})
.catch(b => {
// alert("Erro a inscrever na palestra");
});
};
}
export function getSessions(token) {
axios.defaults.headers.common = {
Authorization: `bearer ${token.access_token}`
@ -324,10 +442,8 @@ export function getAvailableGuestlists(token) {
12 - IOT
14 - WB
15 - DS
*/
export function changeGuestList(token, guestID) {
//http://enei2019.uingress.com/internal/api/Attendee/ChangeGuestlist/
axios.defaults.headers.common = {
@ -340,7 +456,7 @@ export function changeGuestList(token, guestID) {
axios
.get(full)
.then(function(response) {
console.log(response)
axios.defaults.baseURL = "http://enei2019.uingress.com/internal/api";
axios.defaults.headers.common = {
@ -351,11 +467,13 @@ export function changeGuestList(token, guestID) {
.get("/Attendee/AvailableSessions")
.then(function(response) {
// handle success
//console.log(response);
var cenas = [];
c= getCareerPath(response.data);
c = getCareerPath(response.data);
const result = flow(
groupBy("SessionStart")
// map((Id) => ({Id})),
@ -363,11 +481,14 @@ export function changeGuestList(token, guestID) {
)(response.data);
for (let key in result) {
result[key].option = 0;
cenas.push(result[key]);
console.log();
}
console.log("-.-.-..-.-.-.-.-.-.")
console.log(cenas);
console.log("-.-.-..-.-.-.-.-.-.")
dispatch({
type: CHANGE_GUEST,
sessions: response.data,
@ -459,111 +580,112 @@ export function getAvailableSessions(token) {
};
}
function getE(user) {
var cenas = [];
let events = [];
var i = 0;
for (let key in user.Sessions) {
events.push({
key: i++,
time: moment(user.Sessions[key].SessionStart).format("HH:mm"),
timeEnd: moment(user.Sessions[key].SessionEnd).format("HH:mm"),
//lineColor:'#009688',
imageUrl:
"https://d2v9y0dukr6mq2.cloudfront.net/video/thumbnail/Vjkyj2hBg/welcome-white-sign-with-falling-colorful-confetti-animation-on-white-background_sglmmh3qm__F0013.png",
description: user.Sessions[key].Description,
name: user.Sessions[key].Name,
Enrolled: user.Sessions[key].Enrolled,
MaxAttendees: user.Sessions[key].MaxAttendees,
day: moment(user.Sessions[key].SessionStart).format("DD")
});
}
const result = flow(groupBy("day"))(events);
for (let key in result) {
cenas.push(result[key]);
}
var a = [],
b = [],
c = [],
d = [];
for (let key in cenas[0]) {
a.push({
time: cenas[0][key].time,
timeEnd: cenas[0][key].timeEnd,
imageUrl: cenas[0][key].imageUrl,
description: cenas[0][key].description,
name: cenas[0][key].name,
Enrolled: cenas[0][key].Enrolled,
MaxAttendees: cenas[0][key].MaxAttendees,
day: cenas[0][key].day
});
}
for (let key in cenas[1]) {
b.push({
time: cenas[1][key].time,
timeEnd: cenas[1][key].timeEnd,
imageUrl: cenas[1][key].imageUrl,
description: cenas[1][key].description,
name: cenas[1][key].name,
Enrolled: cenas[1][key].Enrolled,
MaxAttendees: cenas[1][key].MaxAttendees,
day: cenas[1][key].day
});
}
for (let key in cenas[2]) {
c.push({
time: cenas[2][key].time,
timeEnd: cenas[2][key].timeEnd,
imageUrl: cenas[2][key].imageUrl,
description: cenas[2][key].description,
name: cenas[2][key].name,
Enrolled: cenas[2][key].Enrolled,
MaxAttendees: cenas[2][key].MaxAttendees,
day: cenas[2][key].day
});
}
for (let key in cenas[3]) {
d.push({
time: cenas[3][key].time,
timeEnd: cenas[3][key].timeEnd,
imageUrl: cenas[3][key].imageUrl,
description: cenas[3][key].description,
name: cenas[3][key].name,
Enrolled: cenas[3][key].Enrolled,
MaxAttendees: cenas[3][key].MaxAttendees,
day: cenas[3][key].day
});
}
a = _.sortBy(a, function(o) {
return o.time;
});
b = _.sortBy(b, function(o) {
return o.time;
});
c = _.sortBy(c, function(o) {
return o.time;
});
d = _.sortBy(d, function(o) {
return o.time;
});
return { a, b, c, d };
}
export function getEvents(user) {
var result = getE(user);
return dispatch => {
let events = [];
console.log("chegou aqui");
var i=0
for (let key in user.Sessions) {
events.push({
key:i++,
time: moment(user.Sessions[key].SessionStart).format("HH:mm"),
timeEnd: moment(user.Sessions[key].SessionEnd).format("HH:mm"),
//lineColor:'#009688',
imageUrl:
"https://d2v9y0dukr6mq2.cloudfront.net/video/thumbnail/Vjkyj2hBg/welcome-white-sign-with-falling-colorful-confetti-animation-on-white-background_sglmmh3qm__F0013.png",
description: user.Sessions[key].Description,
name: user.Sessions[key].Name,
Enrolled: user.Sessions[key].Enrolled,
MaxAttendees: user.Sessions[key].MaxAttendees,
day: moment(user.Sessions[key].SessionStart).format("DD")
});
}
const result = flow(
groupBy("day")
)(events);
var cenas=[];
for (let key in result) {
cenas.push(result[key]);
console.log();
}
console.log(".--------")
console.log(cenas);
console.log(".--------")
var a=[], b=[],c=[],d=[]
for (let key in cenas[0]) {
a.push({
time:cenas[0][key].time ,
timeEnd: cenas[0][key].timeEnd,
imageUrl:cenas[0][key].imageUrl,
description: cenas[0][key].description,
name:cenas[0][key].name,
Enrolled: cenas[0][key].Enrolled,
MaxAttendees: cenas[0][key].MaxAttendees,
day: cenas[0][key].day
});
}
for (let key in cenas[1]) {
b.push({
time:cenas[1][key].time ,
timeEnd: cenas[1][key].timeEnd,
imageUrl:cenas[1][key].imageUrl,
description: cenas[1][key].description,
name:cenas[1][key].name,
Enrolled: cenas[1][key].Enrolled,
MaxAttendees: cenas[1][key].MaxAttendees,
day: cenas[1][key].day
});
}
for (let key in cenas[2]) {
c.push({
time:cenas[2][key].time ,
timeEnd: cenas[2][key].timeEnd,
imageUrl:cenas[2][key].imageUrl,
description: cenas[2][key].description,
name:cenas[2][key].name,
Enrolled: cenas[2][key].Enrolled,
MaxAttendees: cenas[2][key].MaxAttendees,
day: cenas[2][key].day
});
}
for (let key in cenas[3]) {
d.push({
time:cenas[3][key].time ,
timeEnd: cenas[3][key].timeEnd,
imageUrl:cenas[3][key].imageUrl,
description: cenas[3][key].description,
name:cenas[3][key].name,
Enrolled: cenas[3][key].Enrolled,
MaxAttendees: cenas[3][key].MaxAttendees,
day: cenas[3][key].day
});
}
a=_.sortBy(a, function(o) { return o.time; });
b=_.sortBy(b, function(o) { return o.time; });
c=_.sortBy(c, function(o) { return o.time; });
d=_.sortBy(d, function(o) { return o.time; });
dispatch({
type: GET_EVENTS,
events:a,
day1:a,
day2:b,
day3:c,
day4:d
events: result.a,
day1: result.a,
day2: result.b,
day3: result.c,
day4: result.d
});
};
}
@ -653,54 +775,56 @@ export function login(user, pass) {
logged: false,
failedAttempt: true,
tokenData: "error",
user: { Name: "" },
user: { Name: "" }
});
})
.catch(err=>{
console.log("error")
.catch(err => {
console.log("error");
})
.then(res => res.json())
.then(parsed => {
console.log(parsed)
console.log(parsed);
if (
parsed.error_description ==
"Provided username and password is incorrect"
) {
Alert.alert("Dados Inválidos","Podes sempre fazer reset da password para o email.")
Alert.alert(
"Dados Inválidos",
"Podes sempre fazer reset da password para o email."
);
dispatch({
type: API_LOGIN,
logged: false,
failedAttempt: true,
token: obj,
user: { Name: "Henrique" },
userDetails:{},
waitLogin:false,
onHold:false
userDetails: {},
waitLogin: false,
onHold: false
});
return;
}
else{
var obj = {
access_token: parsed.access_token,
expirationDateToken: Math.round(new Date().getTime() / 1000) + 3598,
refreshToken: parsed.refresh_token,
valid: true
};
} else {
var obj = {
access_token: parsed.access_token,
expirationDateToken: Math.round(new Date().getTime() / 1000) + 3598,
refreshToken: parsed.refresh_token,
valid: true
};
var details = {
username: user,
password: pass
};
dispatch({
type: API_LOGIN,
logged: true,
failedAttempt: false,
token: obj,
user: { Name: "Henrique" },
userDetails: details
});}
var details = {
username: user,
password: pass
};
dispatch({
type: API_LOGIN,
logged: true,
failedAttempt: false,
token: obj,
user: { Name: "Henrique" },
userDetails: details
});
}
});
};
}
@ -1000,4 +1124,4 @@ export function checkUser(userDetails) {
//dispatch menu de login
}
};
}
}

View File

@ -16,7 +16,11 @@ export {checkUser,
openModal,
closeModal,
loginInternal,
waitLogin
waitLogin,
removeSession,
changePassword,
resetPassword
} from "./api"
export {

View File

@ -15,7 +15,9 @@ import {
SIGN_SESSION,
OPEN_MODAL,
CLOSE_MODAL,
LOADINGLOGIN
LOADINGLOGIN,
REMOVE_SESSION,
UPDATE_USER,
} from "../actions/actionTypes"; //Import the actions types constant we defined in our actions
@ -42,13 +44,12 @@ let apiState = {
sessions: {},
Blocks: {},
onHoldBlocks: true,
careerPath:{name:'Sem Career Path', color:'#eeeeee'},
a:{},
b:{},
c:{},
d:{},
loadingLogin:false,
careerPath: { name: "Sem Career Path", color: "#eeeeee" },
a: {},
b: {},
c: {},
d: {},
loadingLogin: false
};
const apiReducer = (state = apiState, action) => {
@ -100,8 +101,11 @@ const apiReducer = (state = apiState, action) => {
isConnected: action.isConnected
});
case UPDATE_USER:
state = Object.assign({}, state, { user:action.user});
return state
case LOADINGLOGIN:
state= Object.assign({}, state, {loadingLogin:true});
state = Object.assign({}, state, { loadingLogin: true });
case HOLD:
state = Object.assign({}, state, { onHold: true });
@ -118,7 +122,7 @@ const apiReducer = (state = apiState, action) => {
username: action.userDetails.username,
password: action.userDetails.password
},
loadingLogin:false,
loadingLogin: false,
onHold: action.onHold
});
@ -137,7 +141,11 @@ const apiReducer = (state = apiState, action) => {
return state;
case LOGOUT_USER:
state = Object.assign({}, state, { user:{}, userDetails:{}, logged:false});
state = Object.assign({}, state, {
user: {},
userDetails: {},
logged: false
});
return state;
@ -151,12 +159,28 @@ const apiReducer = (state = apiState, action) => {
return state;
case GET_EVENTS:
state = Object.assign({}, state, { events: action.events , a:action.day1, b:action.day2, c:action.day3, d:action.day4});
state = Object.assign({}, state, {
events: action.events,
a: action.day1,
b: action.day2,
c: action.day3,
d: action.day4
});
return state;
case REMOVE_SESSION:
state = Object.assign({}, state, {
sessions: action.sessions,
Blocks: action.Blocks,
careerPath: action.careerPath,
changingGuest: action.changingGuest,
user: action.user
});
return state;
case OPEN_MODAL:
console.log("open modal")
console.log("open modal");
state = Object.assign({}, state, {
modalOpen: true,
modalInfo: action.modalInfo,
@ -173,13 +197,30 @@ const apiReducer = (state = apiState, action) => {
return state;
case SIGN_SESSION:
state = Object.assign({}, state, {
if(action.sessions==undefined || action.Blocks==undefined || action.user==undefined){
state = Object.assign({}, state, {
changingGuest: false,
});
}
else{
state = Object.assign({}, state, {
sessions: action.sessions,
Blocks: action.Blocks,
careerPath: action.careerPath,
changingGuest: action.changingGuest,
user:action.user
changingGuest: false,
user: action.user,
a:action.day1,
b:action.day2,
c:action.day3,
d:action.day4
});
}
return state;
case SESSION_BLOCKS:
@ -225,4 +266,4 @@ const apiReducer = (state = apiState, action) => {
return state;
}
};
export default apiReducer;
export default apiReducer;

5
App/package-lock.json generated
View File

@ -2745,6 +2745,11 @@
"resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz",
"integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0="
},
"email-validator": {
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/email-validator/-/email-validator-2.0.4.tgz",
"integrity": "sha512-gYCwo7kh5S3IDyZPLZf6hSS0MnZT8QmJFqYvbqlDZSbwdZlY6QZWxJ4i/6UhITOJ4XzyI647Bm2MXKCLqnJ4nQ=="
},
"emojis-list": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-2.1.0.tgz",

View File

@ -9,6 +9,7 @@
"dependencies": {
"@redux-offline/redux-offline": "^2.5.1",
"axios": "^0.18.0",
"email-validator": "^2.0.4",
"expo": "^32.0.5",
"material-icons-react": "^1.0.4",
"moment": "^2.24.0",

0
App/{ Normal file
View File

View File

@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.IdentityModel.Tokens.Jwt;
using System.Net.Http;
using System.Security.Claims;
using System.Text;
using System.Threading.Tasks;
@ -14,6 +15,7 @@ using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using Microsoft.IdentityModel.Tokens;
using Newtonsoft.Json.Linq;
namespace api.Controllers
{
@ -30,15 +32,18 @@ namespace api.Controllers
public IUsersRepository _repo { get; }
private readonly IMapper _mapper;
private readonly RoleManager<Role> _roleManager;
private readonly System.Net.Http.IHttpClientFactory clientFactory;
public AuthController(IConfiguration config, UserManager<User> UserManager, SignInManager<User> SignInManager, IMapper mapper, RoleManager<Role> roleManager, IUsersRepository repo)
public AuthController(IConfiguration config, UserManager<User> UserManager, SignInManager<User> SignInManager, IMapper mapper, RoleManager<Role> roleManager, IUsersRepository repo, System.Net.Http.IHttpClientFactory clientFactory)
{
_mapper = mapper;
_roleManager = roleManager;
_repo = repo;
this.clientFactory = clientFactory;
this.config = config;
_userManager = UserManager;
_signInManager = SignInManager;
}
@ -80,6 +85,40 @@ namespace api.Controllers
}
[HttpPost("loginQR")]
public async Task<IActionResult> loginQr(UserForLoginDto userLoginDTO){
var token= "_A6q1cVGa12QutCrYCsYETfz9nPspnbcnPqjD-87kDaYPr99ArEfpdRTbkEzA4p-WEJzPFQhsMX7nG5BmUm0E6RTju8vQHnaTjGd80NIqUCr-jXefUtGwyl6I00fGD4sN6psW714JnCFuZRbtZbIXsdIRKmD3b8YUpPo2lvYP8SzjoEgACyabj13T3CLpHF43PI8Dvny6ylW6j0ka5qGNvw5MHVvYFURUPiTA7hlxoyQ35eOqHE8-eIiLNSTUJW7q-o8CxIGqGWSkltKPxbrY-Xo5iYagUucesqmj64VxYs";
using (var client = new HttpClient())
{
try{
var url = "http://enei2019.uingress.com/internal/api/Attendee/Detail";
client.DefaultRequestHeaders.Add("Authorization", "Bearer " + token);
var response = await client.GetStringAsync(url);
Console.WriteLine(response);
//var resource = JObject.Parse(response);
return Ok(response);
}catch(Exception e){
Console.WriteLine(e);
return Unauthorized();
}
}
}
private async Task<string> GenerateJwtToken(User user)
{
var claims = new List<Claim>

23
api/Dtos/tokenDto.cs Normal file
View File

@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using api.Models;
namespace api.Dtos
{
public class tokenDto
{
public string access_token{get;set;} //teamid
public string token_type{get;set;} //user qr
public int expires_in{get;set;}
public string refresh_token{get;set;}
}
}

18
api/Dtos/userDetails.cs Normal file
View File

@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using api.Models;
namespace api.Dtos
{
public class userDetails
{
public string name{get;set;} //teamid
public string qr{get;set;} //user qr
}
}

View File

@ -42,7 +42,7 @@ namespace api
// This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services)
{
services.AddHttpClient();
services.AddAutoMapper();
services.AddScoped<IUsersRepository, UsersRepository>();
services.AddScoped<IEventsRepository, EventsRepository>();

View File

@ -3,12 +3,13 @@
<TargetFramework>netcoreapp2.1</TargetFramework>
</PropertyGroup>
<ItemGroup>
<Folder Include="wwwroot\"/>
<Folder Include="wwwroot\" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.1.0"/>
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="2.1.1"/>
<PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="5.0.1"/>
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="2.2.0"/>
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.1.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="2.1.1" />
<PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="5.0.1" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.1" />
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="2.2.0" />
</ItemGroup>
</Project>

View File

@ -1,5 +1,5 @@
{
"ProjectFilePath": "c:\\Users\\ZMiguel\\Desktop\\ENEI2019\\api\\api.csproj",
"ProjectFilePath": "/Users/henrique/ENEI2019/api/api.csproj",
"TargetFramework": "netcoreapp2.1",
"TagHelpers": [],
"Configuration": {

180
website/ctf.html Normal file
View File

@ -0,0 +1,180 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="pt" xml:lang="pt">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta content="width=device-width, initial-scale=1, user-scalable=0" name="viewport">
<meta content="width" name="MobileOptimized">
<meta content="true" name="HandheldFriendly">
<!-- Place favicon.ico in the root directory -->
<link rel="apple-touch-icon" sizes="180x180" href="apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="favicon-16x16.png">
<link rel="manifest" href="site.webmanifest">
<link rel="mask-icon" href="safari-pinned-tab.svg" color="#5bbad5">
<meta name="msapplication-TileColor" content="#da532c">
<meta name="theme-color" content="#ffffff">
<title>ENEI'19</title>
<meta name="description"
content="Página do Encontro Nacional de Estudantes de Informática 2019, no Instituto Superior de Engenharia de Coimbra (ISEC) a realizar-se entre 12 e 15 de abril de 2019. O ENEI pretende oferecer aos estudantes de todo o país um evento que promove a aprendizagem, a troca de ideias e o convívio, enquanto tenta criar fortes ligações com o mundo empresarial.">
<meta property="og:locale" content="pt_PT" />
<meta property="og:title" content="ENEI'19" />
<meta property="og:description"
content="Página do Encontro Nacional de Estudantes de Informática 2019, no Instituto Superior de Engenharia de Coimbra (ISEC) a realizar-se entre 12 e 15 de abril de 2019. O ENEI pretende oferecer aos estudantes de todo o país um evento que promove a aprendizagem, a troca de ideias e o convívio, enquanto tenta criar fortes ligações com o mundo empresarial." />
<meta property="og:site_name" content="ENEI'19" />
<meta property="og:url" content="http://www.enei.pt/" />
<meta property="og:image" content="http://www.enei.pt/imgs/share-image.jpg" />
<meta property="og:type" content="Website" />
<link rel="canonical" href="http://www.enei.pt/" />
<link href="bootstrap-grid.css" rel="stylesheet" type="text/css" />
<link href="main.css" rel="stylesheet" type="text/css" />
<link href="https://fonts.googleapis.com/css?family=Bai+Jamjuree:400,600,700" rel="stylesheet">
</head>
<body>
<header id="main-menu">
<nav>
<a href="#" title="Abrir menu" rel="nofollow" id="open-menu-mobile">Menu</a>
<ul>
<li><a href="#enei" title="Enei">Enei</a></li>
<li class="unavailable">Oradores</li>
<li class="unavailable">Programa</li>
<li><a href="#precos" title="Preços">Preços</a></li>
<li class="unavailable">App</li>
<li><a href="#ctf" title="Faq's">CTF</li>
<li><a href="#sponsors" title="Sponsors">Sponsors</a></li>
<li><a href="#faqs" title="Faq's">Faq's</a></li>
</ul>
</nav>
</header>
<section id="ctf">
<div class="container ctf-container">
<div class="col-lg-12 centerctf">
<h1>Capture the flag</h1>
<h1></h1>
</div>
</div>
</section>
<section>
</section>
<!-- faqs section -->
<section id="faqs">
<div class="container">
<div class="row">
<div class="col-lg-5">
<div class="pre-h1">Perguntas Frequentes</div>
<h1>Faq</h1>
<hr>
</div>
</div>
<div class="row">
<div class="col-lg-10">
<ul id="accordion">
<li>
<a href="#" title="O que é o ENEI?" rel="nofollow" class="toggle">O que é o ENEI?</a>
<div class="content-accordion">
<p>O Encontro Nacional de Estudantes de Informática (ENEI) é um evento que pretende
oferecer aos estudantes de todo o país um evento que promove a aprendizagem, a troca
de
ideias e o convívio, enquanto tenta criar fortes ligações com o mundo empresarial.
</p>
<p>Esta versão do evento também incluirá os tradicionais momentos de diversão noturnos
que
muito apelam a todos os participantes das antigas edições e são uma excelente via de
networking e transferência de conhecimento!</p>
</div>
</li>
<li>
<a href="#" title="Onde me posso inscrever?" rel="nofollow" class="toggle">Onde me posso
inscrever?</a>
<div class="content-accordion">
<p>Podes adquirir o teu bilhete <a href="https://tickets.enei.pt" title="Aqui">AQUI</a>.
</p>
</div>
</li>
<li>
<a href="#" title="Quando é o programa vai estar disponível?" rel="nofollow"
class="toggle">Quando é o programa vai estar disponível?</a>
<div class="content-accordion">
<p>O programa vai sendo lançado nas próximas semanas de forma iterativa.</p>
</div>
</li>
<li>
<a href="#" title="Quem pode participar no evento?" rel="nofollow" class="toggle">Quem pode
participar no evento?</a>
<div class="content-accordion">
<p>Podem participar no ENEI19 todos os estudantes de cursos relacionados com
informática e
todos aqueles que querem aprender mais sobre os temas abordados!</p>
</div>
</li>
<li>
<a href="#" title="Tenho acesso a todas as sessões?" rel="nofollow" class="toggle">Tenho
acesso a todas as sessões?</a>
<div class="content-accordion">
<p>Não, as palestras e workshops necessitam de inscrições visto que têm lugares
limitados.</p>
<p>Brevemente poderás te inscrever na aplicação móvel do ENEI'19!</p>
</div>
</li>
</ul>
</div>
</div>
</div>
</section>
<!-- social network section -->
<aside id="social-network">
<div class="container">
<div class="row">
<div class="col-lg-8 col-lg-offset-2">
<h2>Segue-nos</h2>
<ul>
<li><a href="https://www.facebook.com/ENEIConf/" title="Facebook" target="_blank"
class="icon-facebook"></a></li>
<li><a href="https://www.instagram.com/eneiconf/" title="Instagram" target="_blank"
class="icon-instagram"></a></li>
<li><a href="https://www.linkedin.com/company/enei/" title="Linkedin" target="_blank"
class="icon-linkedin"></a></li>
<li><a href="mailto:geral@enei.pt" title="Email" target="_blank" class="icon-email"></a></li>
</ul>
</div>
</div>
</div>
</aside>
<!-- footer -->
<footer>
<div class="container">
<div class="row">
<div class="col-lg-12">
<p>© 2019 ENEI . Todos os direitos reservados</p>
</div>
</div>
</div>
</footer>
<!-- Scripts -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
<script type="text/javascript" src="js/scripts.js"></script>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-130588243-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() { dataLayer.push(arguments); }
gtag('js', new Date());
gtag('config', 'UA-130588243-1');
</script>
</body>
</html>

BIN
website/imgs/image.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 147 KiB

View File

@ -43,6 +43,7 @@
<li class="unavailable">Programa</li>
<li><a href="#precos" title="Preços">Preços</a></li>
<li class="unavailable">App</li>
<li><a href="#ctf" title="Faq's">CTF</li>
<li><a href="#sponsors" title="Sponsors">Sponsors</a></li>
<li><a href="#faqs" title="Faq's">Faq's</a></li>
</ul>
@ -121,42 +122,53 @@
<h1>Preços</h1>
<hr>
<div class="price-block">
<div class="type">Early-Bird</div>
<div class="type">Normal</div>
<div>
<div class="individual-price">
<div class="price"><span></span>25</div>
<div class="label">Grupo</div>
<span class="options">*Alimentação e alojamento (pavilhão) incluídos</span>
<span class="options">*Alimentação [5,00€] e alojamento (pavilhão) [5,10€]</span>
</div>
</div>
<a href="https://tickets.enei.pt/group" title="Comprar" target="_blank"
class="buy-button">Comprar</a>
</div>
<div class="price-block">
<div class="type">Early-Bird</div>
<div class="type">Normal</div>
<div>
<div class="individual-price">
<div class="price"><span></span>30</div>
<div class="label">Individual</div>
<span class="options">*Alimentação e alojamento (pavilhão) incluídos</span>
<span class="options">*Alimentação [5,00€] e alojamento (pavilhão) [5,10€]</span>
</div>
</div>
<a href="https://tickets.enei.pt" title="Comprar" target="_blank" class="buy-button">Comprar</a>
</div>
<div class="price-block disable">
<div class="price-block">
<div class="type">Pontual</div>
<div class="individual-price">
<div class="price"><span></span>20</div>
<div class="label">Individual</div>
<span class="options">*Alimentação incluída</span>
</div>
<span class="buy-button">Brevemente</span>
<a href="https://tickets.enei.pt/pontual" title="Comprar" target="_blank"
class="buy-button">Comprar</a>
</div>
</div>
</div>
</div>
</section>
<section id="ctf">
<div class="container ctf-container">
<div class="col-lg-12">
<div class="prectf-h1">Brevemente disponível</div>
<h1>Capture the flag</h1>
<a class ="button-ctf" href="ctf.html" title="Comprar" target="_blank">Começar</a>
<h1></h1>
</div>
</div>
</section>
<!-- sponsors section -->
<section id="sponsors">
<div class="container">
@ -173,6 +185,20 @@
</div>
</div>
</div>
<div class="container gold">
<div class="row">
<div class="col-lg-4 col-lg-offset-4 col-sm-6 col-sm-offset-3 col-xs-10 col-xs-offset-1">
<h1>Gold Sponsor</h1>
<hr>
</div>
</div>
<div class="row">
<div class="col-lg-10 col-lg-offset-1 col-sm-8 col-sm-offset-2 col-xs-10 col-xs-offset-1">
<a href="http://www.novabase.pt/pt" title="Novabase" target="_blank"
class="sponsor-image"><img src="imgs/novaBase-sponsor.jpg" alt="Novabase Image"></a>
</div>
</div>
</div>
</section>
<!-- faqs section -->
@ -277,14 +303,12 @@
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
<script type="text/javascript" src="js/scripts.js"></script>
<!-- Global site tag (gtag.js) - Google Analytics -->
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-130588243-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() { dataLayer.push(arguments); }
gtag('js', new Date());
gtag('config', 'UA-130588243-1');
</script>
</body>

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -892,6 +892,61 @@ hr {
}
}
#ctf{
background-image: url("imgs/image.png");
text-align: center;
h1 {
color: white;
margin-top: 80px;
margin-bottom: 50px;
}
.button-ctf {
&:hover {
border-color: #cc1a17;
background-color: white;
color: $grey;
}
}
}
.prectf-h1{
@include font($mont-font, 20px, 22px, $grey);
font-weight: $semi-bold;
text-transform: uppercase;
margin-bottom:100px;
@include portable {
font-size: 17px;
}
@include mobile {
margin-bottom: 5px;
}
color: #cc1a17;
}
.button-ctf{
font-family: "Bai Jamjuree", sans-serif;
font-size: 18px;
line-height: 14px;
color: #CC1A17;
font-weight: 700;
text-transform: uppercase;
border: 1px solid #eeeeee;
padding: 20px 40px;
margin: 200;
transition: border-color 150ms ease-out, background-color 150ms ease-out, color 150ms ease-out;
-webkit-transition: border-color 150ms ease-out, background-color 150ms ease-out, color 150ms ease-out;
}
#faqs,
#tickets {
background: url("imgs/cubes2-image.png") no-repeat bottom right;
@ -971,6 +1026,22 @@ hr {
transform: scale(1.03);
}
}
.gold {
h1 {
font-size: 30px;
line-height: 26px;
margin-top: 75px;
@include portable{
font-size: 27px;
}
@include mobile{
font-size: 23px;
}
}
.sponsor-image {
max-width: 135px;
}
}
}
#social-network {