Skip to content

Conversation

@M1niplayer
Copy link
Contributor

@M1niplayer M1niplayer commented Sep 11, 2025

closes #59

Adding functionality for including images in posts which is to display in chapter website, discord, RSS feeds

features:

  • do some frontend stuff to get some drag n drop action when making a post (and for that matter events)
  • upload image to AWS bucket, which enables saving the URL to the calypso db, URL is then used to display image (wow!)
  • alt text

notes:

  • uploaded images files can only be at most 2MB, be 1920x1080 image resolution, of the file type {png, jpg} and the filename extension should match whatever MIME file type Tika reads from the magic bytes (and also, your file should be an image).
  • there is a double save in the edit controller. One to get the postid, which is then used to compose the URL 🥴

what still has to be done after this:

  • show image on bawang and discord bot
  • do the same thing for activities

useful image:
Screenshot_20250911_191616

throw new ResourceNotFoundException();

var item = baseItem.duplicate();
var item = baseItem.duplicate();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i don't even know myself

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@GetMapping("/admin/duplicate")
public String duplicateForm(@RequestParam(name = "id") Long id, Authentication auth, Model model) {
var user = (DAuthUserDetails) auth.getPrincipal();
var baseItem = itemRepository.findById(id).orElseThrow(ResourceNotFoundException::new);
if (baseItem == null)
throw new ResourceNotFoundException();
var item = baseItem.duplicate();
item.setAuthor(user.getUser());

nvm

@M1niplayer M1niplayer requested a review from Poizon7 September 11, 2025 17:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Images

4 participants