diff --git a/app/helpers/watchers_helper.rb b/app/helpers/watchers_helper.rb
index d846071b5..aa0093cf1 100644
--- a/app/helpers/watchers_helper.rb
+++ b/app/helpers/watchers_helper.rb
@@ -361,8 +361,8 @@ module WatchersHelper
:object_id => (objects.size == 1 ? objects.first.id : objects.map(&:id).sort))
method = watched ? 'delete' : 'post'
link_to text, url, :remote => true, :method => method,
- :class => "pr_join_a" ,:id=>id
- end
+ :class => "sy_btn_pink mr5" ,:id=>id
+ end
# 申请加入项目
def join_in_project_link(project, user, options=[])
@@ -372,9 +372,9 @@ module WatchersHelper
method = 'post'
@applied_flag = project.instance_of?(Project)
if applied
- link = "#{text}"
+ link = "#{text}"
else
- link = link_to(text, url, :remote => true, :method => method, :id => "#{project.id}", :class => "pr_join_a")
+ link = link_to(text, url, :remote => true, :method => method, :id => "#{project.id}", :class => "sy_btn_pink mr5")
end
link.html_safe
# if applied
diff --git a/app/models/project.rb b/app/models/project.rb
index 0d297bb3c..e11693624 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -305,6 +305,11 @@ class Project < ActiveRecord::Base
errors[:identifier].blank? && !(new_record? || identifier.blank?)
end
+ # returns project's creater
+ def creater
+ User.find(self.user_id).try(:show_name)
+ end
+
# returns latest created projects
# non public projects will be returned only if user is a member of those
def self.latest(user=nil, count=5)
diff --git a/app/views/layouts/_base_project_top.html.erb b/app/views/layouts/_base_project_top.html.erb
index 22cb3f01a..ee5f952d5 100644
--- a/app/views/layouts/_base_project_top.html.erb
+++ b/app/views/layouts/_base_project_top.html.erb
@@ -1,21 +1,48 @@
-
-
+
+
+ <% if User.current.logged? && (User.current.allowed_to?({:controller => 'projects', :action => 'settings'}, @project) || User.current.admin?) %>
+ <%=link_to image_tag(url_to_avatar(@project), width:"110", height: "110", :id => 'nh_source_tx'), my_clear_user_avatar_temp_path(:course => @project.id), :remote => true%>
+
+ <%=link_to '', my_clear_user_avatar_temp_path(:project => @project.id), :class => 'homepageEditProfileIcon', :title => '点击编辑头像', :remote => true %>
+
+ <% else %>
+ <%= image_tag(url_to_avatar(@project), :width => "110", :height => "110", :alt => "项目logo") %>
+ <% end %>
+
+
+
+
<%= l(:label_project_ivite_code)%>
<%= (User.current.member_of?(@project) || User.current.admin?) ? @project.invite_code : "******" %>
-
私有
+
+
<%= @project.is_public? ? l(:label_public) : l(:label_private) %>
+
- 项目评分:123
- 浏览:123
- 关注:123
- 成员:123
+ 项目评分:
+ <% if @project.project_type == 0 %>
+ <% unless static_project_score(@project.project_score) == 0 %>
+ <%= l(:label_project_score)%> :
+ <%= link_to(format("%.2f" ,static_project_score(@project.project_score)).to_i,
+ {:controller => 'projects',
+ :action => 'show_projects_score',
+ :remote => true,
+ :id => @project.id}, :class => "sy_cblue" ) %>
+ <% end %>
+ <% end %>
+
+ 浏览:<%= @project.visits.to_i %>
+ <%= l(:label_user_watcher) %>: <%= link_to "#{@project.watcher_users.count}", {:controller=>"projects", :action=>"watcherlist", :id => @project.id}, :class => 'sy_corange' %>
+ <%= l(:label_member) %>: <%= link_to "#{@project.members.count}", project_member_path(@project), :class => 'sy_corange', :id => 'project_members_number' %>
-
+关注
-
+加入
-
退出
-
配置
+ <% text = @project.project_new_type == 1 ? l(:label_development_team) : (@project.project_new_type == 2 ? l(:label_research_group) : l(:label_friend_organization))%>
+ <% typeclass = @project.project_new_type == 1 ? "pr_kafa" : (@project.project_new_type == 2 ? "pr_keyan" : "pr_friend")%>
+ <%= render 'layouts/join_exit_project',{:text => text, :typeclass => typeclass} %>
diff --git a/app/views/layouts/_join_exit_project.html.erb b/app/views/layouts/_join_exit_project.html.erb
index 7d2f1b4d2..4166256ab 100644
--- a/app/views/layouts/_join_exit_project.html.erb
+++ b/app/views/layouts/_join_exit_project.html.erb
@@ -1,19 +1,18 @@
-
+
-
- <%= render :partial => "projects/applied_status" %>
-
+ <%= render :partial => "projects/applied_status" %>
+
<% if User.current.admin? || User.current.allowed_to?({:controller => 'projects', :action => 'settings'}, @project) %>
- <%= link_to "
#{l(:button_configure)}".html_safe, settings_project_path(@project), :class => "pr_join_a" %>
+ <%= link_to "#{l(:button_configure)}", settings_project_path(@project), :class => "sy_btn_blue mr5" %>
<% end %>
- <% if (User.current.login? && User.current.member_of?(@project) && Member.where(:user_id => User.current.id, :project_id => @project.id).first.roles.to_s.include?("Manager")) || User.current.admin? %>
- <%= link_to "
#{text}".html_safe,"javascript:void(0)" ,:onClick => "show_window();", :class => "pr_join_a",:id => "setting_project_type"%>
- <% end %>
+
+
+
<% if (User.current.member_of? @project) && User.current.login? && !User.current.admin &&
!Member.where(:user_id => User.current.id, :project_id => @project.id).first.roles.to_s.include?("Manager") %>
<%= exit_project_link(@project) %>
<% end %>
-
+
diff --git a/app/views/projects/_applied_status.html.erb b/app/views/projects/_applied_status.html.erb
index d29819c03..7e8a22f8e 100644
--- a/app/views/projects/_applied_status.html.erb
+++ b/app/views/projects/_applied_status.html.erb
@@ -4,6 +4,7 @@
<% if AppliedProject.where(:user_id => User.current, :project_id => @project_id).first.nil? %>
<%= join_in_project_link(@project, User.current) %>
<% else %>
- 等待审批
+
等待审批
<% end %>
-<% end %>
\ No newline at end of file
+<% end %>
+
diff --git a/config/locales/projects/zh.yml b/config/locales/projects/zh.yml
index 2b63c45cf..374d31ab4 100644
--- a/config/locales/projects/zh.yml
+++ b/config/locales/projects/zh.yml
@@ -51,7 +51,7 @@ zh:
label_project_ivite_code: "邀请码:"
label_agree_join_project: 同意加入
- label_apply_project: "+申请加入"
+ label_apply_project: "+加入"
label_button_following: "+添加关注"
label_exit_project: 退出项目
label_apply_project_waiting: 已处理申请,请等待管理员审核