-
Notifications
You must be signed in to change notification settings - Fork 9
frontend: Adding Resources
An angular material directive provides a modal form which contains three tabs. The directive is controlled entirely by one controller, which contains yet another controller.
Contributing a new resource to the library begins when a user clicks on the "Add Resource" button, a directive unto itself which, if the user has not logged in with the necessary github authentication, displays angular material's alert message. Otherwise, the user is provided with a modal three tabbed form.
The code for the form can be found in another directive. The first tab of the form provides the user with space to submit the resource link. The buttons guiding the user through the form are different directives at each tab.
Upon clicking to the next button from the first tab, the link is sent to the server whereupon OpenGraph software extracts and sends back meta-data to fill in the second tab of the form, resource information. Users can edit the title and summary description.
In the third and final tab, the user assigns to the new resource a category from the drop down list. Here, the user can also assign to the resource a number of custom tags which are saved in the database under a table entirely devoted to tags.