mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 02:41:13 +08:00
FEATURE: Admin plugin list redesign (#24363)
* Remove checkmark for official plugins * Add author for plugin, which is By Discourse for all discourse and discourse-org github plugins * Link to meta topic instead of github repo * Add experimental flag for plugin metadata and show this as a badge on the plugin list if present --------- Co-authored-by: chapoi <101828855+chapoi@users.noreply.github.com>
This commit is contained in:
@ -516,6 +516,14 @@ class Plugin::Instance
|
||||
@git_repo ||= GitRepo.new(directory, name)
|
||||
end
|
||||
|
||||
def discourse_owned?
|
||||
parsed_commit_url = UrlHelper.relaxed_parse(self.commit_url)
|
||||
return false if !parsed_commit_url
|
||||
github_org = parsed_commit_url.path.split("/")[1]
|
||||
(github_org == "discourse" || github_org == "discourse-org") &&
|
||||
parsed_commit_url.host == "github.com"
|
||||
end
|
||||
|
||||
# A proxy to `DiscourseEvent.on` which does nothing if the plugin is disabled
|
||||
def on(event_name, &block)
|
||||
DiscourseEvent.on(event_name) { |*args, **kwargs| block.call(*args, **kwargs) if enabled? }
|
||||
|
Reference in New Issue
Block a user