From b1a56ee1eddef07d37aed98f816c2fe6e657fa62 Mon Sep 17 00:00:00 2001 From: Rickard Lundqvist Date: Wed, 26 Jan 2022 19:02:29 +0100 Subject: [PATCH] + upload site WIP v2 --- skanhama/forms.py | 2 +- skanhama/models.py | 2 +- skanhama/static/style.css | 281 +++++++++++++++++++++------------ skanhama/templates/upload.html | 257 +++++++++++++++++------------- 4 files changed, 335 insertions(+), 207 deletions(-) diff --git a/skanhama/forms.py b/skanhama/forms.py index 6de6471..8dcd10b 100644 --- a/skanhama/forms.py +++ b/skanhama/forms.py @@ -59,7 +59,7 @@ class UploadPackage(FlaskForm): name = StringField("Package Name", validators=[DataRequired()]) version = StringField("Current Version", validators=[DataRequired(), Length(min=1, max=30)]) author = StringField("Author(s) or Team", validators=[DataRequired()]) - summary = TextAreaField("Brief Description", validators=[DataRequired(), Length(min=1, max=240)]) + summary = TextAreaField("Brief Description", validators=[DataRequired(), Length(min=1, max=230)]) description = TextAreaField("Description", validators=[DataRequired(), Length(min=1, max=5000)]) requirements = TextAreaField("Requirements", validators=[DataRequired()]) category = SelectField("Primary Category", choices=["Combat", "Sex"], validators=[DataRequired()]) diff --git a/skanhama/models.py b/skanhama/models.py index 378808a..633f105 100644 --- a/skanhama/models.py +++ b/skanhama/models.py @@ -29,6 +29,7 @@ class Package(db.Model): name = db.Column(db.String(120), unique=True, nullable=False) version = db.Column(db.String(30), nullable=False) author = db.Column(db.String(100), nullable=False) + nsfw = db.Column(db.Boolean, nullable=False) summary = db.Column(db.String(230), nullable=False) description = db.Column(db.Text, nullable=False) requirements = db.Column(db.Text, nullable=False) @@ -38,7 +39,6 @@ class Package(db.Model): downloads_current_version = db.Column(db.BigInteger, nullable=False) likes = db.Column(db.BigInteger, nullable=False) views_total = db.Column(db.BigInteger, nullable=False) - nsfw = db.Column(db.Boolean, nullable=False) user_id = db.Column(db.Integer, db.ForeignKey("user.id"), nullable=False) category = db.relationship("Categories", backref="category_id", lazy=True) comments = db.relationship("Comment", backref="package_comments", lazy=True) diff --git a/skanhama/static/style.css b/skanhama/static/style.css index 1e9f6c0..1fc4372 100644 --- a/skanhama/static/style.css +++ b/skanhama/static/style.css @@ -38,6 +38,7 @@ --clr-bg-dropdown-accent: rgba(59, 59, 66, 0.8); --clr-bg-content: rgb(37, 37, 42); --clr-bg-content-accent: rgb(33, 33, 36); + --clr-bg-content-dark: rgb(29, 29, 31); --clr-bg-footer: var(--clr-bg-header); --clr-bg-hover: rgb(43, 43, 49); --clr-bg-btn: rgba(16, 16, 19, 0.4); @@ -93,9 +94,6 @@ p { font-weight: 300; /*border: solid #13e1aa 1px;*/ } -.fc-generic { - font-family: 'Work Sans', sans-serif; -} a { color: var(--clr-AB); } @@ -295,7 +293,7 @@ a:visited { } .content-container { margin: 1rem 1.2rem; - border: solid var(--clr-AA) 1px; + /*border: solid var(--clr-AA) 1px;*/ } .content-2col { margin: 1rem 1.2rem; @@ -320,7 +318,9 @@ a:visited { padding: 0.3rem; } -/* Forms */ +/************************************************************************/ +/* Forms */ +/************************************************************************/ .container-form { display: inline-flex; flex-direction: column; @@ -332,9 +332,9 @@ a:visited { width: 100%; } .form-group { - display: flex; - flex-direction: column; - margin: 2rem 0 0 0; + /*display: flex;*/ + /*flex-direction: column;*/ + /*!*margin: 2rem 0 0 0;*!*/ } .container-sidebar-right .form-group { @@ -360,91 +360,193 @@ a:visited { justify-content: flex-end; align-items: center; } +fieldset.form-group-field { + border: none; +} .form-control-label { margin: 0; font-weight: 400; font-size: var(--size-p); } +/* + Form Labels + fl-hint +*/ + +/* + Generic Form Controls + form-control, fc-generic, fc-upload +*/ +input:-webkit-autofill, +input:-webkit-autofill:hover, +input:-webkit-autofill:focus, +input:-webkit-autofill:active{ + -webkit-box-shadow: 0 0 0 30px var(--clr-bg-content) inset !important; + -webkit-text-fill-color: var(--clr-text-light) !important; +} +/* Form Control */ +.form-control { + height: 2em; + font-family: 'Work Sans', sans-serif; + font-weight: 400; + color: var(--clr-text-light); + background: rgba(52, 56, 68, 0.15); + border: solid var(--clr-offsetA) 1px; +} +.form-control:focus { + background: rgba(52, 56, 68, 0.25); + border: solid 1px; + border-image: var(--gradient-A); + outline-style: none; +} +/* Form Control - Generic */ .fc-generic { height: 1.4rem; width: 100%; } -.invalid-feedback { - margin: 0.2rem 0 0 0; +/* Form Label - Hint */ +.fl-hint { + font-size: 0.9em; + margin: 0 0 0.4rem 0; } -#forgot-password { +.fc-select option { + background: var(--clr-bg-content-accent); +} + +/* + Upload Page Forms +*/ +/* Upload Divs */ +.upload-content { + background-color: var(--clr-bg-content-accent); + +} +.upload-content-header { + background-color: var(--clr-bg-content-dark); +} +.upload-content-row { + /*background-color: var(--clr-bg-content-accent);*/ + /*padding: 0.5rem 0.75rem 0.5rem 0.75rem;*/ display: flex; - justify-content: center; - margin: 1rem; + flex-direction: row; + flex-wrap: wrap; + justify-content: flex-start; + gap: 2rem; + padding: 0.25rem 0.75rem 0.75rem 0.75rem; } -.btn { - width: 8rem; - height: 2.4rem; - display: inline-flex; - justify-content: center; - align-items: center; +.upload-content-col { + display: flex; + flex-direction: column; + flex-wrap: wrap; + justify-content: flex-start; + gap: 1rem; + padding: 0.25rem 0.75rem 0.75rem 0.75rem; +} +/* Text Styling */ +.upload-header { + margin: 0 0 0.5rem 0; + padding: 0.5rem 0.75rem; +} +#h1-upload { + padding: 0.5rem 0.75rem 0.5rem 0; +} +.fl-upload { + font-size: 1em; +} +/* Form Control - Upload */ +.fc-upload { + display: flex; + flex-direction: column; + margin-top: 0.2rem; + width: 100%; + text-align: left; + resize: none; } +.fc-select { + padding-top: 4px; +} +.fc-upload-radio { -/* Footer */ -.footer { - grid-area: footer; - display: grid; - grid-template-areas: ". footer-inner ."; - grid-template-columns: inherit; - grid-template-rows: inherit; - background: #485F6E; } -.footer-inner { - grid-area: footer-inner; - display: inline-flex; - justify-content: center; - align-items: center; - height: var(--height-footer); +#fc-nsfw { + width: 1.6rem; + height: 1.6rem; + margin: 0; + padding: 0; } -/************************************************************************/ -/* Forms */ -/************************************************************************/ -fieldset.form-group-field { - border: none; +#fc-summary { + height: 3em; } -.fc-generic { - color: var(--clr-text-light); - border: none; - border-bottom: solid var(--clr-offsetA) 1px; - background: var(--clr-bg-content); - font-weight: 400; +#fc-desc { + height: 40em; } -input:-webkit-autofill, -input:-webkit-autofill:hover, -input:-webkit-autofill:focus, -input:-webkit-autofill:active{ - -webkit-box-shadow: 0 0 0 30px var(--clr-bg-content) inset !important; - -webkit-text-fill-color: var(--clr-text-light) !important; +/* Upload Control Widths */ +#upload-basic-name { + flex-basis: 30%; } -.fc-generic:focus { +#upload-basic-authors { + flex-basis: 25%; +} +#upload-basic-version { + flex-basis: 15%; +} +#upload-category-category { + flex-basis: 35%; +} +#upload-category-nsfw { + flex-basis: 35%; +} +#upload-desc-summary { + width: 50%; +} +/* Form Group - Upload */ +.fg-upload { + margin: 0; + padding: 0; border: none; - border-bottom: solid 1px; - border-image: var(--gradient-A); - outline-style: none; + display: flex; + flex-direction: column; + gap: 1.5rem; } + + + + +/* +Misc Forms +*/ .invalid-feedback { + margin: 0.2rem 0 0 0; font-size: 0.75em; color: var(--clr-text-accent); } -.invalid-form { - border-bottom: solid rgb(90, 8, 35) 1px; -} -.form-check { +#forgot-password { + display: flex; + justify-content: center; + margin: 1rem; font-family: 'Open Sans', sans-serif; font-size: 0.8em; font-weight: 400; } -#forgot-password { +.invalid-form { + border-bottom: solid rgb(90, 8, 35) 1px; +} +.form-check { font-family: 'Open Sans', sans-serif; font-size: 0.8em; font-weight: 400; } -/* Account Page */ + + + + + + + + +/************************************************************************/ +/* Account Page */ +/************************************************************************/ #account-header { margin: 0 0 0.8rem 0; text-align: center; @@ -503,49 +605,25 @@ input:-webkit-autofill:active{ font-size: 1.1em; } -/* Upload Form */ -.upload-content { - /*border: 1px solid red;*/ - -} -#upload-basic { - background-color: var(--clr-bg-content-accent); - padding: 0.5rem 0.75rem 0.5rem 0.75rem; -} -.form-group-upload { - margin: 0; - padding: 0; - border: none; -} -.form-label-upload { - font-size: 1em; -} -.fc-generic .fc-upload { - color: var(--clr-text-light); - border: none; - border-bottom: solid var(--clr-offsetA) 1px; - background: transparent; - font-weight: 400; - display: flex; - flex-direction: column; - margin-top: 0.15rem; -} -.fc-generic .fc-upload:focus { - border: none; - border-bottom: solid 1px; - border-image: var(--gradient-A); - outline-style: none; -} -.upload-header { - margin: 0 0 0.5rem 0; +/* Footer */ +.footer { + grid-area: footer; + display: grid; + grid-template-areas: ". footer-inner ."; + grid-template-columns: inherit; + grid-template-rows: inherit; + background: #485F6E; } -#h1-upload { - padding: 0.5rem 0.75rem 0.5rem 0.75rem; +.footer-inner { + grid-area: footer-inner; + display: inline-flex; + justify-content: center; + align-items: center; + height: var(--height-footer); } - /* Browse Page */ .browse-section-popular .inner { display: flex; @@ -656,6 +734,13 @@ input:-webkit-autofill:active{ } /* Buttons */ +.btn { + width: 8rem; + height: 2.4rem; + display: inline-flex; + justify-content: center; + align-items: center; +} .btn { cursor: pointer; text-decoration: none; diff --git a/skanhama/templates/upload.html b/skanhama/templates/upload.html index 22a5a7b..ec35dc1 100644 --- a/skanhama/templates/upload.html +++ b/skanhama/templates/upload.html @@ -5,124 +5,167 @@

Upload an Animation Package

{{ form.hidden_tag() }} -
-
-

Mod Details

- -
- {{ form.name.label(class="form-label-upload") }} - {% if form.name.errors %} - {{ form.name(class="form-control invalid-form") }} -
- {% for error in form.name.errors %} - {{ error }} - {% endfor %} -
- {% else %} - {{ form.name(class="form-control fc-upload") }} - {% endif %} +
+ +
+
+

Details

- -
- {{ form.author.label(class="form-control-label") }} - {% if form.author.errors %} - {{ form.author(class="form-control invalid-form") }} -
- {% for error in form.author.errors %} - {{ error }} - {% endfor %} -
- {% else %} - {{ form.author(class="form-control") }} - {% endif %} -
- -
- {{ form.version.label(class="form-control-label") }} - {% if form.version.errors %} - {{ form.version(class="form-control invalid-form") }} -
- {% for error in form.version.errors %} - {{ error }} - {% endfor %} -
- {% else %} - {{ form.version(class="form-control") }} - {% endif %} +
+ +
+ {{ form.name.label(class="form-label fl-upload") }} + {% if form.name.errors %} + {{ form.name(class="form-control invalid-form") }} +
+ {% for error in form.name.errors %} + {{ error }} + {% endfor %} +
+ {% else %} + {{ form.name(class="form-control fc-upload") }} + {% endif %} +
+ +
+ {{ form.author.label(class="form-label fl-upload") }} + {% if form.author.errors %} + {{ form.author(class="form-control invalid-form") }} +
+ {% for error in form.author.errors %} + {{ error }} + {% endfor %} +
+ {% else %} + {{ form.author(class="form-control fc-upload") }} + {% endif %} +
+ +
+ {{ form.version.label(class="form-label fl-upload") }} + {% if form.version.errors %} + {{ form.version(class="form-control invalid-form") }} +
+ {% for error in form.version.errors %} + {{ error }} + {% endfor %} +
+ {% else %} + {{ form.version(class="form-control fc-upload") }} + {% endif %} +
- - - -
- {{ form.category.label(class="form-control-label") }} - {% if form.category.errors %} - {{ form.category(class="form-control invalid-form") }} -
- {% for error in form.category.errors %} - {{ error }} - {% endfor %} + +
+
+

Categorization

+
+
+ +
+ {{ form.category.label(class="form-label fl-upload") }} + {% if form.category.errors %} + {{ form.category(class="form-control invalid-form") }} +
+ {% for error in form.category.errors %} + {{ error }} + {% endfor %} +
+ {% else %} +

Select the main category. If your animation package comprises + animations from several categories please select an "Overhaul" category.

+ {{ form.category(class="form-control fc-upload fc-select") }} + {% endif %}
- {% else %} - {{ form.category(class="form-control") }} - {% endif %} -
- -
- {{ form.summary.label(class="form-control-label") }} - {% if form.summary.errors %} - {{ form.summary(class="form-control invalid-form") }} -
- {% for error in form.summary.errors %} - {{ error }} - {% endfor %} + +
+ {{ form.nsfw.label(class="form-label fl-upload") }} + {% if form.nsfw.errors %} + {{ form.nsfw(class="form-control invalid-form") }} +
+ {% for error in form.nsfw.errors %} + {{ error }} + {% endfor %} +
+ {% else %} +

If your animation package pertains to NSFW animations such as + sex animations or if you upload images that are of a sexual nature please check + the box below.

+ {{ form.nsfw(class="form-control fc-upload", id="fc-nsfw") }} + {% endif %}
- {% else %} - {{ form.summary(class="form-control") }} - {% endif %} +
- -
- {{ form.description.label(class="form-control-label") }} - {% if form.description.errors %} - {{ form.description(class="form-control invalid-form") }} -
- {% for error in form.description.errors %} - {{ error }} - {% endfor %} + +
+
+

Description

+
+
+ +
+ {{ form.summary.label(class="form-label fl-upload") }} + {% if form.summary.errors %} + {{ form.summary(class="form-control invalid-form") }} +
+ {% for error in form.summary.errors %} + {{ error }} + {% endfor %} +
+ {% else %} +

Please provide short summary of your animation package which + visitors see when browsing packages. Limited to 230 characters or less.

+ {{ form.summary(class="form-control fc-upload", id="fc-summary") }} + {% endif %}
- {% else %} - {{ form.description(class="form-control") }} - {% endif %} -
- -
- {{ form.requirements.label(class="form-control-label") }} - {% if form.requirements.errors %} - {{ form.requirements(class="form-control invalid-form") }} -
- {% for error in form.requirements.errors %} - {{ error }} - {% endfor %} + +
+ {{ form.description.label(class="form-label fl-upload") }} + {% if form.description.errors %} + {{ form.description(class="form-control invalid-form") }} +
+ {% for error in form.description.errors %} + {{ error }} + {% endfor %} +
+ {% else %} +

Detailed description of your animation package. Does not + currently support any markdown language such as BBCode.

+ {{ form.description(class="form-control fc-upload", id="fc-desc") }} + {% endif %}
- {% else %} - {{ form.requirements(class="form-control") }} - {% endif %} +
- -
- {{ form.nsfw.label(class="form-control-label") }} - {% if form.nsfw.errors %} - {{ form.nsfw(class="form-control invalid-form") }} -
- {% for error in form.nsfw.errors %} - {{ error }} - {% endfor %} + +
+
+

Requirements

+
+ +
+

Add Requirements

+

It is imperative that people know what animation files are required to + ensure that they can download your animation package. Once you have uploaded your animation + package all .hkx files (Skyrim animation files) are removed to ensure that no intellectual + property rights are infringed upon. You can read a more thorough description of why this + step is so important at LINK.

+
+ {{ form.requirements.label(class="form-label fl-label") }} + {% if form.requirements.errors %} + {{ form.requirements(class="form-control invalid-form") }} +
+ {% for error in form.requirements.errors %} + {{ error }} + {% endfor %} +
+ {% else %} + {{ form.requirements(class="form-control fc-upload", id="fc-requirements") }} + {% endif %}
- {% else %} - {{ form.nsfw(class="form-control") }} - {% endif %} +
+