thredded 0.10.1 → 0.11.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (89) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +30 -10
  3. data/app/assets/images/favicons/README.md +3 -0
  4. data/app/assets/images/favicons/amazon.png +0 -0
  5. data/app/assets/images/favicons/github.png +0 -0
  6. data/app/assets/images/favicons/google_branding/logo_calendar_128px.png +0 -0
  7. data/app/assets/images/favicons/google_branding/logo_docs_48px.png +0 -0
  8. data/app/assets/images/favicons/google_branding/logo_drive_48px.png +0 -0
  9. data/app/assets/images/favicons/google_branding/logo_forms_48px.png +0 -0
  10. data/app/assets/images/favicons/google_branding/logo_sheets_48px.png +0 -0
  11. data/app/assets/images/favicons/google_branding/logo_slides_48px.png +0 -0
  12. data/app/assets/images/favicons/stackexchange.png +0 -0
  13. data/app/assets/images/favicons/twitter.png +0 -0
  14. data/app/assets/images/favicons/wikipedia.png +0 -0
  15. data/app/assets/javascripts/thredded/components/user_preferences_form.es6 +16 -1
  16. data/app/assets/stylesheets/thredded/_email.scss +52 -0
  17. data/app/assets/stylesheets/thredded/_thredded.scss +1 -0
  18. data/app/assets/stylesheets/thredded/base/_grid.scss +14 -1
  19. data/app/assets/stylesheets/thredded/base/_typography.scss +4 -0
  20. data/app/assets/stylesheets/thredded/base/_variables.scss +24 -1
  21. data/app/assets/stylesheets/thredded/components/_main-section.scss +6 -0
  22. data/app/assets/stylesheets/thredded/components/_messageboard.scss +4 -1
  23. data/app/assets/stylesheets/thredded/components/_onebox.scss +284 -0
  24. data/app/assets/stylesheets/thredded/components/_post.scss +10 -6
  25. data/app/assets/stylesheets/thredded/components/_topic-header.scss +1 -1
  26. data/app/assets/stylesheets/thredded/components/_topics.scss +5 -5
  27. data/app/assets/stylesheets/thredded/layout/_main-navigation.scss +0 -6
  28. data/app/assets/stylesheets/thredded/layout/_moderation.scss +1 -1
  29. data/app/commands/thredded/autofollow_users.rb +56 -0
  30. data/app/controllers/thredded/preferences_controller.rb +2 -0
  31. data/app/forms/thredded/user_preferences_form.rb +18 -0
  32. data/app/helpers/thredded/application_helper.rb +3 -3
  33. data/app/jobs/thredded/auto_follow_and_notify_job.rb +1 -1
  34. data/app/mailer_previews/thredded/base_mailer_preview.rb +19 -8
  35. data/app/mailers/thredded/base_mailer.rb +1 -1
  36. data/app/models/concerns/thredded/post_common.rb +2 -4
  37. data/app/models/thredded/category.rb +4 -0
  38. data/app/models/thredded/messageboard.rb +12 -6
  39. data/app/models/thredded/private_topic.rb +4 -0
  40. data/app/models/thredded/topic.rb +9 -5
  41. data/app/models/thredded/user_messageboard_preference.rb +24 -0
  42. data/app/models/thredded/user_preference.rb +2 -0
  43. data/app/models/thredded/user_topic_follow.rb +1 -1
  44. data/app/notifiers/thredded/email_notifier.rb +1 -15
  45. data/app/views/thredded/messageboard_groups/new.html.erb +15 -13
  46. data/app/views/thredded/messageboards/_form.html.erb +22 -22
  47. data/app/views/thredded/messageboards/edit.html.erb +3 -1
  48. data/app/views/thredded/messageboards/new.html.erb +3 -1
  49. data/app/views/thredded/moderation/_post.html.erb +1 -1
  50. data/app/views/thredded/moderation/_user_post.html.erb +1 -1
  51. data/app/views/thredded/moderation/activity.html.erb +3 -3
  52. data/app/views/thredded/moderation/history.html.erb +2 -2
  53. data/app/views/thredded/moderation/pending.html.erb +2 -2
  54. data/app/views/thredded/moderation/user.html.erb +43 -41
  55. data/app/views/thredded/moderation/users.html.erb +32 -30
  56. data/app/views/thredded/post_mailer/post_notification.html.erb +21 -12
  57. data/app/views/thredded/posts/_content.html.erb +1 -1
  58. data/app/views/thredded/posts_common/_content.html.erb +1 -3
  59. data/app/views/thredded/preferences/_form.html.erb +25 -8
  60. data/app/views/thredded/private_posts/_content.html.erb +1 -1
  61. data/app/views/thredded/private_topic_mailer/message_notification.html.erb +17 -14
  62. data/app/views/thredded/private_topics/edit.html.erb +21 -19
  63. data/app/views/thredded/topics/edit.html.erb +32 -30
  64. data/app/views/thredded/topics/new.html.erb +8 -6
  65. data/app/views/thredded/topics/show.html.erb +1 -1
  66. data/app/views/thredded/users/_post.html.erb +1 -1
  67. data/bin/rubocop +17 -0
  68. data/config/locales/en.yml +13 -1
  69. data/config/locales/es.yml +14 -0
  70. data/config/locales/pl.yml +13 -0
  71. data/config/locales/pt-BR.yml +12 -0
  72. data/config/locales/ru.yml +197 -0
  73. data/db/migrate/20160329231848_create_thredded.rb +2 -8
  74. data/db/upgrade_migrations/20161113161801_upgrade_v0_8_to_v0_9.rb +6 -5
  75. data/db/upgrade_migrations/20170312131417_upgrade_thredded_v0_10_to_v0_11.rb +20 -0
  76. data/lib/generators/thredded/install/templates/initializer.rb +12 -0
  77. data/lib/thredded.rb +12 -3
  78. data/lib/thredded/content_formatter.rb +16 -25
  79. data/lib/thredded/email_transformer.rb +21 -0
  80. data/lib/thredded/email_transformer/base.rb +47 -0
  81. data/lib/thredded/email_transformer/onebox.rb +20 -0
  82. data/lib/thredded/formatting_demo_content.rb +29 -0
  83. data/lib/thredded/html_pipeline/kramdown_filter.rb +5 -1
  84. data/lib/thredded/html_pipeline/onebox_filter.rb +136 -0
  85. data/lib/thredded/version.rb +1 -1
  86. metadata +62 -22
  87. data/app/commands/thredded/autofollow_mentioned_users.rb +0 -31
  88. data/app/commands/thredded/members_marked_notified.rb +0 -19
  89. data/app/models/thredded/post_notification.rb +0 -18
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 584af3429d4903d4e71c2a9c6ade98a1ce121505
4
- data.tar.gz: 0c4a78eaeb21357be674af2a152bf0e72a35ad9c
3
+ metadata.gz: 2ce9beaa49ff6dabd99f962836ab829e691de0bf
4
+ data.tar.gz: a2760f759370094628101ac41ab618a16f358393
5
5
  SHA512:
6
- metadata.gz: 4fca75e1a3052d79bb58f55202add9746e393418a04d5afca1e07cfa95fd90301eaced3f63189493f94639722d1a689f06170e586388a06ba12fadbee65c0a72
7
- data.tar.gz: 4bb3d36a5fa56b0180e5f73c6c4de8cd5130805e07d0057dabef25d580d1a1de178441b96df0321c8f9c5cd700759a72caf006b7abe7783e51dc2be77fa16501
6
+ metadata.gz: fa1e55d7ef10e1bfc8404746b7773bd3652c9f78b73ddb6300d698c32dd8f58f5ac09bf4eea6d0a4b84295e4d7d8efb50cbe0f5c6be0dbb28a8de80e89358c1b
7
+ data.tar.gz: be8da3f5f1ac118215a12b5122069b2c801c5e6941e8d8ec014cef9acdbb31f5ef09afb8185430e8287877983cf9e01bf6ec2daf9f0c26a3baeec06e3f2eca2a
data/README.md CHANGED
@@ -56,7 +56,7 @@ Then, see the rest of this Readme for more information about using and customizi
56
56
  Add the gem to your Gemfile:
57
57
 
58
58
  ```ruby
59
- gem 'thredded', '~> 0.10.1'
59
+ gem 'thredded', '~> 0.11.0'
60
60
  ```
61
61
 
62
62
  Add the Thredded [initializer] to your parent app by running the install generator.
@@ -300,6 +300,8 @@ any duplicate CSS.
300
300
  ### Email and other notifications
301
301
 
302
302
  Thredded sends several notification emails to the users. You can override in the same way as the views.
303
+ See [this page](https://github.com/thredded/thredded/wiki/Styling-email-content) on how to style the emails.
304
+
303
305
  If you use [Rails Email Preview], you can include Thredded emails into the list of previews by adding
304
306
  `Thredded::BaseMailerPreview.preview_classes` to the [Rails Email Preview] `preview_classes` config option.
305
307
 
@@ -310,18 +312,26 @@ You can also turn off the email notifier totally, or add other notifiers (e.g. P
310
312
 
311
313
  ## I18n
312
314
 
313
- Thredded is mostly internationalized. It is currently available in English, Brazilian Portuguese, Polish, and Spanish.
315
+ Thredded is mostly internationalized. It is currently available in English, Brazilian Portuguese, Polish, Russian,
316
+ and Spanish.
314
317
  We welcome PRs adding support for new languages.
315
318
 
316
- If you use thredded in languages other than English, you probably want to add `rails-i18n` to your Gemfile.
317
- Additionally, you will need to require the translations for rails-timeago in your JavaScript before `thredded` but
318
- after `jquery.timeago` (included in `thredded/dependencies`). E.g. for Brazilian Portuguese:
319
+ Here are the steps to ensure the best support for your language if it isn't English:
319
320
 
320
- ```js
321
- //= require thredded/dependencies
322
- //= require locales/jquery.timeago.pt-br
323
- //= require thredded/thredded
324
- ```
321
+ 1. Add `rails-i18n` to your Gemfile.
322
+
323
+ 2. Require the translations for rails-timeago in your JavaScript before `thredded` but after `jquery.timeago`
324
+ (included in `thredded/dependencies`). E.g. for Brazilian Portuguese:
325
+
326
+ ```js
327
+ //= require thredded/dependencies
328
+ //= require locales/jquery.timeago.pt-br
329
+ //= require thredded/thredded
330
+ ```
331
+
332
+ 3. To generate URL slugs for messageboards, categories, and topics with support for more language than English,
333
+ you can use a gem like [babosa](https://github.com/norman/babosa).
334
+ Add babosa to your Gemfile and uncomment the `Thredded.slugifier` proc for babosa in the initializer.
325
335
 
326
336
  ## Permissions
327
337
 
@@ -494,6 +504,16 @@ To disable moderation, e.g. if you run internal forums that do not need moderati
494
504
  change_column_default :thredded_user_details, :moderation_state, 1 # approved
495
505
  ```
496
506
 
507
+ ### Enabling auto-follow
508
+
509
+ In some cases, you'll want all users to auto-follow new messageboard topics by default. This might be useful
510
+ for a team messageboard or a company announcements board, for example. To enable user auto-follow of new topics,
511
+ run the following migration(s):
512
+
513
+ ```ruby
514
+ change_column_default :thredded_user_preferences, :auto_follow_topics, 1
515
+ ```
516
+
497
517
  ## Plugins
498
518
 
499
519
  The following official plugins are available for Thredded:
@@ -0,0 +1,3 @@
1
+ These icons are copied from the Discourse repo:
2
+
3
+ https://github.com/discourse/discourse/tree/a43ec88f46b1698cb2fbd08983b715011f882c45/app/assets/images/favicons
@@ -1,6 +1,7 @@
1
1
  (($) => {
2
2
  const COMPONENT_SELECTOR = '[data-thredded-user-preferences-form]';
3
3
  const BOUND_MESSAGEBOARD_NAME = 'data-thredded-bound-messageboard-pref';
4
+ const UPDATE_ON_CHANGE_NAME = 'data-thredded-update-checkbox-on-change';
4
5
 
5
6
  class MessageboardPreferenceBinding {
6
7
  constructor($form, genericCheckboxName, messageboardCheckboxName) {
@@ -26,15 +27,29 @@
26
27
  .prop('disabled', !enabled)
27
28
  .filter(':checkbox').prop('checked', enabled ? this.messageboardCheckedWas : false);
28
29
  }
30
+ }
29
31
 
32
+ class UpdateOnChange {
33
+ constructor($form, $sourceElement, targetName) {
34
+ const $target = $form.find(`:checkbox[name="${targetName}"]`);
35
+ if (!$target.length) return;
36
+ $sourceElement.on('change', () => {
37
+ $target.prop('checked', $sourceElement.prop('checked'));
38
+ });
39
+ }
30
40
  }
41
+
31
42
  class UserPreferencesForm {
32
43
  constructor(form) {
33
44
  const $form = $(form);
34
45
  $form.find(`input[${BOUND_MESSAGEBOARD_NAME}]`).each((index, element) => {
35
46
  const $elem = $(element);
36
47
  new MessageboardPreferenceBinding($form, $elem.attr('name'), $elem.attr(BOUND_MESSAGEBOARD_NAME));
37
- })
48
+ });
49
+ $form.find(`input[${UPDATE_ON_CHANGE_NAME}]`).each((index, element) => {
50
+ const $elem = $(element);
51
+ new UpdateOnChange($form, $elem, $elem.attr(UPDATE_ON_CHANGE_NAME))
52
+ });
38
53
  }
39
54
  }
40
55
 
@@ -0,0 +1,52 @@
1
+ @import "thredded/base";
2
+ @import "thredded/components/post";
3
+ @import "thredded/components/onebox";
4
+
5
+ .thredded--email {
6
+ font-family: $thredded-base-font-family;
7
+ color: $thredded-text-color;
8
+ -webkit-font-smoothing: antialiased;
9
+ font-size: 16px;
10
+ line-height: 1.5;
11
+
12
+ a {
13
+ @extend %thredded--link;
14
+ }
15
+ hr {
16
+ @extend %thredded--hr;
17
+ }
18
+ }
19
+
20
+ .thredded--email-post {
21
+ margin: 0;
22
+
23
+ &--author {
24
+ margin-bottom: 1em;
25
+ }
26
+
27
+ .thredded--post--content {
28
+ font-size: inherit;
29
+ border-left: solid 5px $thredded-blockquote-border-color;
30
+ margin: 0 0 0.75rem;
31
+ padding: ($thredded-small-spacing / 2) $thredded-small-spacing;
32
+
33
+ .onebox-wrapper-table {
34
+ width: 100%;
35
+ td {
36
+ border: $thredded-base-border;
37
+ text-align: left;
38
+ padding: $thredded-small-spacing;
39
+ > aside.onebox {
40
+ margin-bottom: 0;
41
+ padding: 0;
42
+ border: 0;
43
+ box-shadow: none;
44
+ }
45
+ }
46
+ }
47
+
48
+ aside.onebox {
49
+ margin-bottom: $thredded-small-spacing;
50
+ }
51
+ }
52
+ }
@@ -31,3 +31,4 @@
31
31
  @import "components/topic-header";
32
32
  @import "components/topics";
33
33
  @import "components/preview_area";
34
+ @import "components/onebox";
@@ -30,8 +30,21 @@
30
30
  }
31
31
  }
32
32
 
33
+ @mixin thredded-media-content-breakout {
34
+ @media (min-width: $thredded-grid-container-max-width + $thredded-content-breakout-min-width + 0.00001rem) {
35
+ @content;
36
+ }
37
+ }
38
+
39
+ @mixin thredded-media-content-no-breakout {
40
+ @media (max-width: $thredded-grid-container-max-width + $thredded-content-breakout-min-width) {
41
+ @content;
42
+ }
43
+ }
44
+
33
45
  @mixin thredded-media-avatar-breakout {
34
- @media (min-width: $thredded-grid-container-max-width + 4rem) {
46
+ @warn "thredded-media-avatar-breakout is deprecated, use thredded-media-content-breakout instead";
47
+ @include thredded-media-content-breakout {
35
48
  @content;
36
49
  }
37
50
  }
@@ -47,6 +47,10 @@
47
47
  p:last-of-type {
48
48
  margin-bottom: 0;
49
49
  }
50
+
51
+ @include thredded-media-mobile {
52
+ padding: ($thredded-small-spacing / 2) $thredded-small-spacing;
53
+ }
50
54
  }
51
55
 
52
56
  %thredded--embed-16-by-9 {
@@ -2,6 +2,10 @@
2
2
  $thredded-grid-container-max-width: 43.125rem !default;
3
3
  $thredded-grid-breakpoint-max-widths: (mobile: 34rem, tablet: 48rem) !default;
4
4
 
5
+ // Minimum width required for the content that breaks out of the container, such
6
+ // as post avatars and topic post counts
7
+ $thredded-content-breakout-min-width: 4rem !default;
8
+
5
9
  // Typography
6
10
  $thredded-base-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", Arial, sans-serif !default;
7
11
  $thredded-base-font-size: 1rem !default; // 16px
@@ -31,11 +35,12 @@ $thredded-action-transition: color 0.1s linear !default;
31
35
  $thredded-nav-color: $thredded-text-color !default;
32
36
  $thredded-nav-hover-color: $thredded-action-color !default;
33
37
  $thredded-nav-current-color: $thredded-action-color !default;
34
- $thredded-overlay-background-color: $thredded-background-color !default;
38
+ $thredded-overlay-background-color: opacify($thredded-background-color, 1) !default;
35
39
  $thredded-overlay-box-shadow: 0 2px 2px 0 rgba(0, 0, 0, .14), 0 3px 1px -2px rgba(0, 0, 0, .2), 0 1px 5px 0 rgba(0, 0, 0, .12) !default;
36
40
  $thredded-secondary-nav-color: $thredded-secondary-text-color !default;
37
41
  $thredded-spoiler-hidden-color: $thredded-light-gray !default;
38
42
  $thredded-spoiler-shown-color: black !default;
43
+ $thredded-code-selected-line-background: #f8eec7 !default;
39
44
 
40
45
 
41
46
  // Colors of alerts and flash messages
@@ -86,6 +91,22 @@ $thredded-badge-active-background: $thredded-action-color !default;
86
91
  $thredded-badge-inactive-color: $thredded-button-color !default;
87
92
  $thredded-badge-inactive-background: rgba($thredded-text-color, 0.3) !default;
88
93
 
94
+ // Onebox
95
+ $thredded-onebox-favicons: (
96
+ 'amazon': 'favicons/amazon.png',
97
+ 'githubblob': 'favicons/github.png',
98
+ 'githubcommit': 'favicons/github.png',
99
+ 'githubgist': 'favicons/github.png',
100
+ 'githubissue': 'favicons/github.png',
101
+ 'githubpullrequest': 'favicons/github.png',
102
+ 'googledocs': 'favicons/google_branding/logo_drive_48px.png',
103
+ 'stackexchange': 'favicons/stackexchange.png',
104
+ 'twitterstatus': 'favicons/twitter.png',
105
+ 'wikipedia': 'favicons/wikipedia.png',
106
+ ) !default;
107
+ // Properties applied based on the image filename:
108
+ $thredded-onebox-favicon-properties: () !default;
109
+
89
110
  // Layout features
90
111
 
91
112
  // Messageboards grid
@@ -112,3 +133,5 @@ $thredded-messageboards-grid-item-flex-basis: 21.5rem !default;
112
133
 
113
134
  // Topics list
114
135
  $thredded-topics-list-gutter-y: $thredded-base-spacing !default;
136
+ $thredded-topics-topic-posts-counter-width: 3rem !default;
137
+ $thredded-topics-topic-follow-icon-width: 2rem !default;
@@ -1,3 +1,9 @@
1
1
  .thredded--main-section {
2
2
  margin-bottom: $thredded-large-spacing;
3
+ @include thredded-media-tablet {
4
+ margin-bottom: $thredded-base-spacing;
5
+ }
6
+ @include thredded-media-mobile {
7
+ margin-bottom: $thredded-small-spacing;
8
+ }
3
9
  }
@@ -1,6 +1,9 @@
1
1
  .thredded--messageboards-group {
2
2
  box-sizing: border-box;
3
- margin-bottom: $thredded-base-spacing;
3
+ &--title {
4
+ font-size: 1em;
5
+ margin: 0.75em 0 0.625em 0;
6
+ }
4
7
  }
5
8
 
6
9
  .thredded--messageboard {
@@ -0,0 +1,284 @@
1
+ // Roughly based on the Discourse onebox styles:
2
+ // https://github.com/discourse/discourse/blob/a6dd1a2cd4f13965bcd59ad2f9af44e13b45cbe6/app/assets/stylesheets/common/base/onebox.scss
3
+
4
+ aside.onebox,
5
+ .maps-onebox,
6
+ .thredded--embed-16-by-9 {
7
+ margin-bottom: $thredded-small-spacing;
8
+ }
9
+
10
+ aside.onebox {
11
+ border: $thredded-base-border;
12
+ box-shadow: 0 1px 3px 0 rgba(0, 0, 0, .2), 0 1px 1px 0 rgba(0, 0, 0, .14), 0 2px 1px -1px rgba(0, 0, 0, .12);
13
+ padding: $thredded-small-spacing;
14
+ line-height: normal;
15
+ font-size: 0.85em;
16
+
17
+ %onebox-favicon {
18
+ background: no-repeat 50% 50%;
19
+ background-size: 16px 16px;
20
+ content: ' ';
21
+ display: inline-block;
22
+ height: 16px;
23
+ vertical-align: bottom;
24
+ width: 16px;
25
+ margin-right: 0.4em;
26
+ }
27
+
28
+ @each $class, $image in $thredded-onebox-favicons {
29
+ &.#{$class} .source > a::before {
30
+ @extend %onebox-favicon;
31
+ background-image: image-url($image);
32
+ @each $name, $value in map-get($thredded-onebox-favicon-properties, $image) {
33
+ #{$name}: $value;
34
+ }
35
+ }
36
+ }
37
+
38
+ header {
39
+ a[href] {
40
+ color: $thredded-secondary-text-color;
41
+ text-decoration: none;
42
+ }
43
+ }
44
+
45
+ .onebox-body {
46
+ clear: both;
47
+
48
+ h3, h4 {
49
+ font-size: 1em;
50
+ margin: 10px 0;
51
+ }
52
+
53
+ img {
54
+ max-height: 80%;
55
+ max-width: 20%;
56
+ height: auto;
57
+ float: left;
58
+ margin-right: 1em;
59
+ }
60
+
61
+ .tweet-images {
62
+ display: block;
63
+ clear: both;
64
+
65
+ img.tweet-image {
66
+ margin-top: 1em;
67
+ max-width: 100%;
68
+ max-height: 100%;
69
+ float: none;
70
+ }
71
+ }
72
+ }
73
+ }
74
+
75
+ .googledocs-onebox-logo {
76
+ width: 60px;
77
+ height: 50px;
78
+ float: left;
79
+ @each $type in docs, forms, sheets, slides, calendar, drive {
80
+ &.g-#{$type}-logo {
81
+ background: image-url("favicons/google_branding/logo_#{$type}_48px.png") no-repeat;
82
+ }
83
+ }
84
+ }
85
+
86
+ // Google Calendar Placeholder
87
+ .gdocs-onebox-splash {
88
+ background-color: $thredded-overlay-background-color;
89
+ color: $thredded-text-color;
90
+ border: 1px inset $thredded-text-color;
91
+ .gdocs-onebox-logo {
92
+ display: inline-block;
93
+ width: 128px;
94
+ height: 128px;
95
+ &.g-calendar-logo {
96
+ background: image-url("favicons/google_branding/logo_calendar_128px.png") no-repeat;
97
+ }
98
+ }
99
+ }
100
+
101
+ aside.onebox .onebox-body .onebox-avatar {
102
+ max-height: none;
103
+ max-width: none;
104
+ height: 90px;
105
+ width: 90px;
106
+ }
107
+
108
+ // -- Onebox Github Code Blob --
109
+ pre.onebox code {
110
+ font-size: 14px;
111
+ tab-size: 4;
112
+ white-space: normal;
113
+
114
+ ol.lines li:before {
115
+ position: absolute;
116
+ display: inline-block;
117
+ width: 35px;
118
+ left: -40px;
119
+ color: #afafaf;
120
+ text-align: right;
121
+ padding-right: 5px;
122
+ font-size: 12px;
123
+ line-height: 1.9em;
124
+ content: counter(li-counter);
125
+ counter-increment: li-counter;
126
+ }
127
+
128
+ ol {
129
+ margin-left: 0;
130
+ line-height: 1.5em;
131
+ }
132
+
133
+ li {
134
+ padding-left: 5px;
135
+ }
136
+
137
+ ol.lines {
138
+ padding: 0;
139
+ margin: 0 0 0.2rem 2rem;
140
+ position: relative;
141
+ }
142
+
143
+ ol.lines li {
144
+ border-left: 1px solid $thredded-base-border-color;
145
+ list-style-type: none;
146
+ margin: 0;
147
+ min-height: 1.5em; // show empty li lines
148
+ padding-left: 5px;
149
+ white-space: pre;
150
+ }
151
+
152
+ li.selected {
153
+ background-color: $thredded-code-selected-line-background;
154
+ }
155
+ }
156
+
157
+ // Onebox - Github - Pull request
158
+ .onebox-body {
159
+ .github-commit-status {
160
+ background: #f5f5f5;
161
+ border-radius: 5px;
162
+ margin: 0 0 5px 100px;
163
+ padding: 10px;
164
+ }
165
+
166
+ .status_tag {
167
+ display: inline-block;
168
+ color: #fff;
169
+ padding: 1px 4px;
170
+ border-radius: 3px;
171
+ font-weight: bold;
172
+ margin-bottom: 5px;
173
+ text-transform: capitalize;
174
+ }
175
+
176
+ .build_status {
177
+ padding: 2px;
178
+ font-size: 12px;
179
+ }
180
+
181
+ .status_tag.open {
182
+ background-color: #6cc644;
183
+ }
184
+
185
+ .status_tag.merged {
186
+ background-color: #6e5494;
187
+ }
188
+
189
+ .status_tag.closed {
190
+ background-color: #bd2c00;
191
+ }
192
+
193
+ .github-content-right {
194
+ margin-left: 100px;
195
+ }
196
+ }
197
+
198
+ // Onebox - Google Maps
199
+ .maps-onebox {
200
+ // The onebox gem adds a div with inline styles that breaks mobile
201
+ // Hide the div
202
+ > div:first-child {
203
+ display: none;
204
+ }
205
+ }
206
+
207
+ // Onebox - Twitter - Status
208
+ aside.onebox.twitterstatus .onebox-body {
209
+ h4 {
210
+ margin-bottom: 0;
211
+ }
212
+ }
213
+
214
+ .onebox.twitterstatus {
215
+ .thumbnail {
216
+ float: left;
217
+ }
218
+ p, .tweet {
219
+ float: left;
220
+ display: inline-block;
221
+ white-space: pre-wrap;
222
+ padding-top: 3px;
223
+ width: 85%;
224
+ }
225
+ .date {
226
+ clear: left;
227
+ padding-top: 5px;
228
+ }
229
+ }
230
+
231
+ // Onebox - Imgur - Album
232
+ .onebox.imgur-album {
233
+ .outer-box {
234
+ position: absolute;
235
+ z-index: 935;
236
+ height: 30px;
237
+ overflow: hidden;
238
+ font-size: 12px;
239
+ color: #fff;
240
+ background-color: rgba(0, 0, 0, 0.6);
241
+ text-overflow: ellipsis;
242
+ max-width: 100%;
243
+
244
+ .inner-box {
245
+ padding-left: 10px;
246
+ padding-right: 10px;
247
+ overflow: hidden;
248
+ text-overflow: ellipsis;
249
+ word-wrap: normal;
250
+ white-space: nowrap;
251
+
252
+ .album-title {
253
+ width: 100%;
254
+ font-size: 13px;
255
+ line-height: 30px;
256
+ color: #ccc;
257
+ text-decoration: none;
258
+ }
259
+ }
260
+ }
261
+ }
262
+
263
+ // Resize stackexchange onebox image
264
+ aside.onebox.stackexchange .onebox-body {
265
+ img {
266
+ max-height: 60%;
267
+ max-width: 10%;
268
+ }
269
+
270
+ .tags {
271
+ color: gray;
272
+ }
273
+ }
274
+
275
+ .onebox-metadata {
276
+ color: $thredded-secondary-text-color;
277
+ }
278
+
279
+ .onebox.xkcd .onebox-body {
280
+ img {
281
+ max-width: 100% !important;
282
+ float: none !important;
283
+ }
284
+ }