Peel, seed and cut the squash into 1/2-inch cubes. Dump the squash into a heavy saucepan or Dutch oven, add a 1/4 cup of olive oil, the chile flakes, and a hefty, 3-finger pinch of salt. Place the pan over medium-high heat, and cover it.
Cook until the squash is tender, about 15 to 20 minutes, lifting the lid occasionally to stir. The squash should quickly sauté and steam. Adjust the heat if necessary so the squash doesn't burn. (Alternatively, you can roast your squash at 425° F until tender.)
While the squash is cooking, make the onion jam: In a small saucepan, heat the remaining 1/4 cup of oil over medium heat, and add the onions, stirring, and cook until they begin to soften and darken, about 15 minutes. Add the vinegar and syrup, and reduce until everything is jammy. Depending on the surface area of your pan, this could take as little as 15 minutes or as long as 30. When it looks as though it's ready to be spread on toast and it tastes tart-sweet, it's ready.
Add the onion mixture to the cooked squash, stirring gently so as to preserve a few chunks of squash. Taste, and season with salt or more chile if needed -- the mixture should have a nice heat.
Cut your loaf of bread in half along its equator, and lightly toast the bottom half. Spread a thick layer of ricotta on the bread, and then a layer of the squash-onion mixture. Sprinkle with a bit of flaky salt and a bit of olive oil, then scatter the chopped mint on top.