all: intial code import
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
rendering
|
||||
addContact
|
||||
(self call: WAContact new)
|
||||
ifNotNil: [ :contact | contactBook addContact: contact ]
|
@@ -0,0 +1,3 @@
|
||||
accessing
|
||||
contacts
|
||||
^ contactBook contacts
|
@@ -0,0 +1,3 @@
|
||||
operations
|
||||
contactsDo: aBlock
|
||||
self contacts do: aBlock
|
@@ -0,0 +1,4 @@
|
||||
initialization
|
||||
initialize
|
||||
super initialize.
|
||||
contactBook := ContactBook createDefault
|
@@ -0,0 +1,7 @@
|
||||
rendering
|
||||
renderButtonsForContact: aContact on: html
|
||||
html tbsButtonGroup: [
|
||||
self
|
||||
renderEditButtonForContact: aContact on: html;
|
||||
renderRemoveButtonForContact: aContact on: html
|
||||
]
|
@@ -0,0 +1,9 @@
|
||||
rendering
|
||||
renderContact: aContact on: html
|
||||
html tableRow: [
|
||||
html
|
||||
tableData: [ self renderPhotoOf: aContact on: html ];
|
||||
tableData: aContact fullname;
|
||||
tableData: aContact email;
|
||||
tableData: [ self renderButtonsForContact: aContact on: html ]
|
||||
]
|
@@ -0,0 +1,12 @@
|
||||
rendering
|
||||
renderContactsOn: html
|
||||
html tbsTable: [
|
||||
html tableHead: [
|
||||
html
|
||||
tableHeading: 'Photo';
|
||||
tableHeading: 'Name';
|
||||
tableHeading: 'Email';
|
||||
tableHeading: 'Actions'
|
||||
].
|
||||
self contactsDo: [ :contact | self renderContact: contact on: html ]
|
||||
]
|
@@ -0,0 +1,11 @@
|
||||
rendering
|
||||
renderContentOn: html
|
||||
html tbsContainer: [
|
||||
html heading
|
||||
level: 1;
|
||||
with: 'My Contact Book'.
|
||||
html tbsForm: [
|
||||
self renderContactsOn: html.
|
||||
self renderGlobalButtonsOn: html
|
||||
]
|
||||
]
|
@@ -0,0 +1,6 @@
|
||||
updating
|
||||
renderEditButtonForContact: aContact on: html
|
||||
html tbsButton
|
||||
beSuccess;
|
||||
callback: [ self call: (WAContact editContact: aContact) ];
|
||||
with: 'Edit'
|
@@ -0,0 +1,8 @@
|
||||
rendering
|
||||
renderGlobalButtonsOn: html
|
||||
html tbsButtonGroup: [
|
||||
html tbsButton
|
||||
beSuccess;
|
||||
callback: [ self addContact ];
|
||||
with: 'New contact'
|
||||
]
|
@@ -0,0 +1,3 @@
|
||||
rendering
|
||||
renderPhotoOf: aContact on: html
|
||||
html image url: aContact gravatarUrl
|
@@ -0,0 +1,6 @@
|
||||
rendering
|
||||
renderRemoveButtonForContact: aContact on: html
|
||||
html tbsButton
|
||||
beDanger;
|
||||
callback: [ self contactBook removeContact: aContact ];
|
||||
with: 'Remove'
|
@@ -0,0 +1,4 @@
|
||||
updating
|
||||
updateRoot: anHtmlRoot
|
||||
super updateRoot: anHtmlRoot.
|
||||
anHtmlRoot title: 'Contact Book'
|
Reference in New Issue
Block a user