Improved input processing.

This commit is contained in:
Offray Luna 2017-06-01 12:10:55 +00:00
parent 17d32b32ba
commit 45c22a857c
2 changed files with 24 additions and 7 deletions

View File

@ -65,8 +65,8 @@ BreaMember >> email [
]
{ #category : #accessing }
BreaMember >> email: anObject [
email := anObject
BreaMember >> email: anEmailAddress [
email := (SHA1 new hashMessage: anEmailAddress) hex
]
{ #category : #accessing }
@ -76,7 +76,9 @@ BreaMember >> facebook [
{ #category : #accessing }
BreaMember >> facebook: aProfileName [
self webPresence facebook: aProfileName
aProfileName = ''
ifTrue: [ self webPresence facebook: nil ]
ifFalse: [ self webPresence facebook: aProfileName ]
]
{ #category : #public }
@ -221,9 +223,13 @@ BreaMember >> htmlInput [
<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label">
<input class="mdl-textfield__input" pattern="[A-Z,a-z, ]*" type="text" name="organizations">
<label class="mdl-textfield__label" for="organizations">
[*]Organization(s)</label>
[*]Organization(s) (separated with commas)</label>
<span class="mdl-textfield__error">Letters and spaces only</span>
</div><br>
<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label">
<input class="mdl-textfield__input" type="text" name="picture">
<label class="mdl-textfield__label" for="website">Profile picture url...</label>
</div>
<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label">
<input class="mdl-textfield__input" type="text" name="website">
<label class="mdl-textfield__label" for="website">Personal website...</label>
@ -325,6 +331,12 @@ BreaMember >> instagram: aProfileName [
self webPresence instagram: aProfileName
]
{ #category : #accessing }
BreaMember >> memberOf: anOrgName [
self organizations add:
(BreaOrganization new name: anOrgName)
]
{ #category : #accessing }
BreaMember >> memberOf: anOrgName withWebsite: aUrl [
self organizations add:
@ -339,8 +351,8 @@ BreaMember >> organizations [
]
{ #category : #accessing }
BreaMember >> organizations: anObject [
organizations := anObject
BreaMember >> organizations: anOrgListOrName [
anOrgListOrName splitOn: ',' do: [ :each | self memberOf: each ]
]
{ #category : #public }
@ -410,7 +422,9 @@ BreaMember >> twitter [
{ #category : #accessing }
BreaMember >> twitter: aProfileName [
self webPresence twitter: aProfileName
aProfileName = ''
ifTrue: [ self webPresence twitter: nil ]
ifFalse: [ self webPresence twitter: aProfileName ]
]
{ #category : #public }

View File

@ -34,6 +34,9 @@ BreaWebsite >> processNewMember: request [
familyName: (request at: #familyName);
email: (request at: #email);
country: (request at: #country);
organizations: (request at: #organizations);
picture: (request at: #picture);
website: (request at: #website);
twitter: (request at: #twitter);
facebook: (request at: #facebook);
tags: (request at: #tags).