We theoretically investigate the temperature-to-phase conversion (TPC) process occurring in dc superconducting quantum interferometers based on superconductor-normal-metal-superconductor (S-N-S) mesoscopic Josephson junctions. In particular, we predict the temperature-driven rearrangement of the phase gradients in the interferometer under the fixed constraints of fluxoid quantization and supercurrent conservation. This mechanism allows sizeable phase variations across the junctions for suitable structure parameters and temperatures. We show that the TPC can be a basis for sensitive single-photon sensors or bolometers. We propose a radiation detector realizable with conventional materials and state-of-the-art nanofabrication techniques. Integrated with a superconducting quantum-interference proximity transistor as a readout setup, an aluminum-based TPC calorimeter can provide a large signal-to-noise ratio >100 in the 10-GHz-10-THz frequency range and a resolving power larger than 102 below 50 mK for terahertz photons. In the bolometric operation, electrical noise equivalent power of approximately 10-22 W/Hz is predicted at 50 mK. This device can be attractive as a cryogenic single-photon sensor operating in the giga- and terahertz regime with applications in dark-matter searches.