Merge branch 'develop' of 10.0.47.245:/home/trustie2 into develop

This commit is contained in:
fanqiang 2013-08-12 15:32:48 +08:00
commit 4b998de820
24 changed files with 436 additions and 328 deletions

View File

@ -1,32 +1,17 @@
class PraiseTreadController < ApplicationController
accept_api_auth :tread_plus,:praise_plus
before_filter :require_login,:only => [:praise_plus,:tread_plus]
def praise_plus
@obj = nil
# @is_in_list = nil
if request.get?
@obj = params[:obj] # 传的是对象最后变成id了
#首先创建或更新praise_tread 表
@pt = PraiseTread.find_by_user_id_and_praise_tread_object_id(User.current.id,@obj)
@pt = @pt.nil? ? PraiseTread.new : @pt
@pt.user_id = User.current.id
@pt.praise_tread_object_id = @obj.to_i
@pt.praise_tread_object_type = User.find_by_id(@obj).class.name.underscore
@pt.praise_or_tread = 1
@pt.save
#再创建或更新praise_tread_cache表
@ptc = PraiseTreadCache.find_by_object_id(@obj)
@ptc = @ptc.nil? ? PraiseTreadCache.new : @ptc
@ptc.object_id = @obj.to_i
@ptc.object_type = User.find_by_id(@obj).class.name.underscore
@ptc.plus(1)
@ptc.save
end
@obj = User.find_by_id(@obj)
respond_to do |format|
format.html
format.js
@obj_id = params[:obj_id]
@obj_type = params[:obj_type]
@obj = find_object_by_type_and_id(@obj_type,@obj_id)
# @is_in_list = params[:is_in_list]
praise_tread_plus(@obj_type,@obj_id,1)
end
end
@ -55,7 +40,15 @@ class PraiseTreadController < ApplicationController
end
def tread_plus
@obj = nil
# @is_in_list = nil
if request.get?
@obj_id = params[:obj_id]
@obj_type = params[:obj_type]
@obj = find_object_by_type_and_id(@obj_type,@obj_id)
# @is_in_list = params[:is_in_list]
praise_tread_plus(@obj_type,@obj_id,0)
end
end
def tread_minus
@ -65,4 +58,46 @@ class PraiseTreadController < ApplicationController
end
end
private
def find_object_by_type_and_id(type,id)
@obj = nil
case type
when 'User'
@obj = User.find_by_id(id)
when 'Issue'
@obj = Issue.find_by_id(id)
when 'Project'
@obj = Project.find_by_id(id)
when 'Bid'
@obj = Bid.find_by_id(id)
end
return @obj
end
def praise_tread_plus(type,id,flag)
unless id.nil? and type.nil?
#首先创建或更新praise_tread 表
@pt = PraiseTread.new
@pt.user_id = User.current.id
@pt.praise_tread_object_id = id.to_i
@pt.praise_tread_object_type = type
@pt.praise_or_tread = flag
@pt.save
# end
#再创建或更新praise_tread_cache表
@ptc = PraiseTreadCache.find_by_object_id_and_object_type(id,type)
@ptc = @ptc.nil? ? PraiseTreadCache.new : @ptc
@ptc.object_id = id.to_i
@ptc.object_type = type
@ptc.save
@ptc.plus(flag,1)
end
respond_to do |format|
format.html
format.js
end
end
end

View File

@ -28,10 +28,10 @@ class UsersController < ApplicationController
before_filter :require_admin, :except => [:show, :index,:tag_save, :user_projects, :user_newfeedback, :user_comments, :watch_bids, :info, :user_watchlist, :user_fanslist,:edit]
before_filter :find_user, :only => [:user_fanslist, :user_watchlist, :show, :edit, :update, :destroy, :edit_membership,
:destroy_membership, :user_activities, :user_projects, :user_newfeedback, :user_comments, :watch_bids, :info]
accept_api_auth :index, :show, :create, :update, :destroy
accept_api_auth :index, :show, :create, :update, :destroy,:tag_save
#william
before_filter :require_login,:only=>[:tag_save]
before_filter :need_login,:only => :tag_save
helper :sort

View File

@ -1317,8 +1317,8 @@ module ApplicationHelper
# end
#added by william
def get_fans_num(user)
user.watcher_users.count
def need_login
redirect_to signin_path
end
#end
end

View File

@ -1,22 +1,27 @@
module PraiseTreadHelper
#added by william
def is_praise_or_tread(object,user_id)
@obj_type = object.class.name.underscore
@obj_type = object.class
@obj_id = object.id
@is_praise = PraiseTread.find_by_sql("select * from praise_treads where user_id=#{user_id} and " +
"praise_tread_object_type='#{@obj_type}' and praise_tread_object_id=#{@obj_id} ")
@is_praise = PraiseTread.find_by_sql("select praise_or_tread from praise_treads where user_id=#{user_id} and " +
"praise_tread_object_type='#{@obj_type}' and praise_tread_object_id=#{@obj_id}")
return @is_praise
end
#end
def get_praise_num(object)
@obj_type = object.class.name.underscore
def get_praise_num(object,flag)
@obj_type = object.class
@obj_id = object.id
@record = PraiseTreadCache.find_by_object_id_and_object_type(@obj_id,@obj_type)
if @record
return @record.praise_num
else
return 0
case flag
when 1
return @record.praise_num.nil? ? 0 : @record.praise_num
when 0
return @record.tread_num.nil? ? 0 : @record.tread_num
end
else
return 0
end
end

View File

@ -1,8 +1,13 @@
class PraiseTreadCache < ActiveRecord::Base
attr_accessible :object_id,:object_type,:praise_num,:tread_num
def plus(num)
self.update_attribute(:praise_num, self.praise_num.to_i + num)
def plus(flag,num)
case flag
when 0
self.update_attribute(:tread_num, self.tread_num.to_i + num)
when 1
self.update_attribute(:praise_num, self.praise_num.to_i + num)
end
end
def minus(num)

View File

@ -48,7 +48,8 @@
<tr>
<td align="left"><a class="font_lighter"> <%= journal.created_on %></a></td>
<td width="200" align="right" class="a"><%= link_to(image_tag('comment.png'), {:controller => 'bids', :action => 'new', :id => bid, :journal_id => journal}, :remote => true,
:method => 'post', :title => l(:button_quote))%><%= link_to(image_tag('delete.png'), {:controller => 'bids', :action => 'destroy', :object_id => journal, :id => bid},
:method => 'post', :title => l(:button_quote))%>
<%= link_to(image_tag('delete.png'), {:controller => 'bids', :action => 'destroy', :object_id => journal, :id => bid},:confirm => l(:label_delete_confirm),
:remote => true, :method => 'delete', :class => "delete", :title => l(:button_delete)) if remove_allowed || journal.user_id == User.current.id %></td>
</tr>
</table></td>

View File

@ -72,23 +72,27 @@
<li id="issue-<%= issue.id %>" class="hascontextmenu-1 <%= issue.css_classes %> <%= level > 0 ? "idnt idnt-#{level}" : nil %>">
<% column_content = ( query.inline_columns.map {|column| "#{column_content_new(column, issue)}"}) %>
<%= render :partial => "/praise_tread/praise_tread",
:locals => {:obj => issue,:user_id =>User.current.id}%>
<% if issue.tracker.name == 'Bug' %>
<%= image_tag("/images/task.png", :class => "img-tag-issues") %>
<% end %>
<% if issue.tracker.name == '任务'%>
<%= image_tag("/images/issues.png", :class => "img-tag-issues") %>
<% end %>
<ul class="issue_list">
<ul class="list-group-item-meta">
<span><%= link_to issue.author.name, user_path(issue.author), :class => "bid_user_u" %></span><%= l(:label_post_on)%><span>
<% a = [] %>
<% a << column_content[1] %>
<% a << "##{column_content[0]}" << "(#{raw column_content[2]}):" << column_content[4] %>
<%= link_to a.join(' '), issue_path(issue) %>
<span> <%= link_to issue.author.name, user_path(issue.author), :class => "bid_user_u" %></span><%= l(:label_post_on)%> <span> <% a = [] %>
<% a << column_content[1] %>
<% a << "##{column_content[0]}" << "(#{raw column_content[2]}):" << column_content[4] %>
<%= link_to a.join(' '), issue_path(issue) %>
</ul>
<ul class="list-group-item-meta">
<div class="issue-list-description">
<%= issue.description %>
<%= l(:field_description)%>:<%= issue.description %>
</div>
</ul>
<ul class="list-group-item-meta">
@ -97,7 +101,9 @@
<% end %>
<!-- <%= raw column_content[6] %> -->
<%= l(:label_updated_time_on, format_date(issue.updated_on)).html_safe %>
<div class="find-comment-class"><span><%= link_to l(:label_find_all_comments), issue_path(issue) %></span><%= l(:label_comments_count, :count => issue.journals.all.count) %></div>
<div class="find-comment-class">
<span><%= link_to l(:label_find_all_comments), issue_path(issue) %></span><%= l(:label_comments_count, :count => issue.journals.all.count) %>
</div>
</ul>
</ul>
</li>

View File

@ -20,12 +20,15 @@
<% end %>
<!-- <%= avatar(@issue.author, :size => "50") %> -->
<div class="subject">
<%= render_issue_subject_with_tree(@issue) %>
</div>
</div>
<!-- 顶和踩 -->
<%= render :partial => "/praise_tread/praise_tread",
:locals => {:obj => @issue,:user_id =>User.current.id}%>
<p class="author">
<%= authoring @issue.created_on, @issue.author %>.
<% if @issue.created_on != @issue.updated_on %>
@ -36,7 +39,6 @@
<div id="tags">
<%= render :partial => 'layouts/tag', :locals => {:obj => @issue,:object_flag => "3" }%>
</div>
<table class="attributes">
<%= issue_fields_rows do |rows|
rows.left l(:field_status), h(@issue.status.name), :class => 'status'

View File

@ -1,6 +1,6 @@
<div id="top-menu" style="background-color: #15bccf;height:40px;margin-top: 10px;margin-bottom: 10px;">
<div style="float: left ">
<%=link_to image_tag("/images/logo.png",weight:"39px", height: "39px"), home_path %>
<div class="welcome_logo">
<%=link_to image_tag("/images/logo.png",weight:"36px", height: "36px"), home_path %>
</div>
<div id="account">
<%= render_menu :account_menu -%>

View File

@ -44,15 +44,12 @@
</tr>
</table></td>
</tr>
<tr><td>
<span id="praise_tread" style="float:left;"> <%= render :partial => "/praise_tread/praise_tread",:locals => {:obj => @user,:show_flag => false,:user_id =>User.current.id}%> </span>
</td></tr>
</table>
<div>
<%= l(:label_user_watcher) %> (<strong class="font_small_watch"><%=link_to User.watched_by(@user.id).count ,:controller=>"users", :action=>"user_watchlist"%></strong>) &nbsp;
<%= render :partial => "watchers/fans_num",:locals => {:fans_num => get_fans_num(@user) }%>
</div>
</div>

View File

@ -1,17 +1,57 @@
<span id="praise">
<% if is_praise_or_tread(obj,user_id).size > 0 %>
<%= image_tag("/images/praise.png") %>
<%= link_to "#{l(:label_cancel_praise)}",:controller=>"praise_tread",:action=>"praise_minus",:remote=>true,:obj => obj %>
(<strong class="font_small_watch"><%= get_praise_num(obj)%></strong>)
<% else %>
<%= image_tag("/images/tread.png") %>
<%= link_to "#{l(:label_praise)}",:controller=>"praise_tread",:action=>"praise_plus",:remote=>true,:obj => obj %>
(<strong class="font_small_watch"><%= get_praise_num(obj)%></strong>)
<% end %>
</span>
<% if show_flag %>
<span id="tread">
<%= link_to image_tag("/images/tread.png"),:controller=>"praise_tread",
:action=>"tread_minus",:remote=>true,:obj => obj %>踩
</span>
<% end %>
<!-- get_praise_num(obj,1)函数中 1代表返回顶得次数 0返回踩的次数 -->
<div id="praise_tread_<%= obj.id %>" style="float:right;">
<% @is_valuate = is_praise_or_tread(obj,user_id)%>
<% if @is_valuate.size > 0 %> <!-- 评价过 1代表赞 0代表踩 -->
<% @flag = @is_valuate.first.praise_or_tread %>
<% if @flag == 1 %> <!-- 顶过 -->
<table style="line-height: 1px">
<tr>
<td ><%= image_tag("/images/praise_tread/praise_true.png") %></td>
</tr>
<tr>
<td align="center"><strong class="font_small_watch">+<%= get_praise_num(obj,1)%></strong></td>
</tr>
<tr>
<td><%= image_tag("/images/praise_tread/tread_false.png") %></td>
</tr>
</table>
<% elsif @flag == 0 %> <!-- 踩过 0-->
<table style="line-height: 1px">
<tr>
<td > <%= image_tag("/images/praise_tread/praise_false.png") %></td>
</tr>
<tr>
<td align="center"><strong class="font_small_watch">-<%= get_praise_num(obj,0)%></strong></td>
</tr>
<tr>
<td><%= image_tag("/images/praise_tread/tread_true.png") %> </td>
</tr>
</table>
<% end %>
<% else %>
<table style="line-height: 1px">
<tr>
<td > <%= link_to image_tag("/images/praise_tread/praise_false.png"),
:controller=>"praise_tread",:action=>"praise_plus",:remote=>true,:obj_id => obj.id,:obj_type => obj.class%> </td>
</tr>
<tr>
<td align="center">+<strong class="font_small_watch"><%= get_praise_num(obj,1)%></strong></td>
</tr>
<tr><td align="center">---</td></tr>
<tr>
<td align="center">-<strong class="font_small_watch"><%= get_praise_num(obj,0)%></strong></td>
</tr>
<tr>
<td> <%= link_to image_tag("/images/praise_tread/tread_false.png"),:controller=>"praise_tread",
:action=>"tread_plus",:remote=>true,:obj_id => obj.id,:obj_type => obj.class %></td>
</tr>
</table>
<% end %>
</div>

View File

@ -1,3 +1,4 @@
$('#praise_tread').html('<%= j(
render :partial => "/praise_tread/praise_tread",:locals => {:obj => @obj,:show_flag => false,:user_id => User.current.id}
$('#praise_tread_<%= @obj.id %>').html('<%= j(
render :partial => "/praise_tread/praise_tread",:locals => {:obj => @obj,:user_id => User.current.id}
)%>');

View File

@ -87,8 +87,7 @@
<div class="autoscroll">
<% for user in @users -%>
<div class="well">
<div class="well">
<%= content_tag "p", "#{format_date(user.created_on)}#{l(:label_member_since)}", :class => "float_right member_since" %>
<%= image_tag "/images/time_member.png", :class => "img_member_time"%>
<!-- <%= get_avatar?(user) ? (link_to image_tag(avatar_image(user), :class => 'avatar'), user_path(user), :class => "avatar") : (link_to image_tag("/images/12_50.png", :class => 'avatar'), user_path(user), :class => "avatar") %> -->
@ -99,9 +98,8 @@
<div style="margin-top: 20px;margin-left:66px">
<%= l(:label_has_fans,:count=>user.watcher_users.count)%>
<%= l(:label_has_watchers,:count=>User.watched_by(user.id).count) %>
<%= l(:label_has_praisers,:count=>get_praise_num(user))%>
</div>
<!--<%= content_tag "span", content_tag("p", user.firstname), :class => "clear avatar_name" %>-->
<div class="user-bottom">
<% unless user.memberships.empty? %>
<%= l(:label_contribute_to, :project_count => "#{user.memberships.count}") %>

View File

@ -1,44 +1,44 @@
<!-- <div class="table_">
<table background="/images/welcome/backgroundnew.png" height="600" width="928">
<tr><td align="left">
<%= call_hook :view_account_login_top %>
<div id="login-form_new">
<%= form_tag(signin_path) do %>
<%= back_url_hidden_field_tag %>
<table>
<tr>
<td align="right"><label for="username"><%=l(:field_login)%>:</label></td>
<td align="left"><%= text_field_tag 'username', params[:username], :tabindex => '1' %></td>
</tr>
<tr>
<td align="right"><label for="password"><%=l(:field_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>
</tr>
<tr>
<td align="left">
<% if Setting.lost_password? %>
<%= link_to l(:label_password_lost), lost_password_path %>
<% end %>
</td>
<td align="right">
<input type="submit" name="login" value="<%=l(:button_login)%> &#187;" tabindex="5"/>
</td>
</tr>
</table>
<table background="/images/welcome/backgroundnew.png" height="600" width="928">
<tr><td align="left">
<%= call_hook :view_account_login_top %>
<div id="login-form_new">
<%= form_tag(signin_path) do %>
<%= back_url_hidden_field_tag %>
<table>
<tr>
<td align="right"><label for="username"><%=l(:field_login)%>:</label></td>
<td align="left"><%= text_field_tag 'username', params[:username], :tabindex => '1' %></td>
</tr>
<tr>
<td align="right"><label for="password"><%=l(:field_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>
</tr>
<tr>
<td align="left">
<% if Setting.lost_password? %>
<%= link_to l(:label_password_lost), lost_password_path %>
<% end %>
</td>
<td align="right">
<input type="submit" name="login" value="<%=l(:button_login)%> &#187;" tabindex="5"/>
</td>
</tr>
</table>
<% end %>
</div>
<%= call_hook :view_account_login_bottom %>
@ -50,76 +50,76 @@
<% end %>
</td></tr>
<tr><td>
<tr><td>
<table width="600" align="center" style="padding-top: 120px" cellspacing="0" cellpadding="0" >
<tr><td width="200" bgcolor="#00adee"><img src="/images/welcome/1.png" width="200" height="200"/></td>
<td width="200" bgcolor="#54c8f3"><img src="/images/welcome/2.png" width="200" height="200"/></td>
<td width="200" bgcolor="#93c5d8"><img src="/images/welcome/3.png" width="200" height="200"/></td>
</tr>
<tr height="50"><td align="center">
<p><%=link_to "发布需求",home_path %></p>
</td><td align="center">
<p><%=link_to "发现开源",home_path %></p>
</td><td align="center">
<p><%=link_to "创建项目",:controller=>'projects',:action=>'index' %></p>
</td></tr>
<tr><td width="200" bgcolor="#00adee"><img src="/images/welcome/1.png" width="200" height="200"/></td>
<td width="200" bgcolor="#54c8f3"><img src="/images/welcome/2.png" width="200" height="200"/></td>
<td width="200" bgcolor="#93c5d8"><img src="/images/welcome/3.png" width="200" height="200"/></td>
</tr>
<tr height="50"><td align="center">
<p><%=link_to "发布需求",home_path %></p>
</td><td align="center">
<p><%=link_to "发现开源",home_path %></p>
</td><td align="center">
<p><%=link_to "创建项目",:controller=>'projects',:action=>'index' %></p>
</td></tr>
</table></td>
</tr>
</table>
</div>
</div>
<div class="table_" style="height:230px;">
<div class="table_" style="height:230px;">
<div class="welcone_left">
<table width="240px">
<tr><td><span class="font_welcome_trustie">Trustieforge</span><span class="">是一个社交化的项目管理、软件开发和众包平台。</span></td></tr>
<tr><td class="font_lighter_trustie">Trustieforge is a socialized collaboration platform for project management,
software development and software crowdsourcing.</td></tr>
</table>
</div>
<div >
<table>
<tr><td align="left">
<%= call_hook :view_account_login_top %>
<div id="login-form_new">
<%= form_tag(signin_path) do %>
<%= back_url_hidden_field_tag %>
<% unless User.current.logged? %>
<table class="welcone_right">
<tr>
<td align="right"><label for="username">用户:</label></td>
<td align="left"><%= text_field_tag 'username', params[:username], :tabindex => '1' %></td>
</tr>
<tr>
<td align="right"><label for="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>
</tr>
<tr>
<td align="left">
<% if Setting.lost_password? %>
<%= link_to l(:label_password_lost), lost_password_path %>
<% end %>
</td>
<td align="right">
<input type="submit" name="login" value="<%=l(:button_login)%> &#187;" tabindex="5"/>
</td>
</tr>
</table>
<% end %>
<table width="240px">
<tr><td><span class="font_welcome_trustie">Trustieforge</span><span class="">是一个社交化的项目管理、软件开发和众包平台。</span></td></tr>
<tr><td class="font_lighter_trustie">Trustieforge is a socialized collaboration platform for project management,
software development and software crowdsourcing.</td></tr>
</table>
</div>
<div >
<table>
<tr><td align="left">
<%= call_hook :view_account_login_top %>
<div id="login-form_new">
<%= form_tag(signin_path) do %>
<%= back_url_hidden_field_tag %>
<% unless User.current.logged? %>
<table class="welcone_right">
<tr>
<td align="right"><label for="username">用户:</label></td>
<td align="left"><%= text_field_tag 'username', params[:username], :tabindex => '1' %></td>
</tr>
<tr>
<td align="right"><label for="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>
</tr>
<tr>
<td align="left">
<% if Setting.lost_password? %>
<%= link_to l(:label_password_lost), lost_password_path %>
<% end %>
</td>
<td align="right">
<input type="submit" name="login" value="<%=l(:button_login)%> &#187;" tabindex="5"/>
</td>
</tr>
</table>
<% end %>
<% end %>
</div>
<%= call_hook :view_account_login_bottom %>
@ -136,142 +136,135 @@
-->
<!--add by huang-->
<!--add by huang-->
<div style="height:220px;">
<div class="welcone_left">
<table width="350px">
<tr><td><span class="font_welcome_trustie">Trustie</span>
<span class="font_welcome_Cdescription">是一个社交化的项目管理、软件开发和众包平台。</span></td></tr>
<tr><td class="font_welcome_Edescription">Trustieforge is a socialized collaboration platform for project management,
software development and software crowdsourcing.</td></tr>
</table>
</div>
<div style="height:190px;">
<div class="welcone_left">
<table width="350px">
<tr>
<td><span class="font_welcome_trustie">Trustie</span><span class="font_welcome_Cdescription">是一个社交化的项目管理、软件开发和众包平台。</span></td>
</tr>
<tr>
<td class="font_welcome_Edescription">Trustieforge is a socialized collaboration platform for project management,
software development and software crowdsourcing.</td>
</tr>
</table>
</div>
<table>
<tr><td>
<%= call_hook :view_account_login_top %>
<div id="login-form_new">
<%= form_tag(signin_path) do %>
<%= back_url_hidden_field_tag %>
<% unless User.current.logged? %> <!--modified by young-->
<table>
<tr>
<td align="right"><label for="username"><%= l(:label_username) %></label></td>
<td align="left"><%= text_field_tag 'username', params[:username], :tabindex => '1' %></td>
<td> <%= call_hook :view_account_login_top %>
<div id="login-form_new">
<%= form_tag(signin_path) do %>
<%= back_url_hidden_field_tag %>
<% unless User.current.logged? %> <!--modified by young-->
<table>
<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>
</tr>
<tr>
<td align="left"> <% if Setting.lost_password? %>
<%= link_to l(:label_password_lost), lost_password_path %>
<% end %> </td>
<td align="right">
<input type="submit" name="login" value="<%= l(:button_login)%> &#187;" tabindex="5"/>
</td>
</tr>
</table>
<% else %>
<div>
<!--info-->
<table width="200" border="0">
<tr>
<td colspan="2" class="font_welcome_Cdescription"><%= l(:label_welcome) %> <strong class="font_small_watch"><%= User.current.name%></strong> <%= l(:label_join) %></td>
</tr>
<tr>
<td rowspan="2" align="left"><%= image_tag(url_to_avatar(User.current), :class => 'avatar') %></td>
<td><%= l(:label_user_watcher) %> (<strong class="font_small_watch"><%= link_to User.watched_by(User.current).count %></strong>)&nbsp
<%= render :partial => "watchers/fans_num",:locals => {:fans_num => get_fans_num(User.current) }%></td>
</tr>
<tr>
<td><% unless User.current.memberships.empty? %>
<%= l(:label_contribute_to, :project_count => "#{User.current.memberships.count}") %> <!-- <% for member in User.current.memberships %>
<%= link_to_project(member.project) %><%= (User.current.memberships.last == member) ? '' : '' %>
<% end %> --> <% end %></td>
</tr>
</table>
</div>
<% end %>
<% end %>
</div> <%= call_hook :view_account_login_bottom %>
<% if params[:username].present? %>
<%= javascript_tag "$('#password').focus();" %>
<% else %>
<%= javascript_tag "$('#username').focus();" %>
<% end %> </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>
</tr>
<tr>
<td align="left">
<% if Setting.lost_password? %>
<%= link_to l(:label_password_lost), lost_password_path %>
<% end %>
</td>
<td align="right">
<input type="submit" name="login" value="<%=l(:button_login)%> &#187;" tabindex="5"/>
</td>
</tr>
</table>
<% else %>
<div>
<table>
<tr><td class="font_welcome_Cdescription">欢迎 <strong class="font_small_watch"><%=User.current.name%></strong> 加入trustie!</td></tr>
<tr><td align="center"><span><%= image_tag(url_to_avatar(User.current), :class => 'avatar') %></span></td></tr>
<tr><td><%= l(:label_user_watcher) %> (<strong class="font_small_watch"><%= User.watched_by(User.current).count %></strong>)
<%= render :partial => "watchers/fans_num",:locals => {:fans_num => get_fans_num(User.current) }%></td></tr>
<tr><td><% unless User.current.memberships.empty? %>
<%= l(:label_contribute_to, :project_count => "#{User.current.memberships.count}") %>
<% for member in User.current.memberships %>
<%= link_to_project(member.project) %><%= (User.current.memberships.last == member) ? '' : '' %>
<% end %>
<% end %></td></tr>
</table>
</div>
<% end %>
<% end %>
</table>
</div>
<%= call_hook :view_account_login_bottom %>
<% if params[:username].present? %>
<%= javascript_tag "$('#password').focus();" %>
<% else %>
<%= javascript_tag "$('#username').focus();" %>
<% end %>
</td></tr>
</table></div>
<!--model-->
<div>
<table width="700" border="0" align="center" style="padding-top: 100px">
<tr align="center">
<td><%= link_to image_tag("/images/welcome/1.png", weight:"200px", height:"200px"), :controller => 'projects', :action => 'index' %></td>
<td width="50">&nbsp;</td>
<td><%= link_to image_tag("/images/welcome/2.png", weight:"200px", height:"200px"), :controller => 'bids', :action => 'index' %></td>
<td width="50">&nbsp;</td>
<td><%= link_to image_tag("/images/welcome/3.png", weight:"200px", height:"200px") %></td>
</tr>
<!-- <tr align="center">
<td><p class="font_welcome"><%= l(:label_create_new_projects) %></p></td>
<td>&nbsp;</td>
<td><p class="font_welcome"><%= l(:label_call_for_bids) %></p></td>
<td>&nbsp;</td>
<td><p class="font_welcome"><%= l(:label_create_course) %></p></td>
</tr> -->
<tr align="center" class="font_lighter2" >
<td>创建新项目,让我们开启一次神奇的开源之旅!</td>
<td>&nbsp;</td>
<td>为你所想,发布需求,体验答案找上门的兴奋感觉!</td>
<td>&nbsp;</td>
<td>课程小社区,创建新课程,让我们共同分享多到想不到的公共资源!</td>
</tr>
</table>
</div>
<table width="700" border="0" align="center" style="padding-top: 100px">
<tr align="center">
<td><%= link_to image_tag("/images/welcome/1.png", weight:"190px", height:"190px"), :controller => 'projects', :action => 'index' %></td>
<td width="65"></td>
<td><%= link_to image_tag("/images/welcome/2.png", weight:"190px", height:"190px"), :controller => 'bids', :action => 'index' %></td>
<td width="65"></td>
<td><%= link_to image_tag("/images/welcome/3.png", weight:"190px", height:"190px") %></td>
<!--feature-->
<div class="font_welcome_feature">
<div align="center"><%= l(:label_features) %>
<div class="user_underline3"></div></div>
</div>
<div style="padding-top: 30px">
<table width="700" border="0" align="center" >
<tr class="font_welcome" align="center" >
<td><%= image_tag("/images/welcome/discuss.png", weight:"30px", height: "26px") %><span style="vertical-align: top"><%= l(:label_board) %></span></td>
<td width="50">&nbsp;</td>
<td><%= image_tag("/images/welcome/news.png", weight:"30px", height: "26px") %><span style="vertical-align: top"><%= l(:label_news) %></span></td>
<td width="50">&nbsp;</td>
<td><%= image_tag("/images/welcome/boards.png", weight:"30px", height: "26px") %><span style="vertical-align: top"><%= l(:label_milestone) %></span></td>
</tr>
<!-- <tr align="center">
<td><p class="font_welcome"><%= l(:label_create_new_projects) %></p></td>
<td>&nbsp;</td>
<td><p class="font_welcome"><%= l(:label_call_for_bids) %></p></td>
<td>&nbsp;</td>
<td><p class="font_welcome"><%= l(:label_create_course) %></p></td>
</tr> -->
<tr align="center" class="font_lighter2" >
<td width="190"><%= l(:label_create_new_projects_description) %></td>
<td width="65"></td>
<td width="190"><%= l(:label_call_for_bids_description) %></td>
<td width="65"></td>
<td width="190"><%= l(:label_create_course_description) %></td>
</tr>
<tr>
<td colspan="5"><div class="font_welcome_feature">
<div align="center">
<%= l(:label_features) %> <div class="user_underline3"></div>
</div>
</div></td>
</tr>
<tr class="font_welcome" align="center">
<td width="190"><%= image_tag("/images/welcome/discuss.png", weight:"30px", height: "26px") %><span style="vertical-align: top"><%= l(:label_board) %></span></td>
<td width="65">&nbsp;</td>
<td width="190"><%= image_tag("/images/welcome/news.png", weight:"30px", height: "26px") %><span style="vertical-align: top"><%= l(:label_news) %></span></td>
<td width="65">&nbsp;</td>
<td width="190"><%= image_tag("/images/welcome/boards.png", weight:"30px", height: "26px") %><span style="vertical-align: top"><%= l(:label_milestone) %></span></td>
</tr>
<tr align="center" class="font_lighter2">
<td>七嘴八舌,汇聚众人智慧,为您排忧解难!</td>
<td>&nbsp;</td>
<td>实时了解项目的最新动态,掌握最新项目咨询!</td>
<td>&nbsp;</td>
<td>在这里您可以可以看见任何一个版本的工程!</td>
</tr>
</table>
</div>
<div style="padding-top: 40px">
<td width="190"><%= l(:label_board_description) %></td>
<td width="65"></td>
<td width="190"><%= l(:label_news_description) %></td>
<td width="65"></td>
<td width="190"><%= l(:label_milestone_description) %></td>
</tr>
</table>
</div>
<div style="padding-top: 40px"></div>

View File

@ -489,7 +489,7 @@ en-GB:
label_information: Information
label_information_plural: Information
label_please_login: Please log in
label_register: Register
label_register: Sign up
label_login_with_open_id_option: or login with OpenID
label_password_lost: Lost password
label_home: Home
@ -498,7 +498,7 @@ en-GB:
label_my_projects: My projects
label_my_page_block: My page block
label_administration: Administration
label_login: Sign in
label_login: Login
label_logout: Sign out
label_help: Help
label_reported_issues: Reported issues

View File

@ -531,7 +531,7 @@ en:
label_information: Information
label_information_plural: Information
label_please_login: Please log in
label_register: Register
label_register: Sign up
label_login_with_open_id_option: or login with OpenID
label_password_lost: Lost password
label_home: Home
@ -540,7 +540,7 @@ en:
label_my_projects: My projects
label_my_page_block: My page block
label_administration: Administration
label_login: Sign in
label_login: Login
label_logout: Sign out
label_help: Help
label_reported_issues: Reported issues
@ -766,7 +766,8 @@ en:
label_disabled: disabled
label_show_completed_versions: Show completed versions
label_me: me
label_board: Forum
label_board: Forums
label_board_description: Rushesbrought together all wisdomsolve problems for you
label_board_new: New forum
label_board_plural: Forums
label_board_locked: Locked
@ -1196,11 +1197,13 @@ en:
label_cancel_praise: cancel praise
label_bid_reason: Please show your reason
default_tracker_task: Task
label_create_new_projects: Create projects
label_call_for_bids: Call for bids
label_create_course: Create courses
label_create_new_projects_description: Create a new projectlet us open a magical journey of collaborative creation and development
label_call_for_bids_description: As you might expectshow your requirementexperience the feeling of excitement that find the answer
label_create_course_description: Curriculum small communitiescreate new courseslet us share more to think of public resources
label_news: News
label_news_description: Real getting the project's latest developmentsobtain the latest project information
label_milestone: Milestone
label_milestone_description: Here you can see any version of the project
label_features: Features
label_has_praisers: praisers(%{count})
label_has_watchers: watchers(%{count})
@ -1216,4 +1219,6 @@ en:
label_about_requirement: about requirement
label_about_issue: about issue
label_quote_my_words: quoted my words
label_have_respond: had a respond
label_have_respond: had a respond
label_welcome: Welcome
label_join: join Trustie

View File

@ -261,7 +261,7 @@ zh:
field_last_login_on: 最后登录
field_language: 语言
field_effective_date: 日期
field_password: 密码
field_password: 密码
field_new_password: 新密码
field_password_confirmation: 确认
field_version: 版本
@ -1232,3 +1232,13 @@ zh:
label_in_bids: 在需求:
label_in_users: 在用户:
label_have_respond: 进行了反馈
label_have_respond: 进行了反馈
label_create_new_projects_description: 创建项目,让我们开启一次神奇的协同创作和开发之旅!
label_call_for_bids_description: 为你所想,发布需求,体验答案找上门的兴奋感觉!
label_news_description: 实时了解项目的最新动态,掌握最新项目咨询!
label_milestone_description: 在这里您可以看见任何一个版本的工程!
label_have_respond: 进行了反馈
label_welcome: 欢迎
label_join: 加入Trustie
label_board_description: 七嘴八舌,汇聚众人智慧,为您排忧解难!
label_create_course_description: 课程小社区,创建新课程,让我们共同分享多到想不到的公共资源!

View File

@ -23,8 +23,8 @@ RedmineApp::Application.routes.draw do
get "tags/show"
get "praise_tread/praise_plus"
get "praise_tread/praise_minus"
get "praise_tread/tread_minus"
get "praise_tread/tread_plus"
root :to => 'welcome#index', :as => 'home'
@ -442,7 +442,7 @@ RedmineApp::Application.routes.draw do
match 'tags/delete_tag',:to => 'tags#delete_tag',:as=>"add_tag"
match 'tags/show_all',:to => 'tags#show_all'
match 'parise_tread/praise_plus',:to => 'parise_tread#praise_plus',:as=>"praise"
match 'parise_tread/tread_minus',:to => 'parise_tread#tread_minus',:as=>"tread"
match 'parise_tread/tread_plus',:to => 'parise_tread#tread_plus',:as=>"tread"
end

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

View File

@ -11,6 +11,11 @@ h4 {border-bottom: 1px dotted #bbb;}
/*new by huang*/
/**/
.welcome_logo{
float: left;
padding-left: 5px;
padding-top: 2px;
}
.welcome_images{
width: 200px;
height: 200px;
@ -154,7 +159,7 @@ ul.tool li{list-style-type:none;
.font_lighter2{
font-family:微软雅黑;
color:#9a9a9a;
font-size:12px;
font-size:14px;
}
.font_lighter_welcome{
@ -191,7 +196,7 @@ ul.tool li{list-style-type:none;
.spaceright{float:left; width:620px;}
.welcone_left{
margin-top: 70px;
margin-top: 50px;
margin-left: 90px;
float:left;
width: 49%;
@ -224,6 +229,11 @@ ul.tool li{list-style-type:none;
padding-bottom: 8px;
}
.inf_user_image img.avatar2{
background: rgb(245, 245, 245);
padding: 4px;
border: 1px solid #e5dfc7;
float: left;
display: block;
height80px;
width: 80px;
@ -545,7 +555,7 @@ ul.newprojects2 li{
padding: 0px 0px 0px 0px;
white-space:nowrap;
}
#top-menu a {color: #000000; margin-right: 8px; font-weight: bold;}
#top-menu a {color: #fff; margin-right: 8px; font-weight: bold;}
#top-menu #loggedas { float: right; margin-right: 0.5em; color: #fff; }
#account {float:right;}

View File

@ -376,7 +376,7 @@ ul.projects li.root
#top-menu ul
{
margin-left: 60px; /*add by huang*/
margin-left: 0px; /*add by huang*/
padding-right: 1px;
}