Пример #1
0
def add_lead_callback(n_clicks, status, state, company, source, current_df):
    if n_clicks > 0:
        if company == "":
            company = "Not named yet"
        query = {
            "LastName": company,
            "Company": company,
            "Status": status,
            "State": state,
            "LeadSource": source,
        }
        sf_manager.add_lead(query)
        df = sf_manager.get_leads()
        return df.to_json(orient="split")

    return current_df
Пример #2
0
         dcc.Link("Leads", href="/"),
         dcc.Link("Cases", href="/"),
     ],
 ),
 dcc.Store(  # finance df
     id="finance_df",
     data="data/df_actual_vs_budget.csv",
     #data=csv_manager.get_data(),
 ),
 dcc.Store(  # opportunities df
     id="opportunities_df",
     data=sf_manager.get_opportunities().to_json(orient="split"),
 ),
 dcc.Store(  # leads df
     id="leads_df",
     data=sf_manager.get_leads().to_json(orient="split")),
 dcc.Store(
     id="cases_df",
     data=sf_manager.get_cases().to_json(orient="split")),  # cases df
 dcc.Location(id="url", refresh=False),
 html.Div(id="tab_content"),
 html.Link(
     href="https://use.fontawesome.com/releases/v5.2.0/css/all.css",
     rel="stylesheet",
 ),
 html.Link(href="https://fonts.googleapis.com/css?family=Dosis",
           rel="stylesheet"),
 html.Link(href="https://fonts.googleapis.com/css?family=Open+Sans",
           rel="stylesheet"),
 html.Link(href="https://fonts.googleapis.com/css?family=Ubuntu",
           rel="stylesheet"),
Пример #3
0
                    dcc.Tab(label="Leads", value="leads_tab"),
                    dcc.Tab(id="cases_tab", label="Cases", value="cases_tab"),
                ],
                value="leads_tab",
            )
        ],
                 className="row tabs_div"),

        # divs that save dataframe for each tab
        html.Div(
            sf_manager.get_opportunities().to_json(
                orient="split"),  # opportunities df
            id="opportunities_df",
            style={"display": "none"},
        ),
        html.Div(sf_manager.get_leads().to_json(orient="split"),
                 id="leads_df",
                 style={"display": "none"}),  # leads df
        html.Div(sf_manager.get_cases().to_json(orient="split"),
                 id="cases_df",
                 style={"display": "none"}),  # cases df

        # Tab content
        html.Div(id="tab_content", className="row", style={"margin": "2% 3%"}),
        html.Link(
            href="https://use.fontawesome.com/releases/v5.2.0/css/all.css",
            rel="stylesheet"),
        html.Link(
            href=
            "https://cdn.rawgit.com/plotly/dash-app-stylesheets/2d266c578d2a6e8850ebce48fdb52759b2aef506/stylesheet-oil-and-gas.css",
            rel="stylesheet"),
Пример #4
0
                    dcc.Tab(id="aases_tab", label="aases", value="aases_tab"),
                ],
                value="leads_tab",
            )

        ],
            className="row tabs_div"
        ),

        # divs that save dataframe for each tab
        html.Div(
            sf_manager.get_opportunities().to_json(orient="split"),  # opportunities df
            id="opportunities_df",
            style={"display": "none"},
        ),
        html.Div(sf_manager.get_leads().to_json(orient="split"), id="leads_df", style={"display": "none"}),  # leads df
        html.Div(sf_manager.get_cases().to_json(orient="split"), id="cases_df", style={"display": "none"}),  # cases df

        # Tab content
        html.Div(id="tab_content", className="row", style={"margin": "2% 3%"}),

        html.Link(href="https://use.fontawesome.com/releases/v5.2.0/css/all.css", rel="stylesheet"),
        html.Link(
            href="https://cdn.rawgit.com/plotly/dash-app-stylesheets/2d266c578d2a6e8850ebce48fdb52759b2aef506/stylesheet-oil-and-gas.css",
            rel="stylesheet"),
        html.Link(href="https://fonts.googleapis.com/css?family=Dosis", rel="stylesheet"),
        html.Link(href="https://fonts.googleapis.com/css?family=Open+Sans", rel="stylesheet"),
        html.Link(href="https://fonts.googleapis.com/css?family=Ubuntu", rel="stylesheet"),
        html.Link(
            href="https://cdn.rawgit.com/amadoukane96/8a8cfdac5d2cecad866952c52a70a50e/raw/cd5a9bf0b30856f4fc7e3812162c74bfc0ebe011/dash_crm.css",
            rel="stylesheet")
Пример #5
0
 html.Div(
     id="mobile_tabs",
     className="row tabs",
     style={"display": "none"},
     children=[
         dcc.Link("Opportunities", href="/"),
         dcc.Link("Leads", href="/"),
         dcc.Link("Cases", href="/"),
     ],
 ),
 dcc.Store(  # opportunities df
     id="opportunities_df",
     data=sf_manager.get_opportunities().to_json(orient="split"),
 ),
 dcc.Store(  # leads df
     id="leads_df", data=sf_manager.get_leads().to_json(orient="split")
 ),
 dcc.Store(
     id="cases_df", data=sf_manager.get_cases().to_json(orient="split")
 ),  # cases df
 dcc.Location(id="url", refresh=False),
 html.Div(id="tab_content"),
 html.Link(
     href="https://use.fontawesome.com/releases/v5.2.0/css/all.css",
     rel="stylesheet",
 ),
 html.Link(
     href="https://fonts.googleapis.com/css?family=Dosis", rel="stylesheet"
 ),
 html.Link(
     href="https://fonts.googleapis.com/css?family=Open+Sans", rel="stylesheet"