Download pool/shard000/JavaScript/0000077_translations.js from Variable-role/sajaniemi_variable_dataset_large: direct link, hf CLI and curl.
- Browser
- Download file 814 Bytes
-
https://huggingface.co/datasets/Variable-role/sajaniemi_variable_dataset_large/resolve/main/pool/shard000/JavaScript/0000077_translations.js
- Command line
-
hf download hf://datasets/Variable-role/sajaniemi_variable_dataset_large/pool/shard000/JavaScript/0000077_translations.js
-
curl -L -o 0000077_translations.js https://huggingface.co/datasets/Variable-role/sajaniemi_variable_dataset_large/resolve/main/pool/shard000/JavaScript/0000077_translations.js
814 Bytes
| import { Template } from 'meteor/templating' | |
| import { Translations } from '/imports/api/indexDB' | |
| import { FlowRouter } from 'meteor/ostrio:flow-router-extra' | |
| import './translations.html' | |
| const nextTranslation = (id) => { | |
| let sample = _.sample(Translations.find({ | |
| _id: { | |
| $ne: id | |
| }, | |
| status: 'new', | |
| 'votes.userId': { | |
| $ne: Meteor.userId() | |
| } | |
| }).fetch()) | |
| setTimeout(() => { | |
| if (!sample) { | |
| FlowRouter.go('/moderator/translations') | |
| } else { | |
| FlowRouter.go(`/moderator/translations/${sample._id}`) | |
| } | |
| }, 300) | |
| } | |
| export { nextTranslation } | |
| Template.modTranslations.onCreated(function() { | |
| this.autorun(() => { | |
| SubsCache.subscribe('translations') | |
| }) | |
| }) | |
| Template.modTranslations.helpers({ | |
| nextTranslation: () => nextTranslation() | |
| }) |