Skip to content

Instantly share code, notes, and snippets.

@nickyp
Created August 19, 2010 19:08
Show Gist options
  • Save nickyp/538632 to your computer and use it in GitHub Desktop.
Save nickyp/538632 to your computer and use it in GitHub Desktop.
renderContentOn: html
html heading: 'Reddit.st'.
html heading level: 3; with: 'In 10 elegant Smalltalk classes'.
self renderActionsOn: html.
self renderHighestRankingLinksOn: html.
self renderLatestLinksOn: html
renderActionsOn: html
html paragraph: [
html anchor callback: [ ]; with: 'Refresh'.
html anchor callback: [ self inform: 'Not yet implemented' ]; with: 'New Link' ]
renderHighestRankingLinksOn: html
html heading level: 2; with: 'Highest Ranking Links'.
html orderedList: [
self highestRankingLinks do: [ :each | self renderLink: each on: html ] ]
renderLatestLinksOn: html
html heading level: 2; with: 'Latest Links'.
html orderedList: [
self latestLinks do: [ :each | self renderLink: each on: html ] ]
renderLink: link on: html
html listItem: [
html anchor url: link url; title: link url; with: link title.
html text: ' Posted ', (self class durationString: link posted), ' ago. '.
html text: link points asString, ' points. '.
html anchor callback: [ self voteUp: link ]; title: 'Vote this link up'; with: 'Up'.
html space.
html anchor callback: [ self voteDown: link ]; title: 'Vote this link down'; with: 'Down' ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment