public static void show(Long forumId, Long topicId, Integer page) { Topic topic = Topic.findById(topicId); notFoundIfNull(topic); topic.views = 1; topic.save(); render(topic, page); }
@SecureAdmin public static void createReply(Long forumId, Long topicId, String content) { Topic topic = Topic.findById(topicId); notFoundIfNull(topic); topic.reply(connectedUser(), content); show(forumId, topicId, null); }
@SecureAdmin(admin = true) public static void delete(Long forumId, Long topicId) { Topic topic = Topic.findById(topicId); notFoundIfNull(topic); topic.delete(); flash.success("The topic has been deleted"); Forums.show(forumId, null); }
@SecureAdmin public static void reply(Long forumId, Long topicId) { Topic topic = Topic.findById(topicId); notFoundIfNull(topic); render(topic); }