Exemplo n.º 1
0
	def get( self, thread ):
		data = ''
		pagination = ''
		not_found = ''
		post_requested = str( self.request.get( 'start' ))
		post_count = str( self.request.get( 'count' ))
		validation_result = EnkiModelThread.validate_thread_pagination( thread, post_requested, post_count )
		if validation_result == enki.libutil.ENKILIB_OK:
			if not post_requested:
				post_requested = EnkiModelPost.POST_DEFAULT
			if not post_count:
				post_count = EnkiModelPost.POSTS_PER_PAGE
			data = EnkiModelPost.get_thread_data( thread, post_requested, post_count )
			pagination = EnkiModelPost.get_thread_pagination_data( thread, post_requested, post_count )
		else:
			not_found = MSG.POST_THREAD_NOT_EXIST( )
		self.render_tmpl( 'thread.html', False,
		                  active_menu = 'forums',
		                  data = data,
		                  pagination = pagination,
		                  user_id = self.user_id,
		                  not_found = not_found,
		                  maxpostlength = EnkiModelPost.POST_LENGTH_MAX )