Class { #name : 'TBHeaderComponent', #superclass : 'SBSComponent', #instVars : [ 'component' ], #category : 'TinyBlog-Components', #package : 'TinyBlog-Components' } { #category : 'instance creation' } TBHeaderComponent class >> from: aComponent [ ^ self new component: aComponent; yourself ] { #category : 'accessing' } TBHeaderComponent >> component [ ^ component ] { #category : 'accessing' } TBHeaderComponent >> component: anObject [ component := anObject ] { #category : 'rendering' } TBHeaderComponent >> renderBrandOn: html [ html navigationBarBrand url: self application url; with: 'TinyBlog' ] { #category : 'rendering' } TBHeaderComponent >> renderButtonsOn: html [ self session isLogged ifTrue: [ self renderSimpleAdminButtonOn: html ] ifFalse: [ self renderModalLoginButtonOn: html ] ] { #category : 'rendering' } TBHeaderComponent >> renderContentOn: html [ | bar | bar := html navigationBar. bar background beLight. bar with: [ html container: [ self renderBrandOn: html. self renderButtonsOn: html ] ] ] { #category : 'rendering' } TBHeaderComponent >> renderModalLoginButtonOn: html [ html render: (TBAuthenticationComponent from: component). html formButton beSecondary; dataTarget: '#myAuthDialog'; dataToggle: 'modal'; with: [ html span class: 'glyphicon glyphicon-lock'. html text: 'Login' ] ] { #category : 'rendering' } TBHeaderComponent >> renderSimpleAdminButtonOn: html [ html form: [ html formButton beSecondary; callback: [ component goToAdministrationView ]; with: [ html span class: 'glyphicon glyphicon-list-alt'. html text: ' Admin View' ]] ]