summaryrefslogtreecommitdiff
path: root/pharo-mooc/tiny-blog/src/TinyBlog-Components/TBAdminHeaderComponent.class.st
blob: cf7e8cd37ecc630095009e481bb05ab63080dc84 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
Class {
	#name : 'TBAdminHeaderComponent',
	#superclass : 'TBHeaderComponent',
	#category : 'TinyBlog-Components',
	#package : 'TinyBlog-Components'
}

{ #category : 'rendering' }
TBAdminHeaderComponent >> renderButtonsOn: html [
	html form: [
		self renderDisconnectButtonOn: html.
		self renderPublicViewButton: html ]
]

{ #category : 'rendering' }
TBAdminHeaderComponent >> renderDisconnectButtonOn: html [
	html formButton
		beSecondary;
		callback: [ self session reset ];
		with: [ 
			html text: 'Disconnect'.
			html span class: 'glyphicon glyphicon-logout' ]
]

{ #category : 'rendering' }
TBAdminHeaderComponent >> renderPublicViewButton: html [
	self session isLogged ifTrue: [ 
		html formButton
			beSecondary;
			callback: [ component goToPostListView ];
			with: [ 
				html span class: 'glyphicon glyphicon-eye-open'.
				html text: ' Public View' ] ]
]