# 允许事件名称超过 30 个字符

**URL:** https://meta.discourse.org/t/allow-30-characters-for-event-names/235900
**Category:** UX
**Tags:** events
**Created:** [2022年七月29日 14:59 UTC](https://meta.discourse.org/t/allow-30-characters-for-event-names/235900 "2022-07-29T14:59:12Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![Chris\_Lail](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/chris_lail/32/199229_2.png) [@Chris\_Lail](https://meta.discourse.org/u/Chris_Lail)
#### Post date: [2022年七月29日 14:59 UTC](https://meta.discourse.org/t/allow-30-characters-for-event-names/235900/1 "2022-07-29T14:59:12Z")

</div>

说得对。我都没考虑到。

最好也能有更长的事件名称。30个字符似乎太少了。

---

<div class="post-metadata">

### Author: ![nathank](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nathank/32/290039_2.png) [@nathank](https://meta.discourse.org/u/nathank)
#### Post date: [2022年七月29日 18:19 UTC](https://meta.discourse.org/t/allow-30-characters-for-event-names/235900/2 "2022-07-29T18:19:04Z")

</div>

> [@Chris\_Lail](#):
>
> 也希望活动名称能长一些。30个字符似乎太少了。

是的，这太疯狂了——尤其是当该字段留空时，它允许显示更长的主题标题。

我已经为此更改提交了一个 PR：

> <https://github.com/discourse/discourse-calendar/pull/307>
>
> Matching the event name length to the default topic title length in Discourse co…re. If there is no event name entered, defaults to topic title anyway.
> 
> Has been requested several times, 30 character limit is extremely restrictive.
> 
> It would be even better if this used the discourse\_max\_topic\_title\_length setting instead to ensure consistency where instances have changed this setting.

---

<div class="post-metadata">

### Author: ![Chris\_Lail](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/chris_lail/32/199229_2.png) [@Chris\_Lail](https://meta.discourse.org/u/Chris_Lail)
#### Post date: [2022年七月29日 20:08 UTC](https://meta.discourse.org/t/allow-30-characters-for-event-names/235900/3 "2022-07-29T20:08:36Z")

</div>

谢谢 @nathank

---

<div class="post-metadata">

### Author: ![nathank](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nathank/32/290039_2.png) [@nathank](https://meta.discourse.org/u/nathank)
#### Post date: [2022年八月10日 02:41 UTC](https://meta.discourse.org/t/allow-30-characters-for-event-names/235900/4 "2022-08-10T02:41:19Z")

</div>

> [@nathankershaw](#):
>
> 我已为此更改提交了一个 PR：
> 
> [Update event.rb by nathan-nz · Pull Request #307 · discourse/discourse-calendar · GitHub](https://github.com/discourse/discourse-calendar/pull/307)

这个 PR 有可能很快被审查吗？

另外，我希望有人能帮我处理这个：

> [@nathankershaw](#):
>
> 我在代码中找不到它在哪里，所以无法提交 PR。有其他人能做到吗？

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [2022年八月11日 16:42 UTC](https://meta.discourse.org/t/allow-30-characters-for-event-names/235900/9 "2022-08-11T16:42:00Z")

</div>

> [@nathankershaw](#):
>
> 这个很快会被处理吗？

这会对 UI 有任何副作用吗？你觉得添加测试怎么样？ 🙂

---

<div class="post-metadata">

### Author: ![nathank](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nathank/32/290039_2.png) [@nathank](https://meta.discourse.org/u/nathank)
#### Post date: [2022年八月12日 00:01 UTC](https://meta.discourse.org/t/allow-30-characters-for-event-names/235900/11 "2022-08-12T00:01:39Z")

</div>

我看不出有什么问题。

在模态框中输入一个非常非常非常长的活动标题时，它会像 discourse 中的其他字段一样换行：

> ![image](https://global.discourse-cdn.com/meta/original/4X/b/f/7/bf77341a4d897535931e0a410da72fb9d3e9a2f6.png)

由于活动标题最多可以有 255 个字符（当它通过主题标题拉取时），这方面的问题已经存在。但似乎并没有什么问题。长标题会被截断并显示一个漂亮的 `...`：

![image](https://cdck-file-uploads-global.s3.dualstack.us-west-2.amazonaws.com/meta/optimized/4X/7/9/e/79eed3fd4b10017ff2150aa7daa28a97e1b65233_2_690x97.png)

这是一个非常微小的改动，解决了 Calendar 插件的事件功能中一个长期存在的错误/用户体验问题。当然，最好是标题长度限制与主题标题长度限制相同。

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [2022年八月12日 01:38 UTC](https://meta.discourse.org/t/allow-30-characters-for-event-names/235900/12 "2022-08-12T01:38:08Z")

</div>

我已经合并了，谢谢你，@nathank

---

<div class="post-metadata">

### Author: ![twofoursixeight](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/twofoursixeight/32/574822_2.png) [@twofoursixeight](https://meta.discourse.org/u/twofoursixeight)
#### Post date: [2022年八月12日 03:31 UTC](https://meta.discourse.org/t/allow-30-characters-for-event-names/235900/13 "2022-08-12T03:31:43Z")

</div>

我认为在某些情况下，长事件名称会很有用。

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [2022年九月6日 12:01 UTC](https://meta.discourse.org/t/allow-30-characters-for-event-names/235900/14 "2022-09-06T12:01:30Z")

</div>


