FEATURE: Improve GitHub commit, PR and issue onebox rendering

FEATURE: Improve GitHub commit, PR and issue onebox rendering

Bump onebox version to include new github rendering, and add relevant CSS

Avatars are reduced in size significantly, and icons are added to easily differentiate PRs and commits. The ‘Issue:’ prefix is removed from issue oneboxes, to make them consistent with commits and PRs.

diff --git a/Gemfile b/Gemfile
index e9c9af1..7bafe7b 100644
--- a/Gemfile
+++ b/Gemfile
@@ -50,7 +50,7 @@ gem 'redis-namespace'
 
 gem 'active_model_serializers', '~> 0.8.3'
 
-gem 'onebox', '1.9.13'
+gem 'onebox', '1.9.14'
 
 gem 'http_accept_language', '~>2.0.5', require: false
 
diff --git a/Gemfile.lock b/Gemfile.lock
index ac2a8ca..7aab14d 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -245,7 +245,7 @@ GEM
     omniauth-twitter (1.4.0)
       omniauth-oauth (~> 1.1)
       rack
-    onebox (1.9.13)
+    onebox (1.9.14)
       htmlentities (~> 4.3)
       moneta (~> 1.0)
       multi_json (~> 1.11)
@@ -360,7 +360,7 @@ GEM
     ruby_dep (1.5.0)
     rubyzip (2.0.0)
     safe_yaml (1.0.5)
-    sanitize (5.0.0)
+    sanitize (5.1.0)
       crass (~> 1.0.2)
       nokogiri (>= 1.8.0)
       nokogumbo (~> 2.0)
@@ -501,7 +501,7 @@ DEPENDENCIES
   omniauth-oauth2
   omniauth-openid
   omniauth-twitter
-  onebox (= 1.9.13)
+  onebox (= 1.9.14)
   openid-redis-store
   parallel_tests
   pg
diff --git a/app/assets/stylesheets/common/base/onebox.scss b/app/assets/stylesheets/common/base/onebox.scss
index b00f53f..37f7245 100644
--- a/app/assets/stylesheets/common/base/onebox.scss
+++ b/app/assets/stylesheets/common/base/onebox.scss
@@ -378,6 +378,23 @@ pre.onebox code {
   white-space: normal;
 }
 
+// Onebox - Github - PR, Commit & Issue
+.onebox.githubpullrequest,
+.onebox.githubcommit,
+.onebox.githubissue {
+  .github-icon {
+    float: left;
+    margin-right: 10px;
+    fill: $primary-high;
+  }
+
+  .onebox-avatar-inline {
+    height: 1em;
+    width: 1em;
+    margin-right: 6px;
+  }
+}
+
 //Onebox - Github - Pull request
 .onebox-body .github-commit-status {
   background: #f5f5f5;

GitHub sha: 615039f2

1 Like