# 山姆的简单主题

**URL:** https://meta.discourse.org/t/sams-simple-theme/23552
**Category:** Theme
**Tags:** official, sams-simple-theme
**Created:** [2014年十二月31日 03:20 UTC](https://meta.discourse.org/t/sams-simple-theme/23552 "2014-12-31T03:20:14Z")
**Posts on this page:** 20
**Page:** 6

<div class="post-metadata">

### Author: ![thangngoc89](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/thangngoc89/32/115436_2.png) [@thangngoc89](https://meta.discourse.org/u/thangngoc89)
#### Post date: [2015年一月10日 16:18 UTC](https://meta.discourse.org/t/sams-simple-theme/23552/102 "2015-01-10T16:18:11Z")

</div>

@chapel @sam where can I find the full template for customize ?

---

<div class="post-metadata">

### Author: ![tobiaseigen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tobiaseigen/32/539204_2.png) [@tobiaseigen](https://meta.discourse.org/u/tobiaseigen)
#### Post date: [2015年一月10日 18:34 UTC](https://meta.discourse.org/t/sams-simple-theme/23552/103 "2015-01-10T18:34:16Z")

</div>

I think @sam is just updating the code snippets in the first post in this topic as he moves along. @sam have I got that right?

Incidentally, thanks for doing this! :awthanks: I have been enjoying observing this experiment and it’s going to be helpful to show my team how amazingly customizable discourse is as a platform.

---

<div class="post-metadata">

### Author: ![thangngoc89](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/thangngoc89/32/115436_2.png) [@thangngoc89](https://meta.discourse.org/u/thangngoc89)
#### Post date: [2015年一月10日 19:05 UTC](https://meta.discourse.org/t/sams-simple-theme/23552/104 "2015-01-10T19:05:03Z")

</div>

Here is a good base for customize on our own  
[https://meta.discourse.org/?preview-style=ab0d551a-aa4b-4590-82b2-f13859205808](https://meta.discourse.org/?preview-style=ab0d551a-aa4b-4590-82b2-f13859205808)

---

<div class="post-metadata">

### Author: ![chapel](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/chapel/32/122414_2.png) [@chapel](https://meta.discourse.org/u/chapel)
#### Post date: [2015年一月11日 11:01 UTC](https://meta.discourse.org/t/sams-simple-theme/23552/105 "2015-01-11T11:01:09Z")

</div>

I’ve updated my post with the current CSS and Header changes.

---

<div class="post-metadata">

### Author: ![JSey](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jsey/32/3540_2.png) [@JSey](https://meta.discourse.org/u/JSey)
#### Post date: [2015年一月11日 20:27 UTC](https://meta.discourse.org/t/sams-simple-theme/23552/106 "2015-01-11T20:27:34Z")

</div>

@sam, did you stumble across this little oddity?

 ![](https://global.discourse-cdn.com/meta/original/3X/0/e/0ebc6277fdfa5c6d4aa51990768d6ea613b8921b.jpg)  
There is a spurious colspan=“2” in the main-link clearfix TD where it really should be a colspan=“1”… I was not really able to reproduce it with anything but the “Welcome to Discourse”-thread…

/Edit: @chapel’s design (thanks for sharing btw!) shows the same effect!

---

<div class="post-metadata">

### Author: ![Mittineague](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mittineague/32/114259_2.png) [@Mittineague](https://meta.discourse.org/u/Mittineague)
#### Post date: [2015年一月11日 20:35 UTC](https://meta.discourse.org/t/sams-simple-theme/23552/107 "2015-01-11T20:35:10Z")

</div>

Is the Pinned icon adding an “extra” table cell to that row?

---

<div class="post-metadata">

### Author: ![JSey](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jsey/32/3540_2.png) [@JSey](https://meta.discourse.org/u/JSey)
#### Post date: [2015年一月11日 20:36 UTC](https://meta.discourse.org/t/sams-simple-theme/23552/108 "2015-01-11T20:36:54Z")

</div>

Nope, it must either be the missing category, or the missing poster list, if I take a look at the original design… do we need the `colspan="{{titleColSpan}}"` at all? Is there any use case left for it in the new, reduced designs?

---

<div class="post-metadata">

### Author: ![chapel](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/chapel/32/122414_2.png) [@chapel](https://meta.discourse.org/u/chapel)
#### Post date: [2015年一月11日 20:39 UTC](https://meta.discourse.org/t/sams-simple-theme/23552/109 "2015-01-11T20:39:50Z")

</div>

Let me check. I don’t have any topics uncategorized so that might explain why I haven’t seen it.

---

<div class="post-metadata">

### Author: ![JSey](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jsey/32/3540_2.png) [@JSey](https://meta.discourse.org/u/JSey)
#### Post date: [2015年一月11日 20:51 UTC](https://meta.discourse.org/t/sams-simple-theme/23552/110 "2015-01-11T20:51:39Z")

</div>

Nope, the missing category isn’t the culprit… must be the missing poster list:

 ![](https://global.discourse-cdn.com/meta/original/3X/7/2/728ae6b9f2fd9343a99a59323e0c062c62356295.jpg)

I just kicked the colspan and haven’t found any other errors in the topic list…

---

<div class="post-metadata">

### Author: ![chapel](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/chapel/32/122414_2.png) [@chapel](https://meta.discourse.org/u/chapel)
#### Post date: [2015年一月11日 21:22 UTC](https://meta.discourse.org/t/sams-simple-theme/23552/111 "2015-01-11T21:22:30Z")

</div>

I’m not able to reproduce or see the case you’re seeing.

> [@JSey](#):
>
> do we need the colspan=“{{titleColSpan}}” at all? Is there any use case left for it in the new, reduced designs?

Due to the modifications in the simplified topic list, I would guess that it isn’t necessary but I haven’t tracked down where that variable is created, I’m sure @sam could answer authoritatively.

---

<div class="post-metadata">

### Author: ![JSey](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jsey/32/3540_2.png) [@JSey](https://meta.discourse.org/u/JSey)
#### Post date: [2015年一月11日 21:29 UTC](https://meta.discourse.org/t/sams-simple-theme/23552/112 "2015-01-11T21:29:46Z")

</div>

Thanks anyway Jacob - so let’s wait and see what @sam knows about `titleColSpan`! 😃

---

<div class="post-metadata">

### Author: ![chapel](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/chapel/32/122414_2.png) [@chapel](https://meta.discourse.org/u/chapel)
#### Post date: [2015年一月11日 21:33 UTC](https://meta.discourse.org/t/sams-simple-theme/23552/113 "2015-01-11T21:33:29Z")

</div>

He is out on vacation for 2 weeks I believe, so he may not show up here any time soon.

Quickly searched and found this:

> <https://github.com/discourse/discourse/blob/0947191060757efee411d05afcc267c968af316e/app/assets/javascripts/discourse/controllers/topic-list-item.js.es6#L25-L33>

From the looks of it, this is the logic that you were seeing: `this.get('model.isPinnedUncategorized')`

So it’s a combination of a pinned topic that is uncategorized. So he colspan attribute is unnecessary for the simplified design.

---

<div class="post-metadata">

### Author: ![downey](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/downey/32/166878_2.png) [@downey](https://meta.discourse.org/u/downey)
#### Post date: [2015年一月12日 14:41 UTC](https://meta.discourse.org/t/sams-simple-theme/23552/114 "2015-01-12T14:41:09Z")

</div>

Without the table headers, how do we sort by # of replies, recency, or category?

---

<div class="post-metadata">

### Author: ![thangngoc89](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/thangngoc89/32/115436_2.png) [@thangngoc89](https://meta.discourse.org/u/thangngoc89)
#### Post date: [2015年一月12日 14:43 UTC](https://meta.discourse.org/t/sams-simple-theme/23552/115 "2015-01-12T14:43:03Z")

</div>

Some hack around inspired by this topic 😄

![](https://global.discourse-cdn.com/meta/original/3X/c/2/c27cc961228258ae7cec80795a0c1dea53579c40.png)

![](https://global.discourse-cdn.com/meta/original/3X/3/4/341114000ebce09dc4650bf5b4864ab4324e7035.png)

```
<script>
Discourse.HTML['categoryStyle'] = function(category) {
    var color = Em.get(category, 'color'),
        textColor = Em.get(category, 'text_color');

    if (!color && !textColor) { return; }
    
    // Add the custom style if we need to
    var style = "";
    if (color) { 
        style += "border: 2px solid #" + color + "; "; 
        style += "color: #" + color + "; ";
    }
    return style;
}
Discourse.HTML['categoryBadge'] = function(category, opts) {
    opts = opts || {};

    if ((!category) ||
          (!opts.allowUncategorized &&
           Em.get(category, 'id') === Discourse.Site.currentProp("uncategorized_category_id") &&
           Discourse.SiteSettings.suppress_uncategorized_badge
          )
       ) return "";

    var name = Em.get(category, 'name'),
        description = Em.get(category, 'description_text'),
        restricted = Em.get(category, 'read_restricted'),
        url = Discourse.getURL("/c/") + Discourse.Category.slugFor(category),
        elem = (opts.link === false ? 'span' : 'a'),
        extraClasses = (opts.extraClasses ? (' ' + opts.extraClasses) : ''),
        html = "<" + elem + " href=\"" + (opts.link === false ? '' : url) + "\" ",
        categoryStyle;

    // Parent stripe implies onlyStripe
    if (opts.onlyStripe) { opts.showParent = true; }

    html += "data-drop-close=\"true\" class=\"badge-category" + (restricted ? ' restricted' : '' ) +
            (opts.onlyStripe ? ' clear-badge' : '') +
            extraClasses + "\" ";
    name = Handlebars.Utils.escapeExpression(name);

    // Add description if we have it, without tags. Server has sanitized the description value.
    if (description) html += "title=\"" + Handlebars.Utils.escapeExpression(description) + "\" ";

    categoryStyle = Discourse.HTML.categoryStyle(category);
    if (categoryStyle) {
        html += "style=\"" + categoryStyle + "\" ";
    }
    if (restricted) {
      html += "><div><i class='fa fa-group'></i> " + name + "</div></" + elem + ">";
    } else {
      html += ">" + name + "</" + elem + ">";
    }
    return html;
  }
</script>

```

---

<div class="post-metadata">

### Author: ![mcwumbly](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mcwumbly/32/103861_2.png) [@mcwumbly](https://meta.discourse.org/u/mcwumbly)
#### Post date: [2015年一月25日 00:33 UTC](https://meta.discourse.org/t/sams-simple-theme/23552/116 "2015-01-25T00:33:51Z")

</div>

digging the squares 🍻

 ![](https://global.discourse-cdn.com/meta/original/3X/6/c/6cd0bbc576b8ffbfb3c48d5a14ef9d79ff2c9077.PNG)

---

<div class="post-metadata">

### Author: ![chapel](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/chapel/32/122414_2.png) [@chapel](https://meta.discourse.org/u/chapel)
#### Post date: [2015年一月25日 01:11 UTC](https://meta.discourse.org/t/sams-simple-theme/23552/117 "2015-01-25T01:11:16Z")

</div>

I switched over to using my minimal view as the default on my forum. If you would like to see how it looks/feels feel free to check it out at [http://discourse.wastingyourlife.co/latest](http://discourse.wastingyourlife.co/latest)

I haven’t tried the squares, but I am thinking of alternative styles to try and see how they look in the different areas categories are shown.

---

<div class="post-metadata">

### Author: ![rumpelsepp](https://avatars.discourse-cdn.com/v4/letter/r/bc79bd/32.png) [@rumpelsepp](https://meta.discourse.org/u/rumpelsepp)
#### Post date: [2015年一月25日 07:07 UTC](https://meta.discourse.org/t/sams-simple-theme/23552/118 "2015-01-25T07:07:21Z")

</div>

👍 I just always think that the “replies” and “last author” column should be changed. But I have no idea about design, though. =)

---

<div class="post-metadata">

### Author: ![Kasper](https://avatars.discourse-cdn.com/v4/letter/k/eada6e/32.png) [@Kasper](https://meta.discourse.org/u/Kasper)
#### Post date: [2015年一月25日 11:38 UTC](https://meta.discourse.org/t/sams-simple-theme/23552/119 "2015-01-25T11:38:30Z")

</div>

@chapel This looks so clean, I think it should be considered as the default discourse theme.

---

<div class="post-metadata">

### Author: ![alefattorini](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/alefattorini/32/119928_2.png) [@alefattorini](https://meta.discourse.org/u/alefattorini)
#### Post date: [2015年一月25日 15:12 UTC](https://meta.discourse.org/t/sams-simple-theme/23552/120 "2015-01-25T15:12:46Z")

</div>

I do like it very much! Clean and minimal 😉 I want it!

---

<div class="post-metadata">

### Author: ![chapel](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/chapel/32/122414_2.png) [@chapel](https://meta.discourse.org/u/chapel)
#### Post date: [2015年一月25日 20:42 UTC](https://meta.discourse.org/t/sams-simple-theme/23552/121 "2015-01-25T20:42:12Z")

</div>

The info is in my [post above](https://meta.discourse.org/t/sams-personal-minimal-topic-list-design/23552/71). Has the necessary CSS and JS changes.

Edit: added link to the post.

[上一頁](https://meta.discourse.org/t/sams-simple-theme/23552.md?page=5)

[下一頁](https://meta.discourse.org/t/sams-simple-theme/23552.md?page=7)
