Anonymous avatar Anonymous committed 535ad78

access name

Comments (0)

Files changed (3)


+    @cached_property
+    def access_name(self):
+        return {
+                 Post.PUBLIC : "public",
+                 Post.FRIENDS : "friends",
+                 Post.PRIVATE : "private"
+               }.setdefault(self.access)
     def can_access(self, user=None):
         if self.access == self.PUBLIC:
             return True


 ul.following li, ul.followers li { display:inline; }
 li.faded { font-weight: 100; }
+a.public { color: #009; }
+a.friends { color: #090; }
+a.private { color: #900; }


     <a href="#" onclick="newsmeme.vote_post('{{ url_for('post.downvote', }}'); return false;"><img src="{{ theme_static("images/down-icon.png") }}"></a>  
 {% endif %}
-<a href="{{ if else post.url }}">{{ post.title }}</a>
+<a href="{{ if else post.url }}" class="{{ post.access_name }}">{{ post.title }}</a>
 {% if %}
 <span class="domain">&rarr; {{ post.domain }}</span>
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.