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 @@
"Update registration": "Aanmelding bijwerken",
"Cancel registration": "Afmelden",
"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';
import ErrorScreen from '../../components/errorScreen/ErrorScreen';
import Colors from '../../style/Colors';
import { termsAndConditionsUrl } from '../../../utils/url';
import * as eventActions from '../../../actions/event';
import * as registrationActions from '../../../actions/registration';
import * as pizzaActions from '../../../actions/pizza';
......@@ -189,12 +191,20 @@ class Event extends Component {
const regAllowed = regRequired && endRegDate > nowDate &&
regStarted && event.registration_allowed;
// Needed once registration on server implemented
if (regAllowed) {
if (event.user_registration === null || event.user_registration.is_cancelled) {
const text = event.max_participants && event.max_participants <= event.num_participants ?
this.props.t('Put me on the waiting list') : this.props.t('Register');
return (
<View>
<Text style={styles.registrationText}>
{this.props.t('By registering, you confirm that you have read the')}
<Text
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}
......@@ -202,6 +212,7 @@ class Event extends Component {
onPress={() => this.props.register(event.pk)}
/>
</View>
</View>
);
} else if (event.user_registration && !event.user_registration.is_cancelled &&
regRequired && regStarted) {
......
......@@ -93,6 +93,9 @@ const styles = StyleSheet.create({
alignItems: 'flex-start',
marginTop: 16,
},
termsUrl: {
color: Colors.magenta,
},
secondButtonMargin: {
marginLeft: 16,
},
......
......@@ -9,6 +9,7 @@ if (__DEV__) { // eslint-disable-line no-undef
export const url = server;
export const apiUrl = `${server}/api/v1`;
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 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