Closed brylie closed 2 years ago
I wouldn't delete account.js
file completely. For example, we need this section to display tabs:
el: '#account',
template: _.template($('#account-template').html()),
settingsTemplate: _.template($('#settings-template').html()),
sidebarTemplate: _.template($('#sidebar-template').html()),
// Account Tabs Templates
mycivisTemplate: _.template($('#my-civis-template').html()),
followersTemplate: _.template($('#followers-template').html()),
followingTemplate: _.template($('#following-template').html()),
myissuesTemplate: _.template($('#my-issues-template').html()),
// Partials
userCardTemplate: _.template($('.user-card-template').html()),
I know we want to simplify the project and we are heavily dependent on JS right now. For this reason, it would be great to remove js but we don't have enough resources so if we delete the JS codes we need the help of designers to launch the new design and it will take some time. instead of doing dramatic (removing account.js
file in this case) changes, my suggestion is to do everything step by step.
So let's not touch any JS files. If we need, we can write and replace the new JS implementations with the old ones. I can help with that.
I just see your new issue #1429. So we are on the same page. 😄
Let me paraphrase myself then. We can create a new accounts JS file from scratch. Then we can deal with other logic as user follow, unfollow, settings tabs, profile edit, etc. When we are done, we will remove the old JS file. After that, we will be ready to remove .less files and start using UI frameworks like bootstrap or tailwind. (Issue #1406)
In short, you don't have to delete account.js file in this PR because it will be a dramatic change.
This PR is in an early draft state, please give it a bit more time to shape up. Please also review the issue description for https://github.com/CiviWiki/OpenCiviWiki/issues/1151 to get an idea of what I intend to include in this pull request.
I firmly believe that Backbone JS harms the project by making it complicated to work with the code. I would instead create follow-up issues where we re-create the features using standard Django functionality while allowing the CiviWiki community, myself included, to take on those tasks. Hence, this pull request will remove some functionality while preserving relevant code for reuse when adding those features back in subsequent issues.
First of all, you did a great job here. That is really a huge effort. 😄
Nicely done, @brylie! Just one comment then I will approve it. 🥳
This pull request takes a step back, feature-wise, so we can take some steps forward. The JavaScript code is a significant blocker, so this pull request removes the blocking code/complexity.
My goal is to remove the
accounts.js
Backbone JS while preserving templates and view code. That way, we can re-implement the features as a community, possibly during Hacktoberfest :jack_o_lantern:Closes #1151
The work can now continue to reimplement the profile sections.
Changes
reverse_name
properties on foreign keysContinuing work
The work to improve the user profile and feed views will continue in the following epic #1429