-
Notifications
You must be signed in to change notification settings - Fork 573
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
#1017 : Adding visible announcements button for easy visibility #1022
Conversation
@tomahawk-pilot I've tested it locally, if that helps. |
@subins2000 is verified |
@biswaz please verify and merge this |
This satisfies #1017 with hashtags that can be cleared and added while adding a new announcement - |
@jojurajan I've looked at them already. My PR covers all of it and a little more and unfortunately renders #1027 superfluous. I really appreciate his work though :) |
@tomahawk-pilot This still hasn't been merged no? |
@subins2000 Surprising. Do you have my complete code? Have migrations been rerun? |
@abhiramr Never mind. It works. It didn't work cause no tags were added. Note to sysadmin : Make sure atleast one announcement item has a tag after merging this, otherwise the whole page will fail |
@subins2000 Thanks for this test. Will try to add a case for 0 tags. Ideally shouldn't fail because of no data. |
is the model modified to add the tags |
@tomahawk-pilot Yes it is. |
@tomahawk-pilot yes, the model has been modified by @abhiramr |
There seems to be a conflict now |
#Get unique hashtags from items in DB | ||
def get_hashtags(announcement_obj): | ||
hashtags_str = "" | ||
for i in (announcement_obj.objects.all().values_list('hashtags', flat=True)): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are you converting a list into a string and then back into a list again ?
for i in (announcement_obj.objects.all().values_list('hashtags', flat=True)): | ||
if i !='': | ||
hashtags_str = hashtags_str +","+i | ||
hashtags = list(set([j.strip() for j in hashtags_str.strip(',').split(',')])) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
similarly list into a set and then into a list again
I'll give you reasons in a bit. For now can you edit any single announcement with a tag? I see a 500 on the page. @biswaz |
@abhiramr Yeah I was in the process of doing it. It's done now. We could've actually used the taggit lib. But if it works.. it works :) |
How about using a plugin like bootstrap-tagsinput along with typeahead for the tag input field. https://bootstrap-tagsinput.github.io/bootstrap-tagsinput/examples/ see the example with typeahead. Make sure that it doesn't compromise the UX on small screens |
Issue Reference
This PR addresses the Issue : Fixes part of #1017
#1017
Summary
dded new Red button for Announcements on top for easy access and visibility per #1017 .