From cda9543849eb9e66d6a68a252758c02fed811a60 Mon Sep 17 00:00:00 2001 From: yanxd Date: Mon, 23 Dec 2013 09:28:28 +0800 Subject: [PATCH 1/9] =?UTF-8?q?=E5=B8=96=E5=AD=90=E5=9B=9E=E5=A4=8D?= =?UTF-8?q?=E6=95=B0=E9=87=8F=E8=B6=85=E8=BF=87=E4=B8=80=E9=A1=B5=EF=BC=8C?= =?UTF-8?q?=E9=A6=96=E9=A1=B5=E5=8A=A8=E6=80=81=E7=82=B9=E5=87=BB=E8=BF=87?= =?UTF-8?q?=E5=8E=BB=E6=97=A0=E6=B3=95=E8=B7=B3=E8=BD=AC=E5=88=B0=E7=9B=B8?= =?UTF-8?q?=E5=BA=94=E9=A1=B5=E9=9D=A2=E5=AE=9A=E4=BD=8D=EF=BC=8C=E9=94=9A?= =?UTF-8?q?=E7=82=B9=E5=A4=B1=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/memos_controller.rb | 6 ++++++ app/models/memo.rb | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) 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' From 55af88777bc0d2bd6a5787a3c516eb88e77895e3 Mon Sep 17 00:00:00 2001 From: yanxd Date: Mon, 23 Dec 2013 09:30:15 +0800 Subject: [PATCH 2/9] =?UTF-8?q?issue#426=20=E4=B8=8D=E6=98=AF=E9=A1=BA?= =?UTF-8?q?=E5=BA=8F=E4=B9=B1=EF=BC=8C=E6=98=AF=E6=B2=A1=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E7=BD=AE=E9=A1=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/boards/show.html.erb | 2 +- app/views/messages/show.html.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/boards/show.html.erb b/app/views/boards/show.html.erb index ad05362b2..1a0a7af45 100644 --- a/app/views/boards/show.html.erb +++ b/app/views/boards/show.html.erb @@ -51,7 +51,7 @@ - + diff --git a/app/views/messages/show.html.erb b/app/views/messages/show.html.erb index a71941ee1..f45b422f8 100644 --- a/app/views/messages/show.html.erb +++ b/app/views/messages/show.html.erb @@ -117,7 +117,7 @@

<%=link_to @topic.author, user_path(@topic.author) %>

-
<%= label_tag l(:field_subject) %>: <%=link_to @topic.subject, project_boards_path(@topic.project) %>
+
<%= label_tag l(:field_subject) %>: <%=link_to @topic.subject, project_boards_path(@topic.project) %>
<%= textilizable(@topic, :content) %> <%= link_to_attachments @topic, :author => false %>
From 8be6e2f3d1094a0a998ee58df546a18aeabb0ce0 Mon Sep 17 00:00:00 2001 From: yanxd Date: Mon, 23 Dec 2013 10:59:04 +0800 Subject: [PATCH 3/9] remove remark. --- app/views/messages/show.html.erb | 41 -------------------------------- 1 file changed, 41 deletions(-) diff --git a/app/views/messages/show.html.erb b/app/views/messages/show.html.erb index f45b422f8..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/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; From ec73bb144e55a6bc74694ef1536390b814e298c7 Mon Sep 17 00:00:00 2001 From: yanxd Date: Mon, 23 Dec 2013 19:54:43 +0800 Subject: [PATCH 6/9] zz --- app/views/welcome/index.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/welcome/index.html.erb b/app/views/welcome/index.html.erb index 0ff079978..32cb43167 100644 --- a/app/views/welcome/index.html.erb +++ b/app/views/welcome/index.html.erb @@ -1,12 +1,12 @@
        -
        +

        <%= l(:label_welcome_trustie) %> , <%= l(:label_welcome_trustie_description) %>

        <%= call_hook :view_account_login_top %> -
        +
        <%= form_tag(signin_path) do %> <%= back_url_hidden_field_tag if is_logout? %> <% unless User.current.logged? %> From fe2dc180ba64762b46195415db7fc8789e71b04b Mon Sep 17 00:00:00 2001 From: yanxd Date: Tue, 24 Dec 2013 10:27:43 +0800 Subject: [PATCH 7/9] =?UTF-8?q?=E6=95=B4=E7=90=86=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E6=A0=87=E7=AD=BE=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/user_newfeedback.html.erb | 2 +- app/views/words/_message.html.erb | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/views/users/user_newfeedback.html.erb b/app/views/users/user_newfeedback.html.erb index 643ccfe96..22ff5a280 100644 --- a/app/views/users/user_newfeedback.html.erb +++ b/app/views/users/user_newfeedback.html.erb @@ -12,7 +12,7 @@
        \ No newline at end of file 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 @@
+ @@ -35,7 +35,8 @@ :method => 'post', :title => l(:button_quote))%> <% end %> -
<%= 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) %>
回答
-

+

<%= textilizable journal.notes%> -

<%= l :label_comment_time %>:  <%= format_time journal.created_on %>
+ +
From 2636d6b1e6b4598921ebb9c4dfdc18f7561b922b Mon Sep 17 00:00:00 2001 From: yanxd Date: Tue, 24 Dec 2013 10:57:59 +0800 Subject: [PATCH 8/9] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E7=95=99=E8=A8=80?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E5=AF=B9=E9=BD=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/base_projects.html.erb | 74 +++++++++++------------- app/views/projects/_new_respond.html.erb | 5 +- app/views/projects/feedback.html.erb | 12 ++-- 3 files changed, 42 insertions(+), 49 deletions(-) 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/projects/_new_respond.html.erb b/app/views/projects/_new_respond.html.erb index 9daa48e14..e6b072399 100644 --- a/app/views/projects/_new_respond.html.erb +++ b/app/views/projects/_new_respond.html.erb @@ -1,8 +1,7 @@ -<%= 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) %> <%= 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"%> <%end%> diff --git a/app/views/projects/feedback.html.erb b/app/views/projects/feedback.html.erb index be7827e9d..b5588ee0f 100644 --- a/app/views/projects/feedback.html.erb +++ b/app/views/projects/feedback.html.erb @@ -11,10 +11,12 @@ - +
<%= submit_tag l(:button_leave_meassge), :name => nil , :class => "bid_btn" %> + <%= submit_tag l(:button_leave_meassge), :name => nil , :class => "bid_btn" %> +
- <% end %> +<% end %> <% if @jour.size >0 %> @@ -29,9 +31,9 @@ -

+

<%= textilizable journal.notes%> -

+
<%= l :label_update_time %>: <%= format_time journal.created_on %> @@ -55,5 +57,5 @@ \ No newline at end of file From 5e5689d945075eed373906693d1df4f84397372b Mon Sep 17 00:00:00 2001 From: yanxd Date: Tue, 24 Dec 2013 11:19:20 +0800 Subject: [PATCH 9/9] =?UTF-8?q?=E9=97=AD=E5=90=88=E7=B4=A0=E6=9C=89?= =?UTF-8?q?=E6=A0=87=E7=AD=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/journals_for_message_observer.rb | 2 +- app/views/bids/index.html.erb | 2 +- app/views/boards/show.html.erb | 1 + app/views/news/index.html.erb | 1 + 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/models/journals_for_message_observer.rb b/app/models/journals_for_message_observer.rb index f0dce08c2..e5023f251 100644 --- a/app/models/journals_for_message_observer.rb +++ b/app/models/journals_for_message_observer.rb @@ -1,7 +1,7 @@ # Added by young class JournalsForMessageObserver < ActiveRecord::Observer def after_create(journals_for_message) - Mailer.journals_for_message_add(User.current, journals_for_message).deliver + # Mailer.journals_for_message_add(User.current, journals_for_message).deliver end end 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 1a0a7af45..8c270eea7 100644 --- a/app/views/boards/show.html.erb +++ b/app/views/boards/show.html.erb @@ -47,6 +47,7 @@
+
<%= link_to image_tag(url_to_avatar(topic.author), :class => "avatar"), user_path(topic.author) %> diff --git a/app/views/news/index.html.erb b/app/views/news/index.html.erb index a43565cfc..80576e434 100644 --- a/app/views/news/index.html.erb +++ b/app/views/news/index.html.erb @@ -38,6 +38,7 @@ <% @newss.each do |news| %>
+
<%= link_to image_tag(url_to_avatar(news.author), :class => "avatar"), user_path(news.author) %>