diff --git a/.project b/.project new file mode 100644 index 0000000..46c7795 --- /dev/null +++ b/.project @@ -0,0 +1,3 @@ +{ + 'srcDirectory' : 'repository' +} \ No newline at end of file diff --git a/repository/.properties b/repository/.properties new file mode 100644 index 0000000..ad0471d --- /dev/null +++ b/repository/.properties @@ -0,0 +1,3 @@ +{ + #format : #tonel +} \ No newline at end of file diff --git a/repository/Brea/BreaMember.class.st b/repository/Brea/BreaMember.class.st new file mode 100644 index 0000000..0fe58e8 --- /dev/null +++ b/repository/Brea/BreaMember.class.st @@ -0,0 +1,290 @@ +" +I model a member of a Brea site, usually a human. +" +Class { + #name : #BreaMember, + #superclass : #Object, + #instVars : [ + 'givenName', + 'familyName', + 'picture', + 'country', + 'tags', + 'email', + 'password', + 'webPresence', + 'organizations' + ], + #category : #Brea +} + +{ #category : #accessing } +BreaMember >> country [ + ^ country +] + +{ #category : #accessing } +BreaMember >> country: anObject [ + country := anObject +] + +{ #category : #helpers } +BreaMember >> createTestUser [ + ^ self class new + givenName: 'Test'; + familyName: 'User'; + country: 'Neverland'; + memberOf: 'HackBo' withWebsite: 'http://hackbo.co/'; + memberOf: 'mutabiT' withWebsite: 'http://mutabit.com/'; + website: 'http://test.user'; + email: 'iam@test.user'; + twitter: '@offrayLC'; + tags: 'just, a lot, of words, separated, by commas'. +] + +{ #category : #accessing } +BreaMember >> email [ + ^ email +] + +{ #category : #accessing } +BreaMember >> email: anObject [ + email := anObject +] + +{ #category : #accessing } +BreaMember >> facebook [ + ^ self webPresence facebook. +] + +{ #category : #accessing } +BreaMember >> facebook: aProfileName [ + self webPresence facebook: aProfileName +] + +{ #category : #accessing } +BreaMember >> familyName [ + ^ familyName +] + +{ #category : #accessing } +BreaMember >> familyName: anObject [ + familyName := anObject +] + +{ #category : #accessing } +BreaMember >> givenName [ + ^ givenName +] + +{ #category : #accessing } +BreaMember >> givenName: anObject [ + givenName := anObject +] + +{ #category : #public } +BreaMember >> head [ + ^ '', self headMeta, self headTitle, self headStyles,'' +] + +{ #category : #utility } +BreaMember >> headMeta [ + ^ ' + + + ' +] + +{ #category : #utility } +BreaMember >> headStyles [ + ^ ' + + + + + + ' +] + +{ #category : #utility } +BreaMember >> headTitle [ + ^ self headTitled: 'GIG: Network' +] + +{ #category : #utility } +BreaMember >> headTitled: aString [ + ^ '', aString ,'' +] + +{ #category : #public } +BreaMember >> html [ + "I show the member profile as HTML" + ^ self head, self htmlOutput +] + +{ #category : #public } +BreaMember >> htmlOutput [ + + ^ self htmlOutputTemplate asMustacheTemplate value: self +] + +{ #category : #public } +BreaMember >> htmlOutputTemplate [ + "I show the member profile as HTML" + + ^ '
+
+

{{givenName}} {{familyName}}

+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + {{#twitter}} + + + + + {{/twitter}} + + + + +
Name{{givenName}} {{familyName}}
Country{{country}}
Organization(s)HackBo, mutabiT
Website + {{website}} +
Twitter + {{twitter}}
+ Tags
+ {{ tags }} +
+
+
+ Read more +
+
+ ' +] + +{ #category : #accessing } +BreaMember >> instagram [ + ^ self webPresence instagram. +] + +{ #category : #accessing } +BreaMember >> instagram: aProfileName [ + self webPresence instagram: aProfileName +] + +{ #category : #accessing } +BreaMember >> memberOf: anOrgName withWebsite: aUrl [ + self organizations add: + (BreaOrganization new + name: anOrgName; + website: aUrl) +] + +{ #category : #accessing } +BreaMember >> organizations [ + ^ organizations ifNil: [ organizations := OrderedCollection new ] +] + +{ #category : #accessing } +BreaMember >> organizations: anObject [ + organizations := anObject +] + +{ #category : #accessing } +BreaMember >> password [ + ^ password +] + +{ #category : #accessing } +BreaMember >> password: anObject [ + password := anObject +] + +{ #category : #accessing } +BreaMember >> picture [ + ^ picture +] + +{ #category : #accessing } +BreaMember >> picture: anObject [ + picture := anObject +] + +{ #category : #helpers } +BreaMember >> renderTestUserAsHtml [ + ^ self class new createTestUser html +] + +{ #category : #accessing } +BreaMember >> tags [ + ^ tags +] + +{ #category : #accessing } +BreaMember >> tags: anObject [ + tags := anObject +] + +{ #category : #accessing } +BreaMember >> twitter [ + ^ self webPresence twitter. +] + +{ #category : #accessing } +BreaMember >> twitter: aProfileName [ + self webPresence twitter: aProfileName +] + +{ #category : #public } +BreaMember >> twitterTemplate [ + ^ ' + Twitter + + {{twitter}} + ' asMustacheTemplate value: self +] + +{ #category : #accessing } +BreaMember >> webPresence [ + ^ webPresence ifNil: [ webPresence := BreaWebPresence new ] +] + +{ #category : #accessing } +BreaMember >> webPresence: anObject [ + webPresence := anObject +] + +{ #category : #accessing } +BreaMember >> website [ + ^ self webPresence website. +] + +{ #category : #accessing } +BreaMember >> website: anUrl [ + self webPresence website: anUrl +] diff --git a/repository/Brea/BreaMemberTest.class.st b/repository/Brea/BreaMemberTest.class.st new file mode 100644 index 0000000..162a3c5 --- /dev/null +++ b/repository/Brea/BreaMemberTest.class.st @@ -0,0 +1,8 @@ +" +A BreaMemberTest is a test class for testing the behavior of BreaMember +" +Class { + #name : #BreaMemberTest, + #superclass : #TestCase, + #category : #'Brea-Tests' +} diff --git a/repository/Brea/BreaOrganization.class.st b/repository/Brea/BreaOrganization.class.st new file mode 100644 index 0000000..7142be6 --- /dev/null +++ b/repository/Brea/BreaOrganization.class.st @@ -0,0 +1,32 @@ +" +I store the places a BreaMember is affiliated to. +" +Class { + #name : #BreaOrganization, + #superclass : #Object, + #instVars : [ + 'name', + 'website' + ], + #category : #Brea +} + +{ #category : #accessing } +BreaOrganization >> name [ + ^ name +] + +{ #category : #accessing } +BreaOrganization >> name: anObject [ + name := anObject +] + +{ #category : #accessing } +BreaOrganization >> website [ + ^ website +] + +{ #category : #accessing } +BreaOrganization >> website: anObject [ + website := anObject +] diff --git a/repository/Brea/BreaWebPresence.class.st b/repository/Brea/BreaWebPresence.class.st new file mode 100644 index 0000000..815a62c --- /dev/null +++ b/repository/Brea/BreaWebPresence.class.st @@ -0,0 +1,54 @@ +" +I store the common forms of web presence a BreaMember can have online. +" +Class { + #name : #BreaWebPresence, + #superclass : #Object, + #instVars : [ + 'website', + 'twitter', + 'facebook', + 'instagram' + ], + #category : #Brea +} + +{ #category : #accessing } +BreaWebPresence >> facebook [ + ^ facebook +] + +{ #category : #accessing } +BreaWebPresence >> facebook: anObject [ + facebook := anObject +] + +{ #category : #accessing } +BreaWebPresence >> instagram [ + ^ instagram +] + +{ #category : #accessing } +BreaWebPresence >> instagram: anObject [ + instagram := anObject +] + +{ #category : #accessing } +BreaWebPresence >> twitter [ + ^ twitter +] + +{ #category : #accessing } +BreaWebPresence >> twitter: anObject [ + twitter := anObject +] + +{ #category : #accessing } +BreaWebPresence >> website [ + ^ website +] + +{ #category : #accessing } +BreaWebPresence >> website: anObject [ + website := anObject +] diff --git a/repository/Brea/BreaWebsite.class.st b/repository/Brea/BreaWebsite.class.st new file mode 100644 index 0000000..02234aa --- /dev/null +++ b/repository/Brea/BreaWebsite.class.st @@ -0,0 +1,27 @@ +" +I model the fossil repository where public data is stored for the +building of this web site. +" +Class { + #name : #BreaWebsite, + #superclass : #Object, + #instVars : [ + 'fossilRepo' + ], + #category : #Brea +} + +{ #category : #utility } +BreaWebsite >> baseRepoUrl [ + ^ 'http://mutabit.com/repos.fossil/gig/' +] + +{ #category : #accessing } +BreaWebsite >> fossilRepo [ + ^ fossilRepo +] + +{ #category : #accessing } +BreaWebsite >> fossilRepo: anObject [ + fossilRepo := anObject +] diff --git a/repository/Brea/package.st b/repository/Brea/package.st new file mode 100644 index 0000000..91625ae --- /dev/null +++ b/repository/Brea/package.st @@ -0,0 +1 @@ +Package { #name : #Brea }