-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Added Datepicker for events #9256
Conversation
app/assets/javascripts/notes.js
Outdated
if(eventDate!== null) | ||
{ | ||
addTag("date:"+eventDate.val()); | ||
alert("Event date has been added"); |
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.
Unexpected alert.
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.
Here perhaps instead we can use: https://getbootstrap.com/docs/4.4/components/toasts/ what do you think?
Codecov Report
@@ Coverage Diff @@
## main #9256 +/- ##
=======================================
Coverage ? 49.75%
=======================================
Files ? 98
Lines ? 6050
Branches ? 0
=======================================
Hits ? 3010
Misses ? 3040
Partials ? 0 |
Wow, this looks really impressive. Is there a way to add help text to show people that they must click the input box to select a date? Or to auto-open it? https://getbootstrap.com/docs/4.4/components/forms/#help-text Thank you so much! |
Hi, just checking if you've gotten stuck on this at all, or if I could help in any way? Thanks! |
26515d3
to
dc445d2
Compare
Hi! I have added the helper text, but the toast appears all the time instead of when |
@@ -87,6 +86,24 @@ | |||
</table> | |||
<% end %> | |||
|
|||
<% if current_user && (current_user.role == "admin" || current_user.role == "moderator" || current_user.id == @node.id || current_user.is_coauthor?(@node)) && @node.has_tag('event') %> | |||
<hr/> | |||
<p>This looks like an event. <span><button id="date-toggle" class="btn-outline-secondary btn-sm" data-toggle="tooltip" data-placement="right" title="Add Date"><i class="fa fa-calendar" aria-hidden="true"></i></button></span></p> |
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.
Would it be possible to tidy up the HTML here a bit before you complete this? Thanks!!!
app/views/notes/show.html.erb
Outdated
Add date to your awesome event in this box | ||
</small> | ||
|
||
<!-- <div class="toast" role="alert" aria-live="assertive" aria-atomic="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.
Hmm. Regarding hiding it initially, I played around with adding the CSS classes show
and fade
and found that 'toast fade show'
is visible but removing show
makes it invisible. Could you test that out? Maybe we start it without show
and it would then be hidden by default, and then if we try adding show
it appears?
Otherwise you could add style="display:none;"
and then just use jQuery's $('.my-toast').show()
. Could that work?
Also would you be able to share a screenshot once you get it working? Thanks a lot, I appreciate your work on this!!!
dc445d2
to
ea2bd93
Compare
Code Climate has analyzed commit ea2bd93 and detected 0 issues on this pull request. View more on Code Climate. |
This is really nice. Thanks so much!!!! |
* Added Datepicker for events * Added help text * added toast message Co-authored-by: imajit <ajit.171it233@nitk.edu.in>
* Added Datepicker for events * Added help text * added toast message Co-authored-by: imajit <ajit.171it233@nitk.edu.in>
Fixes #9232
I have added the code for setting dates for events and also moved the script to its javascript file.