def initialize(self): html = DIV( snippets.Centralizer( "phanterpwa-logo-wrapper", DIV(_class="phanterpwa-background-logo"), H1("PhanterPWA", _class="phanterpwa-the_title"), H3(I18N( "Full-Stack Progressive Web Applications framework written and programmable with Python.", ), _class="phanterpwa-the_subtitle"))) html.html_to("#main-container") window.PhanterPWA.LOAD( **{ "args": ["loads", "phanterpwa_logo.html"], "onComplete": self._after_load }) AdminButton = left_bar.LeftBarButton( "phanterpwa-developer-button", "Development", I(_class="fas fa-users-cog"), **{ "_phanterpwa-way": "developer", "position": "top", "ways": ["home"] }) teste = left_bar.LeftBarButton( "phanterpwa-components-button", "Components", I(_class="fas fa-code"), **{ "_phanterpwa-way": "examples", "position": "top", "ways": ["home"] }) window.PhanterPWA.Components['left_bar'].add_button(AdminButton) window.PhanterPWA.Components['left_bar'].add_button(teste)
def initialize(self): html = CONCATENATE( DIV(DIV(DIV(DIV("PROJECT", _class="phanterpwa-breadcrumb"), DIV(self.request.get_arg(0), _class="phanterpwa-breadcrumb"), _class="phanterpwa-breadcrumb-wrapper"), _class="p-container"), _class='title_page_container card'), DIV(DIV(DIV(DIV( widgets.Preloaders("preload_android"), _style= "width:100%; text-align: center; padding-top: 100px; padding-bottom: 100px;" ), _id="applications_container"), _class="card p-row e-padding_10"), _class="phanterpwa-container p-container")) html.html_to("#main-container") BackButton = left_bar.LeftBarButton( "back_developer", "Voltar", I(_class="fas fa-arrow-circle-left"), **{ "_phanterpwa-way": "developer", "position": "top", "ways": [ lambda: window.PhanterPWA.get_current_way().startswith( "project") ] }) window.PhanterPWA.Components['left_bar'].add_button(BackButton) if self.request.get_arg(1) == "view": ConfigProject = left_bar.LeftBarButton( "config_project", "Configurar Projeto e Api", I(_class="fas fa-tools"), **{ "_phanterpwa-way": "project/{0}/config".format(self.request.get_arg(0)), "position": "top", "ways": [ lambda: window.PhanterPWA.get_current_way().startswith( "project") ] }) window.PhanterPWA.Components['left_bar'].add_button(ConfigProject) window.PhanterPWA.GET( **{ 'url_args': ['api', 'projects', self.request.get_arg(0)], 'onComplete': self._after_get_applications }) elif self.request.get_arg(1) == "config": window.PhanterPWA.GET( **{ 'url_args': ['api', 'config', self.request.get_arg(0)], 'onComplete': self._after_get_config })
def initialize(self): html = CONCATENATE( DIV(DIV(DIV(DIV("DEVELOPMENT", _class="phanterpwa-breadcrumb"), _class="phanterpwa-breadcrumb-wrapper"), _class="p-container"), _class='title_page_container card'), DIV(DIV(DIV(DIV( widgets.Preloaders("preload_android"), _style= "width:100%; text-align: center; padding-top: 100px; padding-bottom: 100px;" ), _id="projects_container"), _class="card p-row e-padding_10"), _class="phanterpwa-container p-container")) html.html_to("#main-container") BackButton = left_bar.LeftBarButton( "back_localizar_aluno", "Voltar", I(_class="fas fa-arrow-circle-left"), **{ "_phanterpwa-way": "home", "position": "top", "ways": ["developer"] }) TestButton = left_bar.LeftBarButton( "test_phanterpwa", "Test PhanterPWA", I(_class="fas fa-tasks"), **{ "_phanterpwa-way": "test_phanterpwa", "position": "top", "ways": ["developer"] }) CheckRequeriments = left_bar.LeftBarButton( "check_requeriments", "Check Requeriments", I(_class="fab fa-connectdevelop"), **{ "_phanterpwa-way": "check_requeriments", "position": "top", "ways": ["developer"] }) NewProjectsFolder = left_bar.LeftBarButton( "change_projects_folder", "Change Project Folder", I(_class="fas fa-folder-open"), **{ "position": "top", "ways": ["developer"], }) window.PhanterPWA.Components['left_bar'].add_button(BackButton) window.PhanterPWA.Components['left_bar'].add_button(TestButton) window.PhanterPWA.Components['left_bar'].add_button(CheckRequeriments) window.PhanterPWA.Components['left_bar'].add_button(NewProjectsFolder) if self.projects_data is None or self.projects_data is js_undefined: window.PhanterPWA.GET( **{ 'url_args': ['api', 'projects'], 'onComplete': self._after_get_applications }) else: self._xml_projects_list(self.projects_data) self._binds()
def initialize(self): html = CONCATENATE( DIV(DIV(DIV(DIV("COMPONENTES", _class="phanterpwa-breadcrumb"), DIV("FONT AWESOME", _class="phanterpwa-breadcrumb"), _class="phanterpwa-breadcrumb-wrapper"), _class="p-container"), _class='title_page_container card'), DIV(DIV(DIV(DIV( widgets.Preloaders("preloader_fontawesome"), _style= "width:100%; text-align: center; padding-top: 100px; padding-bottom: 100px;" ), _id="icon_awesome_container", _class="icon_awesome_container e-padding_20"), _class="card p-row padding_20"), _class="phanterpwa-container p-container")) html.html_to("#main-container") BackButton = left_bar.LeftBarButton( "back_localizar_aluno", "Voltar", I(_class="fas fa-arrow-circle-left"), **{ "_phanterpwa-way": "home", "position": "top", "ways": ["fontawesome"] }) window.PhanterPWA.Components['left_bar'].add_button(BackButton) setTimeout(lambda: self._add_content(0), 300)
def initialize(self): html = CONCATENATE( DIV( DIV( DIV( DIV("TEST PHANTERPWA", _class="phanterpwa-breadcrumb"), _class="phanterpwa-breadcrumb-wrapper" ), _class="p-container"), _class='title_page_container card' ), DIV( DIV( DIV( DIV( widgets.Preloaders("preload_android"), _style="width:100%; text-align: center; padding-top: 100px; padding-bottom: 100px;" ), _id="applications_container"), _class="card p-row e-padding_10" ), _class="phanterpwa-container p-container" ) ) html.html_to("#main-container") BackButton = left_bar.LeftBarButton( "back_developer", "Voltar", I(_class="fas fa-arrow-circle-left"), **{ "_phanterpwa-way": "developer", "position": "top", "ways": [lambda: window.PhanterPWA.get_current_way().startswith("test_phanterpwa")] } ) window.PhanterPWA.Components['left_bar'].add_button(BackButton) window.PhanterPWA.GET(**{ 'url_args': ['api', 'automation', 'test_list'], 'onComplete': self._after_get_test_list })
def _xml_projects_list(self, json): table = XTABLE( "applications-table", XTRH( "applications-table-head", *["Application Name", "Build Folder"], DIV( I(_class="fas fa-plus"), **{ "_phanterpwa-way": "application/new", "_class": "icon_button wave_on_click" }))) apps_dict = dict(json.config.APPS) for x in apps_dict.keys(): table.append( XTRD( "applications-table-data-{0}".format(x), x, apps_dict[x]["build_folder"], widgets.MenuBox( "drop_2_{0}".format(x), DIV(I(_class="fas fa-ellipsis-v"), _class="icon_button wave_on_click"), custom_menu=UL( LI( "Compile", **{ "_id": "btn_compile_app_project_{0}".format(x), "_class": "btn_compile_app_project", "_data-path": json.config['PROJECT']['path'], "_data-app": x }), LI( "View", **{ "_class": "botao_editar_role", "_phanterpwa-way": "application/{0}/view".format(x) }), LI( "Delete", **{ "_class": "botao_editar_role", "_phanterpwa-way": "application/{0}/delete".format(x) }), **{ "data-menubox": "drop_2_{0}".format(x), "_class": 'dropdown-content' }, ), onOpen=lambda: window.PhanterPWA.flash("foi clicado!" )))) url = json.config.BACKEND.api.http_address ShowApi = left_bar.LeftBarButton( "view_api", "Open Api", I(_class="fas fa-globe"), **{ "position": "top", "ways": [ lambda: True if json.running is True and window.PhanterPWA. get_current_way().startswith("project/{0}".format( self.request.get_arg(0))) else False ], "onStart": lambda: self._bind_open_api(self.request.get_arg(0), url) }) window.PhanterPWA.Components['left_bar'].add_button(ShowApi) html = DIV( XSECTION( LABEL("Summary"), DIV(DIV(DIV(DIV(STRONG("PROJECT PATH"), SPAN(json.config['PROJECT']['path']), _class="e-tagger-wrapper"), _class="p-col w1p100"), _class="p-row"), DIV(DIV(DIV(STRONG("IDENTIFIER NAME"), SPAN(json.config['PROJECT']['name']), _class="e-tagger-wrapper"), _class="p-col w1p100"), _class="p-row"), DIV(DIV(DIV(STRONG("TITLE"), SPAN(json.config['PROJECT']['title']), _class="e-tagger-wrapper"), _class="p-col w1p100"), _class="p-row"), DIV(DIV(DIV(STRONG("AUTHOR"), SPAN(json.config['PROJECT']['author']), _class="e-tagger-wrapper"), _class="p-col w1p100"), _class="p-row"), DIV(DIV(DIV(STRONG("VERSION"), SPAN(json.config['PROJECT']['version']), _class="e-tagger-wrapper"), _class="p-col w1p100 w3p50"), DIV(DIV(STRONG("COMPILATION"), SPAN(json.config['PROJECT']['compilation']), _class="e-tagger-wrapper"), _class="p-col w1p100 w3p50"), _class="p-row"), DIV(DIV(DIV(STRONG("DEBUG"), SPAN(json.config['PROJECT']['debug']), _class="e-tagger-wrapper"), _class="p-col w1p100 w3p50"), DIV(DIV(STRONG("STATUS"), SPAN("Running" if json.running else "Stopped", _style="color: {0};".format( "green" if json.running else "red")), _class="e-tagger-wrapper"), _class="p-col w1p100 w3p50"), _class="p-row"), _class="e-padding_20")), table) html.html_to("#applications_container") self.widgets_initialize()
def initialize(self): if self.request.get_arg(0) == "inputs": html = CONCATENATE( DIV(DIV(DIV(DIV("COMPONENTES", _class="phanterpwa-breadcrumb"), DIV("INPUT", _class="phanterpwa-breadcrumb"), _class="phanterpwa-breadcrumb-wrapper"), _class="p-container"), _class='title_page_container card'), DIV(DIV(DIV(DIV( widgets.Preloaders("preload_android"), _style= "width:100%; text-align: center; padding-top: 100px; padding-bottom: 100px;" ), _id="projects_container"), _class="card p-row e-padding_10"), _id="input-container-example", _class="phanterpwa-container p-container")) html.html_to("#main-container") setTimeout(lambda: inputs.Inputs(self), 30) elif self.request.get_arg(0) == "selects": html = CONCATENATE( DIV(DIV(DIV(DIV("COMPONENTES", _class="phanterpwa-breadcrumb"), DIV("SELECT", _class="phanterpwa-breadcrumb"), _class="phanterpwa-breadcrumb-wrapper"), _class="p-container"), _class='title_page_container card'), DIV(DIV(DIV(DIV( widgets.Preloaders("preload_android"), _style= "width:100%; text-align: center; padding-top: 100px; padding-bottom: 100px;" ), _id="projects_container"), _class="card p-row e-padding_10"), _id="selects-container-example", _class="phanterpwa-container p-container")) html.html_to("#main-container") setTimeout(lambda: selects.Selects(self), 30) elif self.request.get_arg(0) == "menus": self.menus = menus.MenuBox(self) elif self.request.get_arg(0) == "others": self.others = Others(self) else: html = CONCATENATE( DIV(DIV(DIV(DIV("COMPONENTES", _class="phanterpwa-breadcrumb"), _class="phanterpwa-breadcrumb-wrapper"), _class="p-container"), _class='title_page_container card'), DIV(DIV( DIV(DIV( DIV( I(**{ "_class": "fas fa-edit promo-icon", }), H2("Inputs", _class="promo-title"), **{ "_class": "link", "_phanterpwa-way": "examples/inputs" }), **{"_class": "promo-container"}), _class='p-col w1p100 w3p50 w4p25'), DIV(DIV( DIV( I(**{ "_class": "far fa-caret-square-down promo-icon", }), H2("Selects", _class="promo-title"), **{ "_class": "link", "_phanterpwa-way": "examples/selects" }), **{"_class": "promo-container"}), _class='p-col w1p100 w3p50 w4p25'), DIV(DIV( DIV( I(**{ "_class": "fas fa-ellipsis-v promo-icon", }), H2("Menus", _class="promo-title"), **{ "_class": "link", "_phanterpwa-way": "examples/menus" }), **{"_class": "promo-container"}), _class='p-col w1p100 w3p50 w4p25'), DIV(DIV( DIV( I(**{ "_class": "fas fa-file-signature promo-icon", }), H2("Others", _class="promo-title"), **{ "_class": "link", "_phanterpwa-way": "examples/others" }), **{"_class": "promo-container"}), _class='p-col w1p100 w3p50 w4p25'), DIV(DIV( DIV( I(**{ "_class": "fas fa-flag promo-icon", }), H2("Font Awesome", _class="promo-title"), **{ "_class": "link", "_phanterpwa-way": "fontawesome" }), **{"_class": "promo-container"}), _class='p-col w1p100 w3p50 w4p25'), _class='p-row card e-padding_20'), _class="phanterpwa-container p-container")) html.html_to("#main-container") BackButton1 = left_bar.LeftBarButton( "back_home", "Voltar", I(_class="fas fa-arrow-circle-left"), **{ "_phanterpwa-way": "home", "position": "top", "ways": [lambda r: True if r == "examples" else False] }) BackButton2 = left_bar.LeftBarButton( "back_examples", "Voltar", I(_class="fas fa-arrow-circle-left"), **{ "_phanterpwa-way": "examples", "position": "top", "ways": [lambda r: True if r.startswith("examples/") else False] }) window.PhanterPWA.Components['left_bar'].add_button(BackButton1) window.PhanterPWA.Components['left_bar'].add_button(BackButton2)