diff options
author | Douwe Maan <douwe@gitlab.com> | 2015-08-27 16:24:51 +0000 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2015-08-27 16:24:51 +0000 |
commit | 30555c1d24af25aca0c6e85f52234a8a570b7691 (patch) | |
tree | fd40fb02e465ae97db65d9e3fb89ba26bd8237ee /app/controllers/application_controller.rb | |
parent | abb5b9f6e526195c4eb027d5b7c28e070d9ac3c1 (diff) | |
parent | ce0a0feff45b47b6c03b9ab01d815b651840a7b2 (diff) | |
download | gitlab-ce-30555c1d24af25aca0c6e85f52234a8a570b7691.tar.gz |
Merge branch 'rs-remove-user-color-scheme-class' into 'master'
Apply syntax highlighting to fenced code blocks client-side
Instead of applying the syntax highlighting scheme class to these blocks
server-side, we use Javascript and Gon to apply the user's color scheme
(or the default) client-side.
This will make it easier to cache these blocks in the future because
they're no longer state-dependent.
See merge request !1203
Diffstat (limited to 'app/controllers/application_controller.rb')
-rw-r--r-- | app/controllers/application_controller.rb | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index ef1170e16da..cb1cf13d34d 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -192,11 +192,12 @@ class ApplicationController < ActionController::Base end def add_gon_variables + gon.api_version = API::API.version + gon.default_avatar_url = URI::join(Gitlab.config.gitlab.url, ActionController::Base.helpers.image_path('no_avatar.png')).to_s gon.default_issues_tracker = Project.new.default_issue_tracker.to_param - gon.api_version = API::API.version - gon.relative_url_root = Gitlab.config.gitlab.relative_url_root - gon.default_avatar_url = URI::join(Gitlab.config.gitlab.url, ActionController::Base.helpers.image_path('no_avatar.png')).to_s - gon.max_file_size = current_application_settings.max_attachment_size; + gon.max_file_size = current_application_settings.max_attachment_size + gon.relative_url_root = Gitlab.config.gitlab.relative_url_root + gon.user_color_scheme = Gitlab::ColorSchemes.for_user(current_user).css_class if current_user gon.current_user_id = current_user.id |