Merge branch 'develop' of 10.0.47.245:/home/trustie2 into develop

Conflicts:
	app/views/words/_message.html.erb
	app/views/words/_new_respond.html.erb
This commit is contained in:
yanxd 2013-12-28 12:19:37 +08:00
commit 112a2b4da6
7 changed files with 119 additions and 28 deletions

View File

@ -1,5 +1,45 @@
<script>
var W3CDOM = document.createElement && document.getElementsByTagName;
window.onload = setMaxLength;
function setMaxLength() {
if (!W3CDOM) return;
var textareas = document.getElementsByTagName('textarea');
var counter = document.createElement('div');
counter.className = 'counter';
for (var i=0;i<textareas.length;i++) {
if (textareas[i].getAttribute('maxlength')) {
var counterClone = counter.cloneNode(true);
counterClone.innerHTML = '<span>0</span>/'+textareas[i].getAttribute('maxlength');
textareas[i].parentNode.insertBefore(counterClone,textareas[i].nextSibling);
textareas[i].relatedElement = counterClone.getElementsByTagName('span')[0];
textareas[i].onkeyup = textareas[i].onchange = checkMaxLength;
textareas[i].onkeyup();
}
}
}
function checkMaxLength() {
var maxLength = this.getAttribute('maxlength');
var currentLength = this.value.length;
alert(currentLength);
if (currentLength >= maxLength) {
this.relatedElement.className = 'toomuch';
}
else {
this.relatedElement.className = '';
}
this.relatedElement.firstChild.nodeValue = currentLength;
}
</script>
<%= form_tag({:controller => 'projects', :action => 'project_respond'}) do %> <%= form_tag({:controller => 'projects', :action => 'project_respond'}) do %>
<%= text_area_tag 'project_respond', "", :class => 'noline', :required => true, :style => "resize: none;", :rows => 6, :placeholder => l(:label_projects_feedback_respond_content) %> <%= text_area_tag 'project_respond', "",
:class => 'noline', :required => true,
:style => "resize: none;", :rows => 6,
:placeholder => l(:label_projects_feedback_respond_content),
:maxlength => 250 %>
<%= hidden_field_tag 'reference_id', params[:reference_id], :value => journal.id %> <%= hidden_field_tag 'reference_id', params[:reference_id], :value => journal.id %>
<%= submit_tag l(:button_projects_feedback_respond), :name => nil , :class => "bid_btn"%> <%= submit_tag l(:button_projects_feedback_respond), :name => nil , :class => "bid_btn"%>

View File

@ -75,6 +75,10 @@
} }
} }
$(function(){
$("a").attr("target", "_blank");
});
function showInfo(id, content) { function showInfo(id, content) {
var text = $('#' + id); var text = $('#' + id);
if (text.val() == '') { if (text.val() == '') {
@ -90,10 +94,10 @@
</style> </style>
<%= stylesheet_link_tag 'welcome' %> <%= stylesheet_link_tag 'welcome' %>
<div class="body_resize">
<div class="left" style="float: left; height: 445px; width: 50%; margin-left: 30px;">
<ul class="welcome-message-list" style="width: 90%; "> <div class="left" style="float: left; min-height: 470px; width: 48%;">
<ul class="welcome-message-list">
<div class="forum-topic" style="height: 25px;"> <div class="forum-topic" style="height: 25px;">
<h3 style="color: rgb(21, 188, 207);margin-left: 8px;"><strong>贴吧动态</strong></h3> <h3 style="color: rgb(21, 188, 207);margin-left: 8px;"><strong>贴吧动态</strong></h3>
@ -108,7 +112,7 @@
<%= link_to topic.subject.truncate(30, omission: '...'), topic.event_url, :class => "gray" , :style => "font-size: 10pt !important;", :target => "_blank" %> <%= link_to topic.subject.truncate(30, omission: '...'), topic.event_url, :class => "gray" , :style => "font-size: 10pt !important;", :target => "_blank" %>
</span> </span>
<br> <br>
<span style="margin-left: 24px; color: rgb(172, 174, 177); white-space: nowrap; font-size 9pt !important;;"><%=time_tag_welcome(topic_last_time topic)%>前</span> <span style="margin-left: 24px; color: rgb(172, 174, 177); white-space: nowrap; font-size 9pt !important;;"><%= l(:field_updated_on) %><%=time_tag_welcome(topic_last_time topic)%>前</span>
<span style="margin-left: 8px; margin-bottom: 0px; color: rgb(172, 174, 177) !important; white-space: nowrap;"> <span style="margin-left: 8px; margin-bottom: 0px; color: rgb(172, 174, 177) !important; white-space: nowrap;">
由&nbsp;<%= link_to topic.author ? topic.author : 'Anonymous', user_path(topic.author_id), :style => "font-size: 9pt !important; color: rgb(17, 102, 173);", :target => "_blank" %>&nbsp;发表 由&nbsp;<%= link_to topic.author ? topic.author : 'Anonymous', user_path(topic.author_id), :style => "font-size: 9pt !important; color: rgb(17, 102, 173);", :target => "_blank" %>&nbsp;发表
</span> </span>
@ -120,8 +124,8 @@
</ul> </ul>
</div> </div>
<div class="right" style="float: right; margin-right: 10px; height: 445px; width: 45%; "> <div class="right" style="float: right; min-height: 470px; width: 48%; ">
<ul class="user-welcome-message-list" style="width: 94%; margin-top: 0px;"> <ul class="user-welcome-message-list">
<h3 style="margin-left: -5px; color: rgb(21, 188, 207)"><strong>用户动态</strong></h3> <h3 style="margin-left: -5px; color: rgb(21, 188, 207)"><strong>用户动态</strong></h3>
<span style="margin-top: -30px;float: right; display: block;"><%= link_to "更多>>", { :controller => 'users', :action => 'index'}, :target => "_blank" %></span> <span style="margin-top: -30px;float: right; display: block;"><%= link_to "更多>>", { :controller => 'users', :action => 'index'}, :target => "_blank" %></span>
<div class="user-message-box-list"> <div class="user-message-box-list">
@ -139,7 +143,7 @@
</div> </div>
</ul> </ul>
</div> </div>
</div>
<div id="J_Slide" class="d-p-index-box d-p-index-hotproject"> <div id="J_Slide" class="d-p-index-box d-p-index-hotproject">
<h3 style="margin-left: 5px; color: #e8770d;"><strong>热门项目</strong></h3> <h3 style="margin-left: 5px; color: #e8770d;"><strong>热门项目</strong></h3>

View File

@ -3,19 +3,18 @@
<span class="portrait"> <span class="portrait">
<%= image_tag url_to_avatar(reply.user), :class => "avatar-3" %> <%= image_tag url_to_avatar(reply.user), :class => "avatar-3" %>
</span> </span>
<div class="body"> <div class="message-body">
<% id = 'project_respond_form_'+ reply.id.to_s %> <% id = 'project_respond_form_'+ reply.id.to_s %>
<p>
<span><%= link_to reply.user.name, user_path(reply.user) %>:&nbsp;</span> <span><%= link_to reply.user.name, user_path(reply.user) %>:&nbsp;</span>
<span class="message-notes"> <%= reply.notes %></span> <span class="message-notes"> <%= reply.notes %></span>
<%# ids = 'project_respond_form_'+ journal.id.to_s%> </p>
<p> <p>
<span class="time"><%= format_time reply.created_on %></span> <span class="time"><%= format_time reply.created_on %></span>
<span style="display: none; margin-left: 4px;" id='<%=ids_r%>' > <span style="display: none; margin-left: 4px;" id='<%=ids_r%>' >
<%= link_to l(:label_projects_feedback_respond),'', <%= link_to l(:label_projects_feedback_respond),'',
{:focus => 'project_respond', :onclick => "toggleAndSettingWordsVal($('##{id}'), $('##{id} textarea'), '#{l(:label_reply_plural)} #{m_reply_id.user.show_name}: '); return false;"} {:focus => 'project_respond', :onclick => "toggleAndSettingWordsVal($('##{id}'), $('##{id} textarea'), '#{l(:label_reply_plural)} #{m_reply_id.user.show_name}: '); return false;"}
%> %>
<% if @user == User.current || User.current.admin? || reply.user.id == User.current.id %> <% if @user == User.current || User.current.admin? || reply.user.id == User.current.id %>
<%= link_to(l(:label_newfeedback_delete), {:controller => 'words', :action => 'destroy', :object_id => reply, :user_id => reply.user}, <%= link_to(l(:label_newfeedback_delete), {:controller => 'words', :action => 'destroy', :object_id => reply, :user_id => reply.user},
:remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :class => "delete", :title => l(:button_delete)) %> :remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :class => "delete", :title => l(:button_delete)) %>

View File

@ -32,11 +32,12 @@
<div id='<%= ids %>' class="respond-form"> <div id='<%= ids %>' class="respond-form">
<%= render :partial => 'words/new_respond', :locals => {:journal => journal, :m_reply_id => journal} %> <%= render :partial => 'words/new_respond', :locals => {:journal => journal, :m_reply_id => journal} %>
</div> </div>
<div style="clear: both;"></div>
<div> <div>
<%= render :partial => "words/journal_reply", :locals => {:journal => journal } %> <%= render :partial => "words/journal_reply", :locals => {:journal => journal } %>
</div> </div>
</li> </li>
<% end %> <% end %>
</ul> </ul>
<% end %> <% end %>

View File

@ -1,9 +1,45 @@
<script>
var W3CDOM = document.createElement && document.getElementsByTagName;
window.onload = setMaxLength;
function setMaxLength() {
if (!W3CDOM) return;
var textareas = document.getElementsByTagName('textarea');
var counter = document.createElement('div');
counter.className = 'counter';
for (var i=0;i<textareas.length;i++) {
if (textareas[i].getAttribute('maxlength')) {
var counterClone = counter.cloneNode(true);
counterClone.innerHTML = '<span>0</span>/'+textareas[i].getAttribute('maxlength');
textareas[i].parentNode.insertBefore(counterClone,textareas[i].nextSibling);
textareas[i].relatedElement = counterClone.getElementsByTagName('span')[0];
textareas[i].onkeyup = textareas[i].onchange = checkMaxLength;
textareas[i].onkeyup();
}
}
}
function checkMaxLength() {
var maxLength = this.getAttribute('maxlength');
var currentLength = this.value.length;
if (currentLength > maxLength)
this.relatedElement.className = 'toomuch';
else
this.relatedElement.className = '';
this.relatedElement.firstChild.nodeValue = currentLength;
}
</script>
<%= form_tag({:controller => 'words', :action => 'create_reply'}, :remote => true) do %> <%= form_tag({:controller => 'words', :action => 'create_reply'}, :remote => true) do %>
<%= text_area_tag 'user_notes', "", :class => 'noline', :style => "resize: none;", :rows => 4, :placeholder => l(:label_projects_feedback_respond_content) %> <%= text_area_tag 'user_notes', "", :class => 'noline',
:style => "resize: none;", :rows => 4,
:placeholder => l(:label_projects_feedback_respond_content),
:maxlength => 250 %>
<%= hidden_field_tag 'reference_id', params[:reference_id], :value => journal.id %> <%= hidden_field_tag 'reference_id', params[:reference_id], :value => journal.id %>
<%= hidden_field_tag 'reference_user_id', params[:reference_user_id], :value => m_reply_id.user.id %> <%= hidden_field_tag 'reference_user_id', params[:reference_user_id], :value => m_reply_id.user.id %>
<%= hidden_field_tag 'reference_message_id', params[:reference_message_id], :value => m_reply_id.id %> <%= hidden_field_tag 'reference_message_id', params[:reference_message_id], :value => m_reply_id.id %>
<%= submit_tag l(:button_projects_feedback_respond), :name => nil , :class => "enterprise", :style => "margin-top: 1px;"%> <%= submit_tag l(:button_projects_feedback_respond), :name => nil , :class => "enterprise", :style => "float: right; margin-top: 1px; margin-right: 4px;"%>
<% end %> <% end %>

View File

@ -159,6 +159,7 @@ li {
margin: 0px; margin: 0px;
padding: 0px; padding: 0px;
background-color: rgb(252, 252, 252); background-color: rgb(252, 252, 252);
margin-top: 6px;
} }
.d-p-index-newsource li,.d-p-index-hotproject ul.d-p-projectlist li{ .d-p-index-newsource li,.d-p-index-hotproject ul.d-p-projectlist li{
color: rgb(102, 102, 102); color: rgb(102, 102, 102);

View File

@ -2125,7 +2125,7 @@ ul.messages-for-user-reply li {
display: none; display: none;
width: 87%; width: 87%;
margin: auto; margin: auto;
clear:both; clear: both;
} }
.outer-message-for-use p { .outer-message-for-use p {
@ -2134,10 +2134,20 @@ ul.messages-for-user-reply li {
margin-top: 5px; margin-top: 5px;
} }
.body p { .message-body p {
margin: 0; margin: 0;
padding: 0; padding: 0;
margin-top: 4px; margin-top: 4px;
margin-left: 4px; margin-left: 4px;
font-size: 9pt; font-size: 9pt;
} }
.message-body {
margin: 0;
padding: 0;
margin-left: 40px;
}
.counter {
float: left;
}