New BreaWebsite for modelling general configuration.
This commit is contained in:
parent
ca242ac99f
commit
618de553a8
3
repository/.properties
Normal file
3
repository/.properties
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
#format : #tonel
|
||||
}
|
290
repository/Brea/BreaMember.class.st
Normal file
290
repository/Brea/BreaMember.class.st
Normal file
@ -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 [
|
||||
^ '<head>', self headMeta, self headTitle, self headStyles,'</head>'
|
||||
]
|
||||
|
||||
{ #category : #utility }
|
||||
BreaMember >> headMeta [
|
||||
^ '<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="description" content="A portfolio template that uses Material Design Lite.">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0">'
|
||||
]
|
||||
|
||||
{ #category : #utility }
|
||||
BreaMember >> headStyles [
|
||||
^ '
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:regular,bold,italic,thin,light,bolditalic,black,medium&lang=en">
|
||||
<link rel="stylesheet" href="https://code.getmdl.io/1.3.0/material.grey-pink.min.css" />
|
||||
<link rel="stylesheet" href="http://mutabit.com/repos.fossil/gig/doc/tip/styles.css" />
|
||||
<link rel="stylesheet" href="styles.css" />
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
|
||||
'
|
||||
]
|
||||
|
||||
{ #category : #utility }
|
||||
BreaMember >> headTitle [
|
||||
^ self headTitled: 'GIG: Network'
|
||||
]
|
||||
|
||||
{ #category : #utility }
|
||||
BreaMember >> headTitled: aString [
|
||||
^ '<title>', aString ,'</title>'
|
||||
]
|
||||
|
||||
{ #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"
|
||||
|
||||
^ '<div class="mdl-cell mdl-card mdl-shadow--4dp portfolio-card">
|
||||
<div class="mdl-card__title">
|
||||
<h2 class="mdl-card__title-text">{{givenName}} {{familyName}}</h2>
|
||||
</div>
|
||||
<div class="mdl-card__media">
|
||||
<img class="article-image"
|
||||
src="./artifacts/members/offray-luna/picture.png"
|
||||
border="0" alt="">
|
||||
</div>
|
||||
<div class="mdl-card__supporting-text">
|
||||
<table class="mdl-data-table mdl-js-data-table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="mdl-data-table__cell--non-numeric"><b>Name</b></td>
|
||||
<td class="mdl-data-table__cell--non-numeric">{{givenName}} {{familyName}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="mdl-data-table__cell--non-numeric"><b>Country</b></td>
|
||||
<td class="mdl-data-table__cell--non-numeric">{{country}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="mdl-data-table__cell--non-numeric"><b>Organization(s)</b></td>
|
||||
<td class="mdl-data-table__cell--non-numeric">HackBo, mutabiT</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="mdl-data-table__cell--non-numeric"><b>Website</b></td>
|
||||
<td class="mdl-data-table__cell--non-numeric">
|
||||
<a href="{{website}}">{{website}}</a>
|
||||
</td>
|
||||
</tr>
|
||||
{{#twitter}}
|
||||
<tr>
|
||||
<td class="mdl-data-table__cell--non-numeric"><b>Twitter</b></td>
|
||||
<td class="mdl-data-table__cell--non-numeric">
|
||||
<a href="https://twitter.com/{{twitter}}">{{twitter}}</a></td>
|
||||
</tr>
|
||||
{{/twitter}}
|
||||
<tr>
|
||||
<td colspan="2"; style="text-align:left">
|
||||
<b>Tags</b><br>
|
||||
{{ tags }}
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="mdl-card__actions mdl-card--border">
|
||||
<a class="mdl-button mdl-button--colored mdl-js-button
|
||||
mdl-js-ripple-effect mdl-button--accent"
|
||||
href="portfolio-example01.html">Read more</a>
|
||||
</div>
|
||||
</div>
|
||||
'
|
||||
]
|
||||
|
||||
{ #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 [
|
||||
^ '<tr>
|
||||
<td class="mdl-data-table__cell--non-numeric"><b>Twitter</b></td>
|
||||
<td class="mdl-data-table__cell--non-numeric">
|
||||
<a href="https://twitter.com/{{twitter}}">{{twitter}}</a></td>
|
||||
</tr>' 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
|
||||
]
|
8
repository/Brea/BreaMemberTest.class.st
Normal file
8
repository/Brea/BreaMemberTest.class.st
Normal file
@ -0,0 +1,8 @@
|
||||
"
|
||||
A BreaMemberTest is a test class for testing the behavior of BreaMember
|
||||
"
|
||||
Class {
|
||||
#name : #BreaMemberTest,
|
||||
#superclass : #TestCase,
|
||||
#category : #'Brea-Tests'
|
||||
}
|
32
repository/Brea/BreaOrganization.class.st
Normal file
32
repository/Brea/BreaOrganization.class.st
Normal file
@ -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
|
||||
]
|
54
repository/Brea/BreaWebPresence.class.st
Normal file
54
repository/Brea/BreaWebPresence.class.st
Normal file
@ -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
|
||||
]
|
27
repository/Brea/BreaWebsite.class.st
Normal file
27
repository/Brea/BreaWebsite.class.st
Normal file
@ -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
|
||||
]
|
1
repository/Brea/package.st
Normal file
1
repository/Brea/package.st
Normal file
@ -0,0 +1 @@
|
||||
Package { #name : #Brea }
|
Loading…
Reference in New Issue
Block a user