# Development

**URL:** https://meta.discourse.org/c/dev/7.md?page=111

[最新版本](https://meta.discourse.org/latest.md) · [分類](https://meta.discourse.org/categories.md) · [標簽](https://meta.discourse.org/tags.md)

**Page:** 112

---

## [通过 API 更改所有权？](https://meta.discourse.org/t/change-ownership-through-the-api/109456)

<div class="topic-metadata">

**Author:** [@nottrobin](https://meta.discourse.org/u/nottrobin)\
**回覆:** 3\
**Last updated:** [2019年二月18日 17:34 UTC](https://meta.discourse.org/t/change-ownership-through-the-api/109456 "2019-02-18T17:34:08Z")

</div>

我试图通过 API 更改帖子的所有权，但不知如何操作。我尝试使用 PUT 请求到 /posts/{id}.json 并设置 post\[username\] 和 post\[user\_id\]，但两者似乎都无效。更多…

---

## [与 Umbraco 集成的 Discourse](https://meta.discourse.org/t/discourse-integration-with-umbraco/109467)

<div class="topic-metadata">

**Author:** [@JVersus](https://meta.discourse.org/u/JVersus)\
**回覆:** 1\
**Last updated:** [2019年二月18日 15:20 UTC](https://meta.discourse.org/t/discourse-integration-with-umbraco/109467 "2019-02-18T15:20:34Z")

</div>

大家好， 我们最近使用 Umbraco CMS 构建了一个新网站。 有人有将 Discourse 与 Umbraco 集成的经验吗？ 谢谢， J

---

## [无法设置无 Docker 安装，因为 cppjieba\_rb 安装失败](https://meta.discourse.org/t/can-t-set-up-dockerless-installation-due-to-cppjieba-rb-failing-to-install/109247)

<div class="topic-metadata">

**Author:** [@sonirahul8123](https://meta.discourse.org/u/sonirahul8123)\
**回覆:** 3\
**Last updated:** [2019年二月15日 14:01 UTC](https://meta.discourse.org/t/can-t-set-up-dockerless-installation-due-to-cppjieba-rb-failing-to-install/109247 "2019-02-15T14:01:58Z")

</div>

我正在尝试为 Discourse 搭建开发环境。根据 https://meta.discourse.org/t/dockerless-install-script/26713 上的说明运行 bundle install 时，我遇到了以下错误， 构建中…

---

## [开发版安装缺少字形](https://meta.discourse.org/t/development-install-has-missing-glyphs/109199)

<div class="topic-metadata">

**Author:** [@typeoneerror](https://meta.discourse.org/u/typeoneerror)\
**回覆:** 7\
**Last updated:** [2019年二月14日 20:40 UTC](https://meta.discourse.org/t/development-install-has-missing-glyphs/109199 "2019-02-14T20:40:42Z")

</div>

Running into this after upgrading to latest. Looks like the URL is getting appended twice:

---

## [如何将论坛分为两个主要部分（一般/群组），并仅显示可发布新帖的子分类？](https://meta.discourse.org/t/how-to-split-the-forum-into-two-main-parts-general-groups-and-how-to-display-only-subcategories-i-can-create-a-new-post-in/108923)

<div class="topic-metadata">

**Author:** [@oca](https://meta.discourse.org/u/oca)\
**回覆:** 1\
**Last updated:** [2019年二月12日 15:39 UTC](https://meta.discourse.org/t/how-to-split-the-forum-into-two-main-parts-general-groups-and-how-to-display-only-subcategories-i-can-create-a-new-post-in/108923 "2019-02-12T15:39:06Z")

</div>

我担任 Discourse 托管服务已有一年，期间仅使用过他人开发的插件和主题。如今，我认为自己已准备好开始构建符合自身需求的工具。不过，针对我的具体问题，我还不……

---

## [插件控制器规范：插件路由未绘制](https://meta.discourse.org/t/plugin-controller-spec-plugin-routes-are-not-drawn/108606)

<div class="topic-metadata">

**Author:** [@kleinfreund](https://meta.discourse.org/u/kleinfreund)\
**回覆:** 7\
**Last updated:** [2019年二月11日 11:29 UTC](https://meta.discourse.org/t/plugin-controller-spec-plugin-routes-are-not-drawn/108606 "2019-02-11T11:29:58Z")

</div>

像这样运行我的插件测试： LOAD\_PLUGINS=1 bundle exec rake plugin:spec\["my-plugin"\] ……插件的路由在以下测试文件中似乎不可用： spec/controllers/plugin/routes\_controlle…

---

## [Help with hiding content until someone registers](https://meta.discourse.org/t/help-with-hiding-content-until-someone-registers/48403)

<div class="topic-metadata">

**Author:** [@panionios](https://meta.discourse.org/u/panionios)\
**回覆:** 5\
**Last updated:** [2019年二月11日 02:28 UTC](https://meta.discourse.org/t/help-with-hiding-content-until-someone-registers/48403 "2019-02-11T02:28:15Z")

</div>

A long time ago, when I got into forum software, using other software I was able to make it so the forum looks alive with threads and titles but when the user clicked to read the thread, he was asked to register. I woul…

---

## [对 /posts.json 执行 POST 请求返回 null](https://meta.discourse.org/t/calling-post-on-posts-json-returns-null/108704)

<div class="topic-metadata">

**Author:** [@JakeFromStateFarm](https://meta.discourse.org/u/JakeFromStateFarm)\
**回覆:** 1\
**Last updated:** [2019年二月11日 01:01 UTC](https://meta.discourse.org/t/calling-post-on-posts-json-returns-null/108704 "2019-02-11T01:01:32Z")

</div>

我试图使用 API 创建新帖子（Discourse 2.2.0）。在设置中，“批准帖子数”设为 3，“除非信任等级为”设为 1：基本用户。 当发布有效数据时，响应为 HTTP 2…

---

## [REST API 与 Ruby API 对比](https://meta.discourse.org/t/rest-api-vs-the-ruby-api/108654)

<div class="topic-metadata">

**Author:** [@kimardenmiller](https://meta.discourse.org/u/kimardenmiller)\
**回覆:** 4\
**Last updated:** [2019年二月9日 23:47 UTC](https://meta.discourse.org/t/rest-api-vs-the-ruby-api/108654 "2019-02-09T23:47:38Z")

</div>

是否可以假设不存在一对一的映射，即 Ruby API 无法实现 REST API 的所有功能？ 我没有找到更新用户组通知级别的方法，因此尝试编写该方法： 我是否理解正确……

---

## [在 JS 中使用 Font Awesome 5 图标](https://meta.discourse.org/t/using-font-awesome-5-icon-in-js/108727)

<div class="topic-metadata">

**Author:** [@zaino](https://meta.discourse.org/u/zaino)\
**回覆:** 1\
**Last updated:** [2019年二月9日 15:38 UTC](https://meta.discourse.org/t/using-font-awesome-5-icon-in-js/108727 "2019-02-09T15:38:27Z")

</div>

我需要一些帮助。我已经阅读了所有关于 FA 5 的讨论，但依然不确定该如何操作。我想在 JavaScript 的 a 标签中使用 FA 图标作为链接。通常我会这样使用…

---

## [Allow users request access to private categories: rendering custom template on exception](https://meta.discourse.org/t/allow-users-request-access-to-private-categories-rendering-custom-template-on-exception/45083)

<div class="topic-metadata">

**Author:** [@rilla](https://meta.discourse.org/u/rilla)\
**回覆:** 1\
**Last updated:** [2019年二月9日 04:00 UTC](https://meta.discourse.org/t/allow-users-request-access-to-private-categories-rendering-custom-template-on-exception/45083 "2019-02-09T04:00:38Z")

</div>

Hi all, I’m working on this plugin which adds a setting to allow showing read-restricted categories in the category list. This is already working (you can check the code in the Github repo), but now, as a next step, I …

---

## [自定义用户目录的模板是什么](https://meta.discourse.org/t/what-is-the-template-for-customizing-the-users-directory/108656)

<div class="topic-metadata">

**Author:** [@zaino](https://meta.discourse.org/u/zaino)\
**回覆:** 2\
**Last updated:** [2019年二月9日 02:37 UTC](https://meta.discourse.org/t/what-is-the-template-for-customizing-the-users-directory/108656 "2019-02-09T02:37:27Z")

</div>

我已经搜索了相当长的时间，所以如果这个问题在别处已有解答，请见谅。 我想自定义显示用户目录（/u 或汉堡菜单中的 Users）的模板。 我正在处理我的 ……

---

## [由于:respond\_to\_suspicous\_request 导致用户创建不一致](https://meta.discourse.org/t/incongruous-user-creation-due-to-respond-to-suspicous-request/108625)

<div class="topic-metadata">

**Author:** [@benjaminkreen](https://meta.discourse.org/u/benjaminkreen)\
**回覆:** 1\
**Last updated:** [2019年二月7日 19:48 UTC](https://meta.discourse.org/t/incongruous-user-creation-due-to-respond-to-suspicous-request/108625 "2019-02-07T19:48:42Z")

</div>

嘿。 我正尝试集成一个 Salesforce 触发器，通过 API 创建 Discourse 账户。我已经为默认的系统管理员用户生成了 API 密钥，当我从 Ruby REPL 创建用户时，一切正常……

---

## [通过 API 触发带上传的备份似乎未包含上传内容](https://meta.discourse.org/t/trigger-backup-with-uploads-per-api-seems-not-to-include-uploads/108479)

<div class="topic-metadata">

**Author:** [@brase](https://meta.discourse.org/u/brase)\
**回覆:** 1\
**Last updated:** [2019年二月6日 16:07 UTC](https://meta.discourse.org/t/trigger-backup-with-uploads-per-api-seems-not-to-include-uploads/108479 "2019-02-06T16:07:22Z")

</div>

你好， 我正在尝试通过 API 触发 Discourse 备份的创建。 我注意到一个奇怪的现象：通过 API 触发的备份似乎不包含上传的文件，其大小为 …

---

## [如何即时切换主题？](https://meta.discourse.org/t/how-to-change-theme-on-the-fly/108342)

<div class="topic-metadata">

**Author:** [@ggurbet](https://meta.discourse.org/u/ggurbet)\
**回覆:** 6\
**Last updated:** [2019年二月5日 14:23 UTC](https://meta.discourse.org/t/how-to-change-theme-on-the-fly/108342 "2019-02-05T14:23:17Z")

</div>

您好。我正在尝试了解如何动态切换主题，路径为：用户 -\> 首选项 -\> 界面 -\> 主题。 当您从此下拉框中选择主题时，可以立即看到效果。我想实现……

---

## [使用自定义 JS 显示搜索弹窗](https://meta.discourse.org/t/display-search-popup-using-custom-js/108392)

<div class="topic-metadata">

**Author:** [@vadim0426](https://meta.discourse.org/u/vadim0426)\
**回覆:** 0\
**Last updated:** [2019年二月5日 09:15 UTC](https://meta.discourse.org/t/display-search-popup-using-custom-js/108392 "2019-02-05T09:15:35Z")

</div>

你好， 我在 after\_header.html 中添加了以下 HTML 代码： 您感兴趣什么？ 立即提问 我希望在用户点击时显示搜索弹窗，但...

---

## [Discourse API 的 Node.js 模块有更新版本吗？](https://meta.discourse.org/t/up-to-date-node-js-module-for-discourse-api/108334)

<div class="topic-metadata">

**Author:** [@Watercolor\_Games](https://meta.discourse.org/u/Watercolor_Games)\
**回覆:** 0\
**Last updated:** [2019年二月4日 18:01 UTC](https://meta.discourse.org/t/up-to-date-node-js-module-for-discourse-api/108334 "2019-02-04T18:01:26Z")

</div>

嘿，你好。我正在开发一个用于 Discord 的 Discourse 集成机器人。它作为 Discord 机器人和 Discourse SSO 客户端运行完美——因此用户可以将其论坛账户与 Discord 服务器关联起来。我需要用到 Discourse…

---

## [仅在触摸屏和鼠标桌面设备的“移动视图”中滑入汉堡菜单](https://meta.discourse.org/t/slide-in-hamburger-menu-in-mobile-view-only-on-touchscreen-mouse-desktops/107793)

<div class="topic-metadata">

**Author:** [@davidkingham](https://meta.discourse.org/u/davidkingham)\
**回覆:** 17\
**Last updated:** [2019年二月4日 16:31 UTC](https://meta.discourse.org/t/slide-in-hamburger-menu-in-mobile-view-only-on-touchscreen-mouse-desktops/107793 "2019-02-04T16:31:54Z")

</div>

在桌面端使用“移动视图”时，侧滑式汉堡菜单无法点击，因为当你靠近它时，它会滑走。我经常用此功能来测试移动特性，而无需使用移动设备。

---

## [使用 PHP 上传头像 API](https://meta.discourse.org/t/upload-avatar-api-with-php/108218)

<div class="topic-metadata">

**Author:** [@Jeremy\_R](https://meta.discourse.org/u/Jeremy_R)\
**回覆:** 4\
**Last updated:** [2019年二月3日 10:46 UTC](https://meta.discourse.org/t/upload-avatar-api-with-php/108218 "2019-02-03T10:46:33Z")

</div>

你好， 我在上传头像的 API 上遇到了问题。 我收到了 500 错误。 以下是我的代码： $files = \[ realpath('logo.png') \]; $postData = array( "api\_key" =\> API\_KEY, "api\_username" =\> API\_USERNAME, …

---

## [扩展用户模型](https://meta.discourse.org/t/extending-user-model/108128)

<div class="topic-metadata">

**Author:** [@Alfarhan\_Zahedi](https://meta.discourse.org/u/Alfarhan_Zahedi)\
**回覆:** 1\
**Last updated:** [2019年二月1日 15:14 UTC](https://meta.discourse.org/t/extending-user-model/108128 "2019-02-01T15:14:34Z")

</div>

你好。 是否有一种方法可以在不修改 User 类本身的情况下，为现有的 User 模型添加新的属性和函数？我认为这可以通过插件实现，但我不清楚如何开始。 我已经修改了…

---

## [How to access current post tags using Ember and JavaScript?](https://meta.discourse.org/t/how-to-access-current-post-tags-using-ember-and-javascript/53354)

<div class="topic-metadata">

**Author:** [@Jay\_Crossler](https://meta.discourse.org/u/Jay_Crossler)\
**回覆:** 4\
**Last updated:** [2016年十一月26日 20:03 UTC](https://meta.discourse.org/t/how-to-access-current-post-tags-using-ember-and-javascript/53354 "2016-11-26T20:03:25Z")

</div>

Hi, first time poster. Loving Discourse so far! I’m writing a plugin that will do some auto-tagging suggesting based on the content of the title and post. I’m trying to access a few things at the JavaScript level - tr…

---

## [RPM 包构建过程中发现少量小问题](https://meta.discourse.org/t/a-few-small-issue-found-during-rpm-package-build/107974)

<div class="topic-metadata">

**Author:** [@darix](https://meta.discourse.org/u/darix)\
**回覆:** 5\
**Last updated:** [2019年一月31日 10:01 UTC](https://meta.discourse.org/t/a-few-small-issue-found-during-rpm-package-build/107974 "2019-01-31T10:01:31Z")

</div>

在构建 2.2.0.beta10~git21.f7b7bc8abe 时发现以下文件设置了 x 位但没有 shebang 行： bin/docker/README.md lib/javascripts/moment\_locale/\*.js script/import\_scripts/json\_generic.rb vendor/assets/javascripts/sweetal…

---

## [在控制台中关闭主题](https://meta.discourse.org/t/closing-a-topic-in-console/107482)

<div class="topic-metadata">

**Author:** [@csmu](https://meta.discourse.org/u/csmu)\
**回覆:** 2\
**Last updated:** [2019年一月31日 05:05 UTC](https://meta.discourse.org/t/closing-a-topic-in-console/107482 "2019-01-31T05:05:31Z")

</div>

如何在 Rails 控制台中关闭一个主题？

---

## [通过控制台设置类别以使用 solved 插件](https://meta.discourse.org/t/setting-a-category-to-use-the-solved-plugin-via-console/107875)

<div class="topic-metadata">

**Author:** [@csmu](https://meta.discourse.org/u/csmu)\
**回覆:** 3\
**Last updated:** [2019年一月31日 02:25 UTC](https://meta.discourse.org/t/setting-a-category-to-use-the-solved-plugin-via-console/107875 "2019-01-31T02:25:26Z")

</div>

如何通过 Rails 控制台将类别设置为使用 solved 插件？

---

## [针对自定义主题组件中渲染的插件功能的验收测试](https://meta.discourse.org/t/acceptance-test-for-a-plugin-feature-which-is-been-rendered-in-the-custom-theme-component/107812)

<div class="topic-metadata">

**Author:** [@ankit.jain](https://meta.discourse.org/u/ankit.jain)\
**回覆:** 0\
**Last updated:** [2019年一月29日 11:19 UTC](https://meta.discourse.org/t/acceptance-test-for-a-plugin-feature-which-is-been-rendered-in-the-custom-theme-component/107812 "2019-01-29T11:19:31Z")

</div>

大家好， 目前，我计划首次为通过插件在 Discourse 中引入的自定义功能编写验收测试用例。但这些自定义功能是通过前端渲染的，并…

---

## [仅允许特定类别访问公网IP](https://meta.discourse.org/t/public-ip-access-only-to-selected-category/107611)

<div class="topic-metadata">

**Author:** [@adopilot](https://meta.discourse.org/u/adopilot)\
**回覆:** 5\
**Last updated:** [2019年一月29日 09:41 UTC](https://meta.discourse.org/t/public-ip-access-only-to-selected-category/107611 "2019-01-29T09:41:37Z")

</div>

在我公司，Discourse 是内部网通信的主要沟通工具。为防止数据泄露，我们将 Discourse 部署在私有网络上，该网络仅允许内部网访问。在某些情况下……

---

## [Discourse-common 资源可用性：开发与生产环境的差异？](https://meta.discourse.org/t/discourse-common-asset-availability-difference-between-development-and-production/107490)

<div class="topic-metadata">

**Author:** [@angus](https://meta.discourse.org/u/angus)\
**回覆:** 4\
**Last updated:** [2019年一月29日 00:27 UTC](https://meta.discourse.org/t/discourse-common-asset-availability-difference-between-development-and-production/107490 "2019-01-29T00:27:38Z")

</div>

我正在调整位置插件，使其在自定义向导插件的上下文中运行得更好。 位置插件包含一个名为 location-selector 的组件，它本质上是一个用于地理编码的自动完成输入框…

---

## [适合新手的IDE与舒适开发环境](https://meta.discourse.org/t/ide-and-comfortable-dev-environment-for-newbies/107439)

<div class="topic-metadata">

**Author:** [@neutralTTY](https://meta.discourse.org/u/neutralTTY)\
**回覆:** 4\
**Last updated:** [2019年一月28日 17:22 UTC](https://meta.discourse.org/t/ide-and-comfortable-dev-environment-for-newbies/107439 "2019-01-28T17:22:18Z")

</div>

你好，我是这里的新人！ 我对学习 Discourse 以及如何为其开发自己的代码非常感兴趣，但我有个小问题：我是个新手。 我已经 15 年没有开发代码了，当时使用的是 PHP（不是…

---

## [如何在 search-menu 小部件中插入新的 DOM 元素](https://meta.discourse.org/t/how-to-insert-new-dom-element-to-search-menu-widget/107722)

<div class="topic-metadata">

**Author:** [@vadim0426](https://meta.discourse.org/u/vadim0426)\
**回覆:** 4\
**Last updated:** [2019年一月28日 13:27 UTC](https://meta.discourse.org/t/how-to-insert-new-dom-element-to-search-menu-widget/107722 "2019-01-28T13:27:35Z")

</div>

你好。 我正在尝试通过重写 html 方法来修改 search-menu 小部件的 HTML。有人能帮我吗？我是 Discourse 论坛的新手，可能有些地方我不太理解。我所需要做的只是在……添加一个 div 元素。

---

## [创建插件](https://meta.discourse.org/t/creating-a-plugin/107696)

<div class="topic-metadata">

**Author:** [@Gael\_Koch](https://meta.discourse.org/u/Gael_Koch)\
**回覆:** 0\
**Last updated:** [2019年一月28日 08:17 UTC](https://meta.discourse.org/t/creating-a-plugin/107696 "2019-01-28T08:17:46Z")

</div>

你好， 我对 Discourse 的工作原理了解甚少，但我需要创建一个插件。我已经看过关于如何创建插件的各种指南，例如 https://meta.discourse.org/t/beginners-guide-to-creating-discourse-plu…

[上一頁](https://meta.discourse.org/c/dev/7.md?page=110)

[下一頁](https://meta.discourse.org/c/dev/7.md?page=112)
