Browse Source

Improved bluemind display and added ent webview screen

keplyx 4 years ago
parent
commit
b62ad1fd4a

+ 6
- 1
components/Sidebar.js View File

@@ -48,7 +48,7 @@ export default class SideBar extends React.Component<Props, State> {
48 48
             {
49 49
                 name: "Amicale",
50 50
                 route: "AmicaleScreen",
51
-                icon: "web",
51
+                icon: "alpha-a-box",
52 52
             },
53 53
             {
54 54
                 name: "Élus Étudiants",
@@ -75,6 +75,11 @@ export default class SideBar extends React.Component<Props, State> {
75 75
                 icon: "email",
76 76
             },
77 77
             {
78
+                name: i18n.t('screens.ent'),
79
+                route: "EntScreen",
80
+                icon: "notebook",
81
+            },
82
+            {
78 83
                 name: i18n.t('screens.availableRooms'),
79 84
                 route: "AvailableRoomScreen",
80 85
                 icon: "calendar-check",

+ 2
- 0
navigation/AppNavigator.js View File

@@ -14,6 +14,7 @@ import AmicaleScreen from "../screens/Websites/AmicaleScreen";
14 14
 import WiketudScreen from "../screens/Websites/WiketudScreen";
15 15
 import ElusEtudScreen from "../screens/Websites/ElusEtudScreen";
16 16
 import BlueMindScreen from "../screens/Websites/BlueMindScreen";
17
+import EntScreen from "../screens/Websites/EntScreen";
17 18
 import AvailableRoomScreen from "../screens/Websites/AvailableRoomScreen";
18 19
 import DebugScreen from '../screens/DebugScreen';
19 20
 import {fromRight} from "react-navigation-transitions";
@@ -37,6 +38,7 @@ function createAppContainerWithInitialRoute(initialRoute: string) {
37 38
                 WiketudScreen: {screen: WiketudScreen},
38 39
                 ElusEtudScreen: {screen: ElusEtudScreen},
39 40
                 BlueMindScreen: {screen: BlueMindScreen},
41
+                EntScreen: {screen: EntScreen},
40 42
                 AvailableRoomScreen: {screen: AvailableRoomScreen},
41 43
                 ProxiwashAboutScreen: {screen: ProxiwashAboutScreen},
42 44
                 ProximoAboutScreen: {screen: ProximoAboutScreen},

+ 4
- 5
screens/Websites/BlueMindScreen.js View File

@@ -12,21 +12,20 @@ type Props = {
12 12
 
13 13
 const URL = 'https://etud-mel.insa-toulouse.fr/webmail/';
14 14
 
15
-const CUSTOM_CSS_GENERAL = '';
15
+const CUSTOM_CSS_GENERAL = 'https://srv-falcon.etud.insa-toulouse.fr/~amicale_app/custom_css/bluemind/customMobile.css';
16 16
 
17 17
 
18 18
 /**
19 19
  * Class defining the app's planex screen.
20 20
  * This screen uses a webview to render the planex page
21 21
  */
22
-export default class AmicaleScreen extends React.Component<Props> {
22
+export default class BlueMindScreen extends React.Component<Props> {
23 23
 
24 24
     customInjectedJS: string;
25 25
 
26 26
     constructor() {
27 27
         super();
28 28
         this.customInjectedJS =
29
-            '$(document).ready(function() {' +
30 29
             '$("head").append(\'<meta name="viewport" content="width=device-width, initial-scale=1.0">\');' +
31 30
             '$("head").append(\'<link rel="stylesheet" href="' + CUSTOM_CSS_GENERAL + '" type="text/css"/>\');true;';
32 31
     }
@@ -41,10 +40,10 @@ export default class AmicaleScreen extends React.Component<Props> {
41 40
                         url: URL,
42 41
                         icon: '',
43 42
                         name: '',
44
-                        customJS: ''
43
+                        customJS: this.customInjectedJS
45 44
                     },
46 45
                 ]}
47
-                headerTitle={'Mails BlueMind'}
46
+                headerTitle={i18n.t('screens.bluemind')}
48 47
                 hasHeaderBackButton={true}
49 48
                 hasSideMenu={false}/>
50 49
         );

+ 91
- 0
screens/Websites/EntScreen.js View File

@@ -0,0 +1,91 @@
1
+// @flow
2
+
3
+import * as React from 'react';
4
+import ThemeManager from "../../utils/ThemeManager";
5
+import WebViewScreen from "../../components/WebViewScreen";
6
+import i18n from "i18n-js";
7
+
8
+type Props = {
9
+    navigation: Object,
10
+}
11
+
12
+
13
+const URL = 'https://ent.insa-toulouse.fr/';
14
+
15
+const CUSTOM_CSS_GENERAL = 'https://srv-falcon.etud.insa-toulouse.fr/~amicale_app/custom_css/ent/customMobile.css';
16
+
17
+// let stylesheet = document.createElement('link');
18
+// stylesheet.type = 'text/css';
19
+// stylesheet.rel = 'stylesheet';
20
+// stylesheet.href = 'https://srv-falcon.etud.insa-toulouse.fr/~amicale_app/custom_css/ent/customMobile.css';
21
+// let mobileSpec = document.createElement('meta');
22
+// mobileSpec.name = 'viewport';
23
+// mobileSpec.content = 'width=device-width, initial-scale=1.0';
24
+// document.getElementsByTagName('head')[0].appendChild(mobileSpec);
25
+// // document.getElementsByTagName('head')[0].appendChild(stylesheet);
26
+// document.getElementsByClassName('preference-items')[0].style.display = 'none';
27
+// document.getElementsByClassName('logoInsa')[0].style.display = 'none';
28
+// document.getElementsByClassName('logoPress')[0].style.display = 'none';
29
+// document.getElementsByClassName('ent')[0].style.display = 'none';
30
+// document.getElementById('portal-page-header').style.margin = 0;
31
+// document.querySelectorAll('.uportal-navigation-category').forEach(element => {
32
+//     element.style.cssText = "width: 100%; display: flex; height: 50px;";
33
+//     if (element.children.length > 0)
34
+//         element.children[0].style.margin = 'auto';
35
+// });
36
+// true;
37
+
38
+
39
+/**
40
+ * Class defining the app's ent screen.
41
+ * This screen uses a webview to render the ent page
42
+ */
43
+export default class EntScreen extends React.Component<Props> {
44
+
45
+    customInjectedJS: string;
46
+
47
+    constructor() {
48
+        super();
49
+        this.customInjectedJS =
50
+            'let stylesheet = document.createElement(\'link\');\n' +
51
+            'stylesheet.type = \'text/css\';\n' +
52
+            'stylesheet.rel = \'stylesheet\';\n' +
53
+            'stylesheet.href = \'' + CUSTOM_CSS_GENERAL +'\';\n' +
54
+            'let mobileSpec = document.createElement(\'meta\');\n' +
55
+            'mobileSpec.name = \'viewport\';\n' +
56
+            'mobileSpec.content = \'width=device-width, initial-scale=1.0\';\n' +
57
+            'document.getElementsByTagName(\'head\')[0].appendChild(mobileSpec);\n' +
58
+            'document.getElementsByTagName(\'head\')[0].appendChild(stylesheet);\n' +
59
+            'document.getElementsByClassName(\'preference-items\')[0].style.display = \'none\';\n' +
60
+            'document.getElementsByClassName(\'logoInsa\')[0].style.display = \'none\';\n' +
61
+            'document.getElementsByClassName(\'logoPress\')[0].style.display = \'none\';\n' +
62
+            'document.getElementsByClassName(\'ent\')[0].style.display = \'none\';\n' +
63
+            'document.getElementById(\'portal-page-header\').style.margin = 0;\n' +
64
+            'document.querySelectorAll(\'.uportal-navigation-category\').forEach(element => {\n' +
65
+            '    element.style.cssText = "width: 100%; display: flex; height: 50px;";\n' +
66
+            '    if (element.children.length > 0)\n' +
67
+            '        element.children[0].style.margin = \'auto\';\n' +
68
+            '});' +
69
+            'true;';
70
+    }
71
+
72
+    render() {
73
+        const nav = this.props.navigation;
74
+        return (
75
+            <WebViewScreen
76
+                navigation={nav}
77
+                data={[
78
+                    {
79
+                        url: URL,
80
+                        icon: '',
81
+                        name: '',
82
+                        customJS: this.customInjectedJS
83
+                    },
84
+                ]}
85
+                headerTitle={i18n.t('screens.ent')}
86
+                hasHeaderBackButton={true}
87
+                hasSideMenu={false}/>
88
+        );
89
+    }
90
+}
91
+

+ 2
- 1
translations/en.json View File

@@ -8,11 +8,12 @@
8 8
     "settings": "Settings",
9 9
     "availableRooms": "Available rooms",
10 10
     "bluemind": "INSA Mails",
11
+    "ent": "INSA ENT",
11 12
     "about": "About",
12 13
     "debug": "Debug"
13 14
   },
14 15
   "sidenav": {
15
-    "divider1": "Useful websites",
16
+    "divider1": "Student websites",
16 17
     "divider2": "Services",
17 18
     "divider3": "Personalisation"
18 19
   },

+ 2
- 1
translations/fr.json View File

@@ -8,11 +8,12 @@
8 8
     "settings": "Paramètres",
9 9
     "availableRooms": "Salles dispo",
10 10
     "bluemind": "Mails INSA",
11
+    "ent": "ENT INSA",
11 12
     "about": "À Propos",
12 13
     "debug": "Debug"
13 14
   },
14 15
   "sidenav": {
15
-    "divider1": "Sites utiles",
16
+    "divider1": "Sites étudiants",
16 17
     "divider2": "Services",
17 18
     "divider3": "Personnalisation"
18 19
   },

Loading…
Cancel
Save