all: intial code import
This commit is contained in:
14
ContactBook.package/WAContactBook.class/README.md
Normal file
14
ContactBook.package/WAContactBook.class/README.md
Normal file
@@ -0,0 +1,14 @@
|
||||
I represent a contact book web application.
|
||||
|
||||
I render a contact book to HTML using Seaside.
|
||||
|
||||
Collaborators:
|
||||
Veit Heller <veit@veitheller.de>
|
||||
|
||||
Internal Representation and Key Implementation Points.
|
||||
|
||||
Instance Variables
|
||||
contactBook: a Contactbook
|
||||
|
||||
|
||||
Implementation Points
|
@@ -0,0 +1,5 @@
|
||||
initialization
|
||||
initialize
|
||||
(WAAdmin register: self asApplicationAt: 'contacts')
|
||||
addLibrary: JQDeploymentLibrary;
|
||||
addLibrary: TBSDeploymentLibrary
|
@@ -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'
|
14
ContactBook.package/WAContactBook.class/properties.json
Normal file
14
ContactBook.package/WAContactBook.class/properties.json
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"category" : "ContactBook",
|
||||
"classinstvars" : [
|
||||
],
|
||||
"classvars" : [
|
||||
],
|
||||
"commentStamp" : "VeitHeller 5/12/2018 14:29",
|
||||
"instvars" : [
|
||||
"contactBook" ],
|
||||
"name" : "WAContactBook",
|
||||
"pools" : [
|
||||
],
|
||||
"super" : "WAComponent",
|
||||
"type" : "normal" }
|
Reference in New Issue
Block a user