Class { #name : 'TBCategoriesComponent', #superclass : 'TBScreenComponent', #instVars : [ 'categories', 'postsList' ], #category : 'TinyBlog-Components', #package : 'TinyBlog-Components' } { #category : 'instance creation' } TBCategoriesComponent class >> categories: categories postsList: aTBScreen [ ^ self new categories: categories; postsList: aTBScreen ] { #category : 'accessing' } TBCategoriesComponent >> categories [ ^ categories ] { #category : 'accessing' } TBCategoriesComponent >> categories: anObject [ categories := anObject ] { #category : 'accessing' } TBCategoriesComponent >> postsList [ ^ postsList ] { #category : 'accessing' } TBCategoriesComponent >> postsList: anObject [ postsList := anObject ] { #category : 'actions' } TBCategoriesComponent >> renderCategoryLinkOn: html with: aCategory [ html listGroupLinkedItem class: 'active' if: aCategory = self postsList currentCategory; callback: [ self selectCategory: aCategory ]; with: aCategory ] { #category : 'actions' } TBCategoriesComponent >> renderContentOn: html [ html listGroup: [ html listGroupItem with: [ html strong: 'Categories' ]. categories do: [ :cat | self renderCategoryLinkOn: html with: cat ] ] ] { #category : 'actions' } TBCategoriesComponent >> selectCategory: aCategory [ postsList currentCategory: aCategory ]