个人主页个性签名增加自动识别url

This commit is contained in:
yuanke 2016-06-13 15:29:15 +08:00
parent e86419c28b
commit 44c9265fee
3 changed files with 14 additions and 10 deletions

View File

@ -1,8 +1,10 @@
<% if user.user_extensions && user.user_extensions.brief_introduction && !user.user_extensions.brief_introduction.empty? %>
<%= user.user_extensions.brief_introduction %>&nbsp;
<% else%>
这位童鞋很懒,什么也没有留下~&nbsp;
<% end %>
<span>
<% if user.user_extensions && user.user_extensions.brief_introduction && !user.user_extensions.brief_introduction.empty? %>
<%= user.user_extensions.brief_introduction %>
<% else%>
这位童鞋很懒,什么也没有留下~
<% end %>
</span>
<% if User.current == user%>
<%= link_to image_tag("../images/signature_edit.png",width:"12px", height: "12px"), "javascript:void(0);", :onclick => "show_edit_user_introduction();"%>
<% end%>
<% end %>

View File

@ -139,9 +139,9 @@
<div>
<div class="homepageSignature break_word">
<p id="user_brief_introduction_show">
<%= render :partial => 'layouts/user_brief_introduction', :locals => {:user => @user} %>
</p>
<div id="user_brief_introduction_show">
<%= render :partial => 'layouts/user_brief_introduction', :locals => {:user => @user} %>
</div>
</div>
<textarea class="homepageSignatureTextarea none" placeholder="请编辑签名" id="user_brief_introduction_edit" onblur="edit_user_introduction('<%= edit_brief_introduction_user_path(@user.id)%>');"><%= @user.user_extensions.brief_introduction %></textarea>
</div>
@ -349,6 +349,7 @@
$(function(){
$('#user_hide_course').hide();
$('#user_hide_project').hide();
autoUrl("user_brief_introduction_show");
});
$("#courseMenu").mouseenter(function(){

View File

@ -1,3 +1,4 @@
$("#user_brief_introduction_show").html("<%= escape_javascript render(:partial => "layouts/user_brief_introduction", :locals => {:user => @user}) %>");
$("#user_brief_introduction_show").show();
$("#user_brief_introduction_edit").hide();
$("#user_brief_introduction_edit").hide();
autoUrl("user_brief_introduction_show");