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.

31 lines
764 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. let error = null;
  8. function deletePeriod() {
  9. stufflog.deletePeriod(period.id).then(() => {
  10. modal.close();
  11. }).catch(err => {
  12. error = err.message || err;
  13. console.warn(err);
  14. });
  15. }
  16. </script>
  17. <ModalFrame title={`Remove ${period.name}`} error={error} closable on:close={() => modal.close()}>
  18. <form on:submit|preventDefault={() => deletePeriod()}>
  19. <p>
  20. Are you sure you want to remove period <b>{period.name}</b>?
  21. </p>
  22. <hr />
  23. <button type="submit">Yes, do as I say</button>
  24. </form>
  25. </ModalFrame>