Peel, seed and cut squash into 1/2-inch cubes. Place squash in 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 pan over medium-high heat, and cover. Cook until squash is tender, about 15 to 20 minutes, lifting lid occasionally to stir. The squash should quickly sauté and steam. Adjust heat if necessary so squash doesn't burn. (Alternatively, roast squash at 425° F until tender.)
While squash is cooking, make onion jam: In small saucepan, heat remaining 1/4 cup of oil over medium heat, and add onions, stirring, and cook until they begin to soften and darken, about 15 minutes. Add vinegar and syrup, and reduce until everything is jammy. Depending on surface area of 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 onion mixture to 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 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. If using feta, spread squash mixture on bread followed by crumbled feta. Sprinkle with a bit of flaky salt and a bit of olive oil, scatter chopped mint on top.