Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
gab-social
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
gab
social
gab-social
Commits
ff03e6a5
Commit
ff03e6a5
authored
Jul 22, 2019
by
2458773093
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
home feed group toggle
parent
bf2d5420
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
21 additions
and
12 deletions
+21
-12
app/controllers/settings/preferences_controller.rb
app/controllers/settings/preferences_controller.rb
+1
-0
app/lib/user_settings_decorator.rb
app/lib/user_settings_decorator.rb
+5
-0
app/models/user.rb
app/models/user.rb
+1
-1
app/serializers/initial_state_serializer.rb
app/serializers/initial_state_serializer.rb
+12
-11
app/views/settings/preferences/show.html.haml
app/views/settings/preferences/show.html.haml
+1
-0
config/locales/simple_form.en.yml
config/locales/simple_form.en.yml
+1
-0
No files found.
app/controllers/settings/preferences_controller.rb
View file @
ff03e6a5
...
...
@@ -50,6 +50,7 @@ class Settings::PreferencesController < Settings::BaseController
:setting_aggregate_reblogs
,
:setting_show_application
,
:setting_advanced_layout
,
:setting_group_in_home_feed
,
notification_emails:
%i(follow follow_request reblog favourite mention digest report pending_account)
,
interactions:
%i(must_be_follower must_be_following)
)
...
...
app/lib/user_settings_decorator.rb
View file @
ff03e6a5
...
...
@@ -34,6 +34,7 @@ class UserSettingsDecorator
user
.
settings
[
'aggregate_reblogs'
]
=
aggregate_reblogs_preference
if
change?
(
'setting_aggregate_reblogs'
)
user
.
settings
[
'show_application'
]
=
show_application_preference
if
change?
(
'setting_show_application'
)
user
.
settings
[
'advanced_layout'
]
=
advanced_layout_preference
if
change?
(
'setting_advanced_layout'
)
user
.
settings
[
'group_in_home_feed'
]
=
group_in_home_feed_preference
if
change?
(
'setting_group_in_home_feed'
)
end
def
merged_notification_emails
...
...
@@ -112,6 +113,10 @@ class UserSettingsDecorator
boolean_cast_setting
'setting_advanced_layout'
end
def
group_in_home_feed_preference
boolean_cast_setting
'setting_group_in_home_feed'
end
def
boolean_cast_setting
(
key
)
ActiveModel
::
Type
::
Boolean
.
new
.
cast
(
settings
[
key
])
end
...
...
app/models/user.rb
View file @
ff03e6a5
...
...
@@ -105,7 +105,7 @@ class User < ApplicationRecord
delegate
:auto_play_gif
,
:default_sensitive
,
:unfollow_modal
,
:boost_modal
,
:delete_modal
,
:reduce_motion
,
:system_font_ui
,
:noindex
,
:theme
,
:display_media
,
:hide_network
,
:expand_spoilers
,
:default_language
,
:aggregate_reblogs
,
:show_application
,
:advanced_layout
,
to: :settings
,
prefix: :setting
,
allow_nil:
false
:advanced_layout
,
:group_in_home_feed
,
to: :settings
,
prefix: :setting
,
allow_nil:
false
attr_reader
:invite_code
attr_writer
:external
...
...
app/serializers/initial_state_serializer.rb
View file @
ff03e6a5
...
...
@@ -23,17 +23,18 @@ class InitialStateSerializer < ActiveModel::Serializer
}
if
object
.
current_account
store
[
:username
]
=
object
.
current_account
.
username
store
[
:me
]
=
object
.
current_account
.
id
.
to_s
store
[
:unfollow_modal
]
=
object
.
current_account
.
user
.
setting_unfollow_modal
store
[
:boost_modal
]
=
object
.
current_account
.
user
.
setting_boost_modal
store
[
:delete_modal
]
=
object
.
current_account
.
user
.
setting_delete_modal
store
[
:auto_play_gif
]
=
object
.
current_account
.
user
.
setting_auto_play_gif
store
[
:display_media
]
=
object
.
current_account
.
user
.
setting_display_media
store
[
:expand_spoilers
]
=
object
.
current_account
.
user
.
setting_expand_spoilers
store
[
:reduce_motion
]
=
object
.
current_account
.
user
.
setting_reduce_motion
store
[
:advanced_layout
]
=
object
.
current_account
.
user
.
setting_advanced_layout
store
[
:is_staff
]
=
object
.
current_account
.
user
.
staff?
store
[
:username
]
=
object
.
current_account
.
username
store
[
:me
]
=
object
.
current_account
.
id
.
to_s
store
[
:unfollow_modal
]
=
object
.
current_account
.
user
.
setting_unfollow_modal
store
[
:boost_modal
]
=
object
.
current_account
.
user
.
setting_boost_modal
store
[
:delete_modal
]
=
object
.
current_account
.
user
.
setting_delete_modal
store
[
:auto_play_gif
]
=
object
.
current_account
.
user
.
setting_auto_play_gif
store
[
:display_media
]
=
object
.
current_account
.
user
.
setting_display_media
store
[
:expand_spoilers
]
=
object
.
current_account
.
user
.
setting_expand_spoilers
store
[
:reduce_motion
]
=
object
.
current_account
.
user
.
setting_reduce_motion
store
[
:advanced_layout
]
=
object
.
current_account
.
user
.
setting_advanced_layout
store
[
:group_in_home_feed
]
=
object
.
current_account
.
user
.
setting_group_in_home_feed
store
[
:is_staff
]
=
object
.
current_account
.
user
.
staff?
end
store
...
...
app/views/settings/preferences/show.html.haml
View file @
ff03e6a5
...
...
@@ -62,6 +62,7 @@
=
f
.
input
:setting_expand_spoilers
,
as: :boolean
,
wrapper: :with_label
=
f
.
input
:setting_reduce_motion
,
as: :boolean
,
wrapper: :with_label
=
f
.
input
:setting_system_font_ui
,
as: :boolean
,
wrapper: :with_label
=
f
.
input
:setting_group_in_home_feed
,
as: :boolean
,
wrapper: :with_label
.actions
=
f
.
button
:button
,
t
(
'generic.save_changes'
),
type: :submit
config/locales/simple_form.en.yml
View file @
ff03e6a5
...
...
@@ -105,6 +105,7 @@ en:
setting_hide_network
:
Hide your network
setting_noindex
:
Opt-out of search engine indexing
setting_reduce_motion
:
Reduce motion in animations
setting_group_in_home_feed
:
Show posts from your groups”
setting_show_application
:
Disclose application used to send gabs
setting_system_font_ui
:
Use system's default font
setting_theme
:
Site theme
...
...
Developer
🥊
@mgabdev
mentioned in commit
b0f94c09
·
Aug 29, 2019
mentioned in commit
b0f94c09
mentioned in commit b0f94c09352cf719ac124b434f64ed74cf9309ca
Toggle commit list
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment