Merge branch 'develop' of 10.0.47.245:/home/trustie2 into develop
This commit is contained in:
commit
4b998de820
|
@ -1,32 +1,17 @@
|
||||||
class PraiseTreadController < ApplicationController
|
class PraiseTreadController < ApplicationController
|
||||||
|
|
||||||
|
accept_api_auth :tread_plus,:praise_plus
|
||||||
|
before_filter :require_login,:only => [:praise_plus,:tread_plus]
|
||||||
|
|
||||||
def praise_plus
|
def praise_plus
|
||||||
@obj = nil
|
@obj = nil
|
||||||
|
# @is_in_list = nil
|
||||||
if request.get?
|
if request.get?
|
||||||
@obj = params[:obj] # 传的是对象,最后变成id了
|
@obj_id = params[:obj_id]
|
||||||
|
@obj_type = params[:obj_type]
|
||||||
#首先创建或更新praise_tread 表
|
@obj = find_object_by_type_and_id(@obj_type,@obj_id)
|
||||||
@pt = PraiseTread.find_by_user_id_and_praise_tread_object_id(User.current.id,@obj)
|
# @is_in_list = params[:is_in_list]
|
||||||
@pt = @pt.nil? ? PraiseTread.new : @pt
|
praise_tread_plus(@obj_type,@obj_id,1)
|
||||||
|
|
||||||
@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
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -55,7 +40,15 @@ class PraiseTreadController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def tread_plus
|
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
|
end
|
||||||
|
|
||||||
def tread_minus
|
def tread_minus
|
||||||
|
@ -65,4 +58,46 @@ class PraiseTreadController < ApplicationController
|
||||||
end
|
end
|
||||||
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
|
end
|
||||||
|
|
|
@ -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 :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,
|
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]
|
: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
|
#william
|
||||||
before_filter :require_login,:only=>[:tag_save]
|
before_filter :need_login,:only => :tag_save
|
||||||
|
|
||||||
|
|
||||||
helper :sort
|
helper :sort
|
||||||
|
|
|
@ -1317,8 +1317,8 @@ module ApplicationHelper
|
||||||
# end
|
# end
|
||||||
|
|
||||||
#added by william
|
#added by william
|
||||||
def get_fans_num(user)
|
def need_login
|
||||||
user.watcher_users.count
|
redirect_to signin_path
|
||||||
end
|
end
|
||||||
#end
|
#end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,20 +1,25 @@
|
||||||
module PraiseTreadHelper
|
module PraiseTreadHelper
|
||||||
#added by william
|
#added by william
|
||||||
def is_praise_or_tread(object,user_id)
|
def is_praise_or_tread(object,user_id)
|
||||||
@obj_type = object.class.name.underscore
|
@obj_type = object.class
|
||||||
@obj_id = object.id
|
@obj_id = object.id
|
||||||
@is_praise = PraiseTread.find_by_sql("select * from praise_treads where user_id=#{user_id} and " +
|
@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}")
|
"praise_tread_object_type='#{@obj_type}' and praise_tread_object_id=#{@obj_id}")
|
||||||
return @is_praise
|
return @is_praise
|
||||||
end
|
end
|
||||||
#end
|
#end
|
||||||
|
|
||||||
def get_praise_num(object)
|
def get_praise_num(object,flag)
|
||||||
@obj_type = object.class.name.underscore
|
@obj_type = object.class
|
||||||
@obj_id = object.id
|
@obj_id = object.id
|
||||||
@record = PraiseTreadCache.find_by_object_id_and_object_type(@obj_id,@obj_type)
|
@record = PraiseTreadCache.find_by_object_id_and_object_type(@obj_id,@obj_type)
|
||||||
if @record
|
if @record
|
||||||
return @record.praise_num
|
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
|
else
|
||||||
return 0
|
return 0
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,9 +1,14 @@
|
||||||
class PraiseTreadCache < ActiveRecord::Base
|
class PraiseTreadCache < ActiveRecord::Base
|
||||||
attr_accessible :object_id,:object_type,:praise_num,:tread_num
|
attr_accessible :object_id,:object_type,:praise_num,:tread_num
|
||||||
|
|
||||||
def plus(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)
|
self.update_attribute(:praise_num, self.praise_num.to_i + num)
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def minus(num)
|
def minus(num)
|
||||||
self.update_attribute(:praise_num, self.praise_num.to_i - num)
|
self.update_attribute(:praise_num, self.praise_num.to_i - num)
|
||||||
|
|
|
@ -48,7 +48,8 @@
|
||||||
<tr>
|
<tr>
|
||||||
<td align="left"><a class="font_lighter"> <%= journal.created_on %></a></td>
|
<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,
|
<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>
|
:remote => true, :method => 'delete', :class => "delete", :title => l(:button_delete)) if remove_allowed || journal.user_id == User.current.id %></td>
|
||||||
</tr>
|
</tr>
|
||||||
</table></td>
|
</table></td>
|
||||||
|
|
|
@ -72,23 +72,27 @@
|
||||||
|
|
||||||
<li id="issue-<%= issue.id %>" class="hascontextmenu-1 <%= issue.css_classes %> <%= level > 0 ? "idnt idnt-#{level}" : nil %>">
|
<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)}"}) %>
|
<% 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' %>
|
<% if issue.tracker.name == 'Bug' %>
|
||||||
<%= image_tag("/images/task.png", :class => "img-tag-issues") %>
|
<%= image_tag("/images/task.png", :class => "img-tag-issues") %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% if issue.tracker.name == '任务'%>
|
<% if issue.tracker.name == '任务'%>
|
||||||
<%= image_tag("/images/issues.png", :class => "img-tag-issues") %>
|
<%= image_tag("/images/issues.png", :class => "img-tag-issues") %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<ul class="issue_list">
|
<ul class="issue_list">
|
||||||
<ul class="list-group-item-meta">
|
<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>
|
<span> <%= link_to issue.author.name, user_path(issue.author), :class => "bid_user_u" %></span><%= l(:label_post_on)%> <span> <% a = [] %>
|
||||||
<% a = [] %>
|
|
||||||
<% a << column_content[1] %>
|
<% a << column_content[1] %>
|
||||||
<% a << "##{column_content[0]}" << "(#{raw column_content[2]}):" << column_content[4] %>
|
<% a << "##{column_content[0]}" << "(#{raw column_content[2]}):" << column_content[4] %>
|
||||||
<%= link_to a.join(' '), issue_path(issue) %>
|
<%= link_to a.join(' '), issue_path(issue) %>
|
||||||
</ul>
|
</ul>
|
||||||
<ul class="list-group-item-meta">
|
<ul class="list-group-item-meta">
|
||||||
<div class="issue-list-description">
|
<div class="issue-list-description">
|
||||||
<%= issue.description %>
|
<%= l(:field_description)%>:<%= issue.description %>
|
||||||
</div>
|
</div>
|
||||||
</ul>
|
</ul>
|
||||||
<ul class="list-group-item-meta">
|
<ul class="list-group-item-meta">
|
||||||
|
@ -97,7 +101,9 @@
|
||||||
<% end %>
|
<% end %>
|
||||||
<!-- <%= raw column_content[6] %> -->
|
<!-- <%= raw column_content[6] %> -->
|
||||||
<%= l(:label_updated_time_on, format_date(issue.updated_on)).html_safe %>
|
<%= 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>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
|
|
|
@ -21,11 +21,14 @@
|
||||||
|
|
||||||
<!-- <%= avatar(@issue.author, :size => "50") %> -->
|
<!-- <%= avatar(@issue.author, :size => "50") %> -->
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div class="subject">
|
<div class="subject">
|
||||||
<%= render_issue_subject_with_tree(@issue) %>
|
<%= 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">
|
<p class="author">
|
||||||
<%= authoring @issue.created_on, @issue.author %>.
|
<%= authoring @issue.created_on, @issue.author %>.
|
||||||
<% if @issue.created_on != @issue.updated_on %>
|
<% if @issue.created_on != @issue.updated_on %>
|
||||||
|
@ -36,7 +39,6 @@
|
||||||
<div id="tags">
|
<div id="tags">
|
||||||
<%= render :partial => 'layouts/tag', :locals => {:obj => @issue,:object_flag => "3" }%>
|
<%= render :partial => 'layouts/tag', :locals => {:obj => @issue,:object_flag => "3" }%>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<table class="attributes">
|
<table class="attributes">
|
||||||
<%= issue_fields_rows do |rows|
|
<%= issue_fields_rows do |rows|
|
||||||
rows.left l(:field_status), h(@issue.status.name), :class => 'status'
|
rows.left l(:field_status), h(@issue.status.name), :class => 'status'
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<div id="top-menu" style="background-color: #15bccf;height:40px;margin-top: 10px;margin-bottom: 10px;">
|
<div id="top-menu" style="background-color: #15bccf;height:40px;margin-top: 10px;margin-bottom: 10px;">
|
||||||
<div style="float: left ">
|
<div class="welcome_logo">
|
||||||
<%=link_to image_tag("/images/logo.png",weight:"39px", height: "39px"), home_path %>
|
<%=link_to image_tag("/images/logo.png",weight:"36px", height: "36px"), home_path %>
|
||||||
</div>
|
</div>
|
||||||
<div id="account">
|
<div id="account">
|
||||||
<%= render_menu :account_menu -%>
|
<%= render_menu :account_menu -%>
|
||||||
|
|
|
@ -44,9 +44,6 @@
|
||||||
</tr>
|
</tr>
|
||||||
</table></td>
|
</table></td>
|
||||||
</tr>
|
</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>
|
</table>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
|
|
|
@ -1,17 +1,57 @@
|
||||||
<span id="praise">
|
<!-- get_praise_num(obj,1)函数中 1代表返回顶得次数 0返回踩的次数 -->
|
||||||
<% if is_praise_or_tread(obj,user_id).size > 0 %>
|
<div id="praise_tread_<%= obj.id %>" style="float:right;">
|
||||||
<%= image_tag("/images/praise.png") %>
|
|
||||||
<%= link_to "#{l(:label_cancel_praise)}",:controller=>"praise_tread",:action=>"praise_minus",:remote=>true,:obj => obj %>
|
<% @is_valuate = is_praise_or_tread(obj,user_id)%>
|
||||||
(<strong class="font_small_watch"><%= get_praise_num(obj)%></strong>)
|
<% 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 %>
|
<% else %>
|
||||||
<%= image_tag("/images/tread.png") %>
|
|
||||||
<%= link_to "#{l(:label_praise)}",:controller=>"praise_tread",:action=>"praise_plus",:remote=>true,:obj => obj %>
|
<table style="line-height: 1px">
|
||||||
(<strong class="font_small_watch"><%= get_praise_num(obj)%></strong>)
|
<tr>
|
||||||
<% end %>
|
<td > <%= link_to image_tag("/images/praise_tread/praise_false.png"),
|
||||||
</span>
|
:controller=>"praise_tread",:action=>"praise_plus",:remote=>true,:obj_id => obj.id,:obj_type => obj.class%> </td>
|
||||||
<% if show_flag %>
|
</tr>
|
||||||
<span id="tread">
|
<tr>
|
||||||
<%= link_to image_tag("/images/tread.png"),:controller=>"praise_tread",
|
<td align="center">+<strong class="font_small_watch"><%= get_praise_num(obj,1)%></strong></td>
|
||||||
:action=>"tread_minus",:remote=>true,:obj => obj %>踩
|
</tr>
|
||||||
</span>
|
<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 %>
|
<% end %>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -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}
|
||||||
)%>');
|
)%>');
|
||||||
|
|
|
@ -88,7 +88,6 @@
|
||||||
<div class="autoscroll">
|
<div class="autoscroll">
|
||||||
<% for user in @users -%>
|
<% 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" %>
|
<%= 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"%>
|
<%= 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") %> -->
|
<!-- <%= 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">
|
<div style="margin-top: 20px;margin-left:66px">
|
||||||
<%= l(:label_has_fans,:count=>user.watcher_users.count)%>
|
<%= l(:label_has_fans,:count=>user.watcher_users.count)%>
|
||||||
<%= l(:label_has_watchers,:count=>User.watched_by(user.id).count) %>
|
<%= l(:label_has_watchers,:count=>User.watched_by(user.id).count) %>
|
||||||
<%= l(:label_has_praisers,:count=>get_praise_num(user))%>
|
|
||||||
</div>
|
</div>
|
||||||
<!--<%= content_tag "span", content_tag("p", user.firstname), :class => "clear avatar_name" %>-->
|
|
||||||
<div class="user-bottom">
|
<div class="user-bottom">
|
||||||
<% unless user.memberships.empty? %>
|
<% unless user.memberships.empty? %>
|
||||||
<%= l(:label_contribute_to, :project_count => "#{user.memberships.count}") %>
|
<%= l(:label_contribute_to, :project_count => "#{user.memberships.count}") %>
|
||||||
|
|
|
@ -136,21 +136,22 @@
|
||||||
-->
|
-->
|
||||||
<!--add by huang-->
|
<!--add by huang-->
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!--add by huang-->
|
<!--add by huang-->
|
||||||
<div style="height:220px;">
|
<div style="height:190px;">
|
||||||
<div class="welcone_left">
|
<div class="welcone_left">
|
||||||
<table width="350px">
|
<table width="350px">
|
||||||
<tr><td><span class="font_welcome_trustie">Trustie</span>
|
<tr>
|
||||||
<span class="font_welcome_Cdescription">是一个社交化的项目管理、软件开发和众包平台。</span></td></tr>
|
<td><span class="font_welcome_trustie">Trustie</span><span class="font_welcome_Cdescription">是一个社交化的项目管理、软件开发和众包平台。</span></td>
|
||||||
<tr><td class="font_welcome_Edescription">Trustieforge is a socialized collaboration platform for project management,
|
</tr>
|
||||||
software development and software crowdsourcing.</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>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<table>
|
<table>
|
||||||
<tr><td>
|
<tr>
|
||||||
<%= call_hook :view_account_login_top %>
|
<td> <%= call_hook :view_account_login_top %>
|
||||||
<div id="login-form_new">
|
<div id="login-form_new">
|
||||||
<%= form_tag(signin_path) do %>
|
<%= form_tag(signin_path) do %>
|
||||||
<%= back_url_hidden_field_tag %>
|
<%= back_url_hidden_field_tag %>
|
||||||
|
@ -172,18 +173,12 @@
|
||||||
<% end %>
|
<% end %>
|
||||||
<tr>
|
<tr>
|
||||||
<td></td>
|
<td></td>
|
||||||
<td align="left">
|
<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>
|
||||||
<% if Setting.autologin? %>
|
|
||||||
<label for="autologin"><%= check_box_tag 'autologin', 1, false, :tabindex => 4 %> <%= l(:label_stay_logged_in) %></label>
|
|
||||||
<% end %>
|
|
||||||
</td>
|
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td align="left">
|
<td align="left"> <% if Setting.lost_password? %>
|
||||||
<% if Setting.lost_password? %>
|
|
||||||
<%= link_to l(:label_password_lost), lost_password_path %>
|
<%= link_to l(:label_password_lost), lost_password_path %>
|
||||||
<% end %>
|
<% end %> </td>
|
||||||
</td>
|
|
||||||
<td align="right">
|
<td align="right">
|
||||||
<input type="submit" name="login" value="<%= l(:button_login)%> »" tabindex="5"/>
|
<input type="submit" name="login" value="<%= l(:button_login)%> »" tabindex="5"/>
|
||||||
</td>
|
</td>
|
||||||
|
@ -191,43 +186,46 @@
|
||||||
</table>
|
</table>
|
||||||
<% else %>
|
<% else %>
|
||||||
<div>
|
<div>
|
||||||
|
<!--info-->
|
||||||
<table>
|
<table width="200" border="0">
|
||||||
<tr><td class="font_welcome_Cdescription">欢迎 <strong class="font_small_watch"><%=User.current.name%></strong> 加入trustie!</td></tr>
|
<tr>
|
||||||
<tr><td align="center"><span><%= image_tag(url_to_avatar(User.current), :class => 'avatar') %></span></td></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><td><%= l(:label_user_watcher) %> (<strong class="font_small_watch"><%= User.watched_by(User.current).count %></strong>)
|
</tr>
|
||||||
<%= render :partial => "watchers/fans_num",:locals => {:fans_num => get_fans_num(User.current) }%></td></tr>
|
<tr>
|
||||||
<tr><td><% unless User.current.memberships.empty? %>
|
<td rowspan="2" align="left"><%= image_tag(url_to_avatar(User.current), :class => 'avatar') %></td>
|
||||||
<%= l(:label_contribute_to, :project_count => "#{User.current.memberships.count}") %>
|
<td><%= l(:label_user_watcher) %> (<strong class="font_small_watch"><%= link_to User.watched_by(User.current).count %></strong>) 
|
||||||
<% for member in User.current.memberships %>
|
<%= 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) ? '' : ',' %>
|
<%= link_to_project(member.project) %><%= (User.current.memberships.last == member) ? '' : ',' %>
|
||||||
<% end %>
|
<% end %> --> <% end %></td>
|
||||||
<% end %></td></tr>
|
</tr>
|
||||||
|
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div> <%= call_hook :view_account_login_bottom %>
|
||||||
<%= call_hook :view_account_login_bottom %>
|
|
||||||
|
|
||||||
<% if params[:username].present? %>
|
<% if params[:username].present? %>
|
||||||
<%= javascript_tag "$('#password').focus();" %>
|
<%= javascript_tag "$('#password').focus();" %>
|
||||||
<% else %>
|
<% else %>
|
||||||
<%= javascript_tag "$('#username').focus();" %>
|
<%= javascript_tag "$('#username').focus();" %>
|
||||||
<% end %>
|
<% end %> </td>
|
||||||
|
</tr>
|
||||||
</td></tr>
|
</table>
|
||||||
</table></div>
|
</div>
|
||||||
<!--model-->
|
<!--model-->
|
||||||
<div>
|
<div>
|
||||||
<table width="700" border="0" align="center" style="padding-top: 100px">
|
<table width="700" border="0" align="center" style="padding-top: 100px">
|
||||||
<tr align="center">
|
<tr align="center">
|
||||||
<td><%= link_to image_tag("/images/welcome/1.png", weight:"200px", height:"200px"), :controller => 'projects', :action => 'index' %></td>
|
<td><%= link_to image_tag("/images/welcome/1.png", weight:"190px", height:"190px"), :controller => 'projects', :action => 'index' %></td>
|
||||||
<td width="50"> </td>
|
<td width="65"></td>
|
||||||
<td><%= link_to image_tag("/images/welcome/2.png", weight:"200px", height:"200px"), :controller => 'bids', :action => 'index' %></td>
|
<td><%= link_to image_tag("/images/welcome/2.png", weight:"190px", height:"190px"), :controller => 'bids', :action => 'index' %></td>
|
||||||
<td width="50"> </td>
|
<td width="65"></td>
|
||||||
<td><%= link_to image_tag("/images/welcome/3.png", weight:"200px", height:"200px") %></td>
|
<td><%= link_to image_tag("/images/welcome/3.png", weight:"190px", height:"190px") %></td>
|
||||||
|
|
||||||
</tr>
|
</tr>
|
||||||
<!-- <tr align="center">
|
<!-- <tr align="center">
|
||||||
|
@ -238,40 +236,35 @@
|
||||||
<td><p class="font_welcome"><%= l(:label_create_course) %></p></td>
|
<td><p class="font_welcome"><%= l(:label_create_course) %></p></td>
|
||||||
</tr> -->
|
</tr> -->
|
||||||
<tr align="center" class="font_lighter2" >
|
<tr align="center" class="font_lighter2" >
|
||||||
<td>创建新项目,让我们开启一次神奇的开源之旅!</td>
|
<td width="190"><%= l(:label_create_new_projects_description) %></td>
|
||||||
<td> </td>
|
<td width="65"></td>
|
||||||
<td>为你所想,发布需求,体验答案找上门的兴奋感觉!</td>
|
<td width="190"><%= l(:label_call_for_bids_description) %></td>
|
||||||
<td> </td>
|
<td width="65"></td>
|
||||||
<td>课程小社区,创建新课程,让我们共同分享多到想不到的公共资源!</td>
|
<td width="190"><%= l(:label_create_course_description) %></td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
<tr>
|
||||||
|
<td colspan="5"><div class="font_welcome_feature">
|
||||||
|
<div align="center">
|
||||||
|
<%= l(:label_features) %> <div class="user_underline3"></div>
|
||||||
</div>
|
</div>
|
||||||
|
</div></td>
|
||||||
<!--feature-->
|
</tr>
|
||||||
<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">
|
<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="190"><%= image_tag("/images/welcome/discuss.png", weight:"30px", height: "26px") %><span style="vertical-align: top"><%= l(:label_board) %></span></td>
|
||||||
<td width="50"> </td>
|
<td width="65"> </td>
|
||||||
<td><%= image_tag("/images/welcome/news.png", weight:"30px", height: "26px") %><span style="vertical-align: top"><%= l(:label_news) %></span></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="50"> </td>
|
<td width="65"> </td>
|
||||||
<td><%= image_tag("/images/welcome/boards.png", weight:"30px", height: "26px") %><span style="vertical-align: top"><%= l(:label_milestone) %></span></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>
|
||||||
<tr align="center" class="font_lighter2">
|
<tr align="center" class="font_lighter2">
|
||||||
<td>七嘴八舌,汇聚众人智慧,为您排忧解难!</td>
|
<td width="190"><%= l(:label_board_description) %></td>
|
||||||
<td> </td>
|
<td width="65"></td>
|
||||||
<td>实时了解项目的最新动态,掌握最新项目咨询!</td>
|
<td width="190"><%= l(:label_news_description) %></td>
|
||||||
<td> </td>
|
<td width="65"></td>
|
||||||
<td>在这里您可以可以看见任何一个版本的工程!</td>
|
<td width="190"><%= l(:label_milestone_description) %></td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<div style="padding-top: 40px">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
<div style="padding-top: 40px"></div>
|
||||||
|
|
||||||
|
|
|
@ -489,7 +489,7 @@ en-GB:
|
||||||
label_information: Information
|
label_information: Information
|
||||||
label_information_plural: Information
|
label_information_plural: Information
|
||||||
label_please_login: Please log in
|
label_please_login: Please log in
|
||||||
label_register: Register
|
label_register: Sign up
|
||||||
label_login_with_open_id_option: or login with OpenID
|
label_login_with_open_id_option: or login with OpenID
|
||||||
label_password_lost: Lost password
|
label_password_lost: Lost password
|
||||||
label_home: Home
|
label_home: Home
|
||||||
|
@ -498,7 +498,7 @@ en-GB:
|
||||||
label_my_projects: My projects
|
label_my_projects: My projects
|
||||||
label_my_page_block: My page block
|
label_my_page_block: My page block
|
||||||
label_administration: Administration
|
label_administration: Administration
|
||||||
label_login: Sign in
|
label_login: Login
|
||||||
label_logout: Sign out
|
label_logout: Sign out
|
||||||
label_help: Help
|
label_help: Help
|
||||||
label_reported_issues: Reported issues
|
label_reported_issues: Reported issues
|
||||||
|
|
|
@ -531,7 +531,7 @@ en:
|
||||||
label_information: Information
|
label_information: Information
|
||||||
label_information_plural: Information
|
label_information_plural: Information
|
||||||
label_please_login: Please log in
|
label_please_login: Please log in
|
||||||
label_register: Register
|
label_register: Sign up
|
||||||
label_login_with_open_id_option: or login with OpenID
|
label_login_with_open_id_option: or login with OpenID
|
||||||
label_password_lost: Lost password
|
label_password_lost: Lost password
|
||||||
label_home: Home
|
label_home: Home
|
||||||
|
@ -540,7 +540,7 @@ en:
|
||||||
label_my_projects: My projects
|
label_my_projects: My projects
|
||||||
label_my_page_block: My page block
|
label_my_page_block: My page block
|
||||||
label_administration: Administration
|
label_administration: Administration
|
||||||
label_login: Sign in
|
label_login: Login
|
||||||
label_logout: Sign out
|
label_logout: Sign out
|
||||||
label_help: Help
|
label_help: Help
|
||||||
label_reported_issues: Reported issues
|
label_reported_issues: Reported issues
|
||||||
|
@ -766,7 +766,8 @@ en:
|
||||||
label_disabled: disabled
|
label_disabled: disabled
|
||||||
label_show_completed_versions: Show completed versions
|
label_show_completed_versions: Show completed versions
|
||||||
label_me: me
|
label_me: me
|
||||||
label_board: Forum
|
label_board: Forums
|
||||||
|
label_board_description: Rushes,brought together all wisdom,solve problems for you!
|
||||||
label_board_new: New forum
|
label_board_new: New forum
|
||||||
label_board_plural: Forums
|
label_board_plural: Forums
|
||||||
label_board_locked: Locked
|
label_board_locked: Locked
|
||||||
|
@ -1196,11 +1197,13 @@ en:
|
||||||
label_cancel_praise: cancel praise
|
label_cancel_praise: cancel praise
|
||||||
label_bid_reason: Please show your reason
|
label_bid_reason: Please show your reason
|
||||||
default_tracker_task: Task
|
default_tracker_task: Task
|
||||||
label_create_new_projects: Create projects
|
label_create_new_projects_description: Create a new project,let us open a magical journey of collaborative creation and development!
|
||||||
label_call_for_bids: Call for bids
|
label_call_for_bids_description: As you might expect,show your requirement,experience the feeling of excitement that find the answer!
|
||||||
label_create_course: Create courses
|
label_create_course_description: Curriculum small communities,create new courses,let us share more to think of public resources!
|
||||||
label_news: News
|
label_news: News
|
||||||
|
label_news_description: Real getting the project's latest developments,obtain the latest project information!
|
||||||
label_milestone: Milestone
|
label_milestone: Milestone
|
||||||
|
label_milestone_description: Here you can see any version of the project!
|
||||||
label_features: Features
|
label_features: Features
|
||||||
label_has_praisers: praisers(%{count})
|
label_has_praisers: praisers(%{count})
|
||||||
label_has_watchers: watchers(%{count})
|
label_has_watchers: watchers(%{count})
|
||||||
|
@ -1217,3 +1220,5 @@ en:
|
||||||
label_about_issue: about issue:
|
label_about_issue: about issue:
|
||||||
label_quote_my_words: quoted my words
|
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!
|
|
@ -261,7 +261,7 @@ zh:
|
||||||
field_last_login_on: 最后登录
|
field_last_login_on: 最后登录
|
||||||
field_language: 语言
|
field_language: 语言
|
||||||
field_effective_date: 日期
|
field_effective_date: 日期
|
||||||
field_password: 密码:
|
field_password: 密码
|
||||||
field_new_password: 新密码
|
field_new_password: 新密码
|
||||||
field_password_confirmation: 确认
|
field_password_confirmation: 确认
|
||||||
field_version: 版本
|
field_version: 版本
|
||||||
|
@ -1232,3 +1232,13 @@ zh:
|
||||||
label_in_bids: 在需求:
|
label_in_bids: 在需求:
|
||||||
label_in_users: 在用户:
|
label_in_users: 在用户:
|
||||||
label_have_respond: 进行了反馈
|
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: 课程小社区,创建新课程,让我们共同分享多到想不到的公共资源!
|
|
@ -23,8 +23,8 @@ RedmineApp::Application.routes.draw do
|
||||||
get "tags/show"
|
get "tags/show"
|
||||||
|
|
||||||
get "praise_tread/praise_plus"
|
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'
|
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/delete_tag',:to => 'tags#delete_tag',:as=>"add_tag"
|
||||||
match 'tags/show_all',:to => 'tags#show_all'
|
match 'tags/show_all',:to => 'tags#show_all'
|
||||||
match 'parise_tread/praise_plus',:to => 'parise_tread#praise_plus',:as=>"praise"
|
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
|
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 |
|
@ -11,6 +11,11 @@ h4 {border-bottom: 1px dotted #bbb;}
|
||||||
|
|
||||||
/*new by huang*/
|
/*new by huang*/
|
||||||
/**/
|
/**/
|
||||||
|
.welcome_logo{
|
||||||
|
float: left;
|
||||||
|
padding-left: 5px;
|
||||||
|
padding-top: 2px;
|
||||||
|
}
|
||||||
.welcome_images{
|
.welcome_images{
|
||||||
width: 200px;
|
width: 200px;
|
||||||
height: 200px;
|
height: 200px;
|
||||||
|
@ -154,7 +159,7 @@ ul.tool li{list-style-type:none;
|
||||||
.font_lighter2{
|
.font_lighter2{
|
||||||
font-family:微软雅黑;
|
font-family:微软雅黑;
|
||||||
color:#9a9a9a;
|
color:#9a9a9a;
|
||||||
font-size:12px;
|
font-size:14px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.font_lighter_welcome{
|
.font_lighter_welcome{
|
||||||
|
@ -191,7 +196,7 @@ ul.tool li{list-style-type:none;
|
||||||
.spaceright{float:left; width:620px;}
|
.spaceright{float:left; width:620px;}
|
||||||
|
|
||||||
.welcone_left{
|
.welcone_left{
|
||||||
margin-top: 70px;
|
margin-top: 50px;
|
||||||
margin-left: 90px;
|
margin-left: 90px;
|
||||||
float:left;
|
float:left;
|
||||||
width: 49%;
|
width: 49%;
|
||||||
|
@ -224,6 +229,11 @@ ul.tool li{list-style-type:none;
|
||||||
padding-bottom: 8px;
|
padding-bottom: 8px;
|
||||||
}
|
}
|
||||||
.inf_user_image img.avatar2{
|
.inf_user_image img.avatar2{
|
||||||
|
background: rgb(245, 245, 245);
|
||||||
|
padding: 4px;
|
||||||
|
border: 1px solid #e5dfc7;
|
||||||
|
float: left;
|
||||||
|
display: block;
|
||||||
height:80px;
|
height:80px;
|
||||||
width: 80px;
|
width: 80px;
|
||||||
|
|
||||||
|
@ -545,7 +555,7 @@ ul.newprojects2 li{
|
||||||
padding: 0px 0px 0px 0px;
|
padding: 0px 0px 0px 0px;
|
||||||
white-space:nowrap;
|
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; }
|
#top-menu #loggedas { float: right; margin-right: 0.5em; color: #fff; }
|
||||||
|
|
||||||
#account {float:right;}
|
#account {float:right;}
|
||||||
|
|
|
@ -376,7 +376,7 @@ ul.projects li.root
|
||||||
|
|
||||||
#top-menu ul
|
#top-menu ul
|
||||||
{
|
{
|
||||||
margin-left: 60px; /*add by huang*/
|
margin-left: 0px; /*add by huang*/
|
||||||
padding-right: 1px;
|
padding-right: 1px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue