Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port threads app templates to Django template syntax #1152

Open
4 of 25 tasks
Tracked by #1129
brylie opened this issue Oct 20, 2021 · 33 comments
Open
4 of 25 tasks
Tracked by #1129

Port threads app templates to Django template syntax #1152

brylie opened this issue Oct 20, 2021 · 33 comments

Comments

@brylie
Copy link
Member

brylie commented Oct 20, 2021

We want to simplify the CiviWiki project by removing JavaScript SPA code in Backbone.js and using Django templates instead. We will work through the Backbone templates in the threads app to convert the template syntax from Backbone to Django. We want to maintain the visual styling. Below is a checklist of the relevant Backbone templates to be ported to complete this task.

Note: Backbone markup is written between {% verbatim %} and {% endverbatim %} template tags.

Task

Port the following template from Backbone to Django view/template syntax.

  • convert API views to Django views (if necessary)

    • new_thread
    • get_thread
    • get_civi
    • get_civis
    • get_responses
    • create_civi
    • rate_civi
    • edit_civi
    • delete_civi
    • edit_thread
    • upload_civi_image
    • upload_thread_image
  • threads app shouldn't use Django REST framework

    • remove threads/api.py file
  • threads app should contain only Class Based Views

    • convert Functıon Based Views to CBVs
    • convert ViewSets to CBVs
  • all templates in threads app should

    • work without any JavaScript (Backbone.js)
    • use only Django template syntax, such as {% for solution in solutions %}
  • all templates in threads app should not contain any

    • Backbone.js template syntax, such as {{# _.each(solutions, function (s) { }}
    • verbatim tags
    • backbone_templates block content
@sreejithliterally
Copy link

@brylie I would like to work on this issue, can I give it a try? Btw I'm a beginner

@brylie
Copy link
Member Author

brylie commented Oct 21, 2021

@sreejithdikru, sure. I'll assign you to the task. Please let us know if you have any difficulty with Backbone or Django templates. We can co-assign another person to the issue to assist.

@brylie brylie added this to the 2.0 milestone Oct 21, 2021
@wassafshahzad

This comment was marked as outdated.

@AmarDeepak

This comment was marked as outdated.

@brylie

This comment was marked as outdated.

@AmarDeepak

This comment was marked as outdated.

@edwardjimi

This comment was marked as outdated.

@brylie

This comment was marked as outdated.

@edwardjimi

This comment was marked as outdated.

@parimalakettymuthu

This comment was marked as outdated.

@brylie

This comment was marked as outdated.

@parimalakettymuthu

This comment was marked as outdated.

@brylie

This comment was marked as outdated.

@LexxLuey

This comment was marked as outdated.

@brylie

This comment was marked as outdated.

@LexxLuey

This comment was marked as outdated.

@brylie

This comment was marked as outdated.

@godfreyJo

This comment was marked as outdated.

@brylie

This comment was marked as outdated.

@LexxLuey

This comment was marked as outdated.

@LexxLuey

This comment was marked as outdated.

@godfreyJo

This comment was marked as outdated.

@abdz-128

This comment was marked as off-topic.

@brylie

This comment was marked as resolved.

@abdz-128

This comment was marked as resolved.

@ksharma20

This comment was marked as outdated.

@gorkemarslan
Copy link
Collaborator

I'd like to take over this task.

@gorkemarslan
Copy link
Collaborator

gorkemarslan commented Oct 18, 2022

@brylie, I will move accounts/feed.html file to threads app. Then I will port the template to Django template syntax. The template basically renders thread list, trending issues, draft threads, etc.

I am planning to create ThreadListView to render this template. In this case, I will rename the template file to thread_list.html or threads.html. I can also keep using FeedView. What do you think of the naming?

@brylie
Copy link
Member Author

brylie commented Oct 18, 2022

Thanks that will help. 😃

I'm heading to bed now, but I'll check for more comments ASAP.

@Nehemiah60
Copy link
Contributor

Hello, @brylie. I see this issue is still open. Also, I have gone through the codebase, and the issues have not been fixed yet. Can you assign me, please?

@Nehemiah60
Copy link
Contributor

Hello, @brylie. I think the only task is deleting the api.py file in the threads app. All the other tasks seem to be completed.

@brylie
Copy link
Member Author

brylie commented Feb 23, 2023

@gorkemarslan, can you confirm the status of this issue?

@Nehemiah60
Copy link
Contributor

I will take this @brylie. I will make the necessary changes where necessary

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment