읽지 않은 주제 (모바일 버전)

며칠 전 제 포럼에서 이 문제가 발생했습니다. 이미 주제에 참여했는데도 불구하고 여전히 읽지 않은 상태로 표시됩니다. 데스크톱 버전에서도 같은 문제가 있었지만 템플릿을 수정해서 해결할 수 있었습니다. 하지만 솔직히 모바일 버전에서는 해결하지 못했습니다. 누군가 도와주셨으면 좋겠습니다. 제가 사용하는 템플릿은 다음과 같습니다:

<script type='text/x-handlebars' data-template-name='mobile/list/topic-list-item.raw'>
    <td>
      {{~#unless expandPinned}}
      <div class='pull-left'>
        <a href="/users/{{topic.creator.username}}">{{avatar topic.creator imageSize="50"}}</a>
              </div>
              
      <div class='right'>
      {{else}}
      <div>
            {{/unless~}}
            

<div class='main-link'>
          {{raw "topic-status" topic=topic}}
          {{topic-link topic}}
          {{#if topic.featured_link}}
            {{topic-featured-link topic}}
          {{/if}}
          
          
{{#if hideCategory}}
   <div class='category'>
          <span class="author-name"><a href="{{topic.creator.path}}" data-user-card="{{topic.creator.username}}">{{topic.creator.username}}</a></span>
        </div>
{{else}}
        
{{/if}}
                    {{#if topic.unseen}}
                      <span class="badge-notification new-topic"></span>
                      
             {{/if}}
          {{~#if expandPinned}}
          {{raw "list/topic-excerpt" topic=topic}}
          {{/if~}}
        </div>
                <div class='pull-right'>
          {{raw "list/post-count-or-badges" topic=topic postBadgesEnabled=showTopicPostBadges}}
        </div>
    
        <div class="topic-item-stats clearfix">
          {{#unless hideCategory}}
            <div class='category'>
              {{category-link topic.category}}
            </div>
          {{/unless}}
    
          {{discourse-tags topic mode="list"}}
    
          <div class="pull-right">
            <div class='num activity last'>
            <span class="age activity" title="{{topic.bumpedAtTitle}}"><a href="{{topic.lastPostUrl}}">{{format-date topic.bumpedAt format="tiny" noTitle="true"}}</a></span>
            </div>
          </div>
              <div class="clearfix"></div>
        </div>
      </div>
    </td>
</script>

코어 템플릿에 몇 가지 변경 사항이 있으므로 해당 내용과 비교해 보시기 바랍니다.

제가 올바르게 파악했다면, 프로필 아바타 섹션을 <a href="/users/{{topic.creator.username}}">{{avatar topic.creator imageSize="50"}}</a>로 변경하신 것 같습니다. /users/ 경로가 올바른가요? 이 경로는 사용자 프로필 페이지로 이동하게 되며, 사용자 카드(팝업)를 열지 않습니다. 기본 사용자 경로는 /u/여야 합니다.

템플릿의 다른 변경 사항은 카테고리가 숨겨져 있을 때 사용자 이름을 표시하는 것입니다. 이는 귀하의 스크린샷에서 명확히 확인할 수 있습니다. 저는 해당 섹션을 다음과 같이 수정했습니다.

템플릿에서 다음을 제거하세요:

{{#if hideCategory}}
   <div class='category'>
          <span class="author-name"><a href="{{topic.creator.path}}" data-user-card="{{topic.creator.username}}">{{topic.creator.username}}</a></span>
   </div>
{{else}}
        
{{/if}}

그리고 다음을 기본 {{#unless hideCategory}} 블록의 {{else}} 부분에 추가하세요.

{{#unless hideCategory}}
{{~raw-plugin-outlet name="topic-list-before-category"}}
<div class='category'>
  {{category-link topic.category}}
</div>
{{else}}
<span class="author-name">
  <a href="{{topic.creator.path}}" data-user-card="{{topic.creator.username}}">{{topic.creator.username}}</a>
</span>
{{/unless}}

따라서 전체 템플릿을 가져온 후, 필요에 맞게 다음과 같이 수정하는 것을 권장합니다.

<script type='text/x-handlebars' data-template-name='mobile/list/topic-list-item.raw'>
<td class="topic-list-data">
  {{~raw-plugin-outlet name="topic-list-before-columns"}}
  <div class='pull-left'>
    <a href="/users/{{topic.creator.username}}">{{avatar topic.creator imageSize="50"}}</a>
  </div>
  <div class='right'>
    {{~raw-plugin-outlet name="topic-list-before-link"}}
    <div class='main-link'>
      {{~raw-plugin-outlet name="topic-list-before-status"}}
      {{~raw "topic-status" topic=topic~}}
      {{~topic-link topic class="raw-link raw-topic-link"}}
      {{~#if topic.featured_link~}}
      {{~topic-featured-link topic~}}
      {{~/if~}}
      {{~raw-plugin-outlet name="topic-list-after-title"}}
      {{~#if topic.unseen~}}
        <span class="topic-post-badges">&nbsp;<span class="badge-notification new-topic"></span></span>
      {{~/if~}}
      {{~#if expandPinned~}}
      {{~raw "list/topic-excerpt" topic=topic~}}
      {{~/if~}}
    </div>
    <div class='pull-right'>
      {{raw "list/post-count-or-badges" topic=topic postBadgesEnabled=showTopicPostBadges}}
    </div>
    <div class="topic-item-stats clearfix">
      {{#unless hideCategory}}
        {{~raw-plugin-outlet name="topic-list-before-category"}}
        <div class='category'>
          {{category-link topic.category}}
        </div>
        {{else}}
        <span class="author-name">
          <a href="{{topic.creator.path}}" data-user-card="{{topic.creator.username}}">{{topic.creator.username}}</a>
        </span>
      {{/unless}}
      {{discourse-tags topic mode="list"}}
      <div class="pull-right">
        <div class='num activity last'>
          <span class="age activity" title="{{topic.bumpedAtTitle}}"><a
              href="{{topic.lastPostUrl}}">{{format-date topic.bumpedAt format="tiny" noTitle="true"}}</a>
          </span>
        </div>
      </div>
      <div class="clearfix"></div>
    </div>
  </div>
</td>
</script>

테마 크리에이터에서 이 내용은 잘 동작하는 것으로 보입니다. 놓친 부분이 있다면 죄송합니다.


사용자 이름을 클릭할 수 있도록 제목의 패딩을 더 얇게 만드는 작은 CSS 수정 사항입니다.

.topic-list .main-link a.title {
  padding: 0.5em 0;
}

정말 감사합니다. 이제 해결되었고, 아주 잘 보입니다. :heart:

한 가지 더 여쭤볼 것이 있습니다. 작성자 이름의 텍스트 글꼴을 더 크게 만들고 색상을 지정하는 CSS가 있을까요?

해결된 것 같아 기뻐. 마음대로 변경해도 돼. 이렇게 :arrow_double_down:
크기와 색상을 원하는 대로 바꿔.

.topic-list .topic-item-stats .author-name a {
  font-size: var(--font-up-1);
  color: red;
}

다시 한번 정말 감사합니다. 제가 원했던 그대로네요. :heart:

Jennifer Lopez Reaction GIF by NBC World Of Dance