个人主页的调整

This commit is contained in:
cxt 2016-10-20 10:50:59 +08:00
parent dff47b586e
commit f085b79999
6 changed files with 44 additions and 54 deletions

View File

@ -17,7 +17,7 @@
:owner_id => @article.nil? ? 0: @article.id,
:owner_type => OwnerTypeHelper::ArticleHomepage,
:width => '100%',
:height => 500,
:height => 418,
:minHeight=>500,
:class => 'talk_text fl',
:input_html => { :id => 'message_content',

View File

@ -1,6 +1,6 @@
<div class="homepageContentContainer" style="margin-top: 25px;">
<div class="homepageMainContent">
<div class="postRightContainer pr">
<div class="postRightContainer pr" style="padding: 25px 40px;">
<% if User.current && User.current == @article.user %>
<div class="homepagePostSetting" id="message_setting_<%= @article.id%>" style="top: -25px;">
<ul>
@ -46,8 +46,22 @@
</div>
<% end %>
<div class="cl"></div>
<div class="postThemeContainer">
<div class="postDetailPortrait">
<%= link_to image_tag(url_to_avatar(@article.user),:width=>50,:height => 50,:alt=>'图像' ),user_path(@article.user) %>
</div>
<div class="postThemeWrap">
<div class="postDetailTitle fl mt5">
<a href="javascript:void(0);" class="f14 linkGrey4 fb" style="overflow:hidden;"><%= @article.title%></a>
</div>
<div class="cl"></div>
<div class="break_word" style="padding: 5px 5px 0 0" id="intro_content">
<div class="postDetailDate"><%= format_time( @article.created_at)%></div>
<div class="cl"></div>
</div>
<div class="cl"></div>
</div>
<div class="break_word mt10" style="padding: 5px 5px 0 0" id="intro_content">
<%=@article.content.html_safe %>
</div>
</div>

View File

@ -1,15 +1,13 @@
<div class="cl"> </div>
<div id="blog-list">
<div class="listbox mt10">
<div class="list-h2 fl" style="font-weight: normal">个人主页列表</div>
<div class="fr">
<%=link_to '新 建', new_article_homepage_path(), :target => "_blank", :class => 'BlueCirBtn' %>
</div>
<div class="cl"></div>
<div class="category">
<div class="category" style="padding: 5px 0;">
<span class="grayTxt">排序:</span>
<%= link_to "时间", {:controller => 'homepages', :action => 'index', :user_id =>@user.id, :sort => @b_sort}, :class => "sortTxt", :remote => true %>
<%= link_to "", {:controller => 'homepages', :action => 'index', :user_id =>@user.id, :sort => @b_sort}, :class => "#{@b_sort.to_i == 1 ? 'sortupbtn' : 'sortdownbtn'} ", :remote => true %>
<div class="fr">
<%=link_to '新 建', new_article_homepage_path(), :target => "_blank", :class => 'BlueCirBtnMiddle', :style => 'margin-right: 0;' %>
</div>
<div class="cl"></div>
</div>
<div class="bloglistbox">
@ -17,57 +15,33 @@
<% @articles.each do |activity| %>
<ul class="list-file pr" onmouseover='$("#message_setting_<%= activity.id%>").show();' onmouseout='$("#message_setting_<%= activity.id%>").hide();'>
<li><span class="item_list fl"></span>
<%= link_to activity.title.to_s.html_safe, user_homepage_article_homepage_path(:user_id=>activity.user_id, :homepage_id=>activity.homepage_id,:id=>activity), :class=> "list-title fl", :target => '_blank' %>
<% if activity.homepage.article_id and activity.id == activity.homepage.article_id %>
<%= link_to activity.title.to_s.html_safe, homepage_user_path(activity.user_id), :class=> "list-title fl", :target => '_blank' %>
<span class="red_homework_btn_cir ml5">主页</span>
<% else %>
<%= link_to activity.title.to_s.html_safe, user_homepage_show_path(:user_id=>activity.user_id,:id=>activity), :class=> "list-title fl", :target => '_blank' %>
<% end %>
<div class="cl"></div>
</li>
<li class="ml15">
<span class="grayTxt">更新:<%= format_time(activity.updated_at) %></span>
<span class="grayTxt fl">更新:<%= format_time(activity.updated_at) %></span>
<div>
<%= link_to(
l(:button_delete),
{:controller => 'article_homepages',:action => 'destroy', :id => activity.id},
:method => :delete,
:data => {:confirm => l(:text_are_you_sure)},
:class => 'fr'
) if User.current.admin? || User.current.id == activity.user_id %>
<%= link_to(
l(:button_edit),
{:controller => 'article_homepages',:action => 'edit', :id => activity.id},
:class => 'fr mr10'
) if User.current.admin? || User.current.id == activity.user_id %>
<div class="cl"></div>
</div>
</li>
<div class="cl"></div>
<div class="homepagePostSetting" id="message_setting_<%= activity.id%>" style="display: none">
<ul>
<li class="homepagePostSettingIcon">
<ul class="homepagePostSettiongText">
<li>
<% if activity.id == activity.homepage.article_id %>
<%= link_to(
l(:button_cancel_base_homepage),
{:controller => 'homepages',:action => 'cancel_homepage',:user_id=>activity.user_id,:id=>activity.homepage_id, :article_id => activity.id},
:method => :post,
:class => 'postOptionLink'
) if User.current && User.current.id == activity.homepage.user_id %>
<% else %>
<%= link_to(
l(:button_set_base_homepage),
{:controller => 'homepages',:action => 'set_homepage',:user_id=>activity.user_id,:id=>activity.homepage_id, :article_id => activity.id},
:method => :post,
:class => 'postOptionLink'
) if User.current && User.current.id == activity.homepage.user_id %>
<% end %>
</li>
<li>
<%= link_to(
l(:button_edit),
{:controller => 'article_homepages',:action => 'edit', :id => activity.id},
:class => 'postOptionLink'
) if User.current.admin? || User.current.id == activity.user_id %>
</li>
<li>
<%= link_to(
l(:button_delete),
{:controller => 'article_homepages',:action => 'destroy', :id => activity.id},
:method => :delete,
:data => {:confirm => l(:text_are_you_sure)},
:class => 'postOptionLink'
) if User.current.admin? || User.current.id == activity.user_id %>
</li>
</ul>
</li>
</ul>
</div>
</ul>
<% end %>
<div>

View File

@ -1,7 +1,7 @@
<div class="homepageRight mt0">
<div class="homepageRightBanner">
<div class="f16 fl fontGrey3">
个人主页
设置个人主页
</div>
</div>
<div class="cl"></div>

View File

@ -555,6 +555,7 @@ RedmineApp::Application.routes.draw do
get '/boards/:id/boards_topic', :to =>'boards#show', :as => 'boards_topic'
match 'courses/:course_id/news/index', :to => 'news#index', :via => [:get, :post], :as => 'new_course_news'
match 'courses/:course_id/news/new', :to => 'news#new', :via => [:get, :post]
match 'users/:user_id/homepage/articles/:id', :to => 'article_homepages#show', :as => "user_homepage_show"
scope ":username" do
resources :posts

View File

@ -531,7 +531,8 @@ a.BlueCirBtn{ display:block;width:75px; height:28px; background-color:#fff; line
a:hover.BlueCirBtn{ background:#3598db; color:#fff;}
a.BlueCirBtnMini{ display:block;width:40px; height:24px; background-color:#ffffff; line-height:24px; vertical-align:middle; text-align:center; border:1px solid #3598db; color:#3598db; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px;}
a:hover.BlueCirBtnMini{ background:#3598db; color:#fff;}
a.BlueCirBtnMiddle{ display:block;width:50px; height:24px; background-color:#ffffff; line-height:24px; vertical-align:middle; text-align:center; border:1px solid #3598db; color:#3598db; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px;}
a:hover.BlueCirBtnMiddle{ background:#3598db; color:#fff;}
/* 按钮*/
a.btn_orange_big{
display:inline-block;