Create mention success flash message with JavaScript

This commit is contained in:
Steffen van Bergerem 2017-03-27 13:41:46 +02:00 committed by Dennis Schubert
parent 4a56c0465c
commit 7feed3545c
No known key found for this signature in database
GPG key ID: 5A0304BEA7966D7E
4 changed files with 3 additions and 10 deletions

View file

@ -69,8 +69,8 @@ app.views.ProfileHeader = app.views.Base.extend({
$("#mentionModal").modal("hide");
app.publisher.clear();
app.publisher.remove();
location.reload();
});
app.flashMessages.success(Diaspora.I18n.t("publisher.mention_success", {names: this.model.get("name")}));
}.bind(this));
},
mentionModalHidden: function() {

View file

@ -53,7 +53,6 @@ class StatusMessagesController < ApplicationController
public: normalize_public_flag
)
status_message = StatusMessageCreationService.new(current_user).create(normalized_params)
handle_mention_feedback(status_message)
respond_to do |format|
format.html { redirect_to :back }
format.mobile { redirect_to stream_path }
@ -78,11 +77,6 @@ class StatusMessagesController < ApplicationController
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?
coming_from_profile_page? && !own_profile_page?
end

View file

@ -1090,8 +1090,6 @@ en:
status_messages:
new:
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"
stream_helper:

View file

@ -169,6 +169,7 @@ en:
list: "list text here"
quote: "quotation text here"
code: "code here"
mention_success: "Successfully mentioned: <%= names %>"
bookmarklet:
post_something: "Post to diaspora*"