I am not against experimenting with adding a tiny avatar, but I would like to see the experiment in a plugin first. It is pretty straightforward to add.
I agree that option (perhaps as global setting) to display mention as @sam OR as Sam Saffron would be really great.
With the same formatting as mentions now have, but displaying full name instead of @handle
So, you guys allow for SSO logins, presumably to allow for companies, anong other entities who maintain master employee/user lists to login with ease.
The issue I’m running into here is this. We have 4500 employees. Most don’t know each other. While tagging by typing name in works perfectly fine, the username displayed is a 5 digit employee #. So now all people see is comeone tagging a 5 digit #
Can you guys write/enable a user option that simply displays the Full Name field in lieu of @username please!
You allow a user option to select the Full Name displayed first in a thread reply with username to the right. A simple visual switch.
I totally get the purpose of using a “twitter” tagging model, but it is severely aggravating for large professional/educational institutions to use. Please, please make an option available. In any means.
It’s not even in a paid hosted/supported version, so you’re missing out there on revenue for large organizations who might otherwise use this.
In my case, I’m trying to “sell” it to my board to adopt discourse. I’m sure they won’t like this missing capibility
Who decided the username had to be a 5 digit number? That’s a bad decision.
It’s quite common from what I have seen in larger organisations to have their AD logon use their payroll or ID number in order to logon rather than names. Not necessarily 5 numbers however. For example my last organisation my login was B3293016 - would be difficult to distinguish who that is if they then used SSO to check against that login and use it for discourse username and mentions.
What @mikechristopher said. The 5 did fit # is our employee I’d. Technically it’s 6, but the zero at the beginning is left off as we haven’t reached numbers greater than 100,000.
Bottom line, again having the feature I described will give corporate/enterprise clients a lot better usability.
Had you not integrated SSO, I’d understand being reluctant to allow full name tags vs username. But you made SSO available, this is a logical next step enhancement
I am not against adding this kind of option, but at the moment none of our paying customers need it so I cannot prioritize it.
I would probably recommend building this as a plugin first, this is something I would consider building if an enterprise customer funded it.
@mcwumbly have you had any luck with the CSS route?
Haven’t tried it, sorry. Just threw out the idea, but this isn’t something I’ve felt the need to explore too deeply personally.
Just to beat this dead horse a bit more, one of the barriers we’re having in our group is that people get super easily confused by the usernames. So right now, they have no problems making mentions, but when reading, they often don’t know who the mentioned person is. As such, in our use case, @cpradio (Jim Smith) would be ideal. The user would type in the @mention (let’s say @cpradio) and it automatically turns into @cpradio (Jim Smith) for others to read.
This would be just like the username mentions by each of our posts.
这里有什么进展吗?必须点击用户名才能知道具体是谁,这很烦人。而且,从 Facebook 群组迁移到 Discourse 时,如果默认看不到全名,确实很头疼。我认为唯一性并不是大家认为的那样是个问题,因为正如之前所说,如果出现这种情况,可以使用用户卡片来区分。我已经更改了站点设置,在用户体验中优先显示全名…
我写了一个快速脚本来实现这个功能。我把它放在组件的 </head> 部分,运行正常。虽然肯定还有改进空间,但先放这里吧。
<script type="text/discourse-plugin" version="0.1">
var decorateAtMentions = function($post) {
$post.find("a.mention").each(function() {
var $elem = $(this);
var username = $elem.text().substr(1);
var data = Discourse.User.findByUsername(username).then(function(user) {
var avatarurl = user.avatar_template.replace("{size}", 18);
var realname = user.name;
$elem.before("<img src='"+avatarurl+"' title='"+realname+"'>");
$elem.attr("title", realname);
$elem.after("["+realname+"]");
});
})
}
api.decorateCooked(decorateAtMentions, {id: 'decorate-at-mentions'});
</script>
标签中的 title 属性可能存在一个问题:如果名字中包含单引号字符,就需要用“正确的方式”来处理(我个人可能会直接去掉它,因为我也不是特别喜欢这个功能)。
我本想直接修改链接文本,而不是在末尾追加真实姓名,但遗憾的是,这会破坏用户卡片的点击事件处理器(因为它似乎依赖于提及文本的原始内容来加载姓名),而我不想陷入这个麻烦的境地。
听起来很棒。对于新手来说,您是否有分步指南,说明如何将其实际添加到我的 Discourse 实例中?![]()
已有相关指南,请先阅读
然后创建您的第一个主题组件。
@nachof 我找到了一个让它生效的方法:https://gist.github.com/jessicah/cd580bab64d89875a157579789b03511,通过覆盖 component:user-card-contents 中的 _show() 方法。我猜前面的下划线可能意味着我们不应该覆盖它?但它似乎确实有效:
也许需要提供一个入口点,以便选择性地从 $target 获取用户名?无论如何,这对我来说确实是部署到更广泛社区的一个阻碍。现在可以继续前进了 ![]()
太棒了!我不是软件开发者,所以无法弄清楚如何将你创建的内容添加到我的 Discourse 站点。我尝试使用这个 URL 通过 Git 仓库进行安装,但它询问我是否确定这是一个 Discourse 主题。我应该采取哪些步骤?
您可以从 UX 创建一个新主题组件,并将相关内容粘贴到主题的head tag部分。
抱歉第100次翻旧账,但我确实正确安装了,用户卡片却无法显示。既然这个问题已经存在两年了,有什么解决办法吗?
我知道您重新编程的可能性不大,但也许会有热心的社区成员帮忙解决。
说实话,我对这些说明仍然感到相当困惑。您在 What makes a successful volunteer Discourse sysadmin? 上的帮助非常有价值,但我尚未找到那位志愿者。
在此期间,@jessicah,您是否还在?能否将此制作成一个发布在 #theme-component 中的主题组件?或者是否有其他人能够制作一个可运行的主题组件?
您好 @debryc 和 @OverseersMight,
如果您仍然感兴趣 ![]()
