Add permalink for stream elements

This commit is contained in:
Steffen van Bergerem 2015-10-05 00:46:12 +02:00
parent 7b4d7dc737
commit 64773d883e
15 changed files with 72 additions and 42 deletions

View file

@ -29,7 +29,14 @@ app.views.StreamPost = app.views.Post.extend({
"click .destroy_participation": "destroyParticipation" "click .destroy_participation": "destroyParticipation"
}, },
tooltipSelector : ".timeago, .post_scope, .post_report, .block_user, .delete, .create_participation, .destroy_participation", tooltipSelector : [".timeago",
".post_scope",
".post_report",
".block_user",
".delete",
".create_participation",
".destroy_participation",
".permalink"].join(", "),
initialize : function(){ initialize : function(){
var personId = this.model.get('author').id; var personId = this.model.get('author').id;

View file

@ -1,6 +1,6 @@
@import 'perfect-scrollbar'; @import 'perfect-scrollbar';
@import "colors"; @import 'color-variables';
@import "bootstrap-complete.scss"; @import "bootstrap-complete.scss";
@import 'mixins'; @import 'mixins';
@ -21,6 +21,7 @@
@import 'vendor/fileuploader'; @import 'vendor/fileuploader';
@import 'vendor/autoSuggest'; @import 'vendor/autoSuggest';
@import 'typeahead'; @import 'typeahead';
@import 'colors';
/* font overrides */ /* font overrides */
@import 'typography'; @import 'typography';

View file

@ -1,4 +1,4 @@
@import 'colors'; @import 'color-variables';
@import 'animations'; @import 'animations';
/** ADMIN STYlES **/ /** ADMIN STYlES **/

View file

@ -0,0 +1,30 @@
$background-white: #FFFFFF;
$background-grey: #EEEEEE;
$background-blue: #E7F2F7;
$grey: #2B2B2B;
$light-grey: #DDDDDD;
$border-grey: #DDDDDD;
$border-dark-grey: #999999;
$link-grey: #777777;
$link-disabled-grey: #999999;
$text-grey: #999999;
$text-dark-grey: #666666;
$text: #333333;
$white: white;
$black: black;
$green: #8EDE3D;
$light-green: lighten($green,20%);
$red: #A80000;
$blue: #3F8FBA;
$dark-blue: darken(#0984C8,10%);
$sidebars-background: #f0f0f0;
$sidebars-sub-background: darken($sidebars-background, 12%);
$left-navbar-drawer-background: darken($sidebars-background, 6%);
$card-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12);

View file

@ -1,30 +1,8 @@
$background-white: #FFFFFF; .gray {
$background-grey: #EEEEEE; color: $text-grey;
$background-blue: #E7F2F7;
$grey: #2B2B2B; [class^="entypo-"],
$light-grey: #DDDDDD; [class*="entypo-"] {
color: $text-grey;
$border-grey: #DDDDDD; }
$border-dark-grey: #999999; }
$link-grey: #777777;
$link-disabled-grey: #999999;
$text-grey: #999999;
$text-dark-grey: #666666;
$text: #333333;
$white: white;
$black: black;
$green: #8EDE3D;
$light-green: lighten($green,20%);
$red: #A80000;
$blue: #3F8FBA;
$dark-blue: darken(#0984C8,10%);
$sidebars-background: #f0f0f0;
$sidebars-sub-background: darken($sidebars-background, 12%);
$left-navbar-drawer-background: darken($sidebars-background, 6%);
$card-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12);

View file

@ -1,4 +1,4 @@
@import 'colors'; @import 'color-variables';
@import 'mixins'; @import 'mixins';
html { min-height: 100%; } html { min-height: 100%; }

View file

@ -1,5 +1,5 @@
@import "colors"; @import 'color-variables';
@import "bootstrap-variables"; @import 'bootstrap-variables';
body { body {
margin-top: $navbar-height; margin-top: $navbar-height;

View file

@ -1,4 +1,4 @@
@import "colors"; @import 'color-variables';
@import "bootstrap-complete"; @import "bootstrap-complete";
@import "_mixins"; @import "_mixins";
@import "vendor/autoSuggest"; @import "vendor/autoSuggest";

View file

@ -90,7 +90,6 @@
.leaflet-control-zoom { .leaflet-control-zoom {
display: block; display: block;
} }
.grey { color: $text-grey; }
.post-content p:last-of-type { margin-bottom: 0; } .post-content p:last-of-type { margin-bottom: 0; }
.nsfw-shield { .nsfw-shield {
color: $text-grey; color: $text-grey;
@ -101,6 +100,16 @@
} }
} }
.permalink {
@include transition(opacity);
opacity: 0;
}
&:hover .permalink {
opacity: .8;
&:hover { opacity: 1; }
}
div.reshare { div.reshare {
border-left: 2px solid $border-grey; border-left: 2px solid $border-grey;
margin-top: 3px; margin-top: 3px;

View file

@ -1,4 +1,4 @@
<span class="post_scope grey"> <span class="post_scope gray">
{{#if public}} {{#if public}}
{{t "stream.public"}} {{t "stream.public"}}
{{else}} {{else}}

View file

@ -5,7 +5,7 @@
<div class="bd"> <div class="bd">
{{#unless likes_fetched}} {{#unless likes_fetched}}
<a href="#" class="expand_likes grey"> <a href="#" class="expand_likes gray">
{{t "stream.likes" count=likesCount}} {{t "stream.likes" count=likesCount}}
</a> </a>

View file

@ -12,7 +12,7 @@
{{name}} {{name}}
{{/linkToAuthor}} {{/linkToAuthor}}
<span class="details grey"> <span class="details gray">
- -
<a href="/posts/{{id}}"> <a href="/posts/{{id}}">
<time class="timeago" datetime="{{created_at}}"/> <time class="timeago" datetime="{{created_at}}"/>

View file

@ -40,12 +40,16 @@
{{name}} {{name}}
{{/linkToAuthor}} {{/linkToAuthor}}
<span class="details grey"> <span class="details gray">
- -
<a href="/posts/{{id}}"> <a href="/posts/{{id}}">
<time class="timeago" data-original-title="{{{localTime created_at}}}" datetime="{{created_at}}" /> <time class="timeago" data-original-title="{{{localTime created_at}}}" datetime="{{created_at}}" />
</a> </a>
<a href="/posts/{{id}}" class="permalink" title="{{t "stream.permalink"}}">
<i class="entypo-link"></i>
</a>
{{#if interactions.reshares_count}} {{#if interactions.reshares_count}}
- -
{{t "stream.reshares" count=interactions.reshares_count}} {{t "stream.reshares" count=interactions.reshares_count}}

View file

@ -228,6 +228,7 @@ en:
unfollow: "Unfollow" unfollow: "Unfollow"
enable_post_notifications: "Enable notifications for this post" enable_post_notifications: "Enable notifications for this post"
disable_post_notifications: "Disable notifications for this post" disable_post_notifications: "Disable notifications for this post"
permalink: "Permalink"
via: "via <%= provider %>" via: "via <%= provider %>"
likes: likes:

View file

@ -79,7 +79,7 @@ Feature: commenting
And I fill in the following: And I fill in the following:
| text | I think thats a cat | | text | I think thats a cat |
And I press "Comment" And I press "Comment"
When I follow "less than a minute ago" within "span.details.grey" When I follow "less than a minute ago" within "span.details.gray"
Then I should see "I think thats a cat" within ".comments .comment:last-child" Then I should see "I think thats a cat" within ".comments .comment:last-child"
When I follow "less than a minute ago" within ".comments .comment:last-child" When I follow "less than a minute ago" within ".comments .comment:last-child"
Then I should see "I think thats a cat" within ".comments .comment .highlighted" Then I should see "I think thats a cat" within ".comments .comment .highlighted"