stephenmcd/mezzanine — pull request #1071 by dsanders11 (2014-07-18 03:58:23+00:00)
Title: Add "device_group" to context via TemplateForDeviceMiddleware

#### Motivation

Sometimes it's more convenient to add device awareness to the main template instead of making a separate one. In situations where you just need to remove or add one small piece of HTML it is overkill to make a new block, and then a new template which extends and overrides the block.

#### Pull Request Change

Adds ``device_group`` as a context variable in TemplateForDeviceMiddleware to make it easy to do minor device aware template changes in a single main template.

Name could also be ``device_type``, group was chosen simply to stay somewhat consistent with the documentation.

A future change could be to add ``device_user_agent`` as well for more fine-grained control. That could be useful even within the device group specific templates in order to disable or enable features specific to a device.