عرض مؤلف الموضوع في قائمة المواضيع

Hello!

I would like to change the topic list to only display the topic’s author instead of a list of frequent posters in a topic.

Would there be an easy way to accomplish this?

EDIT: Here’s a more complete solution I threw together that you can download as a theme component:

8 إعجابات

@tshenry, awesome, I am looking for a similar solution but i would like to display the poster username instead of their image.

Where could we take a look into the repo of your component?

Ah! I definitely goofed by failing to provide a way to download or see the code! It’s just some CSS. I’ll bundle it into a proper theme component on GitHub when I get a chance.

// Hide all posters except the topic author
.topic-list .posters {
    width: 75px;
    text-align: center;
    
    // Only show first poster
    a:not(:first-of-type) {
        display: none;
    }
    // Get rid of offset and decoration
    a:first-child .avatar.latest:not(.single) {
        position: static;
        box-shadow: none;
        border: 0;
    }
    // Adjustment for center alignment
    & > a {
        float: none;
        margin-right: 0;
    }
}

// Make sure the correct user is showing at smaller width
@media screen and (max-width: 850px) {
    .topic-list td.posters {
        // Ensure first poster is showing
        a:not(.latest) {
            display: block;
        }
        // Hide everything else
        a:not(:first-of-type) {
            display: none;
        }
    }
}

What you are trying to accomplish is probably closer to:

4 إعجابات

هذا رائع جدًا. شكرًا لك!

يبدو أن كود CSS للجوال لا يعمل. هل غيّر Discourse مؤخرًا طريقة تنظيمه للكتاب في الجوال؟ هل لديك أي نصائح حول كيفية إصلاح ذلك؟

شكرًا لك!

لم يكن المقصود من CSS أعلاه مخصصًا للأجهزة المحمولة، لكنني أعتقد أن هذا على الأرجح ما تبحث عنه؟

إعجاب واحد (1)

نعم! لم أستطع تقييد هذا التخطيط المخصص للمشاركين الأصليين (OP) لفئات محددة عبر CSS باستخدام سمة الهاتف المحمول كما أفعل مع كود CSS الخاص بك. هل لديك نصائح حول كيفية تحقيق ذلك على الهاتف المحمول (عذراً، أنا جديد على Ember.js :/)؟

للأسف، تقييد النتائج حسب الفئة سيكون إضافة كبيرة نسبيًا إلى مكون الهاتف المحمول، حيث لا يمكنك التحقق من الفئة باستخدام ملف Handlebars وحده. إليك بعض الخيارات المتاحة:

  • أنشئ موضوعًا في قناة Development واطلب من المطورين تقديم بعض التوجيهات.
  • تصفح كود مكونات السمات الحالية التي تتضمن فئات، وراجع ما إذا كان يمكنك العثور على أفكار أو إلهام.
  • أنشئ قائمة في قناة Marketplace ودفع مبلغًا لشخص ما لبناء هذه الميزة لك.
إعجابَين (2)