Added QRCode and link to configure android application

This commit is contained in:
Nicolas Lœuillet 2016-10-31 16:16:41 +01:00
parent 5feef9f7a4
commit e61ee56031
8 changed files with 59 additions and 39 deletions

View file

@ -1,5 +1,7 @@
const $ = require('jquery'); const $ = require('jquery');
var jrQrcode = require('jr-qrcode');
function supportsLocalStorage() { function supportsLocalStorage() {
try { try {
return 'localStorage' in window && window.localStorage !== null; return 'localStorage' in window && window.localStorage !== null;

View file

@ -99,5 +99,8 @@
"stylelint": "^7.3.1", "stylelint": "^7.3.1",
"stylelint-config-standard": "^13.0.2", "stylelint-config-standard": "^13.0.2",
"through": "^2.3.8" "through": "^2.3.8"
},
"dependencies": {
"jr-qrcode": "^1.0.5"
} }
} }

View file

@ -149,6 +149,7 @@ class ConfigController extends Controller
'token' => $config->getRssToken(), 'token' => $config->getRssToken(),
], ],
'twofactor_auth' => $this->getParameter('twofactor_auth'), 'twofactor_auth' => $this->getParameter('twofactor_auth'),
'wallabag_url' => $this->get('craue_config')->get('wallabag_url'),
'enabled_users' => $this->getDoctrine() 'enabled_users' => $this->getDoctrine()
->getRepository('WallabagUserBundle:User') ->getRepository('WallabagUserBundle:User')
->getSumEnabledUsers(), ->getSumEnabledUsers(),

View file

@ -71,6 +71,18 @@
</div> </div>
</div> </div>
<div class="row">
<div class="input-field col s12">
<h5>Configure your Android application</h5>
<a href="wallabag://{{ app.user.username }}@{{ wallabag_url }}" class="waves-effect waves-light btn hide-on-large-only">Touch here to prefill your Android application</a>
<img id="androidQrcode" class="hide-on-med-and-down" />
</div>
<script>
var imgBase64 = jrQrcode.getQrBase64('wallabag://{{ app.user.username }}@{{ wallabag_url }}');
document.getElementById('androidQrcode').src=imgBase64;
</script>
</div>
{{ form_widget(form.config.save, {'attr': {'class': 'btn waves-effect waves-light'}}) }} {{ form_widget(form.config.save, {'attr': {'class': 'btn waves-effect waves-light'}}) }}
{{ form_rest(form.config) }} {{ form_rest(form.config) }}
</form> </form>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long