This commit is contained in:
cxt 2015-07-31 15:51:52 +08:00
commit 8eb2b72802
18 changed files with 269 additions and 222 deletions

View File

@ -150,11 +150,15 @@ class ProjectsController < ApplicationController
end
def new
if User.current.login?
@issue_custom_fields = IssueCustomField.sorted.all
@trackers = Tracker.sorted.all
@project = Project.new
@project.safe_attributes = params[:project]
render :layout => 'base'
else
redirect_to signin_url
end
end
def share
@ -167,6 +171,10 @@ class ProjectsController < ApplicationController
end
def create
unless User.current.login?
redirect_to signin_url
return
end
@issue_custom_fields = IssueCustomField.sorted.all
@trackers = Tracker.sorted.all
@project = Project.new
@ -280,11 +288,11 @@ class ProjectsController < ApplicationController
# 根据私密性,取出符合条件的所有数据
if User.current.member_of?(@project) || User.current.admin?
@events_pages = ForgeActivity.where("project_id = ?",@project).order("created_at desc").page(params['page'|| 1]).per(20);
@events_pages = ForgeActivity.where("project_id = ? and forge_act_type != ?",@project, "Document" ).order("created_at desc").page(params['page'|| 1]).per(20);
#events = @activity.events(@date_from, @date_to)
else
@events_pages = ForgeActivity.includes(:project).where("forge_activities.project_id = ? and projects.is_public
= ?",@project,1).order("created_at desc")
= ? and forge_act_type != ? ",@project,1, "Document").order("created_at desc")
.page(params['page'|| 1]).per(10);
# @events = @activity.events(@date_from, @date_to, :is_public => 1)
end

View File

@ -475,7 +475,7 @@ module UsersHelper
when "Issue"
return '发表了问题'
when "Journal"
return '回复了问题'
return '更新了问题'
when "JournalsForMessage"
return e.class.to_s == 'Course' ? '发表了留言' : '提交了反馈'
#return ( activity.act.reply_id == nil || activity.act.reply_id == 0 ) ? '' : ''

View File

@ -388,7 +388,8 @@ class Mailer < ActionMailer::Base
@user = applied.user
recipients = @project.manager_recipients
s = l(:text_applied_project, :id => "##{@user.show_name}", :project => @project.name)
@applied_url = url_for(:controller => 'projects', :action => 'settings', :id => @project.id,:tab=>'members')
@token = Token.get_token_from_user(@user, 'autologin')
@applied_url = url_for(:controller => 'projects', :action => 'settings', :id => @project.id,:tab=>'members', :token => @token.value)
mail :to => recipients,
:subject => s
end

View File

@ -37,7 +37,7 @@
<% if options[:length] %>
<%= link_to_short_attachment attachment, :class => ' link_file_board', :download => true,:length => options[:length] -%>
<% else %>
<%= link_to_short_attachment attachment, :class => ' link_file_board', :download => true -%>
<% end %>
</span>
<%if is_float%>
@ -66,6 +66,16 @@
:class => 'delete delete-homework-icon',
:remote => true,
:title => l(:button_delete) %>
<% elsif attachment.container_type == 'Issue' %>
<% if User.current == attachment.author %>
<%= link_to image_tag('delete.png'), attachment_path(attachment),
:data => {:confirm => l(:text_are_you_sure)},
:method => :delete,
:class => 'delete',
#:remote => true,
#:id => "attachments_" + attachment.id.to_s,
:title => l(:button_delete) %>
<% end %>
<% else %>
<%= link_to image_tag('delete.png'), attachment_path(attachment),
:data => {:confirm => l(:text_are_you_sure)},

View File

@ -1,5 +1,5 @@
<% watcher_count,watcher_list = get_watcher_users(user) %>
<div id="watcher_nav_list" class="leftbox mt10" style="display:<%= watcher_count==0 ? 'none' : 'block' %>">
<div id="watcher_nav_list" class="leftbox" style="display:<%= watcher_count==0 ? 'none' : 'block' %>">
<h4 class="fl">关注</h4><a href="<%=url_for(:controller => 'users', :action => 'user_watchlist', :id=>user.id)%>" data-count="<%= watcher_count %>" style="display:<%= watcher_count>10 ? 'block' : 'block' %>" class="more fr mr10">更多</a>
<div class="cl"></div>
<div class="mt5">

View File

@ -70,7 +70,7 @@
<% end %>
</div><!--uers_info end-->
<div class="leftbox mt10">
<div class="leftbox">
<ul class="leftbox_ul_left">
<li>最近登录&nbsp;:</li> <!--加入时间修改为最近登录 -->
<% if @user.user_extensions!=nil && @user.user_extensions.identity == 2 %>
@ -171,7 +171,7 @@
<div class="cl"></div>
<div class="leftbox mt10">
<div class="leftbox">
<ul class="leftbox_ul_left">
<% if !@user.user_extensions.nil? && @user.user_extensions.identity == 0 %>
<% if(get_create_course_count(@user)) == 0 %>
@ -254,7 +254,7 @@
<%= render :partial => 'layouts/user_fans_list', :locals => {:user => @user} %>
<% visitor_count,visitor_list = get_visitor_users(@user) %>
<% if(User.current.admin?) %>
<div class="leftbox mt10" style="display:<%= visitor_count==0 ? 'none' : 'block' %>">
<div class="leftbox" style="display:<%= visitor_count==0 ? 'none' : 'block' %>">
<h4 class="fl">访客</h4><a href="<%=url_for(:controller => 'users', :action => 'user_visitorlist', :id=>@user.id)%>" data-count="<%= visitor_count %>" style="display:<%= visitor_count>10 ? 'block' : 'block' %>" class="more fr mr10">更多</a>
<div class="cl"></div>
<div class="mt5">

View File

@ -225,10 +225,10 @@
:style => "color:#2E8DD7; float:left;display:block; margin-right:5px; margin-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"%>
<span class="wmail_txt" style="float:left; margin-right:5px;color:#ACAEB1;"><%= l(:label_project_issue_update) %></span>
<% if issues_journal.notes.blank? || issues_journal.notes.nil? %>
<%= link_to truncate(l(:label_isuue_mail_status),length: 30,omission: '...'),issue_url(issues_journal.issue, :token => @token.value),
<%= link_to truncate(issues_journal.issue.subject.html_safe, length: 30,omission: '...'),issue_url(issues_journal.issue, :token => @token.value),
:style => "color:#2E8DD7;float:left; font-weight:normal;margin-right:5px; display:block;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %>
<% else %>
<%= link_to truncate(issues_journal.notes.html_safe,length: 30,omission: '...'),issue_url(issues_journal.issue, :token => @token.value),
<%= link_to truncate(issues_journal.notes.html_safe, length: 30,omission: '...'),issue_url(issues_journal.issue, :token => @token.value),
:style => "color:#2E8DD7;float:left; font-weight:normal;margin-right:5px; display:block;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %>
<% end %>
<span class="wmail_date" style="color:#6e6e6e; float:left;display:block; margin-left:40px;"><%= format_time(issues_journal.created_on) %></span>

View File

@ -22,14 +22,14 @@
<hr/>
</div>
<% else %>
<%= form_for('new_form', :method => :post,
<%= form_for('new_form', :method => :post, :html => {:id => 'project_feedback_form', :multipart => true},
:url => {:controller => 'words', :action => 'leave_project_message'}) do |f|%>
<%= f.text_area 'project_message', :rows => 3, :cols => 65,
:placeholder => "#{l(:label_welcome_my_respond)}",:nhname=>'new_message_textarea' %>
<p nhname="contentmsg"></p>
<div class="fl mt10" style="padding-top:5px;" nhname="toolbar_container"></div>
<%= submit_tag l(:button_leave_meassge), :name => nil , :class => "blue_btn fr mt10 mb10" %>
<%#= submit_tag l(:button_leave_meassge), :name => nil , :class => "blue_btn fr mt10 mb10" %>
<%= link_to l(:button_leave_meassge), "javascript:void(0)", :onclick => 'submitProjectFeedback();', :onmouseover => 'submitFocus(this);', :class => 'blue_btn fr mt10 mb10' %>
<% end %>
<% end %>

View File

@ -93,21 +93,7 @@
</div>
<div class="cl"></div>
</div>
<!--Document-->
<% elsif e.forge_act_type == "Document" %>
<div class="problem_main">
<a class="problem_pic fl"><%= image_tag(url_to_avatar(e.user), :width => "42", :height => "42") %></a>
<div class="problem_txt fl mt5 break_word">
<a class="problem_name fl ">
<%= h(e.project) if @project.nil? || @project.id != e.project_id %>
<%= link_to h(e.user), user_path(e.user_id), :class => "problem_name c_orange fl" %></a><span class="fl"> <%= l(:label_new_activity) %> </span>
<%= link_to format_activity_title("#{l(:label_document)}: #{act.title}"), {:controller => 'documents', :action => 'show', :id => act.id}, :class => "problem_tit fl fb" %><br />
<p class="mt5 break_word"><%= textAreailizable act,:description %><br />
<%= l :label_create_time %> <%= format_activity_day(act.created_on) %> <%= format_time(act.created_on, false) %></p>
</div>
<div class="cl"></div>
</div>
<!--Attachment -->
<% elsif e.forge_act_type == "Attachment" %>
<div class="problem_main">

View File

@ -1,15 +1,6 @@
<div id="tags_show">
<%= render :partial => "tags/tag_name",:locals => {:obj => obj,:non_list_all => false ,:object_flag => object_flag} %>
<div id="tags">
<div id="tags_show">
<%= render :partial => "tags/tag_project_new_name",:locals => {:obj => obj,:non_list_all => false ,:object_flag => object_flag} %>
</div>
</div>
<% if User.current.logged?%>
<a href="javascript:void(0)" class="yellowBtn f_l" onclick="$('#add_tag01').slideToggle();"><%= l(:label_add_tag)%></a>
<span id="add_tag01" style="display:none; vertical-align: middle;" class="ml10 f_l">
<%= form_for "tag_for_save",:remote=>true,:url=>save_tag_path,:update => "tags_show",:complete => '$("#put-tag-form").slideUp();' do |f| %>
<%= f.text_field :name ,:id => "tags_name",:size=>"20",:require=>true,:maxlength => Setting.tags_max_length,:minlength=>Setting.tags_min_length,:class =>"isTxt w90 f_l" %>
<%= f.text_field :object_id,:value=> obj.id,:style=>"display:none"%>
<%= f.text_field :object_flag,:value=> object_flag,:style=>"display:none"%>
<input type="button" class="submit f_l" onclick="$('#tags_name').parent().submit();" />
<% end %>
</span>
<% end%>

View File

@ -0,0 +1,30 @@
<% @tags = obj.reload.tag_list %>
<% if non_list_all && @tags.size > 0 %>
<% else %>
<!-- 用来显示三大对象的主页中的tag 故是全部显示 -->
<% if @tags.size > 0 %>
<% @tags.each do |tag| %>
<span class="re_tag f_l " id="tag">
<%= link_to tag, :controller => "tags", :action => "index", :q => tag, :object_flag => object_flag, :obj_id => obj.id, :class => 'pt5' %>
<span class="del">
<%= link_to('x', remove_tag_path(:tag_name => tag,:taggable_id => obj.id, :taggable_type => object_flag), :remote => true, :confirm => l(:text_are_you_sure) ) if (ProjectInfo.find_by_project_id(obj.id)).try(:user_id) == User.current.id %>
</span>
</span>
<% end %>
<% end %>
<% end %>
<% if User.current.logged?%>
<a href="javascript:void(0)" class="yellowBtn f_l" onclick="$('#add_tag02').slideToggle();"><%= l(:label_add_tag)%></a>
<span id="add_tag02" style="display:none; vertical-align: middle;" class="ml10 f_l">
<%= form_for "tag_for_save",:remote => true,:url=>save_tag_path,:update => "tags_show",:complete => '$("#put-tag-form").slideUp();' do |f| %>
<%= f.text_field :name ,:id => "tags_name2",:size=>"20",:require=>true,:maxlength => Setting.tags_max_length,:minlength=>Setting.tags_min_length,:class =>"isTxt w90 f_l" %>
<%= f.text_field :object_id,:value=> obj.id,:style=>"display:none"%>
<%= f.text_field :object_flag,:value=> object_flag,:style=>"display:none"%>
<input type="button" class="submit f_l" onclick="$('#tags_name2').parent().submit();" />
<% end %>
</span>
<% end%>

View File

@ -2,6 +2,9 @@
<% if @object_flag == '3'%>
$('#tags_show_issue').html('<%= escape_javascript(render :partial => 'tags/tag_name',
:locals => {:obj => @obj,:non_list_all => false,:object_flag => @object_flag}) %>');
<% elsif @object_flag == '2'%>
$('#tags_show').html('<%= escape_javascript(render :partial => 'tags/tag_project_new_name',
:locals => {:obj => @obj,:non_list_all => false,:object_flag => @object_flag}) %>');
<% elsif @object_flag == '6'%>
$("#tags_show-<%=@obj.class%>-<%=@obj.id%>").empty();
$("#tags_show-<%=@obj.class%>-<%=@obj.id%>").html('<%= escape_javascript(render :partial => 'tags/tag_name',

View File

@ -4,6 +4,10 @@ $('#tags_show_issue').html('<%= escape_javascript(render :partial => 'tags/tag_n
:locals => {:obj => @obj,:non_list_all => false,:object_flag => @obj_flag}) %>');
//$('#put-tag-form-issue').hide();
$('#name-issue').val("");
<% elsif @obj_flag == '2'%>
$('#tags_show').html('<%= escape_javascript(render :partial => 'tags/tag_project_new_name',
:locals => {:obj => @obj,:non_list_all => false,:object_flag => @obj_flag}) %>');
$('#tags_name2').val("");
<% elsif @obj_flag == '6'%>
<%if @course%>
$("#tags_show-<%=@obj.class%>-<%=@obj.id%>").empty();

View File

@ -74,11 +74,11 @@
<% end %>
<br/><br/>
<% other_formats_links do |f| %>
<%= f.link_to 'PDF', :url => {:id => @page.title, :version => params[:version]} %>
<%= f.link_to 'HTML', :url => {:id => @page.title, :version => params[:version]} %>
<%= f.link_to 'TXT', :url => {:id => @page.title, :version => params[:version]} %>
<% end if User.current.allowed_to?(:export_wiki_pages, @project) %>
<%# other_formats_links do |f| %>
<%#= f.link_to 'PDF', :url => {:id => @page.title, :version => params[:version]} %>
<%#= f.link_to 'HTML', :url => {:id => @page.title, :version => params[:version]} %>
<%#= f.link_to 'TXT', :url => {:id => @page.title, :version => params[:version]} %>
<%# end if User.current.allowed_to?(:export_wiki_pages, @project) %>
<% content_for :sidebar do %>
<%= render :partial => 'sidebar' %>
<% end %>

View File

@ -491,3 +491,8 @@ function judgeprojectname(){
}
});
}
//用户反馈
function submitProjectFeedback() {
$("#project_feedback_form").submit();
}

View File

@ -31,7 +31,7 @@ a:hover.pr_join_a{ background:#41a8c8;}
/*左侧导航*/
.subNavBox{width:240px; background:#fff;margin:10px 10px 0 0;}
.subNav{border-bottom:solid 1px #e5e3da;cursor:pointer;font-weight:bold;font-size:14px;color:#3ca5c6; height:26px;padding-left:10px;background-color:#fff; padding-top:2px;}
.subNav{border-bottom:solid 1px #e5e3da;cursor:auto;font-weight:bold;font-size:14px;color:#3ca5c6; height:26px;padding-left:10px;background-color:#fff; padding-top:2px;}
.subNav_jiantou{background:url(../images/jiantou1.jpg) no-repeat;background-position:95% 50%; background-color:#fff;}
.subNav_jiantou:hover{color:#0781b4; }
.currentDd{color:#0781b4;}

View File

@ -74,7 +74,11 @@ a:hover.problem_pic{border:1px solid #64bdd9;}
.issues_icon{ background:url(../images/public_icon.png) 0 -342px no-repeat; width:16px; height:21px;}
.problem_txt{ width:600px; margin-left:10px; color:#777777; }
.pro_txt_w{width:610px;}
a.problem_name{ color:#ff5722; }
a.problem_name{ color:#ff5722;max-width: 80px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
a:hover.problem_name{ color:#d33503;}
a.problem_tit{ color:#0781b4; max-width:430px; font-weight:bold; display:block; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;}
a.problem_tit02{ color:#0781b4; font-weight:bold;max-width:400px;}
@ -690,9 +694,10 @@ table.list thead th
tr.changeset { height: 20px }
tr.changeset ul, ol { margin-top: 0px; margin-bottom: 0px; }
tr.changeset td.revision_graph { width: 15%; background-color: #fffffb; }
tr.changeset td.revision_graph { width: 1%; background-color: #fffffb; }
tr.changeset td.author { text-align: center; width: 15%; white-space:nowrap;}
tr.changeset td.committed_on { text-align: center; width: 15%; white-space:nowrap;}
tr.changeset td.comments { text-align: center; word-break:break-all; word-wrap: break-word;;}
div.changeset { padding: 4px;}
div.changeset { border-bottom: 1px solid #ddd; }

View File

@ -443,7 +443,6 @@ color: #000000;
width:auto;
/*float:center;*/
min-height:800px;
border: 1px solid #ffffff;
}
/*by huang*/
@ -1122,6 +1121,11 @@ a.root {
line-height: 1;
}
.courses{
margin:0px;
padding-left: 0em;
}
.project-table {
margin-left: auto;
margin-right: auto;