Repository
https://github.com/dimitrisp2/AristotleApp
About Aristotle App
Aristotle App will help the translation teams of have a more uniformed and centralised method to keep track of their progress and tasks. Most of the teams are using spreadsheets to manage their work, but if such spreadsheets are not properly managed, they can become a burden instead of a help (I know as I'm part of the Greek Translations Team).
It was originally created to help the Greek Team's activities in the Translation category, as well as managing the community account .
Overview
In the past week some major work was done on the project. In 16 commits since the previous post, the major additions were the "Weekly Reports" section and the "Add contribution" form.
I also implemented a couple of changes, as suggested by in his previous review.I didn't to implement all of
suggestions due to lack of time, as I was super busy the past week, but I'll do so as soon as possible.
Let's have a look on the most important things I've done in the app in the past week (as with the previous contribution post, I am marking each addition/change on the project with the respective commits on Github. Some commits may not be found here, as the post is very big for my taste and/or they are not worthy of mention.)
Add new Contribution Post routine
In several commits over the week, I've implemented the following routine to add a contribution to the database. Let's see how it works:
The user clicks on the "Add Contribution" link, and a modal window appears and asks for a Steemit.com link
As soon as the user presses "Submit", the app is fetching a few details from the Blockchain and shows a confirmation form to make sure all details are correct. There is also a check for duplicate submission to the DB, so if someone tries to add a contribution that was already in the DB, an error message should appear.
If the user confirms that all details are correct, the contribution post is added to the database.
The confirmation form (and therefore, the addition to the database) only happens if the post author has a valid TR/LM role in the team, as defined in the App's database. If they don't have access, the app returns an error message and stops the routine there.
Related commits: [ae6f721], [27bbb49], [f699b48], [37faa81], [d27c2f9]
Weekly Reports
As Language Moderators, we have to fill out a weekly report for the contributions we've reviewed, that contains various messages for each contribution, as well as for the week overall. I've talked with about this and since it's not 100% sure it will be used by everyone, the final implementation will also include a spreadsheet generated by the app, that will be updated regularly, to make sure that we won't disrupt the way things work so far
However, since we also want to go back from time to time and check out how the translators are doing etc, I've started implementing it in the same manner the contributions are handled in the App.
The only things that are working right now, are the weekly report list and single report viewing.
This is the Single Report view. There are empty fields as they contain sensitive data and they are not supposed to be seen in public. Some notes on this view:
- the "Project" field will contain the actual translation part number when we everything is imported correctly to the DB.
- The red "X" in the "Submit" column, means the post hasn't been upvoted by
. If it was voted, it would turn to a Green checkmark.
- The last column will have actions, to edit the part number, comment, wordcount & score.
Related commits: [51391ff], [3e05f30], [15a8032], [c26be19], [f73a08d]
Other fixes/changes
Function GetUsername()
There was already a function to get a user's ID in the database, from their username. However, we also need the opposite (get a username from an ID).
I implemented GetUsername() that accepts one parameter, an integer number, that will be used to quickly find out the corresponding username.
Related commit: [f73a08d]
Fix and add more parameters to GetContributionList()
GetContributionList() was changed twice in the past week, in order to be used in a more broad manner. The previous function declaration was:
function GetContributionList($user = NULL, $project = NULL, $from = NULL, $to = NULL, $voted = NULL, $reviewed = NULL, $title = NULL){...}
And the current function declaration is:
function GetContributionList($user = NULL, $project = NULL, $from = NULL, $to = NULL, $voted = NULL, $reviewed = NULL, $proofreader = NULL, $title = NULL, $weeklyreport = NULL){...}
By setting the parameters of "proofreader" and "weeklyreport" to the respective needed values, the table will show the score/wordcount/contribution comment as well. If the declaration gets bigger (with more parameters), I'll probably modify it to accept one single parameter (which would be an array) and parse it inside the function as it is already ridiculously long! For example, if I wanted to get a weekly report's contribution list, I would call it as
$contributions = GetContributionList(NULL, NULL, $weekstart, $weekend, NULL, NULL, $proofreader, NULL, true);
Also a bug was fixed on GetContributionList() that wouldn't show the list if 2 or more fields were filled on the Contribution "Filter Results" form.
Related commits: [84ce88e], [f73a08d]
Menu Reworked & Bug fix
The Menu now has some kind of ACL, that will show links depending on the actual level of access of each user. There was also a bug that would show many error messages on the main page and the menu if no user was logged-in. This happened with a change in the code, while implementing the GetMainPageContent() and GetMenu() in the past.
Related commits: [3e05f30], [820df65]
Combining of IFs
As (whom I can't thank enough for his great reviews so far) noted in his previous review, fewer IFs/ELSEs could be used in certain functions. I only got to implement this on GetMenu() and GetMainPageContent(), but I'll get on the others in the coming days!
Related commit: [23eca0d]
Fixes/To Do in the next few days
Among other things, these are the things I want to do as soon as possible.
- The "Add Contribution" form, needs a better way to check the contribution links. If a user tries to add a contribution with "www.steemit.com", instead of "steemit.com" as the domain, as well as use "http" instead of "https", the duplicate check won't work
- Pages need an actual ACL check. Right now, if a user knows the URL of a page, they can navigate to it manually and see everything
- Add forms to submit the weekly report's and each contribution's comment
Previous updates/reports:
- An app to supplement the Utopian Translation Teamwork [2018-10-15]
- Dynamic NavBar, Contributions List, Project View page, and more... [2018-10-22]
How to contribute?
You can find me on Utopian's discord if you want to talk. You can also open a pull request on github if you have something to add/fix.
Before opening a pull request, please have a look on the project's README.md.