Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Just-In-Timeberlake
Aug 18, 2003
jesus gently caress there is nothing more aggravating to deal with than CORS bullshit when it comes to web dev

Adbot
ADBOT LOVES YOU

prom candy
Dec 16, 2005

Only I may dance
Is that too long to be a thread title?

Volguus
Mar 3, 2009

Just-In-Timeberlake posted:

jesus gently caress there is nothing more aggravating to deal with than CORS bullshit when it comes to web dev

Why are you trying to talk to websites other than the one you're loaded from? And why from the browser directly when you can do it from the server?

Just-In-Timeberlake
Aug 18, 2003

Volguus posted:

Why are you trying to talk to websites other than the one you're loaded from? And why from the browser directly when you can do it from the server?

I've got an API running on AWS Lambda.

I've got a website hosted elsewhere.

They have to talk to each other, it's not that hard to imagine.

Volguus
Mar 3, 2009

Just-In-Timeberlake posted:

I've got an API running on AWS Lambda.

I've got a website hosted elsewhere.

They have to talk to each other, it's not that hard to imagine.

Come on, they should talk through the server, not just willy-nilly like that. That website's server component.

Cugel the Clever
Apr 5, 2009
I LOVE AMERICA AND CAPITALISM DESPITE BEING POOR AS FUCK. I WILL NEVER RETIRE BUT HERE'S ANOTHER 200$ FOR UKRAINE, SLAVA
I like Jen, but hooboy is this just about the worst take:


Some good responses, though:
https://twitter.com/BenDelarre/status/1490750660303851523

teen phone cutie
Jun 18, 2012

last year i rewrote something awful from scratch because i hate myself

Volguus posted:

Why are you trying to talk to websites other than the one you're loaded from? And why from the browser directly when you can do it from the server?

ITT we are web developers from TYOOL 2000

kedo
Nov 27, 2007

CSS will never catch on! Javascript is just a dumb gimmick for making text follow a mouse cursor, nothing more!

Pablo Bluth
Sep 7, 2007

I've made a huge mistake.
If a web page (not mine) is using a <video> element, is there a way stats about the video it's playing? I want to check the resolution/framerate/bitrate of the video file?

Pablo Bluth fucked around with this message at 22:15 on Feb 7, 2022

Data Graham
Dec 28, 2009

📈📊🍪😋



Tables and <FONT> tags ftw!!!

prom candy
Dec 16, 2005

Only I may dance

Cugel the Clever posted:

I like Jen, but hooboy is this just about the worst take:



I never realized not liking Safari is toxic masculinity

Nolgthorn
Jan 30, 2001

The pendulum of the mind alternates between sense and nonsense

kedo posted:

CSS will never catch on! Javascript is just a dumb gimmick for making text follow a mouse cursor, nothing more!

I heard javascript is picking up adoption rates at an alarming speed, god help us

Vincent Valentine
Feb 28, 2006

Murdertime

Speaking of being y2000 devs, a few years ago I had to do some research in adapting a website for a Japanese audience so I needed to see their design ideas to make it fit in nicely with what they'd expect to be seeing.

Observe, the biggest website in Japan by a huge margin: https://www.yahoo.co.jp/ (view on desktop, not mobile)

Leshy
Jun 21, 2004

I was going to make a joke about that page certainly having to be accessible via the URL https://www.geocities.com/tokyo/yahoo, but had to look up the most appropriate neighbourhood name on Wikipedia. Then I read the following snippet: "The GeoCities Japan version of the service endured until March 31, 2019."

So yeah, up until recently, it may very well have been :v:

Leshy fucked around with this message at 10:47 on Feb 10, 2022

kedo
Nov 27, 2007

Man, Geocities was just awesome. :allears: The early days of the internet were a whole lot of fun before everything got so darn serious and standardized and forced into various competing Javascript frameworks.

It was just dancing babies and web rings and <marquee> elements. It was beautiful.

Data Graham
Dec 28, 2009

📈📊🍪😋



Can't we go back to when a guest book and a hit counter were the extent of web programming

Doh004
Apr 22, 2007

Mmmmm Donuts...
I thought I was hot poo poo when I got a cjb.net subdomain for my Geocities site.

chami
Mar 28, 2011

Keep it classy, boys~
Fun Shoe

Data Graham posted:

Can't we go back to when a guest book and a hit counter were the extent of web programming

Frames were the poo poo, none of this overly complicated grid BS for your sidebars :okboomer:

Vincent Valentine
Feb 28, 2006

Murdertime

chami posted:

Frames were the poo poo, none of this overly complicated grid BS for your sidebars :okboomer:

They were great because you could always have your frame there when the user navigated to another website so eventually you could just have a huge pile of frames, like a group of friends on a bar crawl picking up more friends as they go along.

Mursupitsku
Sep 12, 2011
I have an idea for a pretty simple website that features a "calculator" of sorts. Visitor on the site could enter some values and then some simple calculations are performed and a results is shown.

However I have no idea where to start with setting up a website. How big of an effort would setting up such a site be? I only have some programming experience with python but I'm a fast learner and picking up anything new shouldn't be a problem.

Can someone point me to a good beginners guide for creating such a website? Googling anything related to setting up a website seems to come up with a lot of sites that seem like little more than an advertisement for something or other.

Verisimilidude
Dec 20, 2006

Strike quick and hurry at him,
not caring to hit or miss.
So that you dishonor him before the judges



Mursupitsku posted:

I have an idea for a pretty simple website that features a "calculator" of sorts. Visitor on the site could enter some values and then some simple calculations are performed and a results is shown.

However I have no idea where to start with setting up a website. How big of an effort would setting up such a site be? I only have some programming experience with python but I'm a fast learner and picking up anything new shouldn't be a problem.

Can someone point me to a good beginners guide for creating such a website? Googling anything related to setting up a website seems to come up with a lot of sites that seem like little more than an advertisement for something or other.

You can host it on GitHub pages for free. Then later on if you get a url for it you can attach the url to the GitHub pages repository. It’s a very easy way to deploy something, and works great for apps and sites that don’t have backend data to worry about.

aperfectcirclefan
Nov 21, 2021

by Hand Knit

Mursupitsku posted:

I have an idea for a pretty simple website that features a "calculator" of sorts. Visitor on the site could enter some values and then some simple calculations are performed and a results is shown.

However I have no idea where to start with setting up a website. How big of an effort would setting up such a site be? I only have some programming experience with python but I'm a fast learner and picking up anything new shouldn't be a problem.

Can someone point me to a good beginners guide for creating such a website? Googling anything related to setting up a website seems to come up with a lot of sites that seem like little more than an advertisement for something or other.

Since you know Python you're probably best off learning Flask and doing it in that.

https://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-i-hello-world

D34THROW
Jan 29, 2012

RETAIL RETAIL LISTEN TO ME BITCH ABOUT RETAIL
:rant:

aperfectcirclefan posted:

Since you know Python you're probably best off learning Flask and doing it in that.

https://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-i-hello-world

Gonna second this, both recommendations. Miguel Grinberg's tutorial has gotten me very far both with SQLAlchemy (ORM is loving fantastic, holy poo poo; I can parse it mentally so much easier than SQL) and with Flask.

I'm a little pissed though. I got to the Bootstrap chapter after spending an inordinate amount of time loving with CSS to get it exactly right and it's like "oh, here's a nice framework you can fit to your needs".

minato
Jun 7, 2004

cutty cain't hang, say 7-up.
Taco Defender
Does the calculation have to involve a backend server? Or can it all be done on the client? If it's the latter, then you only need to serve a static website with the web pages and Javascript files, and that's a lot easier to create and maintain. As someone said above, you can host it for free on Github Pages or various other places.

But as soon as your calculator needs a database or server-side processing, things will get (relatively) more complicated.

Mursupitsku
Sep 12, 2011

minato posted:

Does the calculation have to involve a backend server? Or can it all be done on the client? If it's the latter, then you only need to serve a static website with the web pages and Javascript files, and that's a lot easier to create and maintain. As someone said above, you can host it for free on Github Pages or various other places.

But as soon as your calculator needs a database or server-side processing, things will get (relatively) more complicated.

I'm such a novice that I don't really know which kind of sites need a backend but I'm guessing that it doesn't need one. Think something like this: https://www.unitconverters.net/ (but not related to converting units lol).

Thanks for all the helpful comments. Already set up a hello world page on github pages.

How do these website builders fit into all this? Are they worth using? After doing some google searches I constantly get ads for them.

Can you have ads on a "github pages" website?

minato
Jun 7, 2004

cutty cain't hang, say 7-up.
Taco Defender
Website builders are tools for compiling a set of pages that all share some common components. Like, say you want to have a website with an About page, a Contact page, the Home page, etc; you'll likely want all those to share the same look & feel, headers, footers, etc. Website building tools use simple languages to define all the components and how they're shared, and then the tools compile these to produce the actual HTML / JavaScript / CSS that you upload to your web host.

You can host ads on static sites. Not sure about Github Pages specifically. Once you know you just need a static site, there are a lot of options.

However the language you'll need to write your calculator in *will* be JavaScript. That's really the only option for any client-side code.


E: There's 2 types of "website builders". I was referring to "static site" website builders. But the term can also apply to drag-n-drop website creation sites like Squarespace, which are designed for non-engineers to create a basic website, with the downside that you're locked into their ecosystem/hosting.

minato fucked around with this message at 22:06 on Feb 14, 2022

CarForumPoster
Jun 26, 2013

⚡POWER⚡

minato posted:


However the language you'll need to write your calculator in *will* be JavaScript. That's really the only option for any client-side code.


E: There's 2 types of "website builders". I was referring to "static site" website builders. But the term can also apply to drag-n-drop website creation sites like Squarespace, which are designed for non-engineers to create a basic website, with the downside that you're locked into their ecosystem/hosting.

There are python-only options for the calculator that wrap react.

I pitch Dash basically anytime someone needs a single page app and prefers Python. Everything done in Python. Good ecosystem.

https://plotly.com/dash/

D34THROW
Jan 29, 2012

RETAIL RETAIL LISTEN TO ME BITCH ABOUT RETAIL
:rant:
:bang: Okay, so I'm running into an issue that has me ready to spit nails. After much loving around, I am getting exactly nowhere.

Python Flask app, I have a <table> element that has a header section of sorts and a varying number of <tr> elements below that, each of which holds an entry of a FieldList from WTForms.

The page itself has a <nav> section and a <footer> section, then between them a <div> which I want to act as a sort of scrolling independent viewport. I've tried every combination of clip and scroll and auto in the CSS that I can imagine, but no matter what I do the same thing happens: Above an certain number of data rows, based on viewport height, the table overflows its parent <div> and the scrollbar never activates. I want the <div> to clip the table to its "viewport" and be scrollable, without affecting the <nav> and <footer> sections.

kedo
Nov 27, 2007

That sounds like a CSS issue... can you recreate it in a JS Fiddle or something to share?

teen phone cutie
Jun 18, 2012

last year i rewrote something awful from scratch because i hate myself
Anyone have a definitive guide they know of for Dockerizing a flask app with mysql and nginx, complete with saving database data with volumes?

D34THROW
Jan 29, 2012

RETAIL RETAIL LISTEN TO ME BITCH ABOUT RETAIL
:rant:

kedo posted:

That sounds like a CSS issue... can you recreate it in a JS Fiddle or something to share?

90% of the problem code is generated by jinja2 and I'd have to manually recreate it in HTML. Here's the relevant CSS and HTML, if that helps?

CSS code:
#header {
    position: absolute; 
    top: 0;
    width: 100%;
    padding-top: 5px;
    padding-bottom: 5px;
    border-bottom: solid 1px dimgrey;
    text-align: center;
    vertical-align: baseline;
    /* height: 32px; */
    height: 5vh;
    overflow: auto;
}

#footer {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 3vh;
    padding-top: 5px;
    padding-bottom: 5px;
    border-top: solid 1px dimgrey;
    color: dimgrey;
    text-align: center;
    vertical-align: middle;
}	

#multiline {
    overflow: auto;
    position: absolute;
    top: 7vh;
    /* bottom: 5vh; */
    height: 85vh;
    width: 99%;
    border: 1px solid red;
}

table.multiline {
    table-layout: fixed;
    width: 80%;
}
table.multiline is the containing table for the aforementioned "header" section and <tr>s that contain <tables> for each row of line data, populated by Flask and WTForms.

base.html
HTML code:
<html>
    <head>
        <title>{{ title }}</title>
        <link type="text/css" rel="stylesheet" 
            href={{ url_for('static', filename="css/styles.css")}} />
        <link rel="shortcut icon" 
            href="{{ url_for('static', filename='favicon.ico') }}">
    </head>
    <body>
    {% block content %}{% endblock %}
    <footer id="footer">
        <span style="display: inline-block;">
            Design and Programming &copy; Copyright 2022 by $me | 
            Images &copy; Copyright {{ year }} 
            <a href="https://icons8.com/icons/ultraviolet">
                icons8.com Blue UI set
            </a>
        </span>
    </footer>
    </body>
</html>
logged_in.html
HTML code:
{% extends "base.html" %}

{% block content %}
<div id="content">
    {% block page %}{% endblock %}
</div>
{% endblock %}
index.html
HTML code:
{% extends "logged_in.html" %}

{% block page %}
<nav id="header">
    <table class="mainheader">
        <td class="headleft" vertical-align="middle">
            Logged in as {{ session["USERNAME"] }}.
        </td>
        <td class="headmiddle">
            {{ title }}
        </td>
        <td class="headright">
            <a href="{{ url_for('main_menu') }}">
                <img class="size32"
                    src="{{ url_for('static', filename='/img/home.png') }}"
                    alt='Main Menu'
                    title='Main Menu'>
            </a>
            <a href="{{ url_for('bug_report') }}">
                <img class="size32"
                    src="{{ url_for('static', filename='/img/bug.png') }}"
                    alt='Report a Bug'
                    title='Report a Bug'>
            </a>
            {% if admin %}
            <a href="{{ url_for('admin_panel') }}">
                <img class="size32"
                    src="{{ url_for('static', filename='/img/admin.png') }}"
                    alt='Administrative Panel'
                    title='Administrative Panel'>
            </a>
            {% endif %}
            <a href="{{ url_for('auth.logout') }}">
                <img class="logout"
                    src="{{ url_for('static', filename='/img/logout.png') }}"
                    alt='Log Out of WhiteUtils Web'
                    title='Log Out of WhiteUtils Web'>
            </a>
        </td>
    </table>
</nav>
{% with messages = get_flashed_messages() %}
                    {% if messages %}
                    <div id="messages-authed">
                    <ul class="flash">
                        {% for message in messages %}
                        <li>{{ message }}</li>
                        {% endfor %}
                    </ul>
                    </div>
                    {% endif %}
                    {% endwith %}
<div id="page-content">
    {% block pagecontent %}{% endblock %}
</div>
{% endblock %}
stormpanel.html, where the issue is occurring:
HTML code:
{% extends "index.html" %}

{% block pagecontent %}
<div id="multiline">
<form action="" method="post" novalidate>
    {{ form.hidden_tag() }}
    <table class="centered multiline">
        <colgroup>
            <col>
            <col>
            <col>
            <col>
        </colgroup>
        <tr>
            <td colspan="4" class="header">Storm Panel Calculator</td>
        </tr>
        <tr>
            <td colspan="2">
                {% with messages = get_flashed_messages() %}
                    {% if messages %}
                        <div id="messages-anon">
                            <ul class="flash-login">
                                {% for message in messages %}
                                    <li>{{ message }}</li>
                                {% endfor %}
                            </ul>
                        </div>
                    {% endif %}
                {% endwith %}
            </td>
        </tr>
        <tr>
            <td class="ml-label">{{form.name.label}}</td>
                <td class="ml-control">{{ form.name(width=48) }}</td>
            <td class="ml-label">{{form.job_no.label}}</td>
                <td class="ml-control">{{ form.job_no(width=8) }}</td>
        </tr>
        <tr>
            <td>Notes</td>
        </tr>
        <tr>
            <td colspan="4" class="ml-notes">{{ form.notes }}</td>
        </tr>
        <tr>
            <td colspan="2" class="ml-buttons">{{ form.add_line }}</td>
            <td colspan="2" class="ml-buttons">{{ form.submit }}</td>
        </tr>
        <tr>
            <td colspan="4" style="font-size:80%; font-family: sans-serif; 
                text-align:center; padding: 16px">
                Please round all measurements to the <i>next</i> full inch.</td>
        </tr>
        <tr>
            <td colspan="4">
                {% for line in form.lines %}
                <table class="calcline">
                    <colgroup>
                        <col>
                        <col>
                        <col>
                        <col>
                        <col>
                        <col>
                        <col>
                        <col>
                        <col>
                    </colgroup>
                    <tr>
                        <td rowspan="3" class="calcline-rowno">
                            {{line.name.split('-')[1] | int + 1}}
                        </td>
                        <td class="calcline-label">{{line.width.label}}</td>
                            <td class="calcline-control">{{line.width(width=8)}}</td>
                        <td class="calcline-label">{{line.height.label}}</td>
                            <td class="calcline-control">{{line.height(width=8)}}</td>
                        <td class="calcline-label">{{line.clear_panels.label}}</td>
                            <td class="calcline-control">{{line.clear_panels(width=8)}}</td>
                    </tr>
                    <tr>
                        <td class="calcline-label">{{line.direction.label}}</td>
                            <td class="calcline-control">
                                {%for radio in line.direction %}
                                    {{radio}} {{radio.label}}
                                {% endfor %}
                            </td>
                        <td class="calcline-label">{{line.removable.label}}</td>
                            <td class="calcline-control">
                                {%for radio in line.removable %}
                                    {{radio}} {{radio.label}}
                                {% endfor %}
                            </td>
                        <td class="calcline-label">{{line.trapped.label}}</td>
                            <td class="calcline-control">
                                {%for radio in line.trapped %}
                                    {{radio}} {{radio.label}}
                                {% endfor %}
                            </td>
                    </tr>
                    <tr>
                        <td class="calcline-label">{{line.buildout.label}}</td>
                            <td class="calcline-control">{{line.buildout}}</td>
                        <td class="calcline-label">{{line.top_attachment.label}}</td>
                            <td class="calcline-control">{{line.top_attachment}}</td>
                        <td class="calcline-label">{{line.bottom_attachment.label}}</td>
                            <td class="calcline-control">{{line.bottom_attachment}}</td>
                    </tr>
                </table>
                {% endfor %}
            </td>
        </tr>
    </table>
</form>
</div>
{% endblock %}

div#page-content, in my perfect world, will be its own little frame of sorts that acts as a scrollable, clipping viewport for table.multiline in stormpanel.html. Make sense? I can't make it work, table.multiline just clips over everything and becomes completely unscrollable past n rows based on viewport height.

Also, I know tables are way deprecated. I can't wrap my head around flexboxes and grids right now and this is targeted at Chromium-based browsers on Windows. I tried other methods and it just breaks me.


EDIT: Looking at it now, with borders on div#pagecontent and height set to auto, the table isn't even like...fitting in the div. The div is like one line up at the top of the viewport, above the table. This is occurring even when I add a div#multiline around the <form> on stormpanel.html and change #pagecontent to #multiline in the CSS; the table is completely outside of the div.

EDIT 2: What the gently caress, it's not looking like even though table.multiline is inside div#multiline, the table isn't considered a child of the div? Assigning a background color to children of div#multiline does exactly jack gently caress to table.multiline. :suicide:

Lumpy posted:

You don't even have a div#multiline ?

Added it in VSCode, forgot to add it on here. :doh: On JSFiddle, a table inside a form inside a div is acting as expected.

D34THROW fucked around with this message at 22:23 on Feb 15, 2022

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice
You don't even have a div#multiline ?

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice
I can't really guess without you posting the rendered output, but since you are absolute positioning everything (why?) my guess is it is some interaction with all those absolutes and what they think they are parented to.

D34THROW
Jan 29, 2012

RETAIL RETAIL LISTEN TO ME BITCH ABOUT RETAIL
:rant:
Eh, I appreciate it but gently caress it all. I'm redesigning the whole thing up with bootstrap and all-new everything, using grids. I'm learning this poo poo as I go along, and when I'm doing straight code, I have a little tougher of a time visualizing grids in my head, I think, than tables.

kedo
Nov 27, 2007

Honestly you'll have an easier time, even if you have to learn grids from scratch. Tables are a huge pain in the rear end to style at the best of times.

CarForumPoster
Jun 26, 2013

⚡POWER⚡

kedo posted:

Honestly you'll have an easier time, even if you have to learn grids from scratch. Tables are a huge pain in the rear end to style at the best of times.

This

D34THROW posted:

Eh, I appreciate it but gently caress it all. I'm redesigning the whole thing up with bootstrap and all-new everything, using grids. I'm learning this poo poo as I go along, and when I'm doing straight code, I have a little tougher of a time visualizing grids in my head, I think, than tables.

Sounds like you're recreating plotly dash + dash bootstrap components.

Also probably half your posts in this and the Python thread you just never would have made.

You need to make some business dashboard/calculator wrapper on your businesses DB/API/ERP is basically the ideal use case for dash.

minato
Jun 7, 2004

cutty cain't hang, say 7-up.
Taco Defender

CarForumPoster posted:

You need to make some business dashboard/calculator wrapper on your businesses DB/API/ERP is basically the ideal use case for dash.
I was intrigued by this and took a brief look, but it seems Dash is (a) targeted at data science workflows rather than general purpose stuff, and (b) requires Dash Enterprise (for presumably $$$) if I wanted to do anything that wasn't a toy. Was that a misjudgement? Do you have an example of a "regular" website built in Dash you could point me at?

D34THROW
Jan 29, 2012

RETAIL RETAIL LISTEN TO ME BITCH ABOUT RETAIL
:rant:
It's not a wrapper on the ERP DBs. It's a standalone thing that works on data that isn't available on the ERP. I'd love to have access to the user, customer, and job tables to simplify that end of things, but the chances of a lowly branch purchasing agent getting that kind of access are nil. No API that I know of either.

It's less the logic and more the views that are giving me hell. I know how to pass to the page what I want to pass, it's making it display nicely that's making me mad.

CarForumPoster posted:

Also probably half your posts in this and the Python thread you just never would have made.

Ah gently caress, I'm this guy now? At least I'm actively trying to climb out of the well before everyone starts pissing in it.

aperfectcirclefan
Nov 21, 2021

by Hand Knit
Do any of you deal with Hubspot CRM and HubL? I fukkin hate it and wish I could use ACF

Adbot
ADBOT LOVES YOU

prom candy
Dec 16, 2005

Only I may dance
I've worked with the hub spot CRM a bit. It's not a great api.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply