mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: Remove unused code and translations
This commit is contained in:
parent
d684d5fba4
commit
6c09fd4289
@ -1,19 +0,0 @@
|
|||||||
import I18n from "I18n";
|
|
||||||
import Component from "@ember/component";
|
|
||||||
import discourseComputed from "discourse-common/utils/decorators";
|
|
||||||
|
|
||||||
export default Component.extend({
|
|
||||||
classNames: ["topic-notice"],
|
|
||||||
|
|
||||||
@discourseComputed("model.group.{full_name,name,allow_membership_requests}")
|
|
||||||
accessViaGroupText(group) {
|
|
||||||
const name = group.full_name || group.name;
|
|
||||||
const suffix = group.allow_membership_requests ? "request" : "join";
|
|
||||||
return I18n.t(`topic.group_${suffix}`, { name });
|
|
||||||
},
|
|
||||||
|
|
||||||
@discourseComputed("model.group.allow_membership_requests")
|
|
||||||
accessViaGroupButtonText(allowRequest) {
|
|
||||||
return `groups.${allowRequest ? "request" : "join"}`;
|
|
||||||
}
|
|
||||||
});
|
|
@ -1,5 +0,0 @@
|
|||||||
{{accessViaGroupText}}
|
|
||||||
{{d-button action=action
|
|
||||||
class="btn-primary topic-join-group"
|
|
||||||
icon="user-plus"
|
|
||||||
label=accessViaGroupButtonText}}
|
|
@ -42,8 +42,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.topic-error,
|
.topic-error {
|
||||||
.topic-notice {
|
|
||||||
padding: 18px;
|
padding: 18px;
|
||||||
width: 60%;
|
width: 60%;
|
||||||
margin-left: auto;
|
margin-left: auto;
|
||||||
@ -52,8 +51,7 @@
|
|||||||
text-align: center;
|
text-align: center;
|
||||||
line-height: $line-height-medium;
|
line-height: $line-height-medium;
|
||||||
|
|
||||||
.topic-retry,
|
.topic-retry {
|
||||||
.topic-join-group {
|
|
||||||
display: block;
|
display: block;
|
||||||
margin-top: 28px;
|
margin-top: 28px;
|
||||||
margin-left: auto;
|
margin-left: auto;
|
||||||
|
@ -135,8 +135,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.topic-error,
|
.topic-error {
|
||||||
.topic-notice {
|
|
||||||
padding: 18px;
|
padding: 18px;
|
||||||
width: 90%;
|
width: 90%;
|
||||||
margin-left: auto;
|
margin-left: auto;
|
||||||
@ -144,8 +143,7 @@
|
|||||||
font-size: $font-up-4;
|
font-size: $font-up-4;
|
||||||
line-height: $line-height-medium;
|
line-height: $line-height-medium;
|
||||||
|
|
||||||
.topic-retry,
|
.topic-retry {
|
||||||
.topic-join-group {
|
|
||||||
display: block;
|
display: block;
|
||||||
margin-top: 20px;
|
margin-top: 20px;
|
||||||
margin-left: auto;
|
margin-left: auto;
|
||||||
|
@ -470,18 +470,12 @@ class GroupsController < ApplicationController
|
|||||||
end
|
end
|
||||||
|
|
||||||
def request_membership
|
def request_membership
|
||||||
params.require(:reason) if params[:topic_id].blank?
|
params.require(:reason)
|
||||||
|
|
||||||
group = find_group(:id)
|
group = find_group(:id)
|
||||||
|
|
||||||
if params[:topic_id] && topic = Topic.find_by_id(params[:topic_id])
|
|
||||||
reason = I18n.t("groups.view_hidden_topic_request_reason", group_name: group.name, topic_url: topic.url)
|
|
||||||
end
|
|
||||||
|
|
||||||
reason ||= params[:reason]
|
|
||||||
|
|
||||||
begin
|
begin
|
||||||
GroupRequest.create!(group: group, user: current_user, reason: reason)
|
GroupRequest.create!(group: group, user: current_user, reason: params[:reason])
|
||||||
rescue ActiveRecord::RecordNotUnique => e
|
rescue ActiveRecord::RecordNotUnique => e
|
||||||
return render json: failed_json.merge(error: I18n.t("groups.errors.already_requested_membership")), status: 409
|
return render json: failed_json.merge(error: I18n.t("groups.errors.already_requested_membership")), status: 409
|
||||||
end
|
end
|
||||||
|
@ -2236,9 +2236,6 @@ en:
|
|||||||
toggle_information: "toggle topic details"
|
toggle_information: "toggle topic details"
|
||||||
read_more_in_category: "Want to read more? Browse other topics in %{catLink} or %{latestLink}."
|
read_more_in_category: "Want to read more? Browse other topics in %{catLink} or %{latestLink}."
|
||||||
read_more: "Want to read more? %{catLink} or %{latestLink}."
|
read_more: "Want to read more? %{catLink} or %{latestLink}."
|
||||||
group_request: "You need to request membership to the `%{name}` group to see this topic"
|
|
||||||
group_join: "You need join the `%{name}` group to see this topic"
|
|
||||||
group_request_sent: "Your group membership request has been sent. You will be informed when it's accepted."
|
|
||||||
unread_indicator: "No member has read the last post of this topic yet."
|
unread_indicator: "No member has read the last post of this topic yet."
|
||||||
|
|
||||||
# keys ending with _MF use message format, see https://meta.discourse.org/t/message-format-support-for-localization/7035 for details
|
# keys ending with _MF use message format, see https://meta.discourse.org/t/message-format-support-for-localization/7035 for details
|
||||||
|
@ -428,7 +428,6 @@ en:
|
|||||||
title: "You've been accepted into @%{group_name}"
|
title: "You've been accepted into @%{group_name}"
|
||||||
body: |
|
body: |
|
||||||
Your request to enter @%{group_name} has been accepted and you are now a member.
|
Your request to enter @%{group_name} has been accepted and you are now a member.
|
||||||
view_hidden_topic_request_reason: "I would like to join the group '%{group_name}', so I may access [this topic](%{topic_url})"
|
|
||||||
|
|
||||||
education:
|
education:
|
||||||
until_posts:
|
until_posts:
|
||||||
|
Loading…
Reference in New Issue
Block a user