socialforge/app/views/welcome/index.html.erb

391 lines
17 KiB
Plaintext
Raw Normal View History

<!--add by huang-->
2013-12-05 17:03:55 +08:00
<div style="height:220px;">
<div class="welcome_left" style="margin-top: 60px">
<table width="388px">
<tr><td><span class="font_welcome_trustie"><%= l(:label_welcome_trustie) %> </span><span class="font_welcome_tdescription">, <%= l(:label_welcome_trustie_description) %></span></td></tr>
</table>
2013-08-12 10:25:23 +08:00
</div>
<table>
<tr>
<td> <%= call_hook :view_account_login_top %>
2013-12-05 17:03:55 +08:00
<div id="login-form_new" style="margin-top: -20px;">
2013-08-12 10:25:23 +08:00
<%= form_tag(signin_path) do %>
2013-11-21 17:11:55 +08:00
<%= back_url_hidden_field_tag if is_logout? %>
<% unless User.current.logged? %> <!--modified by young-->
2013-11-27 16:40:47 +08:00
<table >
2013-11-21 17:11:55 +08:00
<tr>
<td align="right"><label for="username"><%= l(:label_username) %></label></td>
<td align="left"><%= text_field_tag 'username', params[:username], :tabindex => '1' %></td>
</tr>
<tr>
<td align="right"><label for="password"><%= l(:label_password) %></label></td>
<td align="left"><%= password_field_tag 'password', nil, :tabindex => '2' %></td>
</tr>
<% if Setting.openid? %>
<tr>
<td align="right"><label for="openid_url"><%= l(:field_identity_url)%></label></td>
<td align="left"><%= text_field_tag "openid_url", nil, :tabindex => '3' %></td>
</tr>
<% end %>
<tr>
<td></td>
<td align="left"> <% if Setting.autologin? %> <label for="autologin"><%= check_box_tag 'autologin', 1, false, :tabindex => 4 %> <%= l(:label_stay_logged_in) %></label> <% end %> </td>
2013-11-21 17:11:55 +08:00
</tr>
<tr>
<td align="left"> <% if Setting.lost_password? %>
2013-11-21 17:11:55 +08:00
<%= link_to l(:label_password_lost), lost_password_path %>
<% end %> </td>
2013-11-21 17:11:55 +08:00
<td align="right">
<input type="submit" name="login" value="<%= l(:button_login)%> &#187;" tabindex="5"/>
</td>
</tr>
</table>
2013-11-27 16:40:47 +08:00
<% else %>
<div>
<!--info-->
2013-11-21 17:11:55 +08:00
<table width="200" border="0">
<tr>
<td colspan="2" align="center" class="font_welcome_Cdescription" ><%= l(:label_welcome) %> <strong class="font_small_watch" style=" word-wrap: break-word; word-break: break-all"><%=link_to User.current.lastname<<User.current.firstname, user_path(User.current) %></strong> <%= l(:label_join) %></td>
</tr>
<tr>
<td rowspan="2" style="padding-left: 20px"><%= image_tag(url_to_avatar(User.current), :class => 'avatar') %></td>
2013-11-21 17:11:55 +08:00
<td><strong class="font_small_watch"><%= link_to l(:label_user_watcher)+"("+User.watched_by(User.current).count.to_s+")", user_path(User.current) %></strong>&nbsp
<strong class="font_small_watch"><%=link_to l(:label_x_user_fans, :count => User.current.watcher_users(User.current.id).count)+"("+User.current.watcher_users(User.current.id).count.to_s+")", user_path(User.current) %></strong></td>
</tr>
<tr>
<td align="left"><% unless User.current.memberships.empty? %>
<%= l(:label_x_welcome_participate, :count => User.current.memberships.count) %> <strong class="font_small_watch"><%= link_to User.current.memberships.count, {:controller => 'users', :action => 'user_projects', :id => User.current} %></strong> <%= l(:label_welcome_participate_project)%>
<% end %>
</td>
</tr>
2013-11-27 16:40:47 +08:00
</table>
<!-- end -->
</div>
2013-08-12 10:25:23 +08:00
<% end %>
<% end %>
</div> <%= call_hook :view_account_login_bottom %>
2013-08-12 10:25:23 +08:00
<% if params[:username].present? %>
<%= javascript_tag "$('#password').focus();" %>
<% else %>
<%= javascript_tag "$('#username').focus();" %>
<% end %>
</td>
</tr>
</table>
2013-11-27 16:40:47 +08:00
</div>
2013-08-12 10:25:23 +08:00
<!--model-->
<!-- fq -->
<script type="text/javascript" language="javascript">
function clearInfo(id, content) {
var text = $('#' + id);
if (text.val() == content) {
$('#' + id).val('');
}
}
function showInfo(id, content) {
var text = $('#' + id);
if (text.val() == '') {
$('#' + id).val(content);
}
}
2013-12-03 08:42:54 +08:00
2013-12-05 15:26:29 +08:00
// $(function(){
// var x = 10;
// var y = 20;
// $("span.tooltip").mouseover(function(e){
// this.myTitle = this.title;
// this.title = "";
// var tooltip = "<div id='tooltip' style=' position: absolute;'><div class='arrow bottom right'></div>" + this.myTitle + "</div>";
// $("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"
// });
// });
// })
2013-12-04 15:49:21 +08:00
// $('li').mouseover(function(){
// var id=$(this).attr('id');
// alert(id);
// });
2013-12-11 16:14:51 +08:00
// $(function(){
// $(".welcome-box-list-new").hide();
// $("#hot-topic").bind("click", function(){
// $(".welcome-box-list-new").hide();
// $(".welcome-box-list").show();
// $(this).css({
// "border-top": "1px solid #717171",
// "border-left": "1px solid #717171",
// "border-bottom": "1px solid #FFFFFF",
// "border-right": "1px solid #FFFFFF"
// });
// $("#new-topic").css({
// "border-top": "1px solid #FFFFFF",
// "border-left": "1px solid #FFFFFF",
// "border-bottom": "1px solid #717171",
// "border-right": "1px solid #717171"
// });
// });
//
// $("#new-topic").bind("click", function(){
// $(".welcome-box-list").hide();
// $(".welcome-box-list-new").show();
// $(this).css({
// "border-top": "1px solid #717171",
// "border-left": "1px solid #717171",
// "border-bottom": "1px solid #FFFFFF",
// "border-right": "1px solid #FFFFFF"
// });
// $("#hot-topic").css({
// "border-top": "1px solid #FFFFFF",
// "border-left": "1px solid #FFFFFF",
// "border-bottom": "1px solid #717171",
// "border-right": "1px solid #717171"
// });
//
// });
// // $("#panel h5.head").bind("mouseout", function(){
// // $(this).next().fadeOut();
// // });
// })
// $(function(){
// $("#new-topic").hover(function(){
// $(this).css({
// "border-top": "1px solid #717171",
// "border-left": "1px solid #717171",
// "border-bottom": "1px solid #FFFFFF",
// "border-right": "1px solid #FFFFFF"
// }),
// $(this).css({
// "border-top": "1px solid #FFFFFF",
// "border-left": "1px solid #FFFFFF",
// "border-bottom": "1px solid #717171",
// "border-right": "1px solid #717171"
// });
// });
// $("#hot-topic").hover(function(){
// $(this).css({
// "border-top": "1px solid #717171",
// "border-left": "1px solid #717171",
// "border-bottom": "1px solid #FFFFFF",
// "border-right": "1px solid #FFFFFF"
// }),
// $(this).css({
// "border-top": "1px solid #FFFFFF",
// "border-left": "1px solid #FFFFFF",
// "border-bottom": "1px solid #717171",
// "border-right": "1px solid #717171"
// });
// });
// })
2013-12-03 09:37:34 +08:00
</script>
2013-12-11 16:14:51 +08:00
<style>
2013-12-10 19:45:38 +08:00
.forum-topic li{
float: left;
}
2013-12-11 16:14:51 +08:00
</style>
2013-11-22 14:34:05 +08:00
<!-- info display block -->
2013-11-21 17:11:55 +08:00
<%= stylesheet_link_tag 'welcome' %>
<div class="body_resize">
2013-11-27 15:37:43 +08:00
2013-11-28 16:00:53 +08:00
<div class="left" style="float: left; height: 445px; width: 50%;">
2013-11-28 17:22:24 +08:00
<ul class="welcome-message-list" style="width: 90%; ">
2013-12-11 16:14:51 +08:00
<div class="forum-topic" style="height: 25px;">
<h3 style="color: rgb(21, 188, 207);margin-left: 8px;"><strong>论坛动态</strong></h3>
<!-- <ul class="inner-content">
<li>
<a href="#" id="hot-topic">最热帖子</a>
2013-12-10 19:45:38 +08:00
</li>
<li>
2013-12-11 16:14:51 +08:00
<a href="#" id="new-topic">最新帖子</a>
2013-12-10 19:45:38 +08:00
</li>
<li>
2013-12-11 16:14:51 +08:00
<a href="#">更多主题</a>
</li>
</ul> -->
2013-12-10 19:45:38 +08:00
</div>
2013-12-11 16:14:51 +08:00
<!-- <div class="welcome-box-list">
2013-11-28 10:14:03 +08:00
<% find_hot_forum_topics.each do |topic|%>
<li class="message-brief-intro" style="min-height: 25px;">
2013-12-05 15:26:29 +08:00
<div style="display: inline-block; width: 100%;">
2013-12-06 11:19:15 +08:00
<span style="color:gray; display: inline-block; background: url('/images/list-icon.png') no-repeat scroll ;background-position: left center;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
2013-12-10 19:45:38 +08:00
<%= link_to topic.subject.truncate(30, omission: '...'), topic.event_url, :class => "gray" , :style => "font-size: 10pt !important;"%>
2013-12-06 11:19:15 +08:00
</span>
2013-12-05 15:26:29 +08:00
<br>
2013-12-09 18:31:08 +08:00
<span style="margin-left: 20px; color: rgb(172, 174, 177); white-space: nowrap; font-size 9pt !important;;"><%=l(:field_updated_on)%><%=time_tag_welcome(topic_last_time topic)%>前</span>
2013-12-05 15:26:29 +08:00
<span style="margin-left: 5px; color: rgb(172, 174, 177) !important; white-space: nowrap;">
由<%= link_to topic.author, user_path(topic.author), :style => "font-size: 9pt !important; color: rgb(17, 102, 173);"%>发表
2013-11-28 10:14:03 +08:00
</span>
2013-12-06 11:19:15 +08:00
<span style="float: right; color: rgb(172, 174, 177); white-space: nowrap; font-size 9pt !important;;">回复(<%= link_to topic.replies_count, topic.event_url %>)</span>
2013-11-28 17:22:24 +08:00
</div>
2013-11-27 15:37:43 +08:00
</li>
2013-11-28 10:07:49 +08:00
<% end %>
2013-12-11 16:14:51 +08:00
</div> -->
<div class="welcome-box-list-new">
<% find_new_forum_topics.each do |topic|%>
<li class="message-brief-intro" style="min-height: 25px;">
<div style="display: inline-block; width: 100%;">
<span style="color:gray; display: inline-block; background: url('/images/list-icon.png') no-repeat scroll ;background-position: left center;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<%= link_to topic.subject.truncate(30, omission: '...'), topic.event_url, :class => "gray" , :style => "font-size: 10pt !important;"%>
</span>
<br>
<span style="margin-left: 20px; color: rgb(172, 174, 177); white-space: nowrap; font-size 9pt !important;;"><!-- <%=l(:field_updated_on)%> --><%=time_tag_welcome(topic_last_time topic)%>前</span>
<span style="margin-left: 5px; color: rgb(172, 174, 177) !important; white-space: nowrap;">
由<%= link_to topic.author ? topic.author : 'Anonymous', user_path(topic.author_id), :style => "font-size: 9pt !important; color: rgb(17, 102, 173);"%>发表
</span>
<span style="float: right; color: rgb(172, 174, 177); white-space: nowrap; font-size 9pt !important;;">回复(<%= link_to topic.replies_count, topic.event_url %>)</span>
</div>
</li>
<% end %>
2013-11-27 15:37:43 +08:00
</div>
</ul>
</div>
2013-12-05 15:26:29 +08:00
<div class="right" style="float: right; margin-right: -20px; height: 445px; width: 50%; ">
2013-11-29 10:48:16 +08:00
<ul class="user-welcome-message-list" style="width: 80%; margin-top: 0px;">
2013-12-04 15:49:21 +08:00
<h3 style="margin-left: -5px; color: rgb(21, 188, 207)"><strong>用户动态</strong></h3>
2013-11-27 15:37:43 +08:00
<div class="user-message-box-list">
2013-11-28 10:40:19 +08:00
<% find_all_activities.each do |event| %>
2013-11-28 09:46:16 +08:00
<li style="display: block;height:60px;">
2013-11-28 17:22:24 +08:00
<div class="inner-right" style="float: left; height: 100%; ">
2013-11-28 10:40:19 +08:00
<%= image_tag url_to_avatar(event.event_author), :class => "avatar-3" %>
2013-11-28 09:46:16 +08:00
</div>
2013-11-28 17:22:24 +08:00
<div class="inner-right" style="float: right; width:86%; height: 100%; ">
2013-12-05 15:26:29 +08:00
<span style="color: green;"><%= link_to event.event_author, (user_path(event.event_author) if event.event_author), :style => "color:green;" %></span><!-- &nbsp;发表了<%= find_all_event_type event %><span style="color: blue;"><%= link_to truncate(event.event_title, length: 30, omission:'...'), event.event_url %>
2013-11-30 10:41:14 +08:00
</span> --><%= show_user_content event %>
2013-12-05 15:26:29 +08:00
<p><span style="color: rgb(172, 174, 177)"><%= time_tag_welcome event.event_datetime %>前</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="float: right; color: rgb(172, 174, 177);"><%= show_event_reply event %></span></p>
2013-11-27 15:37:43 +08:00
</div>
</li>
2013-11-28 10:07:49 +08:00
<% end %>
2013-11-27 15:37:43 +08:00
</div>
</ul>
</div>
<div id="J_Slide" class="d-p-index-box d-p-index-hotproject">
2013-12-05 15:26:29 +08:00
<h3 style="margin-left: 5px; color: #e8770d;"><strong>热门项目</strong></h2>
2013-11-28 16:14:23 +08:00
<div class="d-p-projectlist-box">
<ul class="d-p-projectlist">
<% find_all_hot_project.map do |project| break if(project == find_all_hot_project[15]) %>
<li style="background-image:none;">
2013-11-28 17:22:24 +08:00
<div style="float: left;">
<%= image_tag url_to_avatar(project), :class => "avatar-4" %>
</div>
<div style="float: left; margin-left: 10px; width: 360px;">
<p class="layout">
2013-11-29 10:48:16 +08:00
<%= link_to( project.name, project_path(project.project_id), :class => "d-g-blue d-p-project-name", :title => "#{project.name}")%>
2013-12-03 08:42:54 +08:00
<!-- <span style="cursor: help; display: inline-block; float: right; color: #ec6300; background: url('/images/score.png') no-repeat scroll ;background-position: left center;" title="项目得分,综合考虑了项目的各项活动,反映了该项目的活跃程度" class="tooltip-#{project.project_id}"><%= show_grade project %></span> -->
<%= content_tag "span", show_grade(project),
2013-12-05 15:26:29 +08:00
:style => "cursor: pointer; display: inline-block; float: right; color: #ec6300; ",
2013-12-03 08:42:54 +08:00
:title => "项目得分,综合考虑了项目的各项活动,反映了该项目的活跃程度",
:class => "tooltip",
:id => "tooltip-#{project.project_id}" %>
2013-11-28 17:22:24 +08:00
</p>
<p class="layout-1" >
2013-11-29 10:48:16 +08:00
<%= content_tag "span", project.description.truncate(50, omission: '...'), :class => "d-p-project-intro" , :title => project.description %>
2013-11-28 17:22:24 +08:00
</p>
</div>
2013-11-27 15:37:43 +08:00
</li>
2013-11-28 16:14:23 +08:00
<% end %>
</ul>
</div>
2013-11-28 08:34:20 +08:00
</div>
2013-12-05 15:26:29 +08:00
2013-11-27 15:37:43 +08:00
<div id="J_Slide" class="d-p-index-box d-p-index-hotproject" style="float: right;">
2013-12-05 15:26:29 +08:00
<h3 style="margin-left: 5px; color: #e8770d;"><strong>热门课程</strong></h3>
2013-11-28 16:14:23 +08:00
<div class="d-p-projectlist-box">
<ul class="d-p-projectlist">
2013-12-05 15:26:29 +08:00
<% find_all_hot_course.map do |project| break if(project == find_all_hot_course[5]) %>
2013-11-28 16:14:23 +08:00
<li style="background-image:none;">
2013-12-05 15:26:29 +08:00
<div style="float: left;">
<% 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 %>
</div>
<div style="float: left; margin-left: 10px; width: 360px;">
2013-11-28 16:14:23 +08:00
<p class="layout">
2013-12-05 15:26:29 +08:00
<%= link_to( project.name, project_path(project.project_id), :class => "d-g-blue d-p-project-name",:title => "#{project.name}")%>
2013-12-07 09:47:54 +08:00
<span style="cursor: pointer; display: inline-block; float: right; color: #ec6300; white-space: nowrap;">学生人数:<%= link_to "#{studentCount(project)}", project_member_path(project, :role => 2) ,:course =>'1'%></span>
2013-11-28 16:14:23 +08:00
</p>
<p class="layout-1" >
2013-12-05 15:26:29 +08:00
<%= content_tag "span", project.description.truncate(50, omission: '...'), :class => "d-p-project-intro" , :title => project.description %>
</p>
</div>
2013-11-28 16:14:23 +08:00
</li>
<% end %>
</ul>
</div>
2013-11-28 08:34:20 +08:00
</div>
2013-11-27 15:37:43 +08:00
2013-12-05 15:26:29 +08:00
<div id="J_Slide" class="d-p-index-box d-p-index-hotproject" style="float: right;">
2013-12-07 09:47:54 +08:00
<h3 style="margin-left: 5px; color: color: (51, 119, 51);"><strong>热门竞赛</strong></h3>
2013-11-28 16:14:23 +08:00
<div class="d-p-projectlist-box">
<ul class="d-p-projectlist">
2013-12-05 15:26:29 +08:00
<% find_all_hot_contest.map do |contest| break if(contest == find_all_hot_contest[5]) %>
2013-11-28 16:14:23 +08:00
<li style="background-image:none;">
<p class="layout">
2013-12-05 15:26:29 +08:00
<span style = "background: url('/images/007.gif') no-repeat scroll ;background-position: left center;"><%= link_to( contest.name, respond_path(contest.id), :class => "d-g-blue d-p-project-name", :title => "#{contest.name}",
:style => "margin-left: 28px;") %></span>
2013-11-28 16:14:23 +08:00
</p>
<p class="layout-1" >
2013-12-05 15:26:29 +08:00
<%= content_tag "span", contest.description.truncate(50, omission: '...'), :class => "d-p-project-intro" , :title => contest.description %>
</p>
2013-11-28 16:14:23 +08:00
</li>
<% end %>
</ul>
</div>
2013-11-28 08:34:20 +08:00
</div>
2013-12-05 15:26:29 +08:00
<div id="J_Slide" class="d-p-index-box d-p-index-hotproject" style="float: right;">
2013-12-07 09:47:54 +08:00
<h3 style="margin-left: 5px; color: color: (51, 119, 51);"><strong>热门众包</strong></h3>
2013-11-28 16:14:23 +08:00
<div class="d-p-projectlist-box">
<ul class="d-p-projectlist">
2013-12-05 15:26:29 +08:00
<% find_all_hot_bid.map do |bid| break if(bid == find_all_hot_bid[5]) %>
2013-11-28 16:14:23 +08:00
<li style="background-image:none;">
<p class="layout">
2013-12-05 15:26:29 +08:00
<span style = "background: url('/images/007.gif') no-repeat scroll ;background-position: left center;"><%= link_to( bid.name, respond_path(bid.id), :class => "d-g-blue d-p-project-name", :title => "#{bid.name}",
:style => "margin-left: 28px;")%></span>
2013-11-28 16:14:23 +08:00
</p>
<p class="layout-1" >
2013-12-05 15:26:29 +08:00
<%= content_tag "span", bid.description.truncate(50, omission: '...'), :class => "d-p-project-intro" , :title => bid.description %>
2013-11-28 16:14:23 +08:00
</p>
</li>
<% end %>
</ul>
</div>
2013-11-28 08:34:20 +08:00
</div>
2013-12-05 15:26:29 +08:00
2013-11-27 15:37:43 +08:00
2013-11-30 09:29:02 +08:00
<div class="clr">
2013-11-21 17:11:55 +08:00
</div>
2013-11-27 15:37:43 +08:00
2013-11-21 17:11:55 +08:00
<br/><br/><br/><br/><br/><br/><br/>
<!-- end -->
<div style="padding-top: 40px"></div>