I have decided to come back to the drawing board, and redesign the editor a bit to make things clearer, and easier to code.
Here is how the creation and maintenance page looks now.
As you can see, I have replaced all the different lists by only one, and when you want to change the values, just click in the cell and edit it.
3rd column is the requirement to build the unit, 4th to train it, and 5th to maintain it.
Value can range from 0 to 9. 0 means the requirement doesn't exist.
For the resource, the value is the number of resource needed, for building and technology it is a level. My idea is to avoid to have "Cavalry warfare", "mounted warfare", "cavalry tactics", "cavalry tradition", which are a bit artificial, but to use "cavalry warfare - Level 1" "cavalry warfare - level 2", etc. Or perhaps with more explicit names, lile "ancien cavalry tactics", "medieval cavalry tactics".
So in this screenshot, the Greek spearman weapons can be build with Bronze working level 2 and 2 copper.
The unit can be trained with Militarism level 2, a barrack and no resource, but will use 2 manpower.
Then, the upkeep will require Militarism and bronze working level 1, a barrack, 1 copper and 1 population.
It means that if you have bronze working level 1, you cannot build the unit but can train it and upkeep it. So you can try to buy the weapons from a faction with bronze working level 2. If you have militarism level 1, you cannot train the unit either, but you can recruit mercenaries and then upkeep it.
With militarism or bronze working at 0, you can still buy the unit, but cannot upkeep it. Losses taken during battle won't be replaced, and the unit can lose HP regularly (lack of training, weapons deteriorating, etc).
You can compare it with the screenshot in the first page.
All the pages will undergone such a refitting, so I hope you like it.