Giter VIP home page Giter VIP logo

Comments (9)

LinQiaoPorco avatar LinQiaoPorco commented on June 10, 2024

Hi,
I tried to add the comment function myself.

  • People and post comment and edit after posting:

image

  • The comments have a simple tree structure to collect the sub-comments which responds another comment. User can choose to fold or unfold it:

image

  • Comment needs user to login to post comment or thumb-up/revoke thumb-up. Post author had a 'Author' tab in pill shape:
    image

I haven't raise the PR yet, because I haven't communicated with the repo owner about the solution, yet.

from blogifier.

LinQiaoPorco avatar LinQiaoPorco commented on June 10, 2024

Solution:

  • New table 'Comments' to store comments and user id who posted them, foreign key to 'Posts' table;
  • New table 'CommentsLikes' to store thumb-ups and user id, foreign key to 'Comments' table;
  • Embed a Blazor Server to 'Blogifier' project, hosting and embeding 'Comments.razor' into each post.cshtml;
  • 'CommentCard.razor' show the contents, and 'CommentEditor.razor' show the easyMDE editor to edit or post new comment, are also embeded into 'Comments.razor';

Flaws:

  • Blazor Server embeded into existing MVC can not share httpcontext, so the Login function may need changes to avoid user login again for comment;
  • As for myself, I changed the Auth funciton to SSO using IdentityServer4, so I haven't study how the original Blogifier project should handle it.

Full size screenshot:
localhost_5002_posts_draft-post

from blogifier.

dorthl avatar dorthl commented on June 10, 2024

@LinQiaoPorco
hello
Whether you submit your implemented comment feature to a pr
I'm looking forward to implementing comments
This project is being upgraded, please push it to the dev branch if possible

from blogifier.

LinQiaoPorco avatar LinQiaoPorco commented on June 10, 2024

Hi, I haven't looked into the project for quite a long time. I will try to PR from latest branch to see if it works.
My previous repo was revised to use OpenID connect, so it is not proper to PR the original one.

I found that dev branch is in .NET 7 already, while I did not plan to hasve .NET 7 SDK. Can I just pr to main branch?

from blogifier.

dorthl avatar dorthl commented on June 10, 2024

It can be in the mian-bak branch, the mian branch was wrongly submitted by me and I am asking the warehouse manager to fix it, [mian-bak] is the original warehouse code
But the .net7 update in the dev branch will be updated to the mian branch soon. If you submit to the mian branch, the request will probably not be merged.

from blogifier.

dorthl avatar dorthl commented on June 10, 2024

You can try to push to the dev branch and we can solve the problem together

from blogifier.

LinQiaoPorco avatar LinQiaoPorco commented on June 10, 2024

OK. That will be a messy though. BTW, did you read description on my solution? Would that be OK to progress?

from blogifier.

dorthl avatar dorthl commented on June 10, 2024

Yes, there may be a big difference in the login plan
My idea is to use the code that can be used as much as possible to realize the comment function, structure table, logic, etc... even css..

from blogifier.

LinQiaoPorco avatar LinQiaoPorco commented on June 10, 2024

image

I remember that the changes target comments function added since this commit.

from blogifier.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.