Browse Source

Add an About view

Phyks (Lucas Verney) 2 years ago
parent
commit
975907916d
7 changed files with 1246 additions and 12 deletions
  1. 21
    0
      LICENSE.md
  2. 8
    0
      src/components/NavigationDrawer.vue
  3. 14
    5
      src/i18n/en/index.js
  4. 12
    6
      src/router/index.js
  5. 26
    0
      src/views/About.vue
  6. 1
    1
      src/views/Preferences.vue
  7. 1164
    0
      static/openfoodfacts.svg

+ 21
- 0
LICENSE.md View File

@@ -0,0 +1,21 @@
1
+The MIT License (MIT)
2
+
3
+Copyright (c) 2017 Phyks (Lucas Verney)
4
+
5
+Permission is hereby granted, free of charge, to any person obtaining a copy
6
+of this software and associated documentation files (the "Software"), to deal
7
+in the Software without restriction, including without limitation the rights
8
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+copies of the Software, and to permit persons to whom the Software is
10
+furnished to do so, subject to the following conditions:
11
+
12
+The above copyright notice and this permission notice shall be included in all
13
+copies or substantial portions of the Software.
14
+
15
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+SOFTWARE.

+ 8
- 0
src/components/NavigationDrawer.vue View File

@@ -38,6 +38,14 @@
38 38
                     <v-list-tile-title>{{ $t('navigation.preferences') }}</v-list-tile-title>
39 39
                 </v-list-tile-content>
40 40
             </v-list-tile>
41
+            <v-list-tile :to="{ name: 'About' }">
42
+                <v-list-tile-action>
43
+                    <v-icon>info</v-icon>
44
+                </v-list-tile-action>
45
+                <v-list-tile-content>
46
+                    <v-list-tile-title>{{ $t('navigation.about') }}</v-list-tile-title>
47
+                </v-list-tile-content>
48
+            </v-list-tile>
41 49
         </v-list>
42 50
     </v-navigation-drawer>
43 51
 </template>

+ 14
- 5
src/i18n/en/index.js View File

@@ -1,16 +1,25 @@
1 1
 export default {
2
-    navigation: {
3
-        home: 'Home',
4
-        scan: 'Scan',
5
-        manualBarcode: 'Manual barcode',
6
-        preferences: 'Preferences',
2
+    about: {
3
+        appDescription: 'InFood is your grocery companion app, to help you scan quickly facts about products you are about to buy.',
4
+        licenseDescription: 'It is available under a {MITLicense} and source code is hosted by {Github}. Please report any bugs {there}.',
5
+        MITLicense: 'MIT license',
6
+        OpenFoodFactsDescription: 'Products data is provided by {OpenFoodFacts} under {OpenDatabaseLicense}.',
7
+        OpenDatabaseLicense: 'Open Database License',
7 8
     },
8 9
     misc: {
9 10
         or: 'or',
11
+        there: 'there',
10 12
     },
11 13
     manualBarcode: {
12 14
         heading: 'Which barcode are you looking for?',
13 15
         EAN13Barcode: 'EAN13 barcode',
14 16
         go: 'Go!',
15 17
     },
18
+    navigation: {
19
+        home: 'Home',
20
+        scan: 'Scan',
21
+        manualBarcode: 'Manual barcode',
22
+        preferences: 'Preferences',
23
+        about: 'About',
24
+    },
16 25
 };

+ 12
- 6
src/router/index.js View File

@@ -1,27 +1,28 @@
1 1
 import Vue from 'vue';
2 2
 import Router from 'vue-router';
3 3
 
4
+import About from '@/views/About';
4 5
 import Home from '@/views/Home';
5 6
 import ManualBarcode from '@/views/ManualBarcode';
6
-import Scan from '@/views/Scan';
7 7
 import Product from '@/views/Product';
8 8
 import Preferences from '@/views/Preferences';
9
+import Scan from '@/views/Scan';
9 10
 
10 11
 Vue.use(Router);
11 12
 
12 13
 export default new Router({
13 14
     routes: [
14 15
         {
16
+            path: '/about',
17
+            name: 'About',
18
+            component: About,
19
+        },
20
+        {
15 21
             path: '/',
16 22
             name: 'Home',
17 23
             component: Home,
18 24
         },
19 25
         {
20
-            path: '/scan',
21
-            name: 'Scan',
22
-            component: Scan,
23
-        },
24
-        {
25 26
             path: '/barcode',
26 27
             name: 'ManualBarcode',
27 28
             component: ManualBarcode,
@@ -36,5 +37,10 @@ export default new Router({
36 37
             name: 'Preferences',
37 38
             component: Preferences,
38 39
         },
40
+        {
41
+            path: '/scan',
42
+            name: 'Scan',
43
+            component: Scan,
44
+        },
39 45
     ],
40 46
 });

+ 26
- 0
src/views/About.vue View File

@@ -0,0 +1,26 @@
1
+<template>
2
+    <v-container fluid>
3
+        <p>
4
+            {{ $t('about.appDescription') }}
5
+        </p>
6
+        <i18n path="about.licenseDescription" tag="p">
7
+            <a href="https://github.com/Phyks/Food/blob/master/LICENSE.md" place="MITLicense">{{ $t('about.MITLicense') }}</a>
8
+            <a href="https://github.com/phyks/food" place="Github">Github</a>
9
+            <a href="https://github.com/phyks/food/issues" place="there">{{ $t('misc.there') }}</a>
10
+        </i18n>
11
+        <i18n path="about.OpenFoodFactsDescription" tag="p">
12
+            <a href="https://world.openfoodfacts.org/" place="OpenFoodFacts">OpenFoodFacts</a>
13
+            <a href="http://opendatacommons.org/licenses/odbl/1.0/" place="OpenDatabaseLicense">{{ $t('about.OpenDatabaseLicense') }}</a>
14
+        </i18n>
15
+        <p class="text-xs-center"><img src="/static/openfoodfacts.svg"/></p>
16
+    </v-container>
17
+</template>
18
+
19
+<script>
20
+export default {
21
+    created() {
22
+        this.$store.dispatch('setTitle', { title: this.$t('navigation.about') });
23
+        this.$store.dispatch('setBackgroundColor', { backgroundColor: '#F5F5F5' });
24
+    },
25
+};
26
+</script>

+ 1
- 1
src/views/Preferences.vue View File

@@ -7,7 +7,7 @@
7 7
 <script>
8 8
 export default {
9 9
     created() {
10
-        this.$store.dispatch('setTitle', { title: 'Preferences' });
10
+        this.$store.dispatch('setTitle', { title: this.$t('navigation.preferences') });
11 11
     },
12 12
 };
13 13
 </script>

+ 1164
- 0
static/openfoodfacts.svg
File diff suppressed because it is too large
View File