Moving average filter using DF-I and DF-II
To start, notice that the diagrams are in the $\mathcal{Z}$ domain, multiplying by $z^{-1}$ is the delay of one sample.
DF-I
Writing the equation for $y_n$ of the DF-I
$$y_n = \sum_{k=0}^{M} b_k x_{n-k} - \sum_{l=1}^{N} a_{l} y_{n-l}$$
Comparing with the equation of the moving average
$$y_n = \sum_{k=0}^{M} \frac{1}{M+1} x_{n-k}$$
we see that we could realise the moving average by settings $b_k=1/(M+1)$, and $N$ set to zero.
DF-II
For the DF-II realization you the sequences $a$ and $b$ must have the same size, so what we can do is to set $a_l=0$, and $b_k = 1/(M+1)$.
If you choose to compute a moving sum then $b_k=1$ and you can save the multiplications, the moving average still can be computed by a gain, thus, performing one multiplication per sample instead of $M+1$ multiplications per sample.