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

View File

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