wip
This commit is contained in:
parent
ea357a96ef
commit
3b08fc8406
9 changed files with 81 additions and 48 deletions
|
|
@ -1,18 +0,0 @@
|
||||||
-# Copyright (c) 2010-2011, Diaspora Inc. This file is
|
|
||||||
-# licensed under the Affero General Public License version 3 or later. See
|
|
||||||
-# the COPYRIGHT file.
|
|
||||||
.comment_stream
|
|
||||||
- unless comments_expanded
|
|
||||||
%ul.show_comments{:class => ("hidden" if post.comments.size <= 3)}
|
|
||||||
%li
|
|
||||||
= comment_toggle( post)
|
|
||||||
|
|
||||||
%ul.comments{:class => ('loaded' if post.comments.size <= 3)}
|
|
||||||
-if post.comments.size > 3 && !comments_expanded
|
|
||||||
= render :partial => 'comments/comment', :collection => post.last_three_comments, :locals => {:post => post}
|
|
||||||
-else
|
|
||||||
= render :partial => 'comments/comment', :collection => post.comments, :locals => {:post => post}
|
|
||||||
|
|
||||||
- unless !user_signed_in? || @commenting_disabled
|
|
||||||
.new_comment_form_wrapper{:class => comment_form_wrapper_class(post)}
|
|
||||||
= new_comment_form(post.id, current_user)
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
= hidden_field_tag :post_id, post_id, :id => "post_id_on_#{post_id}"
|
= hidden_field_tag :post_id, post_id, :id => "post_id_on_#{post_id}"
|
||||||
= text_area_tag :text, nil, :rows => 2, :class => "comment_box",:id => "comment_text_on_#{post_id}"
|
= text_area_tag :text, nil, :rows => 2, :class => "comment_box",:id => "comment_text_on_#{post_id}"
|
||||||
|
|
||||||
%div{:style => 'text-align:right;'}
|
.actions
|
||||||
= link_to "Cancel", post_path(post_id), :class => "cancel_new_comment btn"
|
= link_to "Cancel", post_path(post_id), :class => "cancel_new_comment btn"
|
||||||
= submit_tag t('.comment'), :id => "comment_submit_#{post_id}", :disable_with => t('.commenting'), :class => "action"
|
= submit_tag t('.comment'), :id => "comment_submit_#{post_id}", :disable_with => t('.commenting'), :class => "action"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
= render :partial => 'comments/comment', :collection => @comments, :locals => {:post => @post}
|
= render :partial => 'comments/comment', :colleccion => @comments, :locals => {:post => @post}
|
||||||
|
|
|
||||||
|
|
@ -1 +1,5 @@
|
||||||
= render :partial => 'comments/comment', :collection => @comments, :locals => {:post => @post}
|
%ul.comments
|
||||||
|
= render :partial => 'comments/comment', :collection => @comments, :locals => {:post => @post}
|
||||||
|
|
||||||
|
%li.comment.add_comment_bottom_link_container
|
||||||
|
= link_to "Add a comment", new_post_comment_path(@post), :class => 'add_comment_bottom_link btn comment_action inactive'
|
||||||
|
|
|
||||||
|
|
@ -62,7 +62,6 @@
|
||||||
|
|
||||||
/ javascripts at the bottom
|
/ javascripts at the bottom
|
||||||
= include_javascripts :mobile
|
= include_javascripts :mobile
|
||||||
= yield(:javascript)
|
|
||||||
|
|
||||||
/-if current_user
|
/-if current_user
|
||||||
/ :javascript
|
/ :javascript
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,8 @@
|
||||||
-# the COPYRIGHT file.
|
-# the COPYRIGHT file.
|
||||||
|
|
||||||
= form_for StatusMessage.new, {:data => {:ajax => false}} do |status|
|
= form_for StatusMessage.new, {:data => {:ajax => false}} do |status|
|
||||||
= status.text_area :text, :placeholder => t('.whats_on_your_mind'), :style => "width:300px", :rows => 4, :autofocus => "autofocus"
|
#message_container
|
||||||
|
= status.text_area :text, :placeholder => t('.whats_on_your_mind'), :style => "width:300px", :rows => 4, :autofocus => "autofocus"
|
||||||
|
|
||||||
- for aspect_id in aspect_ids
|
- for aspect_id in aspect_ids
|
||||||
= hidden_field_tag 'aspect_ids[]', aspect_id.to_s
|
= hidden_field_tag 'aspect_ids[]', aspect_id.to_s
|
||||||
|
|
@ -16,8 +17,6 @@
|
||||||
- unless current_user.services.empty?
|
- unless current_user.services.empty?
|
||||||
%div{:data => {:role => 'fieldcontain'}}
|
%div{:data => {:role => 'fieldcontain'}}
|
||||||
%label{:for => 'services', :class => 'select'}
|
%label{:for => 'services', :class => 'select'}
|
||||||
choose services
|
|
||||||
|
|
||||||
- current_user.services.each do |service|
|
- current_user.services.each do |service|
|
||||||
%input{:type => 'checkbox', :name => "services[]", :id => "#{service.provider}", :class => 'custom', :value => "#{service.provider}"}
|
%input{:type => 'checkbox', :name => "services[]", :id => "#{service.provider}", :class => 'custom', :value => "#{service.provider}"}
|
||||||
%label{:for => "#{service.provider}"}
|
%label{:for => "#{service.provider}"}
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,6 @@
|
||||||
- elsif post.activity_streams?
|
- elsif post.activity_streams?
|
||||||
= image_tag post.image_url
|
= image_tag post.image_url
|
||||||
|
|
||||||
|
|
||||||
.content
|
.content
|
||||||
.from
|
.from
|
||||||
= person_image_link(post.author, :size => :thumb_small)
|
= person_image_link(post.author, :size => :thumb_small)
|
||||||
|
|
|
||||||
|
|
@ -59,8 +59,7 @@ $(document).ready(function(){
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: link.attr('href'),
|
url: link.attr('href'),
|
||||||
success: function(data){
|
success: function(data){
|
||||||
var comments = $("<ul class='comments'></ul>");
|
parent.append(data);
|
||||||
parent.append(comments.append(data));
|
|
||||||
link.addClass('active');
|
link.addClass('active');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
@ -72,7 +71,9 @@ $(document).ready(function(){
|
||||||
var link = $(this);
|
var link = $(this);
|
||||||
|
|
||||||
if(link.hasClass('inactive')) {
|
if(link.hasClass('inactive')) {
|
||||||
var parent = link.closest(".bottom_bar").first();
|
var parent = link.closest(".bottom_bar").first(),
|
||||||
|
container = link.closest('.bottom_bar').find('.add_comment_bottom_link_container');
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: link.attr('href'),
|
url: link.attr('href'),
|
||||||
beforeSend: function(){
|
beforeSend: function(){
|
||||||
|
|
@ -81,7 +82,11 @@ $(document).ready(function(){
|
||||||
success: function(data){
|
success: function(data){
|
||||||
link.removeClass('loading')
|
link.removeClass('loading')
|
||||||
.removeClass('inactive');
|
.removeClass('inactive');
|
||||||
|
|
||||||
|
container.first().hide();
|
||||||
|
|
||||||
parent.append(data);
|
parent.append(data);
|
||||||
|
parent.find('textarea').first().focus();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -92,9 +97,13 @@ $(document).ready(function(){
|
||||||
var link = $(this);
|
var link = $(this);
|
||||||
form = link.closest("form"),
|
form = link.closest("form"),
|
||||||
commentActionLink = link.closest(".bottom_bar").find("a.comment_action").first();
|
commentActionLink = link.closest(".bottom_bar").find("a.comment_action").first();
|
||||||
|
container = link.closest('.bottom_bar').find('.add_comment_bottom_link_container');
|
||||||
|
|
||||||
|
if(container.length > 0 ){
|
||||||
|
container.first().show();
|
||||||
|
}
|
||||||
|
|
||||||
commentActionLink.addClass("inactive");
|
commentActionLink.addClass("inactive");
|
||||||
form.remove();
|
form.remove();
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -213,6 +213,7 @@ body {
|
||||||
#author_info.profile {
|
#author_info.profile {
|
||||||
box-shadow: inset 0 -1px 3px #111;
|
box-shadow: inset 0 -1px 3px #111;
|
||||||
margin-top: -10px;
|
margin-top: -10px;
|
||||||
|
text-align: left;
|
||||||
|
|
||||||
h2 {
|
h2 {
|
||||||
color: #ccc;
|
color: #ccc;
|
||||||
|
|
@ -285,7 +286,7 @@ footer {
|
||||||
top: 1px solid #dddddd; };
|
top: 1px solid #dddddd; };
|
||||||
min-height: 24px;
|
min-height: 24px;
|
||||||
|
|
||||||
a,
|
> a,
|
||||||
.show_comments {
|
.show_comments {
|
||||||
color: #999;
|
color: #999;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
|
|
@ -378,7 +379,7 @@ footer {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.comment_action {
|
.comment_action.image_link {
|
||||||
background-image: url("/images/icons/pencil_mobile_grey_active.png");
|
background-image: url("/images/icons/pencil_mobile_grey_active.png");
|
||||||
|
|
||||||
&.inactive {
|
&.inactive {
|
||||||
|
|
@ -396,38 +397,78 @@ footer {
|
||||||
}
|
}
|
||||||
|
|
||||||
#new_status_message {
|
#new_status_message {
|
||||||
|
text-align: left;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: 0;
|
left: 0;
|
||||||
top: 45px;
|
top: 40px;
|
||||||
width:100%;
|
width: 100%;
|
||||||
|
|
||||||
|
fieldset {
|
||||||
|
padding: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#message_container {
|
||||||
|
background-color: #fff;
|
||||||
|
padding: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
textarea {
|
textarea {
|
||||||
@include border-radius(0);
|
@include border-radius(0);
|
||||||
left: 0;
|
left: 0;
|
||||||
|
border: none;
|
||||||
|
margin: 10px 0;
|
||||||
|
font-size: larger;
|
||||||
|
padding: 0;
|
||||||
|
min-width: 100%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
textarea {
|
||||||
|
font-size: larger !important;
|
||||||
|
}
|
||||||
|
|
||||||
form {
|
form {
|
||||||
input:not([type='checkbox']),
|
input:not([type='checkbox']),
|
||||||
textarea {
|
textarea {
|
||||||
-webkit-appearance: none;
|
-webkit-appearance: none;
|
||||||
text-size: larger;
|
text-size: larger;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.btn,
|
.btn,
|
||||||
input[type=submit] {
|
input[type=submit] {
|
||||||
@include border-radius(3px);
|
@include border-radius(3px);
|
||||||
background-color: #ccc;
|
background-color: #ddd;
|
||||||
color: #666;
|
color: #666;
|
||||||
text-size: larger;
|
text-size: larger;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
border: 1px solid #999;
|
border: 1px solid #ccc;
|
||||||
|
min-width: 100px;
|
||||||
|
|
||||||
&.action {
|
&.action {
|
||||||
color: #fff;
|
color: #fff;
|
||||||
background-color: green;
|
background-color: green;
|
||||||
border: 1px solid #888;
|
border: 1px solid #888;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.new_comment {
|
||||||
|
padding: 10px 0;
|
||||||
|
padding-top: 20px;
|
||||||
|
|
||||||
|
textarea {
|
||||||
|
width: 98%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.actions {
|
||||||
|
text-align: right;
|
||||||
|
margin-top: 10px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.comment.add_comment_bottom_link_container {
|
||||||
|
text-align: center;
|
||||||
|
padding: 15px !important;
|
||||||
|
padding-top: 25px !important;
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue