-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add profile option to always view full names in event view #566
base: master
Are you sure you want to change the base?
Changes from all commits
d777bb9
a4b84d8
2f7311a
250c88f
686930f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -112,12 +112,16 @@ def to_s | |
role + ": " + assigned_to | ||
end | ||
|
||
def assigned_to(options = {}) | ||
def assigned_to(mode = :full_name) | ||
# Logger | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Logger? |
||
if assigned? | ||
if options[:use_display_name] | ||
DaAwesomeP marked this conversation as resolved.
Show resolved
Hide resolved
|
||
member.display_name | ||
else | ||
case mode | ||
when :full_name | ||
member.fullname | ||
when :display_name | ||
member.display_name | ||
when :both_names | ||
"#{member.display_name} (#{member.fullname})" | ||
end | ||
else | ||
"(unassigned)" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -98,11 +98,16 @@ | |
<dd><%= f.text_field :interests, class: "wide-input" %></dd> | ||
</dl> | ||
|
||
<dl> | ||
<dt><%= f.label :prefers_full_name, "Show full names of members:" %></dt> | ||
<dd><%= f.check_box :prefers_full_name %></dd> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. likewise I think it is a little more straightforward to say something like There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree somewhat with this. Technically in the code what is happening is that the fullname variable is being displayed. I think it's better to use only one name for this in the code. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. One small edit request: Make it "Always show full names of members:" The new distinction is the always. |
||
</dl> | ||
|
||
</fieldset> | ||
|
||
<fieldset> | ||
<legend>Notifications</legend> | ||
|
||
<dl> | ||
<dt><%= f.check_box :receives_comment_emails %></dt> | ||
<dd><%= f.label :receives_comment_emails, "Email me when comments are posted on events I have run positions for" %></dd> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
class AddProfileOptionViewFullName < ActiveRecord::Migration[6.1] | ||
def change | ||
# Change members table; Add column prefers_full_name | ||
add_column :members, :prefers_full_name, :boolean, default: false | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please also add |
||
end | ||
end |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use
run_position_name_preference()
here too to be consistent? Maybe:That way if we add more options or change things in the future it lowers the number of places in the code to update.