Create mention success flash message with JavaScript
This commit is contained in:
parent
4a56c0465c
commit
7feed3545c
4 changed files with 3 additions and 10 deletions
|
|
@ -69,8 +69,8 @@ app.views.ProfileHeader = app.views.Base.extend({
|
||||||
$("#mentionModal").modal("hide");
|
$("#mentionModal").modal("hide");
|
||||||
app.publisher.clear();
|
app.publisher.clear();
|
||||||
app.publisher.remove();
|
app.publisher.remove();
|
||||||
location.reload();
|
app.flashMessages.success(Diaspora.I18n.t("publisher.mention_success", {names: this.model.get("name")}));
|
||||||
});
|
}.bind(this));
|
||||||
},
|
},
|
||||||
|
|
||||||
mentionModalHidden: function() {
|
mentionModalHidden: function() {
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,6 @@ class StatusMessagesController < ApplicationController
|
||||||
public: normalize_public_flag
|
public: normalize_public_flag
|
||||||
)
|
)
|
||||||
status_message = StatusMessageCreationService.new(current_user).create(normalized_params)
|
status_message = StatusMessageCreationService.new(current_user).create(normalized_params)
|
||||||
handle_mention_feedback(status_message)
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html { redirect_to :back }
|
format.html { redirect_to :back }
|
||||||
format.mobile { redirect_to stream_path }
|
format.mobile { redirect_to stream_path }
|
||||||
|
|
@ -78,11 +77,6 @@ class StatusMessagesController < ApplicationController
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def handle_mention_feedback(status_message)
|
|
||||||
return unless comes_from_others_profile_page?
|
|
||||||
flash[:notice] = t("status_messages.create.success", names: status_message.mentioned_people_names)
|
|
||||||
end
|
|
||||||
|
|
||||||
def comes_from_others_profile_page?
|
def comes_from_others_profile_page?
|
||||||
coming_from_profile_page? && !own_profile_page?
|
coming_from_profile_page? && !own_profile_page?
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -1090,8 +1090,6 @@ en:
|
||||||
status_messages:
|
status_messages:
|
||||||
new:
|
new:
|
||||||
mentioning: "Mentioning: %{person}"
|
mentioning: "Mentioning: %{person}"
|
||||||
create:
|
|
||||||
success: "Successfully mentioned: %{names}"
|
|
||||||
too_long: "Please make your status message fewer than %{count} characters. Right now it is %{current_length} characters"
|
too_long: "Please make your status message fewer than %{count} characters. Right now it is %{current_length} characters"
|
||||||
|
|
||||||
stream_helper:
|
stream_helper:
|
||||||
|
|
|
||||||
|
|
@ -169,6 +169,7 @@ en:
|
||||||
list: "list text here"
|
list: "list text here"
|
||||||
quote: "quotation text here"
|
quote: "quotation text here"
|
||||||
code: "code here"
|
code: "code here"
|
||||||
|
mention_success: "Successfully mentioned: <%= names %>"
|
||||||
|
|
||||||
bookmarklet:
|
bookmarklet:
|
||||||
post_something: "Post to diaspora*"
|
post_something: "Post to diaspora*"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue