Libera la versión de desarrollo 0.0.25 [pagetop]
This commit is contained in:
parent
a3ef00526b
commit
93beb620c7
8 changed files with 70 additions and 48 deletions
|
|
@ -19,4 +19,4 @@ db_pass = "DrU__#3T"
|
||||||
tracing = "Info,pagetop=Debug,sqlx::query=Warn"
|
tracing = "Info,pagetop=Debug,sqlx::query=Warn"
|
||||||
|
|
||||||
[dev]
|
[dev]
|
||||||
#static_files = "pagetop/static"
|
#static_files = "../pagetop/static"
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,14 @@
|
||||||
[package]
|
[package]
|
||||||
name = "pagetop"
|
name = "pagetop"
|
||||||
version = "0.0.24"
|
version = "0.0.25"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
authors = [
|
authors = [
|
||||||
"Manuel Cillero <manuel@cillero.es>"
|
"Manuel Cillero <manuel@cillero.es>"
|
||||||
]
|
]
|
||||||
description = """\
|
description = """\
|
||||||
PageTop is an opinionated framework for using the most stable and popular \
|
PageTop is an opinionated web development framework that uses the most stable and popular Rust \
|
||||||
Rust packages to build modular, extensible and configurable web solutions.\
|
packages to build modular, extensible and configurable Server-side rendered solutions.\
|
||||||
"""
|
"""
|
||||||
homepage = "https://suitepro.cillero.es/projects/pagetop"
|
homepage = "https://suitepro.cillero.es/projects/pagetop"
|
||||||
repository = "https://gitlab.com/manuelcillero/pagetop"
|
repository = "https://gitlab.com/manuelcillero/pagetop"
|
||||||
|
|
@ -28,7 +28,7 @@ doc-comment = "0.3.3"
|
||||||
figlet-rs = "0.1.3"
|
figlet-rs = "0.1.3"
|
||||||
futures = "0.3.21"
|
futures = "0.3.21"
|
||||||
once_cell = "1.13.0"
|
once_cell = "1.13.0"
|
||||||
paste = "1.0.7"
|
paste = "1.0.8"
|
||||||
substring = "1.4.5"
|
substring = "1.4.5"
|
||||||
term_size = "0.3.2"
|
term_size = "0.3.2"
|
||||||
url = "2.2.2"
|
url = "2.2.2"
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ pub struct Paragraph {
|
||||||
renderable: Renderable,
|
renderable: Renderable,
|
||||||
id : IdentifierValue,
|
id : IdentifierValue,
|
||||||
classes : Classes,
|
classes : Classes,
|
||||||
html : HtmlMarkup,
|
components: ComponentsBundle,
|
||||||
display : ParagraphDisplay,
|
display : ParagraphDisplay,
|
||||||
template : String,
|
template : String,
|
||||||
}
|
}
|
||||||
|
|
@ -42,9 +42,14 @@ impl ComponentTrait for Paragraph {
|
||||||
(self.renderable.check)(context)
|
(self.renderable.check)(context)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn default_render(&self, _: &mut PageContext) -> Markup {
|
fn default_render(&self, context: &mut PageContext) -> Markup {
|
||||||
html! {
|
html! {
|
||||||
p id=[self.id().get()] class=[self.classes().get()] { (*self.html()) }
|
p
|
||||||
|
id=[self.id().get()]
|
||||||
|
class=[self.classes().get()]
|
||||||
|
{
|
||||||
|
(self.components().render(context))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -59,7 +64,7 @@ impl ComponentTrait for Paragraph {
|
||||||
|
|
||||||
impl Paragraph {
|
impl Paragraph {
|
||||||
pub fn with(html: Markup) -> Self {
|
pub fn with(html: Markup) -> Self {
|
||||||
Paragraph::new().with_html(html)
|
Paragraph::new().with_component(Html::with(html))
|
||||||
}
|
}
|
||||||
|
|
||||||
// Paragraph BUILDER.
|
// Paragraph BUILDER.
|
||||||
|
|
@ -84,8 +89,8 @@ impl Paragraph {
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn with_html(mut self, html: Markup) -> Self {
|
pub fn with_component(mut self, component: impl ComponentTrait) -> Self {
|
||||||
self.alter_html(html);
|
self.alter_component(component);
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -121,8 +126,8 @@ impl Paragraph {
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn alter_html(&mut self, html: Markup) -> &mut Self {
|
pub fn alter_component(&mut self, component: impl ComponentTrait) -> &mut Self {
|
||||||
self.html.markup = html;
|
self.components.add(component);
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -158,8 +163,8 @@ impl Paragraph {
|
||||||
&self.classes
|
&self.classes
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn html(&self) -> &Markup {
|
pub fn components(&self) -> &ComponentsBundle {
|
||||||
&self.html.markup
|
&self.components
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn display(&self) -> &ParagraphDisplay {
|
pub fn display(&self) -> &ParagraphDisplay {
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,7 @@ async fn demo() -> ResultPage<Markup, FatalError> {
|
||||||
.with_context(PageOp::AddStyleSheet(StyleSheet::located(
|
.with_context(PageOp::AddStyleSheet(StyleSheet::located(
|
||||||
"/theme/module/homepage/styles.css",
|
"/theme/module/homepage/styles.css",
|
||||||
)))
|
)))
|
||||||
|
.with_body_classes(ClassesOp::AddFirst, "default-homepage")
|
||||||
.add_to("region-content", hello_world())
|
.add_to("region-content", hello_world())
|
||||||
.add_to("region-content", welcome())
|
.add_to("region-content", welcome())
|
||||||
.add_to("region-content", about_pagetop())
|
.add_to("region-content", about_pagetop())
|
||||||
|
|
@ -54,34 +55,32 @@ fn hello_world() -> Container {
|
||||||
.with_component(
|
.with_component(
|
||||||
Paragraph::with(html! {
|
Paragraph::with(html! {
|
||||||
(e("hello_intro", &args![
|
(e("hello_intro", &args![
|
||||||
"app" => format!("<strong>{}</strong>", &SETTINGS.app.name)
|
"app" => format!("<span class=\"app-name\">{}</span>", &SETTINGS.app.name)
|
||||||
]))
|
]))
|
||||||
})
|
})
|
||||||
.with_display(ParagraphDisplay::Small),
|
.with_display(ParagraphDisplay::Small),
|
||||||
)
|
)
|
||||||
.with_component(Paragraph::with(html! {
|
.with_component(Paragraph::with(html! {
|
||||||
(e("hello_pagetop", &args![
|
(e("hello_powered", &args![
|
||||||
"pagetop" => "<a href=\"https://pagetop-rs\">PageTop</a>"
|
"pagetop" => "<a href=\"https://pagetop.cillero.es\" target=\"_blank\">PageTop</a>"
|
||||||
]))
|
]))
|
||||||
}))
|
}))
|
||||||
.with_component(
|
.with_component(
|
||||||
Anchor::button(
|
Anchor::button(
|
||||||
"#",
|
"https://gitlab.com/manuelcillero/pagetop",
|
||||||
html! {
|
html! { (l("hello_code")) },
|
||||||
("Offered services")
|
|
||||||
},
|
|
||||||
)
|
)
|
||||||
.with_left_icon(Icon::with("card-checklist"))
|
.with_target(AnchorTarget::Blank)
|
||||||
.with_classes(ClassesOp::Add, "services-link"),
|
.with_left_icon(Icon::with("git"))
|
||||||
|
.with_classes(ClassesOp::Add, "code-link"),
|
||||||
)
|
)
|
||||||
.with_component(
|
.with_component(
|
||||||
Anchor::button(
|
Anchor::link(
|
||||||
"#",
|
"#welcome",
|
||||||
html! {
|
html! { (l("hello_welcome")) },
|
||||||
("Get quote")
|
|
||||||
},
|
|
||||||
)
|
)
|
||||||
.with_left_icon(Icon::with("envelope-open-heart-fill")),
|
.with_left_icon(Icon::with("arrow-down-circle-fill"))
|
||||||
|
.with_classes(ClassesOp::Add, "welcome-link"),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
.with_column(
|
.with_column(
|
||||||
|
|
@ -97,11 +96,13 @@ fn welcome() -> Container {
|
||||||
.with_id("welcome")
|
.with_id("welcome")
|
||||||
.with_classes(ClassesOp::Add, "welcome-col-text")
|
.with_classes(ClassesOp::Add, "welcome-col-text")
|
||||||
.with_component(Heading::h2(html! {
|
.with_component(Heading::h2(html! {
|
||||||
(t("welcome_to", &args!["app" => SETTINGS.app.name.as_str()]))
|
(l("welcome_page"))
|
||||||
}))
|
}))
|
||||||
.with_component(
|
.with_component(
|
||||||
Heading::h3(html! {
|
Heading::h3(html! {
|
||||||
(l("welcome_subtitle"))
|
(e("welcome_subtitle", &args![
|
||||||
|
"app" => format!("<span class=\"app-name\">{}</span>", &SETTINGS.app.name)
|
||||||
|
]))
|
||||||
})
|
})
|
||||||
.with_display(HeadingDisplay::Subtitle),
|
.with_display(HeadingDisplay::Subtitle),
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -4,10 +4,12 @@ module_description = Displays a demo homepage when none is configured.
|
||||||
page_title = Hello world!
|
page_title = Hello world!
|
||||||
|
|
||||||
hello_intro = This page is used to test the proper operation of { $app } after installation.
|
hello_intro = This page is used to test the proper operation of { $app } after installation.
|
||||||
hello_pagetop = This web solution is powered by { $pagetop }.
|
hello_powered = This web solution is powered by { $pagetop }.
|
||||||
|
hello_code = Code
|
||||||
|
hello_welcome = Welcome
|
||||||
|
|
||||||
welcome_to = Welcome to { $app }
|
welcome_page = Welcome Page
|
||||||
welcome_subtitle = Are you user of this website?
|
welcome_subtitle = Are you user of { $app }?
|
||||||
welcome_text1 = If you don't know what this page is about, this probably means that the site is either experiencing problems or is undergoing routine maintenance.
|
welcome_text1 = If you don't know what this page is about, this probably means that the site is either experiencing problems or is undergoing routine maintenance.
|
||||||
welcome_text2 = If the problem persists, please contact your system administrator.
|
welcome_text2 = If the problem persists, please contact your system administrator.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,11 +3,13 @@ module_description = Muestra una página de demostración predeterminada cuando
|
||||||
|
|
||||||
page_title = ¡Hola mundo!
|
page_title = ¡Hola mundo!
|
||||||
|
|
||||||
hello_intro = Esta página se utiliza para probar el correcto funcionamiento de { $app } después de la instalación.
|
hello_intro = Esta página se utiliza para comprobar el correcto funcionamiento de { $app } después de la instalación.
|
||||||
hello_pagetop = Esta solución web funciona con { $pagetop }.
|
hello_powered = Una solución web creada con { $pagetop }.
|
||||||
|
hello_code = Código
|
||||||
|
hello_welcome = Bienvenida
|
||||||
|
|
||||||
welcome_to = Bienvenido a { $app }
|
welcome_page = Página de bienvenida
|
||||||
welcome_subtitle = ¿Eres usuario de este sitio web?
|
welcome_subtitle = ¿Utilizas los servicios de { $app }?
|
||||||
welcome_text1 = Si no sabes de qué trata esta página, probablemente significa que el sitio está experimentando problemas o está pasando por un mantenimiento de rutina.
|
welcome_text1 = Si no sabes de qué trata esta página, probablemente significa que el sitio está experimentando problemas o está pasando por un mantenimiento de rutina.
|
||||||
welcome_text2 = Si el problema persiste, póngase en contacto con el administrador del sistema.
|
welcome_text2 = Si el problema persiste, póngase en contacto con el administrador del sistema.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ pub type HashMapResources = std::collections::HashMap<&'static str, StaticResour
|
||||||
/// This function uses the [static_files](https://docs.rs/static-files/latest/static_files/) library
|
/// This function uses the [static_files](https://docs.rs/static-files/latest/static_files/) library
|
||||||
/// to embed at compile time a bundle of static files in your binary.
|
/// to embed at compile time a bundle of static files in your binary.
|
||||||
///
|
///
|
||||||
/// Just create the folder with static resources in your project (for example `static`):
|
/// Just create folder with static resources in your project (for example `static`):
|
||||||
///
|
///
|
||||||
/// ```bash
|
/// ```bash
|
||||||
/// cd project_dir
|
/// cd project_dir
|
||||||
|
|
@ -54,12 +54,13 @@ pub type HashMapResources = std::collections::HashMap<&'static str, StaticResour
|
||||||
/// }
|
/// }
|
||||||
/// ```
|
/// ```
|
||||||
///
|
///
|
||||||
/// This will create a file called `guides.rs` where all output and intermediate artifacts are
|
/// This will create a file called `guides.rs` in the standard directory
|
||||||
/// placed, see [OUT_DIR](https://doc.rust-lang.org/cargo/reference/environment-variables.html).
|
/// [OUT_DIR](https://doc.rust-lang.org/cargo/reference/environment-variables.html) where all
|
||||||
|
/// intermediate and output artifacts are placed during compilation.
|
||||||
///
|
///
|
||||||
/// You don't need to access this file, just include it in your source code and a module called
|
/// You don't need to access this file, just include it in your project source code and a module called
|
||||||
/// `resources_guides` will be added to your project. Use the function `bundle_guides` to embed the
|
/// `resources_guides` will be added. Then simply reference the `bundle_guides` function to embed
|
||||||
/// generated HashMap resources collection:
|
/// the generated HashMap resources collection:
|
||||||
///
|
///
|
||||||
/// ```rust#ignore
|
/// ```rust#ignore
|
||||||
/// use pagetop::prelude::*;
|
/// use pagetop::prelude::*;
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,24 @@
|
||||||
|
body.default-homepage span.app-name {
|
||||||
|
font-weight: bold;
|
||||||
|
color: inherit;
|
||||||
|
}
|
||||||
|
|
||||||
#hello-world {
|
#hello-world {
|
||||||
padding: 2em 5%;
|
padding: 2em 5%;
|
||||||
}
|
}
|
||||||
#hello-world a {
|
#hello-world a {
|
||||||
margin: .25em;
|
margin: .25em;
|
||||||
}
|
}
|
||||||
#hello-world a.services-link {
|
#hello-world a.code-link {
|
||||||
padding-left: 1.5em;
|
padding-left: 2em;
|
||||||
padding-right: 1.5em;
|
padding-right: 2em;
|
||||||
border-radius: 1.5em;
|
border-radius: 1.5em;
|
||||||
|
font-size: 112.5%;
|
||||||
|
}
|
||||||
|
#hello-world a.welcome-link {
|
||||||
|
text-decoration: none;
|
||||||
|
display: inline-block;
|
||||||
|
vertical-align: middle;
|
||||||
}
|
}
|
||||||
|
|
||||||
#welcome {
|
#welcome {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue