File size: 1,837 Bytes
1da1c98
 
 
68fd913
 
 
 
 
 
 
 
 
 
1da1c98
68fd913
 
 
1da1c98
 
 
 
68fd913
 
 
 
 
 
 
 
b1fc4cc
68fd913
1da1c98
 
 
 
295d317
1da1c98
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
68fd913
2b93ee2
 
 
 
68fd913
1da1c98
 
68fd913
1da1c98
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
import scholarpy
import streamlit as st
from streamlit_option_menu import option_menu
from apps import (
    grant,
    home,
    google,
    journal,
    orcid,
    organization,
    publication,
    researcher,
)

st.set_page_config(
    page_title="Scholar Web App", page_icon="chart_with_upwards_trend", layout="wide"
)

# A dictionary of apps in the format of {"App title": "App icon"}
# More icons can be found here: https://icons.getbootstrap.com

apps = {
    "home": {"title": "Home", "icon": "house"},
    "grant": {"title": "Grant", "icon": "coin"},
    "journal": {"title": "Journal", "icon": "journals"},
    "publication": {"title": "Publication", "icon": "journal"},
    "researcher": {"title": "Researcher", "icon": "person-circle"},
    "orcid": {"title": "ORCID", "icon": "person-square"},
    "organization": {"title": "Organization", "icon": "building"},
    # "google": {"title": "Google Scholar", "icon": "google"},
}


titles = [app["title"] for app in apps.values()]
icons = [app["icon"] for app in apps.values()]
params = st.experimental_get_query_params()

if "page" in params:
    default_index = int(titles.index(params["page"][0].lower()))
else:
    default_index = 0

with st.sidebar:
    selected = option_menu(
        "Main Menu",
        options=titles,
        icons=icons,
        menu_icon="cast",
        default_index=default_index,
    )

    # st.sidebar.title("About")
    st.sidebar.info(
        """
        **URL:** <https://scholar.gishub.org>
    """
    )
    st.sidebar.info(
        """
        **Contact:** [Qiusheng Wu](https://gishub.org)
    """
    )
    # st.image("https://i.imgur.com/2WhANKg.png")

if "dsl" not in st.session_state:
    st.session_state["dsl"] = scholarpy.Dsl()

for app in apps:
    if apps[app]["title"] == selected:
        eval(f"{app}.app()")
        break