forked from juagarfer4/Deliberations
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Primera versión estable del proyecto
Primera versión estable del proyecto
- Loading branch information
Showing
257 changed files
with
5,094 additions
and
1,482 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
|
||
package controllers; | ||
|
||
import org.springframework.stereotype.Controller; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.servlet.ModelAndView; | ||
|
||
@Controller | ||
@RequestMapping("/about-us") | ||
public class AboutController extends AbstractController { | ||
|
||
// Constructors ----------------------------------------------------------- | ||
|
||
public AboutController() { | ||
super(); | ||
} | ||
|
||
// Index ------------------------------------------------------------------ | ||
|
||
@RequestMapping(value = "/teams") | ||
public ModelAndView cookies() { | ||
ModelAndView result; | ||
|
||
result = new ModelAndView("about-us/developers"); | ||
|
||
return result; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
package controllers; | ||
|
||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.stereotype.Controller; | ||
import org.springframework.util.Assert; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RequestMethod; | ||
import org.springframework.web.bind.annotation.RequestParam; | ||
import org.springframework.web.servlet.ModelAndView; | ||
|
||
import domain.Comment; | ||
import domain.Karma; | ||
import services.CommentService; | ||
import services.KarmaService; | ||
import services.UserService; | ||
|
||
@Controller | ||
@RequestMapping("/karma") | ||
public class KarmaController extends AbstractController { | ||
|
||
// Supporting services ----------------------- | ||
|
||
@Autowired | ||
private KarmaService karmaService; | ||
|
||
@Autowired | ||
private CommentService commentService; | ||
|
||
@Autowired | ||
private UserService userService; | ||
|
||
@Autowired | ||
private ThreadController threadController; | ||
|
||
// Constructors ----------------------------------------------------------- | ||
|
||
public KarmaController() { | ||
super(); | ||
} | ||
|
||
// Edition ---------------------------------------------------------------- | ||
|
||
@RequestMapping(value = "/setKarma", method = RequestMethod.GET) | ||
public ModelAndView setKarma(@RequestParam int commentId, @RequestParam String value ) { | ||
Assert.isTrue(!commentService.findOne(commentId).getUser().equals(userService.findOneByPrincipal())); | ||
ModelAndView result; | ||
Comment comment; | ||
Karma karma; | ||
|
||
if(karmaService.karmaOfUserAtComment(commentId)==null){ | ||
|
||
karma = karmaService.create(); | ||
|
||
}else{ | ||
|
||
karma = karmaService.karmaOfUserAtComment(commentId); | ||
|
||
} | ||
|
||
comment = commentService.findOne(commentId); | ||
karma = karmaService.setKarma(karma, comment, value); | ||
|
||
karmaService.save(karma); | ||
|
||
result = threadController.seeThread(comment.getThread().getId(), 1); | ||
|
||
return result; | ||
} | ||
|
||
// Ancillary methods ------------------------------------------------------ | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
|
||
package controllers; | ||
|
||
import org.springframework.stereotype.Controller; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.servlet.ModelAndView; | ||
|
||
@Controller | ||
@RequestMapping("/policy") | ||
public class PolicyController extends AbstractController { | ||
|
||
// Constructors ----------------------------------------------------------- | ||
|
||
public PolicyController() { | ||
super(); | ||
} | ||
|
||
// Index ------------------------------------------------------------------ | ||
|
||
@RequestMapping(value = "/cookies") | ||
public ModelAndView cookies() { | ||
ModelAndView result; | ||
|
||
result = new ModelAndView("policies/cookies"); | ||
|
||
return result; | ||
} | ||
|
||
@RequestMapping(value = "/terms") | ||
public ModelAndView terms() { | ||
ModelAndView result; | ||
|
||
result = new ModelAndView("policies/terms"); | ||
|
||
return result; | ||
} | ||
|
||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.