As per my proposal, the 5th week was decided on working on improving UI of social elements and adding improved search functionality for models and users in OGV. The search was thought to be implemented using package art1sec8:fuse
. But my notifications panel and share functionality isn't complete yet. So would be completing that first before working on this week's work.
Still thinking about ideas for implementing share functionality. I went to facebook to take a break from OGV. And saw a side ticker that showed recent activity of people I am following. IDEA! How about if I create a similar thing to show the shared models. For this moment, to complete share functionality, later on we can work on showing shared models in profile page and newsfeed.
Created a new template named shareTickr
to show models shared by users one is currently following.
Since notification panel was almost complete, I started working on finding ways to utilize the values stored in SharedModels
collection.
A simple idea that came in my mind was to merge two cursors of different collection. This means merging two variables somewhat similar to a and b defined below.
a = ModelFiles.find(); b = SharedModels.find();
After some search, and reading stack overflow answers, it didn't seem approachable. What could be done was to merge an array of objects of both results.
The main motive behind merging cursor variables was to avoid rewriting different template for shared models and using the existing code to do so. But this wasn't possible with merged array of result objects.
Today I couldn't work much. I had to pay my semester fees, and the queue was endless :P
However after almost an entire day spent outside, I found time to work in evening. Added final touchups to notification panel.
It came to me, that if I myself love my own model, I get a notification like "Super User loved Super User's model. This doesn't seem right, so fixed it with simple if condition to throw notification only when current User is not the same as owner of the model
Worked on UI of notification panel. I designed the basic idea in my proposal, tried to implement the same.