diff --git a/src/main/java/edu/boun/yilmaz4/deniz/akitaBackend/controller/TagController.java b/src/main/java/edu/boun/yilmaz4/deniz/akitaBackend/controller/TagController.java index 3856e70..7b72ea6 100644 --- a/src/main/java/edu/boun/yilmaz4/deniz/akitaBackend/controller/TagController.java +++ b/src/main/java/edu/boun/yilmaz4/deniz/akitaBackend/controller/TagController.java @@ -17,9 +17,11 @@ import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; import javax.validation.Valid; +import java.io.IOException; @Controller @RequestMapping(Routing.ROOT_TAG) @@ -71,4 +73,19 @@ public String allTags(Model model) { } return "tags"; } + + @PostMapping(Routing.URI_VIEW) + public String viewMoreInfoAboutTag(Model model, + @RequestParam("tagName") String name) throws IOException { + Tag tag = tagService.findByName(name); + String extract = tagService.getMoreInformationAboutTag(tag); + model.addAttribute("tag", tag); + model.addAttribute("extract", extract); + String username = memberService.getCurrentUserLogin(); + if(!username.equals("anonymousUser")) { + Member member = memberService.findByUsername(username); + model.addAttribute("messageCount", String.valueOf(messageService.checkForUnreadMessage(member))); + } + return "view-tag-info"; + } } \ No newline at end of file diff --git a/src/main/resources/templates/view-offer.html b/src/main/resources/templates/view-offer.html index d70fe56..7525c92 100644 --- a/src/main/resources/templates/view-offer.html +++ b/src/main/resources/templates/view-offer.html @@ -62,6 +62,25 @@ +
name | ++ |
---|---|
+ | + + | +
+ + \ No newline at end of file