mirror of
https://codeberg.org/demostf/frontend.git
synced 2026-06-04 02:34:13 +02:00
build rework
This commit is contained in:
parent
fc5cd1d24f
commit
dc80d715a6
18 changed files with 1681 additions and 115 deletions
|
|
@ -2,6 +2,7 @@ pub mod about;
|
|||
pub mod demo;
|
||||
pub mod index;
|
||||
mod plugin_section;
|
||||
pub mod upload;
|
||||
|
||||
use crate::asset::saved_asset_url;
|
||||
use crate::session::SessionData;
|
||||
|
|
|
|||
|
|
@ -62,6 +62,9 @@ impl Render for PluginSection<'_> {
|
|||
}
|
||||
}
|
||||
}
|
||||
li {
|
||||
"Restart the server."
|
||||
}
|
||||
}
|
||||
a.button.button-primary href = "https://github.com/demostf/plugin/raw/master/demostf.smx" { "Download" }
|
||||
a.button href = "https://github.com/demostf/plugin/raw/master/demostf.sp" { "Source" }
|
||||
|
|
|
|||
55
src/pages/upload.rs
Normal file
55
src/pages/upload.rs
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
use crate::pages::plugin_section::PluginSection;
|
||||
use crate::pages::Page;
|
||||
use maud::{html, Markup};
|
||||
use std::borrow::Cow;
|
||||
|
||||
pub struct UploadPage {
|
||||
pub key: String,
|
||||
}
|
||||
|
||||
impl UploadPage {
|
||||
pub fn plugin_section(&self) -> PluginSection {
|
||||
PluginSection {
|
||||
key: Some(self.key.as_str()),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Page for UploadPage {
|
||||
fn title(&self) -> Cow<'static, str> {
|
||||
"Upload - demos.tf".into()
|
||||
}
|
||||
|
||||
fn render(&self) -> Markup {
|
||||
html! {
|
||||
.upload-page {
|
||||
section.upload {
|
||||
.teams {
|
||||
.red {
|
||||
input type = "text" name = "red" placeholder = "RED";
|
||||
}
|
||||
.blue {
|
||||
input type = "text" name = "blue" placeholder = "BLU";
|
||||
}
|
||||
.clearfix {}
|
||||
}
|
||||
.dropzone role = "button" {
|
||||
noscript {
|
||||
"Javascript is required for demo upload."
|
||||
}
|
||||
"Drop files or click to upload"
|
||||
}
|
||||
button.button.button-primary disabled { "Upload" }
|
||||
}
|
||||
section {
|
||||
.title {
|
||||
h3 { "API Key" }
|
||||
}
|
||||
pre { (self.key) }
|
||||
p { "This key is used by the plugin to authenticate you as the uploader and link the uploaded demo to your account." }
|
||||
}
|
||||
(self.plugin_section())
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue