This website works better with JavaScript.
Home
Explore
Help
Sign In
closed-social
/
mastodon
Watch
3
Star
0
Fork
2
Code
Issues
5
Pull Requests
0
Projects
0
Releases
3
Wiki
Activity
Browse Source
Fixing some stuff for Turbolinks, adding gzip on top, fixing a n+1 query
closed-social-glitch-2
Eugen Rochko
8 years ago
parent
36f3da3cde
commit
318886287b
7 changed files
with
16 additions
and
3 deletions
Split View
Diff Options
Show Stats
Download Patch File
Download Diff File
+1
-1
Gemfile
+1
-1
app/assets/javascripts/mastodon-logo.coffee
+2
-0
app/assets/javascripts/profiler.coffee
+4
-0
app/assets/stylesheets/application.scss
+1
-1
app/models/status.rb
+1
-0
config/application.rb
+6
-0
config/initializers/rack-mini-profiler.rb
+ 1
- 1
Gemfile
View File
@ -66,5 +66,5 @@ group :production do
end
group
:development
,
:production
do
gem
'rack-mini-profiler'
gem
'rack-mini-profiler'
,
require
:
false
end
+ 1
- 1
app/assets/javascripts/mastodon-logo.coffee
View File
@ -44,5 +44,5 @@ work = ->
if
runs
==
stop_at_run
stop
(
)
$
->
$
(
document
)
.
on
'
turbolinks:load
'
,
->
setTimeout
(
start
,
100
)
+ 2
- 0
app/assets/javascripts/profiler.coffee
View File
@ -0,0 +1,2 @@
$
(
document
)
.
on
'
turbolinks:load
'
,
->
window
.
MiniProfiler
.
pageTransition
(
)
unless
typeof
window
.
MiniProfiler
==
'
undefined
'
+ 4
- 0
app/assets/stylesheets/application.scss
View File
@ -279,6 +279,10 @@ body {
}
}
.
turbolinks-progress-bar
{
background-color
:
#
2b90d9
;
}
.
mastodon
{
$head
:
#282c37
;
$tusk
:
#d9e1e8
;
+ 1
- 1
app/models/status.rb
View File
@ -17,7 +17,7 @@ class Status < ActiveRecord::Base
validates
:text
,
presence
:
true
,
if
:
Proc
.
new
{
|
s
|
s
.
local?
&&
!
s
.
reblog?
}
scope
:with_counters
,
-
>
{
select
(
'statuses.*, (select count(r.id) from statuses as r where r.reblog_of_id = statuses.id) as reblogs_count, (select count(f.id) from favourites as f where f.status_id = statuses.id) as favourites_count'
)
}
scope
:with_includes
,
-
>
{
includes
(
:account
,
:mentions
,
reblog
:
[
:account
,
:mentions
]
,
thread
:
[
:account
,
:mentions
]
)
}
scope
:with_includes
,
-
>
{
includes
(
:account
,
:mentions
,
:stream_entry
,
reblog
:
[
:account
,
:mentions
]
,
thread
:
[
:account
,
:mentions
]
)
}
def
local?
self
.
uri
.
nil?
+ 1
- 0
config/application.rb
View File
@ -37,5 +37,6 @@ module Mastodon
end
config
.
middleware
.
use
Rack
::
Attack
config
.
middleware
.
use
Rack
::
Deflater
end
end
+ 6
- 0
config/initializers/rack-mini-profiler.rb
View File
@ -0,0 +1,6 @@
require
'rack-mini-profiler'
Rack
::
MiniProfilerRails
.
initialize!
(
Rails
.
application
)
Rails
.
application
.
middleware
.
delete
(
Rack
::
MiniProfiler
)
Rails
.
application
.
middleware
.
insert_after
(
Rack
::
Deflater
,
Rack
::
MiniProfiler
)
Write
Preview
Loading…
Cancel
Save