Пример #1
0
 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);
 }
Пример #2
0
 @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);
 }
Пример #3
0
 @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);
 }
Пример #4
0
 @SecureAdmin
 public static void reply(Long forumId, Long topicId) {
   Topic topic = Topic.findById(topicId);
   notFoundIfNull(topic);
   render(topic);
 }