diff --git a/app/assets/javascripts/livepage.js.coffee.erb b/app/assets/javascripts/livepage.js.coffee similarity index 80% rename from app/assets/javascripts/livepage.js.coffee.erb rename to app/assets/javascripts/livepage.js.coffee index 6890eaea3..b8f3e80fc 100644 --- a/app/assets/javascripts/livepage.js.coffee.erb +++ b/app/assets/javascripts/livepage.js.coffee @@ -7,8 +7,11 @@ window.Livepage = angular.module 'Livepage', [] configFunc = ($logProvider) -> - $logProvider.debugEnabled <%= !Settings.disable_js_debugging %> + $logProvider.debugEnabled window.debug or window.insider configFunc.$inject = ['$logProvider'] window.Livepage.config configFunc + + + diff --git a/app/models/user.rb b/app/models/user.rb index 2edaf0391..1605731de 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -136,7 +136,7 @@ def for_select end def insider? - email =~ /@voicerepublic.com^/ + !!(email =~ /@voicerepublic.com$/) end end diff --git a/app/views/talks/show.html.haml b/app/views/talks/show.html.haml index 5232408f1..7952201c9 100644 --- a/app/views/talks/show.html.haml +++ b/app/views/talks/show.html.haml @@ -299,5 +299,8 @@ = t('.just_listening_in') .scripts + :javascript + window.debug = #{!Settings.disable_js_debugging}; + window.insider = #{current_user.insider?}; = javascript_include_tag 'livepage' = render 'config'