Skip to content

Commit b9e6052

Browse files
authored
Merge pull request #986 from indentlabs/jul-18-changes
Document table changes & other polish
2 parents 99efc21 + c2f3338 commit b9e6052

File tree

162 files changed

+592
-384
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

162 files changed

+592
-384
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
$(document).ready(function () {
2+
$('.material-icons').attr('translate', 'no');
3+
});

app/controllers/contributors_controller.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ def destroy
99

1010
# Create a notification letting the user know!
1111
user.notifications.create(
12-
message_html: "<div>You have been removed as a contributor from the <span class='#{Universe.color}-text'>#{relevant_universe.name}</span> universe.</div>",
12+
message_html: "<div>You have been removed as a contributor from the <span class='#{Universe.text_color}'>#{relevant_universe.name}</span> universe.</div>",
1313
icon: Universe.icon,
1414
icon_color: Universe.color,
1515
happened_at: DateTime.current,
@@ -18,7 +18,7 @@ def destroy
1818

1919
# Create a notification letting the universe owner know
2020
relevant_universe.user.notifications.create(
21-
message_html: "<div><span class='#{User.color}-text'>#{user.display_name}</span> has stopped collaborating on your <span class='#{Universe.color}-text'>#{relevant_universe.name}</span> universe.</div>",
21+
message_html: "<div><span class='#{User.text_color}'>#{user.display_name}</span> has stopped collaborating on your <span class='#{Universe.text_color}'>#{relevant_universe.name}</span> universe.</div>",
2222
icon: Universe.icon,
2323
icon_color: Universe.color,
2424
happened_at: DateTime.current,

app/controllers/documents_controller.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ def index
3232
.where(context: 'Document', parent_folder_id: nil)
3333
.order('title ASC')
3434

35+
# TODO: can we reuse this content to skip a few queries in this controller action?
36+
cache_linkable_content_for_each_content_type
37+
3538
# TODO: all of this filtering code is repeated everywhere and would be nice to abstract out somewhere
3639
if params.key?(:favorite_only)
3740
@documents = @documents.where(favorite: true)

app/controllers/page_collection_submissions_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def approve
6464

6565
# Create a notification for the submitter to let them know it's been accepted
6666
@page_collection_submission.user.notifications.create(
67-
message_html: "<div>Your <span class='#{@page_collection_submission.content.class.color}-text'>#{@page_collection_submission.content.name}</span> #{@page_collection_submission.content_type.downcase} submission to <span class='#{PageCollection.color}-text'>#{@page_collection_submission.page_collection.title}</span> was approved!</div>",
67+
message_html: "<div>Your <span class='#{@page_collection_submission.content.class.text_color}'>#{@page_collection_submission.content.name}</span> #{@page_collection_submission.content_type.downcase} submission to <span class='#{PageCollection.text_color}'>#{@page_collection_submission.page_collection.title}</span> was approved!</div>",
6868
icon: PageCollection.icon,
6969
icon_color: PageCollection.color,
7070
happened_at: DateTime.current,

app/controllers/registrations_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ def add_account
8484
# Create a notification letting the user know about each collaboration!
8585
potential_contributor_records.each do |contributorship|
8686
resource.notifications.create(
87-
message_html: "<div>You have been added as a contributor to the <span class='#{Universe.color}-text'>#{contributorship.universe.name}</span> universe.</div>",
87+
message_html: "<div>You have been added as a contributor to the <span class='#{Universe.text_color}'>#{contributorship.universe.name}</span> universe.</div>",
8888
icon: Universe.icon,
8989
icon_color: Universe.color,
9090
happened_at: DateTime.current,

app/controllers/user_followings_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def create
3030

3131
# Create a notification letting the user know!
3232
@user_following.followed_user.notifications.create(
33-
message_html: "<div><span class='#{User.color}-text'>#{@user_following.user.display_name}</span> is now following your public updates.</div>",
33+
message_html: "<div><span class='#{User.text_color}'>#{@user_following.user.display_name}</span> is now following your public updates.</div>",
3434
icon: User.icon,
3535
icon_color: User.color,
3636
happened_at: DateTime.current,

app/jobs/content_page_share_notification_job.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def perform(*args)
1313
next if comment.user == following.user
1414

1515
following.user.notifications.create(
16-
message_html: "<div><span class='#{User.color}-text'>#{comment.user.display_name}</span> commented on #{comment.user == comment.content_page_share.content_page.user ? 'the' : 'your'} shared #{comment.content_page_share.content_page.class.name.downcase} <span class='#{comment.content_page_share.content_page.class.color}-text'>#{comment.content_page_share.content_page.name}</span>.</div>",
16+
message_html: "<div><span class='#{User.text_color}'>#{comment.user.display_name}</span> commented on #{comment.user == comment.content_page_share.content_page.user ? 'the' : 'your'} shared #{comment.content_page_share.content_page.class.name.downcase} <span class='#{comment.content_page_share.content_page.class.text_color}'>#{comment.content_page_share.content_page.name}</span>.</div>",
1717
icon: comment.content_page_share.content_page.class.icon,
1818
icon_color: comment.content_page_share.content_page.class.color,
1919
happened_at: DateTime.current,

app/jobs/document_analysis_job.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def perform(*args)
3838

3939
# Create a notification letting the user know!
4040
analysis.document.user.notifications.create(
41-
message_html: "<div>An analysis of <span class='#{Document.color}-text'>#{analysis.document.title}</span> is ready to view.</div>",
41+
message_html: "<div>An analysis of <span class='#{Document.text_color}'>#{analysis.document.title}</span> is ready to view.</div>",
4242
icon: Document.icon,
4343
icon_color: Document.color,
4444
happened_at: DateTime.current,

app/models/application_integration.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ def self.color
1414
'orange'
1515
end
1616

17+
def self.text_color
18+
'orange-text'
19+
end
20+
1721
def generate_new_access_token!
1822
self.update(application_token: SecureRandom.hex(24))
1923
end

app/models/documents/document.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,18 @@ def self.color
3232
'teal'
3333
end
3434

35+
def self.text_color
36+
'teal-text'
37+
end
38+
3539
def color
3640
Document.color
3741
end
3842

43+
def text_color
44+
Document.text_color
45+
end
46+
3947
def self.hex_color
4048
'#009688'
4149
end

0 commit comments

Comments
 (0)