Speiseplan der Mensen der Georg-August-Universität Göttingen https://mensa.schneider-hosting.de
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.

98 lines
2.1 KiB

7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
  1. <template>
  2. <div id="app">
  3. <h1>Essen in Göttingen</h1>
  4. Wo? <select v-model="where">
  5. <option v-for="mensa in mensen" :value="mensa.url">{{mensa.name}}</option>
  6. </select>
  7. Wann? <select v-model="when">
  8. <option v-for="day in days" :value="day" :key="day">{{dayOfWeek[day]}}</option>
  9. </select>
  10. <router-view></router-view>
  11. <footer>
  12. <hr>
  13. <span>
  14. Developed by <a href="https://webschneider.org">webschneider.org</a>
  15. &copy; {{ new Date().getFullYear() }}
  16. </span>
  17. <span><a href="https://webschneider.org/impress">Impressum</a></span>
  18. </footer>
  19. </div>
  20. </template>
  21. <script>
  22. import Mensen from '@/lib/Mensen.js'
  23. export default {
  24. name: 'app',
  25. data () {
  26. return {
  27. menu: {},
  28. mensen: Mensen,
  29. days: [1, 2, 3, 4, 5, 6],
  30. dayOfWeek: {
  31. 1: 'Montag',
  32. 2: 'Dienstag',
  33. 3: 'Mittwoch',
  34. 4: 'Donnerstag',
  35. 5: 'Freitag',
  36. 6: 'Samstag'
  37. },
  38. where: 'zentralmensa',
  39. when: '' + (new Date().getDay() || 1)
  40. }
  41. },
  42. watch: {
  43. 'where': 'updateRoute',
  44. 'when': 'updateRoute'
  45. },
  46. methods: {
  47. updateRoute () {
  48. this.$router.push(`/${this.where}/${this.when}`)
  49. window.localStorage.setItem('where', this.where)
  50. }
  51. },
  52. filters: {
  53. noBreak (value) {
  54. return value.replace(/\s/g, '\u00a0')
  55. }
  56. },
  57. computed: {
  58. today () {
  59. return '' + new Date().getDay()
  60. }
  61. },
  62. created () {
  63. this.where = window.localStorage.getItem('where') || 'zentralmensa'
  64. }
  65. }
  66. </script>
  67. <style src="./assets/base.css"></style>
  68. <style src="./assets/links.css"></style>
  69. <style>
  70. #app {
  71. font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  72. -webkit-font-smoothing: antialiased;
  73. -moz-osx-font-smoothing: grayscale;
  74. text-align: center;
  75. color: #2c3e50;
  76. font-size: 16px;
  77. max-width: 30em;
  78. margin: 0 auto;
  79. }
  80. footer{
  81. margin: 1em 0;
  82. }
  83. nav>a{
  84. margin: 0.3em;
  85. wrap: no-wrap;
  86. }
  87. .router-link-active:before{
  88. content: '>';
  89. }
  90. .router-link-active:after{
  91. content: '<';
  92. }
  93. </style>