Plan stuff. Log stuff.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
888 B

4 years ago
  1. <script>
  2. import pluralize from "pluralize";
  3. import ModalFrame from "../components/ModalFrame";
  4. import modal from "../stores/modal";
  5. import stufflog from "../stores/stufflog";
  6. export let period = {};
  7. export let goal = {};
  8. export let activity = {};
  9. let error = null;
  10. function removePeriodLog() {
  11. stufflog.updatePeriod(period.id, {removeGoal: goal.id}).then(() => {
  12. modal.close();
  13. }).catch(err => {
  14. error = err.message || err;
  15. console.warn(err);
  16. });
  17. }
  18. </script>
  19. <ModalFrame title={`Remove ${period.name} Goal`} error={error} closable on:close={() => modal.close()}>
  20. <form on:submit|preventDefault={() => removePeriodLog()}>
  21. <p>
  22. Are you sure you want to remove <b>{activity.name}</b> goal from
  23. period <b>{period.name}</b>?
  24. </p>
  25. <hr />
  26. <button type="submit">Yes, do as I say</button>
  27. </form>
  28. </ModalFrame>