Thisnthat 3 years ago
parent
commit
3d0edffdda
7 changed files with 288 additions and 1 deletions
  1. 22 0
      LICENSE.txt
  2. 3 1
      README.md
  3. 5 0
      about.json
  4. 5 0
      common/color_definitions.scss
  5. 157 0
      desktop/desktop.scss
  6. 92 0
      desktop/header.html
  7. 4 0
      locales/en.yml

+ 22 - 0
LICENSE.txt

@@ -0,0 +1,22 @@
+Copyright (c) 2016: Sam Saffron
+
+MIT License
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

+ 3 - 1
README.md

@@ -1,2 +1,4 @@
-# simple-custom
+## Sam's simple discourse theme
+
+More info at: https://meta.discourse.org/t/sams-personal-minimal-topic-list-design/23552?u=sam
 

+ 5 - 0
about.json

@@ -0,0 +1,5 @@
+{
+  "name": "Sam's Simple Theme",
+  "about_url": "https://meta.discourse.org/t/sams-personal-minimal-topic-list-design/23552",
+  "license_url": "https://github.com/SamSaffron/discourse-simple-theme/blob/master/LICENSE.txt"
+}

+ 5 - 0
common/color_definitions.scss

@@ -0,0 +1,5 @@
+$simple-theme-link-color: dark-light-choose(#3b5998, #7e97cd);
+
+:root {
+  --simple-theme-link-color: #{$simple-theme-link-color};
+}

+ 157 - 0
desktop/desktop.scss

@@ -0,0 +1,157 @@
+.topic-list > tbody > tr:nth-child(odd) {
+  background-color: var(--secondary);
+}
+
+.topic-list > tbody tr:not(.last-visit):not(.topic-list-item-separator) td {
+  border-bottom: 1px solid var(--primary-low);
+}
+
+.topic-list a.title:not(.badge-notification) {
+  color: var(--simple-theme-link-color);
+  font-weight: normal;
+  font-family: "Helvetica Neue", Helvetica, Arial, Utkal, sans-serif;
+  font-size: 18px;
+}
+
+.topic-list a.title:not(.badge-notification):hover {
+  text-decoration: underline;
+}
+
+.topic-list .creator,
+.topic-list .editor {
+  font-size: 13px;
+  display: block;
+  margin-top: 3px;
+}
+
+.topic-list .main-link {
+  width: auto;
+}
+
+.topic-list {
+  td,
+  .creator a,
+  .editor a {
+    color: var(--primary-medium);
+  }
+}
+
+.topic-list td {
+  padding-bottom: 10px;
+}
+
+.topic-list th {
+  color: var(--primary);
+  background-color: var(--primary-very-low);
+}
+.topic-list {
+  border-top: none;
+}
+
+.topic-list td:first-of-type {
+  padding-bottom: 10px;
+  padding-left: 10px;
+  padding-top: 10px;
+}
+
+.topic-list tr.topic-list-item-separator td:first-of-type {
+  padding: 0;
+}
+
+.topic-list {
+  .fa-tag {
+    opacity: 0.7;
+    font-size: 10px;
+    margin-right: -2px;
+  }
+  .num.posts-map {
+    position: relative;
+    font-size: 17px;
+    a {
+      color: var(--primary-medium) !important;
+      font-weight: normal;
+    }
+    a.heatmap-high {
+      color: #c66 !important;
+    }
+    width: 100px;
+  }
+}
+
+.topic-list td.last-post,
+.topic-list th.activity {
+  width: 160px;
+  .relative-date {
+    color: var(--primary-high);
+  }
+}
+
+.topic-list .creator .relative-date {
+  margin-left: 8px;
+}
+
+.badge-category-bg {
+  opacity: 0.8;
+}
+
+.topic-list .badge-wrapper.bar {
+  .badge-category {
+    color: #9a9a9a !important;
+    font-weight: 600;
+    font-size: 12px;
+    padding: 2px 6px;
+  }
+  .badge-category-bg {
+    top: -1px;
+  }
+}
+
+.last-post {
+  .poster-avatar {
+    margin-right: 10px;
+  }
+  .poster-avatar,
+  .poster-info {
+    float: left;
+  }
+}
+
+.topic-list .posts {
+  width: auto;
+}
+
+/* topic page */
+
+nav.post-controls button.has-like {
+  color: #08c;
+}
+
+.creator .badge-wrapper.bullet span.badge-category {
+  margin-top: -2px;
+}
+
+img.avatar {
+  border-radius: 3px;
+}
+
+#suggested-topics td.main-link {
+  width: 500px;
+}
+
+.topic-list a.title.visited:not(.badge-notification) {
+  color: #6644aa;
+}
+
+.topic-list-item .discourse-tags {
+  font-size: 0.75em;
+  display: inline-block;
+  margin-left: 5px;
+}
+
+body {
+  .topic-list-item.visited a.badge-wrapper,
+  .latest-topic-list-item.visited a.badge-wrapper,
+  .category-topic-link.visited a.badge-wrapper {
+    opacity: 1;
+  }
+}

+ 92 - 0
desktop/header.html

@@ -0,0 +1,92 @@
+<script type='text/x-handlebars' data-template-name='list/topic-list-item.raw'>
+
+{{#if bulkSelectEnabled}}
+<td class='star'>
+  <input type='checkbox' class='bulk-select'>
+</td>
+{{/if}}
+
+<td class='main-link clearfix'>
+  {{raw "topic-status" topic=topic}}
+  {{topic-link topic}}
+  {{#if controller.showTopicPostBadges}}
+    {{raw "topic-post-badges" unread=topic.unread newPosts=topic.displayNewPosts unseen=topic.unseen url=topic.lastUnreadUrl}}
+  {{/if}}
+  {{discourse-tags topic mode="list"}}
+  {{raw "list/topic-excerpt" topic=model}}
+  <div class='creator'>
+  {{#if showCategory}}
+     {{category-link topic.category}}
+   {{/if}}
+  {{~#if topic.creator ~}}
+  <a href="/users/{{topic.creator.username}}" data-auto-route="true" data-user-card="{{topic.creator.username}}">{{topic.creator.username}}</a> <a href={{topic.url}}>{{format-date topic.createdAt format="tiny"}}</a>
+  {{~/if ~}}
+   {{raw "list/action-list" topic=topic postNumbers=topic.liked_post_numbers className="likes" icon="heart"}}
+   </div>
+</td>
+
+{{#if controller.showLikes}}
+<td class="num likes">
+  {{number topic.like_count}} <i class='fa fa-heart'></i>
+</td>
+{{/if}}
+
+{{#if controller.showOpLikes}}
+<td class="num likes">
+  {{number topic.op_like_count}} <i class='fa fa-heart'></i>
+</td>
+{{/if}}
+
+{{raw "list/posts-count-column" topic=topic}}
+
+<td class="last-post">
+<div class='poster-avatar'>
+<a href="{{topic.lastPostUrl}}" data-user-card="{{topic.last_poster_username}}">{{avatar topic.lastPosterUser imageSize="medium"}}</a>
+</div>
+<div class='poster-info'>
+<a href="{{topic.lastPostUrl}}">
+{{format-date topic.bumpedAt format="tiny"}}
+</a>
+<span class='editor'><a href="/users/{{topic.last_poster_username}}" data-auto-route="true" data-user-card="{{topic.last_poster_username}}">{{topic.last_poster_username}}</a></span>
+</div>
+</td>
+</script>
+
+<script type='text/x-handlebars' data-template-name='topic-list-header.raw'>
+  {{#if bulkSelectEnabled}}
+  <th class='star'>
+    {{#if canBulkSelect}}
+        <button class='btn bulk-select' title='{{i18n "topics.bulk.toggle"}}'><i class='fa fa-list'></i></button>
+    {{/if}}
+  </th>
+  {{/if}}
+  {{raw "topic-list-header-column" order='default' name='topic.title' bulkSelectEnabled=bulkSelectEnabled showBulkToggle=toggleInTitle canBulkSelect=canBulkSelect}}
+
+  {{#if showLikes}}
+     {{raw "topic-list-header-column" sortable='true' order='likes' number='true' forceName=(theme-i18n 'likes')}}
+  {{/if}}
+  {{#if showOpLikes}}
+     {{raw "topic-list-header-column" sortable='true' order='op_likes' number='true' forceName=(theme-i18n 'likes')}}
+  {{/if}}
+  {{raw "topic-list-header-column" sortable='true' number='true' order='posts' forceName=(theme-i18n 'replies') }}
+  {{raw "topic-list-header-column" sortable='true' order='activity' forceName=(theme-i18n 'last_post')}}
+</script>
+
+<script>
+
+(function(){
+
+var TopicListItemView = require('discourse/components/topic-list-item').default;
+
+
+TopicListItemView.reopen({
+    showCategory: function(){
+        return !this.get('controller.hideCategory') &&
+                this.get('topic.creator') &&
+                this.get('topic.category.name') !== 'uncategorized';
+    }.property()
+});
+
+})();
+
+</script>

+ 4 - 0
locales/en.yml

@@ -0,0 +1,4 @@
+en:
+  replies: Replies
+  last_post: Last Post
+  likes: Likes