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

[hi] L10n of Feedback section #665

Merged
merged 3 commits into from
Mar 30, 2022

Conversation

Shivansh-yadav13
Copy link
Contributor

@netlify
Copy link

netlify bot commented Mar 29, 2022

Deploy Preview for cncfglossary ready!

Name Link
🔨 Latest commit 37d52b7
🔍 Latest deploy log https://app.netlify.com/sites/cncfglossary/deploys/6243ce381b653700084a73ae
😎 Deploy Preview https://deploy-preview-665--cncfglossary.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@jihoon-seo
Copy link
Collaborator

Preview: https://deploy-preview-665--cncfglossary.netlify.app/hi/devops/

To take effect, please add layouts/partials/feedback.html file to this PR, as the same as this.

Sorry for the previous insufficient guide 😅

[layouts/partials/feedback.html file to add]

<style>
  .feedback--answer {
    display: inline-block;
  }
  .feedback--answer-no {
    margin-left: 1em;
  }
  .feedback--response {
    display: none;
    margin-top: 1em;
  }
  .feedback--response__visible {
    display: block;
  }
</style>
<div class="d-print-none">
<h2 class="feedback--title">{{ T "feedback_title" }}</h2>
<p class="feedback--question">{{ T "feedback_question" }}</p>
<button class="btn btn-primary mb-4 feedback--answer feedback--answer-yes">{{ T "feedback_answer_yes" }}</button>
<button class="btn btn-primary mb-4 feedback--answer feedback--answer-no">{{ T "feedback_answer_no" }}</button>
<p class="feedback--response feedback--response-yes">
  {{ .yes | safeHTML }}
</p>
<p class="feedback--response feedback--response-no">
  {{ .no | safeHTML }}
</p>
</div>
<script>
  const yesButton = document.querySelector('.feedback--answer-yes');
  const noButton = document.querySelector('.feedback--answer-no');
  const yesResponse = document.querySelector('.feedback--response-yes');
  const noResponse = document.querySelector('.feedback--response-no');
  const disableButtons = () => {
    yesButton.disabled = true;
    noButton.disabled = true;
  };
  const sendFeedback = (value) => {
    if (typeof ga !== 'function') return;
    const args = {
      command: 'send',
      hitType: 'event',
      category: 'Helpful',
      action: 'click',
      label: window.location.pathname,
      value: value
    };
    ga(args.command, args.hitType, args.category, args.action, args.label, args.value);
  };
  yesButton.addEventListener('click', () => {
    yesResponse.classList.add('feedback--response__visible');
    disableButtons();
    sendFeedback(1);
  });
  noButton.addEventListener('click', () => {
    noResponse.classList.add('feedback--response__visible');
    disableButtons();
    sendFeedback(0);
  });
</script>

@Shivansh-yadav13
Copy link
Contributor Author

@jihoon-seo I was adding it previously but I wasn't sure to add it after referencing the #519, it might already exist there mb 😅

Copy link
Collaborator

@jihoon-seo jihoon-seo left a comment

Choose a reason for hiding this comment

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

@Garima-Negi @sayantani11 @anubha-v-ardhan @jayesh-srivastava Please review this PR, and perform merge if looks good. 😊

Preview: https://deploy-preview-665--cncfglossary.netlify.app/hi/devops/
image

  • Recommended merge method: 'Squash and merge'

layouts/partials/feeback.html Outdated Show resolved Hide resolved
@Garima-Negi
Copy link
Collaborator

LGTM!

@Garima-Negi Garima-Negi merged commit 254fe66 into cncf:dev-hi Mar 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lang/hi for Hindi
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants