Molecular Theory of Weak Polyelectrolyte Gels: The Role of pH and Salt Concentration