Loss-tolerant all-photonic quantum repeater with generalized Shor code