section = null;
}
TagName.checkTag(tag);
Template tmpl = Template.getTemplate(request);
TopicListController.setExpireHeaders(response, null, null);
String title = getTitle(tag, section);
modelAndView.addObject("navtitle", title);
modelAndView.addObject("ptitle", title);
offset = topicListService.fixOffset(offset);
List<Topic> topics = topicListService.getTopicsFeed(
section,
null,
tag,
offset,
null,
null,
20
);
List<PersonalizedPreparedTopic> preparedTopics = prepareService.prepareMessagesForUser(
topics,
request.isSecure(),
tmpl.getCurrentUser(),
tmpl.getProf(),
false
);
modelAndView.addObject(
"messages",
preparedTopics
);
modelAndView.addObject("offsetNavigation", true);
modelAndView.addObject("tag", tag);
modelAndView.addObject("section", sectionId);
modelAndView.addObject("offset", offset);
modelAndView.addObject("sectionList", sectionService.getSectionList());
if (tmpl.isSessionAuthorized()) {
modelAndView.addObject(
"isShowFavoriteTagButton",
!userTagService.hasFavoriteTag(tmpl.getCurrentUser(), tag)
);
modelAndView.addObject(
"isShowUnFavoriteTagButton",
userTagService.hasFavoriteTag(tmpl.getCurrentUser(), tag)
);
if (!tmpl.isModeratorSession()) {
modelAndView.addObject(
"isShowIgnoreTagButton",
!userTagService.hasIgnoreTag(tmpl.getCurrentUser(), tag)
);
modelAndView.addObject(
"isShowUnIgnoreTagButton",
userTagService.hasIgnoreTag(tmpl.getCurrentUser(), tag)
);
}
}
TagInfo tagInfo = tagService.getTagInfo(tag, true);