diff --git a/app/controllers/memos_controller.rb b/app/controllers/memos_controller.rb index 03ecd8235..30dca1c2a 100644 --- a/app/controllers/memos_controller.rb +++ b/app/controllers/memos_controller.rb @@ -60,6 +60,12 @@ class MemosController < ApplicationController @memo.update_attribute(:viewed_count, @memo.viewed_count.to_i + 1) page = params[:page] + if params[:r] && page.nil? + offset = @memo.children.where("#{Memo.table_name}.id < ?", params[:r].to_i).count + page = 1 + offset / pre_count + else + + end @reply_count = @memo.children.count @reply_pages = Paginator.new @reply_count, pre_count, page @replies = @memo.children. diff --git a/app/models/memo.rb b/app/models/memo.rb index 56dd3e99c..284d2ba1b 100644 --- a/app/models/memo.rb +++ b/app/models/memo.rb @@ -21,7 +21,7 @@ class Memo < ActiveRecord::Base :description => :content, :author => :author, :type => Proc.new {|o| o.parent_id.nil? ? 'Memo' : 'Reply'}, - :url => Proc.new {|o| {:controller => 'memos', :action => 'show', :forum_id => o.forum_id}.merge(o.parent_id.nil? ? {:id => o.id} : {:id => o.parent_id, :anchor => "reply-#{o.id}"})} + :url => Proc.new {|o| {:controller => 'memos', :action => 'show', :forum_id => o.forum_id}.merge(o.parent_id.nil? ? {:id => o.id} : {:id => o.parent_id, :r => o.id, :anchor => "reply-#{o.id}"})} acts_as_activity_provider :author_key => :author_id, :func => 'memos', :timestamp => 'created_at' diff --git a/app/views/bids/index.html.erb b/app/views/bids/index.html.erb index bf405e6b5..ac724b1a1 100644 --- a/app/views/bids/index.html.erb +++ b/app/views/bids/index.html.erb @@ -4,7 +4,7 @@ <%= form_tag(calls_path, :method => :get) do %> - + --> <% @topics.each do |topic| %>
<%= l(:label_requirement_enterprise ) %><%= l(:label_requirement_enterprise ) %> <%= l(:label_user_location) %> : <% if User.current.logged? %> diff --git a/app/views/boards/show.html.erb b/app/views/boards/show.html.erb index ad05362b2..8c270eea7 100644 --- a/app/views/boards/show.html.erb +++ b/app/views/boards/show.html.erb @@ -47,11 +47,12 @@
+ +
<%= link_to image_tag(url_to_avatar(topic.author), :class => "avatar"), user_path(topic.author) %> - + diff --git a/app/views/forums/_show_topics.html.erb b/app/views/forums/_show_topics.html.erb index 1aab4af80..61b136ba1 100644 --- a/app/views/forums/_show_topics.html.erb +++ b/app/views/forums/_show_topics.html.erb @@ -5,7 +5,7 @@ <% if memos.any? %> <% memos.each do |topic| %>
<%= link_to h(topic.subject), board_message_path(@board, topic) %><%= link_to h(topic.subject), board_message_path(@board, topic) %>
<%=link_to (topic.replies_count), board_message_path(@board, topic) %>
回答
- + + @@ -35,7 +35,8 @@ :method => 'post', :title => l(:button_quote))%> <% end %> -
<%= link_to image_tag(url_to_avatar(topic.author), :class => "avatar"), user_path(topic.author) %>
<%= link_to image_tag(url_to_avatar(topic.author), :class => "avatar"), user_path(topic.author) %> diff --git a/app/views/forums/show.html.erb b/app/views/forums/show.html.erb index bb358c99c..8388b6aef 100644 --- a/app/views/forums/show.html.erb +++ b/app/views/forums/show.html.erb @@ -14,7 +14,7 @@ <% end %> -
+

<%= f.text_field :subject, :required => true, :size => 95 %>

<%= f.text_area :content, :required => true, :id => 'editor02' %>

@@ -24,7 +24,7 @@ <%= render :partial => 'attachments/form', :locals => {:container => @memo} %>

<%= f.submit :value => l(:label_memo_create) %> - <%= link_to l(:button_cancel), "#", :onclick => '$("#add-memo").hide(); return false;' %>

+ <%= link_to l(:button_cancel), "#", :onclick => '$("#add-memo").hide(); return false;' %>
<% end %> <% end %> diff --git a/app/views/layouts/_base_header.html.erb b/app/views/layouts/_base_header.html.erb index 516bdaa4e..a2f0cde18 100644 --- a/app/views/layouts/_base_header.html.erb +++ b/app/views/layouts/_base_header.html.erb @@ -8,16 +8,6 @@ <%= content_tag('div', "#{link_to(l(:label_layouts_feedback)+'(' + User.current.count_new_jour.to_s + ')', feedback_path(User.current))}".html_safe, :id => 'loggedas') if User.current.logged? %> <%= content_tag('div', "#{l(:label_logged_as)} #{link_to_user(User.current, :format => :username)}".html_safe, :id => 'loggedas') if User.current.logged? %> <%= render_menu :top_menu if User.current.logged? || !Setting.login_required? -%> - - - - - -
diff --git a/app/views/layouts/base_forums.html.erb b/app/views/layouts/base_forums.html.erb index cd53d6140..48f55244e 100644 --- a/app/views/layouts/base_forums.html.erb +++ b/app/views/layouts/base_forums.html.erb @@ -1,4 +1,3 @@ - @@ -14,7 +13,6 @@ <%= heads_for_theme %> <%= javascript_include_tag "ckeditor/ckeditor.js" %> <%= call_hook :view_layouts_base_html_head %> - <%= yield :header_tags -%> @@ -26,8 +24,8 @@
- - + + - - + +
软件项目托管社区<%= l(:label_user_location) %> : 软件项目托管社区<%= l(:label_user_location) %> :
<%= link_to "forge.trustie.net/forums", forums_path %>

<%=link_to l(:label_home),home_path %> > <%=link_to '公共贴吧', :controller => 'forums', :action => 'index' %> > <%=link_to @forum.name, forum_path(@forum) %>

<%= link_to "forge.trustie.net/forums", forums_path %>

<%=link_to l(:label_home),home_path %> > <%=link_to '公共贴吧', :controller => 'forums', :action => 'index' %> > <%=link_to @forum.name, forum_path(@forum) %>

@@ -49,24 +46,27 @@
@@ -78,7 +78,7 @@
<%= render :partial => 'layouts/base_footer'%> - <%= debug(params) if Rails.env.development? %> + <%= debug(params) if Rails.env.development? %> - <%= call_hook :view_layouts_base_body_bottom %> + + <%= call_hook :view_layouts_base_body_bottom %> diff --git a/app/views/layouts/base_projects.html.erb b/app/views/layouts/base_projects.html.erb index 3a524157a..6e184fa25 100644 --- a/app/views/layouts/base_projects.html.erb +++ b/app/views/layouts/base_projects.html.erb @@ -22,90 +22,82 @@
<%=render :partial => 'layouts/base_header'%>
- - -
+
- - + + - +
软件项目托管社区<%= l(:label_user_location) %> : 软件项目托管社区<%= l(:label_user_location) %> :
<%= link_to "forge.trustie.net/projects", :controller => 'projects', :action => 'index', :project_type => 0 %><%= link_to "forge.trustie.net/projects", :controller => 'projects', :action => 'index', :project_type => 0 %>

<%=link_to l(:label_home),home_path %> > <%=link_to l(:label_project_deposit),:controller => 'projects', :action => 'index', :project_type => 0 %> > <%=link_to @project, project_path(@project) %>

- - + + - -
<%= call_hook :view_layouts_base_body_bottom %> +
diff --git a/app/views/messages/show.html.erb b/app/views/messages/show.html.erb index a71941ee1..9e6e5e659 100644 --- a/app/views/messages/show.html.erb +++ b/app/views/messages/show.html.erb @@ -1,36 +1,3 @@ - - - - + <%= stylesheet_link_tag 'welcome' %>
-
-
    -
    -

    贴吧动态

    - - <%= link_to "更多>>", forums_path %> -
    - - -
    - <% find_new_forum_topics(8).each do |topic|%> -
  • -
    -       - <%= link_to topic.subject.truncate(30, omission: '...'), topic.event_url, :class => "gray" , :style => "font-size: 10pt !important;"%> - -
    - <%=time_tag_welcome(topic_last_time topic)%>前 - - 由 <%= link_to topic.author ? topic.author : 'Anonymous', user_path(topic.author_id), :style => "font-size: 9pt !important; color: rgb(17, 102, 173);"%> 发表 - - 回复(<%= link_to topic.replies_count, topic.event_url %>) -
    -
  • - <% end %> -
    -
-
+
+
    +
    +

    贴吧动态

    -
    -
      -

      用户动态

      - <%= link_to "更多>>", { :controller => 'users', :action => 'index'} %> -
      - <% find_all_activities.each do |event| %> -
    • -
      - <%= image_tag url_to_avatar(event.event_author), :class => "avatar-3" %> -
      -
      - <%= link_to event.event_author, (user_path(event.event_author) if event.event_author), :style => "color:green;" %><%= show_user_content event %> -

      <%= time_tag_welcome event.event_datetime %>前     <%= show_event_reply event %>

      -
      -
    • - <% end %> + <%= link_to "更多>>", forums_path %> +
      + +
      + <% find_new_forum_topics(8).each do |topic|%> +
    • +
      +       + <%= link_to topic.subject.truncate(30, omission: '...'), topic.event_url, :class => "gray" , :style => "font-size: 10pt !important;"%> + +
      + <%=time_tag_welcome(topic_last_time topic)%>前 + + 由 <%= link_to topic.author ? topic.author : 'Anonymous', user_path(topic.author_id), :style => "font-size: 9pt !important; color: rgb(17, 102, 173);"%> 发表 + + 回复(<%= link_to topic.replies_count, topic.event_url %>) +
      +
    • + <% end %>
    +
    + +
    +
      +

      用户动态

      + <%= link_to "更多>>", { :controller => 'users', :action => 'index'} %> +
      + <% find_all_activities.each do |event| %> +
    • +
      + <%= image_tag url_to_avatar(event.event_author), :class => "avatar-3" %> +
      +
      + <%= link_to event.event_author, (user_path(event.event_author) if event.event_author), :style => "color:green;" %><%= show_user_content event %> +

      <%= time_tag_welcome event.event_datetime %>前     <%= show_event_reply event %>

      +
      +
    • + <% end %> +
      +
    +
    -

    热门项目

    - <%= link_to "更多>>", { :controller => 'projects', :action => 'index', :project_type => 0} %> -
    +

    热门项目

    + <%= link_to "更多>>", { :controller => 'projects', :action => 'index', :project_type => 0} %> +
      <% find_all_hot_project.map do |project| break if(project == find_all_hot_project[15]) %>
    • @@ -294,7 +154,6 @@

      <%= link_to( project.name, project_path(project.id), :class => "d-g-blue d-p-project-name", :title => "#{project.name}")%> - <%= content_tag "span", show_grade(project), :style => "cursor: pointer; display: inline-block; float: right; color: #ec6300; ", :title => "项目得分,综合考虑了项目的各项活动,反映了该项目的活跃程度", @@ -362,8 +221,8 @@

      -

      热门众包

      - <%= link_to "更多>>", {:controller => 'bids', :action => 'index'} %> +

      热门众包

      + <%= link_to "更多>>", {:controller => 'bids', :action => 'index'} %>
        <% find_all_hot_bid.map do |bid| break if(bid == find_all_hot_bid[5]) %> @@ -388,9 +247,7 @@






        -
        - diff --git a/app/views/words/_message.html.erb b/app/views/words/_message.html.erb index f76ffc94c..1201bae22 100644 --- a/app/views/words/_message.html.erb +++ b/app/views/words/_message.html.erb @@ -18,9 +18,9 @@
-

+

<%= textilizable journal.notes%> -

<%= l :label_comment_time %>:  <%= format_time journal.created_on %>
+
diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index 9f0f648ba..533126eb2 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -732,7 +732,7 @@ ul.tool li{list-style-type:none; .font_tool{ font-family:微软雅黑; font-size:14px; - color: 1a1a1a; + color: #1a1a1a; padding-left: 6px; } @@ -743,8 +743,8 @@ ul.tool li{list-style-type:none; .welcome_left{ margin-top: 70px; float:left; + padding-left: 10px; width: 49%; - padding-left: 0px; } .welcome_right{ @@ -1490,7 +1490,7 @@ margin-left:-10px; background:#fff; text-align:left; - margin-top: 50px; + margin-top: 50px; width:320px; font-family:微软雅黑,lucida grande,verdana;