diff --git a/app/helpers/welcome_helper.rb b/app/helpers/welcome_helper.rb index 5a103e015..b9192f47b 100644 --- a/app/helpers/welcome_helper.rb +++ b/app/helpers/welcome_helper.rb @@ -73,13 +73,13 @@ module WelcomeHelper rescue Exception => e logger.error "[WelcomeHelper] ===> #{e}" end - "项目得分:".html_safe << grade.to_s + "项目评分:".html_safe << grade.to_s end def show_user_content event str = ''.html_safe case event.event_type - when ('news' || 'issue' || 'attachment' || 'message' || 'bid' || 'wiki-page' || 'document') + when 'news' , 'issue' , 'attachment' , 'message' , 'bid' , 'wiki-page' , 'document' str << " ".html_safe << content_tag("span", "发表了") << content_tag("span", find_all_event_type(event)) << ': '.html_safe << link_to(truncate(event.event_title, length: 30, omission:'...'), event.event_url) when 'reply' str << " ".html_safe << content_tag("span", "发表了") << content_tag("span", find_all_event_type(event)) << ': '.html_safe << link_to(truncate(event.event_description, length: 30, omission:'...'), event.event_url) @@ -89,6 +89,18 @@ module WelcomeHelper str end + def show_event_reply event + str = "回复(" + case event.event_type + when "issue" + str << link_to(cal_issues_count(event), issue_path(event)) << ")" + when "Memo" + str << link_to(cal_memos_count(event), forum_memo_path(event.forum_id,event.id)) << ")" + else + str = "" + end + str.html_safe + end private @@ -141,7 +153,7 @@ module WelcomeHelper end #取得论坛数据 - def find_hot_forum_topics limit=10 + def find_hot_forum_topics limit=9 #Memo.order('replies_count DESC').where('replies_count <> 0').limit(limit) Memo.order('replies_count DESC, created_at DESC').where('parent_id IS NULL').limit(limit) ## 以下语句会内链接自身查询出最后一条回复时间,没有回复的帖子不会显示 @@ -180,6 +192,10 @@ module WelcomeHelper '回复' when 'bid' '作业' + when 'Memo' + '主题' + when 'document' + '文件' else event.event_type end diff --git a/app/views/welcome/index.html.erb b/app/views/welcome/index.html.erb index db1db2955..2bba8e495 100644 --- a/app/views/welcome/index.html.erb +++ b/app/views/welcome/index.html.erb @@ -94,30 +94,30 @@ } } - $(function(){ - var x = 10; - var y = 20; - $("span.tooltip").mouseover(function(e){ - this.myTitle = this.title; - this.title = ""; - var tooltip = "
" + this.myTitle + "
"; - $("body").append(tooltip); - $("#tooltip") - .css({ - "top": (e.pageY + y) + "px", - "left": (e.pageX + x) + "px" - }).show("fast"); - }).mouseout(function(){ - this.title = this.myTitle; - $("#tooltip").remove(); - }).mousemove(function(e){ - $("#tooltip") - .css({ - "top": (e.pageY + y) + "px", - "left": (e.pageX + x) + "px" - }); - }); - }) + // $(function(){ + // var x = 10; + // var y = 20; + // $("span.tooltip").mouseover(function(e){ + // this.myTitle = this.title; + // this.title = ""; + // var tooltip = "
" + this.myTitle + "
"; + // $("body").append(tooltip); + // $("#tooltip") + // .css({ + // "top": (e.pageY + y) + "px", + // "left": (e.pageX + x) + "px" + // }).show("fast"); + // }).mouseout(function(){ + // this.title = this.myTitle; + // $("#tooltip").remove(); + // }).mousemove(function(e){ + // $("#tooltip") + // .css({ + // "top": (e.pageY + y) + "px", + // "left": (e.pageX + x) + "px" + // }); + // }); + // }) // $('li').mouseover(function(){ // var id=$(this).attr('id'); @@ -132,16 +132,18 @@
-
+
-

热门项目

+

热门项目

    <% find_all_hot_project.map do |project| break if(project == find_all_hot_project[15]) %> @@ -183,7 +185,7 @@ <%= link_to( project.name, project_path(project.project_id), :class => "d-g-blue d-p-project-name", :title => "#{project.name}")%> <%= content_tag "span", show_grade(project), - :style => "cursor: help; display: inline-block; float: right; color: #ec6300; ", + :style => "cursor: pointer; display: inline-block; float: right; color: #ec6300; ", :title => "项目得分,综合考虑了项目的各项活动,反映了该项目的活跃程度", :class => "tooltip", :id => "tooltip-#{project.project_id}" %> @@ -197,15 +199,44 @@
+ +
+

热门课程

+
+
    + <% find_all_hot_course.map do |project| break if(project == find_all_hot_course[5]) %> +
  • +
    + <% if get_avatar?(project)%> + <%= image_tag(url_to_avatar(project), :class => "avatar-4") %> + <% else %> + <%= image_tag('../images/avatars/Project/course.jpg', :class => "avatar-4") %> + <% end %> +
    +
    +

    + <%= link_to( project.name, project_path(project.project_id), :class => "d-g-blue d-p-project-name",:title => "#{project.name}")%> +

    +

    + <%= content_tag "span", project.description.truncate(50, omission: '...'), :class => "d-p-project-intro" , :title => project.description %> +

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

热门竞赛

+

热门竞赛

    <% find_all_hot_contest.map do |contest| break if(contest == find_all_hot_contest[5]) %>
  • - <%= link_to( contest.name, respond_path(contest.id), :class => "d-g-blue d-p-project-name", :title => "#{contest.name}")%> + <%= link_to( contest.name, respond_path(contest.id), :class => "d-g-blue d-p-project-name", :title => "#{contest.name}", + :style => "margin-left: 28px;") %>

    <%= content_tag "span", contest.description.truncate(50, omission: '...'), :class => "d-p-project-intro" , :title => contest.description %> @@ -217,14 +248,14 @@

-

热门众包

- +

热门众包

    <% find_all_hot_bid.map do |bid| break if(bid == find_all_hot_bid[5]) %>
  • - <%= link_to( bid.name, respond_path(bid.id), :class => "d-g-blue d-p-project-name", :title => "#{bid.name}")%> + <%= link_to( bid.name, respond_path(bid.id), :class => "d-g-blue d-p-project-name", :title => "#{bid.name}", + :style => "margin-left: 28px;")%>

    <%= content_tag "span", bid.description.truncate(50, omission: '...'), :class => "d-p-project-intro" , :title => bid.description %> @@ -235,23 +266,7 @@

-
-

热门课程

-
-
    - <% find_all_hot_course.map do |project| break if(project == find_all_hot_course[5]) %> -
  • -

    - <%= link_to( project.name, project_path(project.project_id), :class => "d-g-blue d-p-project-name",:title => "#{project.name}")%> -

    -

    - <%= content_tag "span", project.description.truncate(50, omission: '...'), :class => "d-p-project-intro" , :title => project.description %> -

    -
  • - <% end %> -
-
-
+
diff --git a/public/images/007.gif b/public/images/007.gif new file mode 100644 index 000000000..16e705d92 Binary files /dev/null and b/public/images/007.gif differ diff --git a/public/images/021.png b/public/images/021.png new file mode 100644 index 000000000..536464fce Binary files /dev/null and b/public/images/021.png differ diff --git a/public/images/039.gif b/public/images/039.gif new file mode 100644 index 000000000..919d667c9 Binary files /dev/null and b/public/images/039.gif differ diff --git a/public/stylesheets/welcome.css b/public/stylesheets/welcome.css index 7d85e3615..f4feb824d 100644 --- a/public/stylesheets/welcome.css +++ b/public/stylesheets/welcome.css @@ -102,16 +102,16 @@ ul.welcome-message-list{ margin-right: 10px; color: #999999; } -.d-p-index-box h2{ +.d-p-index-box h3{ height: 35px; line-height: 35px; background-color: rgb(252, 252, 252); color: green; - text-indent: 8px; + /*text-indent: 8px;*/ margin: 0; padding: 0; display: block; - font-size: 1em; + /*font-size: 1em;*/ border-top: none; border-bottom: 1px solid rgb(21, 165, 200); /*-webkit-margin-before: 0.83em; @@ -159,7 +159,7 @@ li { background-color: rgb(252, 252, 252); } .d-p-index-newsource li,.d-p-index-hotproject ul.d-p-projectlist li{ - color: rgb(72,72,72); + color: rgb(102, 102, 102); background: center -1px no-repeat; line-height: 20px; padding: 5px 5px 0px 9px; @@ -174,7 +174,7 @@ li { } .d-g-blue{ - color: rgb(62, 98, 166) !important; + color: rgb(17, 102, 173) !important; font-weight: 700; } @@ -222,9 +222,47 @@ p.layout { .inner-right a, a:link, a:visited { - color: rgb(62, 98, 166); + color: rgb(17, 102, 173); +} + + +.tooltip { + margin-left: 10px; +} + +div#tooltip { + background-color: #46ccef; + border: 1px solid #c8c8c8; + border-radius: 5px; + width: 220px; + /*text-align: center;*/ + text-indent: -5px; + padding: 20px; + position: absolute; + opacity: 100; +} + +/*div#tooltip .arrow { + border-style: solid; + position: absolute; +} + +div#tooltip .bottom { + border-color: #c8c8c8 transparent transparent transparent; + border-width: 8px 8px 0px 8px; + bottom: -8px; +}*/ + +div#tooltip::after { + border-color: #f8f8f8 transparent transparent transparent; + border-style: solid; + border-width: 7px 7px 0px 7px; + bottom: 1px; + content: ""; + position: absolute; + left: -7px; + } -