Skip to content
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

Merged
merged 3 commits into from
Apr 9, 2021
Merged

Conversation

imajit
Copy link
Contributor

@imajit imajit commented Mar 2, 2021

Fixes #9232
I have added the code for setting dates for events and also moved the script to its javascript file.
datepicker

@gitpod-io
Copy link

gitpod-io bot commented Mar 2, 2021

if(eventDate!== null)
{
addTag("date:"+eventDate.val());
alert("Event date has been added");
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unexpected alert.

Copy link
Member

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
Copy link

codecov bot commented Mar 2, 2021

Codecov Report

❗ No coverage uploaded for pull request base (main@0908bfd). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #9256   +/-   ##
=======================================
  Coverage        ?   49.75%           
=======================================
  Files           ?       98           
  Lines           ?     6050           
  Branches        ?        0           
=======================================
  Hits            ?     3010           
  Misses          ?     3040           
  Partials        ?        0           

@jywarren
Copy link
Member

jywarren commented Mar 2, 2021

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!

@jywarren
Copy link
Member

jywarren commented Mar 9, 2021

Hi, just checking if you've gotten stuck on this at all, or if I could help in any way? Thanks!

@imajit imajit force-pushed the datepicker-for-notes branch from 26515d3 to dc445d2 Compare March 10, 2021 04:42
@imajit
Copy link
Contributor Author

imajit commented Mar 10, 2021

Hi, just checking if you've gotten stuck on this at all, or if I could help in any way? Thanks!

Hi! I have added the helper text, but the toast appears all the time instead of when ('.toast').toast('show') is called. Not sure where I'm going on wrong 😕

@@ -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>
Copy link
Member

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!!!

Add date to your awesome event in this box
</small>

<!-- <div class="toast" role="alert" aria-live="assertive" aria-atomic="true">
Copy link
Member

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!!!

@imajit imajit force-pushed the datepicker-for-notes branch from dc445d2 to ea2bd93 Compare March 17, 2021 19:43
@codeclimate
Copy link

codeclimate bot commented Mar 17, 2021

Code Climate has analyzed commit ea2bd93 and detected 0 issues on this pull request.

View more on Code Climate.

@imajit
Copy link
Contributor Author

imajit commented Mar 17, 2021

datepicker2
I used jquery instead of bootstrap for the toast message

@cesswairimu cesswairimu requested review from jywarren and noi5e March 30, 2021 13:17
@jywarren jywarren merged commit 017789d into publiclab:main Apr 9, 2021
@jywarren
Copy link
Member

jywarren commented Apr 9, 2021

This is really nice. Thanks so much!!!!

reginaalyssa pushed a commit to reginaalyssa/plots2 that referenced this pull request Oct 16, 2021
* Added Datepicker for events

* Added help text

* added toast message

Co-authored-by: imajit <ajit.171it233@nitk.edu.in>
billymoroney1 pushed a commit to billymoroney1/plots2 that referenced this pull request Dec 28, 2021
* Added Datepicker for events

* Added help text

* added toast message

Co-authored-by: imajit <ajit.171it233@nitk.edu.in>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Calendar "datepicker" integration as tagging widget or wizard for notes
2 participants