Commit e5f1da01 authored by Sébastiaan Versteeg's avatar Sébastiaan Versteeg
Browse files

Merge branch '61-refer-to-terms-and-conditions' into 'master'

Resolve "Reference to terms and conditions on event page"

Closes #61

See merge request !177
parents ebde1d3f d7ecf0fa
...@@ -26,5 +26,8 @@ ...@@ -26,5 +26,8 @@
"Update registration": "Aanmelding bijwerken", "Update registration": "Aanmelding bijwerken",
"Cancel registration": "Afmelden", "Cancel registration": "Afmelden",
"Registrations": "Aanmeldingen", "Registrations": "Aanmeldingen",
"Could not load the event...": "Kan het evenement niet laden..." "Could not load the event...": "Kan het evenement niet laden...",
"By registering, you confirm that you have read the": "Door te registreren, bevestig je dat je de",
"terms and conditions": "voorwaarden",
", that you understand them and that you agree to be bound by them.": "hebt gelezen, dat je ze begrijpt en dat je accepteert eraan gebonden te zijn."
} }
...@@ -12,6 +12,8 @@ import LoadingScreen from '../../components/loadingScreen/LoadingScreen'; ...@@ -12,6 +12,8 @@ import LoadingScreen from '../../components/loadingScreen/LoadingScreen';
import ErrorScreen from '../../components/errorScreen/ErrorScreen'; import ErrorScreen from '../../components/errorScreen/ErrorScreen';
import Colors from '../../style/Colors'; import Colors from '../../style/Colors';
import { termsAndConditionsUrl } from '../../../utils/url';
import * as eventActions from '../../../actions/event'; import * as eventActions from '../../../actions/event';
import * as registrationActions from '../../../actions/registration'; import * as registrationActions from '../../../actions/registration';
import * as pizzaActions from '../../../actions/pizza'; import * as pizzaActions from '../../../actions/pizza';
...@@ -189,18 +191,27 @@ class Event extends Component { ...@@ -189,18 +191,27 @@ class Event extends Component {
const regAllowed = regRequired && endRegDate > nowDate && const regAllowed = regRequired && endRegDate > nowDate &&
regStarted && event.registration_allowed; regStarted && event.registration_allowed;
// Needed once registration on server implemented
if (regAllowed) { if (regAllowed) {
if (event.user_registration === null || event.user_registration.is_cancelled) { if (event.user_registration === null || event.user_registration.is_cancelled) {
const text = event.max_participants && event.max_participants <= event.num_participants ? const text = event.max_participants && event.max_participants <= event.num_participants ?
this.props.t('Put me on the waiting list') : this.props.t('Register'); this.props.t('Put me on the waiting list') : this.props.t('Register');
return ( return (
<View style={styles.registrationActions}> <View>
<Button <Text style={styles.registrationText}>
color={Colors.magenta} {this.props.t('By registering, you confirm that you have read the')}
title={text} <Text
onPress={() => this.props.register(event.pk)} style={styles.termsUrl}
/> onPress={() => Linking.openURL(termsAndConditionsUrl)}
> {this.props.t('terms and conditions')} </Text>
{this.props.t(', that you understand them and that you agree to be bound by them.')}
</Text>
<View style={styles.registrationActions}>
<Button
color={Colors.magenta}
title={text}
onPress={() => this.props.register(event.pk)}
/>
</View>
</View> </View>
); );
} else if (event.user_registration && !event.user_registration.is_cancelled && } else if (event.user_registration && !event.user_registration.is_cancelled &&
......
...@@ -93,6 +93,9 @@ const styles = StyleSheet.create({ ...@@ -93,6 +93,9 @@ const styles = StyleSheet.create({
alignItems: 'flex-start', alignItems: 'flex-start',
marginTop: 16, marginTop: 16,
}, },
termsUrl: {
color: Colors.magenta,
},
secondButtonMargin: { secondButtonMargin: {
marginLeft: 16, marginLeft: 16,
}, },
......
...@@ -9,6 +9,7 @@ if (__DEV__) { // eslint-disable-line no-undef ...@@ -9,6 +9,7 @@ if (__DEV__) { // eslint-disable-line no-undef
export const url = server; export const url = server;
export const apiUrl = `${server}/api/v1`; export const apiUrl = `${server}/api/v1`;
export const defaultProfileImage = `${server}/static/members/images/default-avatar.jpg`; export const defaultProfileImage = `${server}/static/members/images/default-avatar.jpg`;
export const termsAndConditionsUrl = `${server}/event-registration-terms/`;
export const tokenSelector = state => state.session.token; export const tokenSelector = state => state.session.token;
export const loggedInSelector = state => state.navigation.loggedIn; export const loggedInSelector = state => state.navigation.loggedIn;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment