<%= l(:label_bidding_user_studentcode)%>:
diff --git a/app/views/layouts/mailer.html.erb b/app/views/layouts/mailer.html.erb
index abb896b61..c5be3f4fd 100644
--- a/app/views/layouts/mailer.html.erb
+++ b/app/views/layouts/mailer.html.erb
@@ -44,9 +44,7 @@ a:hover.mail_reply{ background:#06a9bc; text-decoration:none;}
<%= l(:mail_issue_greetings)%>
<%= yield %>
-
-
-
+
diff --git a/app/views/layouts/system_log.html.erb b/app/views/layouts/system_log.html.erb
new file mode 100644
index 000000000..ba1fe1ad1
--- /dev/null
+++ b/app/views/layouts/system_log.html.erb
@@ -0,0 +1,54 @@
+<%#
+# To change this template, choose Tools | Templates
+# and open the template in the editor.
+%>
+
+
+
+
+ System Log
+
+
+
+
+ <%= yield %>
+
+
\ No newline at end of file
diff --git a/app/views/mailer/_issue.html.erb b/app/views/mailer/_issue.html.erb
index 0ec585868..5145dbb2c 100644
--- a/app/views/mailer/_issue.html.erb
+++ b/app/views/mailer/_issue.html.erb
@@ -1,26 +1,29 @@
+
<%= link_to(h("#{@author.login}(#{@author.show_name})"), @issue_author_url , :style=>'color:#1b55a7; font-weight:bold;') %>
<%= l(:mail_issue_title_userin)%>
<%= link_to(h("#{@issue.project.name}"), @project_url, :style=>'color:#1b55a7; font-weight:bold;') %> <%= l(:mail_issue_title_active)%>
- <%= l(:mail_issue_subject)%> <%= link_to(issue.subject, issue_url, :style=>'color:#1b55a7; font-weight:bold;') %>
- <%= l(:mail_issue_sent_from)%> <%= issue.project.name %>| <%= l(:mail_issue_from_project)%>
- <%= l(:mail_issue_content)%>
+ <%= l(:mail_issue_subject)%> <%= link_to(issue.subject, issue_url, :style=>'color:#1b55a7; font-weight:bold;') %>
+ <%= l(:mail_issue_sent_from)%> <%= issue.project.name %>| <%= l(:mail_issue_from_project)%>
+ <%= l(:mail_issue_content)%>
+
<% if @journal.nil? %>
- <%= issue.description %>
+ <%= issue.description=='' ? l(:label_none) : issue.description %>
<% else %>
- <%= @journal.notes %>
+ <%= @journal.notes=='' ? l(:label_none) : @journal.notes %>
<% end%>
-
-
- <% unless @issue.attachments.nil? %>
- <%= l(:mail_issue_attachments)%>
+
+ <%= l(:mail_issue_attachments)%>
+ <% if @issue.attachments.count == 0 %>
+ <%= l(:label_none)%>
+ <% else %>
<% @issue.attachments.each do |attach| %>
<%= link_to_attachment(attach, :download => true, :token => @token.value, :only_path => false, :style=>'color:#1b55a7; font-weight:bold;')%>
diff --git a/app/views/mailer/issue_edit.html.erb b/app/views/mailer/issue_edit.html.erb
index f7412402c..35b963b41 100644
--- a/app/views/mailer/issue_edit.html.erb
+++ b/app/views/mailer/issue_edit.html.erb
@@ -1,10 +1,6 @@
-
- <%= l(:text_issue_updated, :id => "##{@issue.project_index}", :author => h(@journal.user)) %>
-
-
-
+
<%= render :partial => 'issue', :formats => [:html], :locals => { :issue => @issue, :issue_url => @issue_url } %>
diff --git a/app/views/mailer/news_comment_added.html.erb b/app/views/mailer/news_comment_added.html.erb
index 5ac95a571..3e0118849 100644
--- a/app/views/mailer/news_comment_added.html.erb
+++ b/app/views/mailer/news_comment_added.html.erb
@@ -24,7 +24,7 @@
<%= l(:mail_issue_content)%>
- <%= @news.description %>
+ <%= @comment.comments %>
diff --git a/app/views/members/create.js.erb b/app/views/members/create.js.erb
index 3b01980ad..35280b7a4 100644
--- a/app/views/members/create.js.erb
+++ b/app/views/members/create.js.erb
@@ -12,7 +12,11 @@ hideOnLoad();
$("#member-<%= member.id %>").effect("highlight");
<% end %>
<% else %>
- <% errors = @members.collect {|m| m.errors.full_messages}.flatten.uniq.join(', ') %>
- alert('<%= raw(escape_javascript(l(:notice_failed_to_save_members, :errors => errors))) %>');
+ <% if @members %>
+ <% errors = @members.collect {|m| m.errors.full_messages}.flatten.uniq.join(', ')%>
+ alert('<%= raw(escape_javascript(l(:notice_failed_to_save_members, :errors => errors || ''))) %>');
+ <% else%>
+// alert('');
+ <% end%>
<% end %>
<% end %>
diff --git a/app/views/memos/edit.html.erb b/app/views/memos/edit.html.erb
index 09e4262fe..008522316 100644
--- a/app/views/memos/edit.html.erb
+++ b/app/views/memos/edit.html.erb
@@ -1,5 +1,6 @@
<% @replying = !@memo.parent.nil? %>
+
<%=l(:label_memo_edit)%>
<%= labelled_form_for(@memo, :url => forum_memo_path(@memo.forum_id, @memo)) do |f| %>
<% if @memo.errors.any? %>
@@ -19,8 +20,12 @@
<% end %>
- <%= f.text_field :subject, :required => true, :size => 96 ,:readonly => @replying, :maxlength => 50%>
-
+ <% if @memo.parent.nil? && @memo.children.first.nil? %>
+ <%= f.text_field :subject, :required => true, :size => 96 ,:readonly => false, :maxlength => 50%>
+ <% else %>
+ <%= f.text_field :subject, :required => true, :size => 96 ,:readonly => true, :style => "border: 1px solid gray", :maxlength => 50%>
+ <% end %>
+
<% if User.current.admin?%>
<% unless @replying %>
diff --git a/app/views/news/_form.html.erb b/app/views/news/_form.html.erb
index f76aaad88..5e5cdf532 100644
--- a/app/views/news/_form.html.erb
+++ b/app/views/news/_form.html.erb
@@ -3,12 +3,25 @@
<%= @project ? l(:label_news_new) : l(:bale_news_notice) %>
-
<%= f.text_field :title, :required => true, :size => 60, :style => "width:488px;", :onkeyup => "regexTitle();" %>
-
(60个字符以内)
+
+ <%= f.text_field :title, :required => true, :size => 60, :style => "width:488px;", :onkeyup => "regexTitle();" %>
+
+
+ (60个字符以内)
+
-
<%= f.text_area :description, :required => true, :cols => 60, :rows => 11, :class => 'wiki-edit', :style => "width:490px;", :onkeyup => "regexDescription();" %>
-
-
<%= l(:label_attachment_plural) %> <%= render :partial => 'attachments/form', :locals => {:container => @news} %>
+
+ <%= f.text_area :description, :required => true, :cols => 60, :rows => 11, :class => 'wiki-edit', :style => "width:490px;", :onkeyup => "regexDescription();" %>
+
+
+
+
+
+
+ <%= l(:label_attachment_plural) %>
+
+ <%= render :partial => 'attachments/form', :locals => {:container => @news} %>
+
<%= wikitoolbar_for 'news_description' %>
diff --git a/app/views/news/_project_news.html.erb b/app/views/news/_project_news.html.erb
index 79217f1fe..b18c2abd8 100644
--- a/app/views/news/_project_news.html.erb
+++ b/app/views/news/_project_news.html.erb
@@ -82,11 +82,11 @@
:html => {:id => 'news-form', :multipart => true} do |f| %>
<%= render :partial => 'news/form', :locals => {:f => f} %>
<%#= submit_tag l(:button_create), :class => 'whiteButton m3p10 h30', :name => nil %>
- <%= link_to l(:button_create), "#", :onclick => 'submitNews();',:onmouseover => 'submitFocus(this);', :class => 'whiteButton m3p10' %>
- |
+ <%= link_to l(:button_create), "#", :onclick => 'submitNews();',:onmouseover => 'submitFocus(this);', :class => 'ButtonColor m3p10' %>
+
<%#= preview_link preview_news_path(:project_id => @project), 'news-form', target='preview', {:class => 'whiteButton m3p10'} %>
- <%= link_to l(:button_cancel), "#", :onclick => '$("#add-news").hide()', :class => 'whiteButton m3p10' %>
+ <%= link_to l(:button_cancel), "#", :onclick => '$("#add-news").hide()', :class => 'ButtonColor m3p10' %>
<% end if @project %>
diff --git a/app/views/originizations/index.html.erb b/app/views/originizations/index.html.erb
new file mode 100644
index 000000000..7e31a2e75
--- /dev/null
+++ b/app/views/originizations/index.html.erb
@@ -0,0 +1,25 @@
+
+
+ <%= link_to l(:label_all_enterprises) %>
+
+
+ <% if @enterprises.count == 0 %>
+
<%= l(:label_enterprise_nil) %>
+ <% else %>
+ <% @enterprises.each do |enterprise| %>
+ <% unless enterprise.enterprise_name.blank? %>
+
+
+ <%= link_to enterprise.enterprise_name, home_path(:originization => enterprise.enterprise_name) %>
+
+
+ <% end %>
+ <% end %>
+ <% end %>
+
+
+
+
+<% html_title(l(:label_enterprise_all)) -%>
diff --git a/app/views/poll/_edit_MC.html.erb b/app/views/poll/_edit_MC.html.erb
index 066eafe0d..19a1e1e89 100644
--- a/app/views/poll/_edit_MC.html.erb
+++ b/app/views/poll/_edit_MC.html.erb
@@ -39,8 +39,12 @@
diff --git a/app/views/poll/_edit_MCQ.html.erb b/app/views/poll/_edit_MCQ.html.erb
index 129f50e94..508835d7d 100644
--- a/app/views/poll/_edit_MCQ.html.erb
+++ b/app/views/poll/_edit_MCQ.html.erb
@@ -36,8 +36,12 @@
diff --git a/app/views/poll/_edit_head.html.erb b/app/views/poll/_edit_head.html.erb
index ed90a5ef8..dfa5b5cfc 100644
--- a/app/views/poll/_edit_head.html.erb
+++ b/app/views/poll/_edit_head.html.erb
@@ -7,8 +7,12 @@
diff --git a/app/views/poll/_edit_mulit.html.erb b/app/views/poll/_edit_mulit.html.erb
index d498169f4..f3f121784 100644
--- a/app/views/poll/_edit_mulit.html.erb
+++ b/app/views/poll/_edit_mulit.html.erb
@@ -20,8 +20,12 @@
diff --git a/app/views/poll/_edit_single.html.erb b/app/views/poll/_edit_single.html.erb
index 2c2d41e0f..eadf5b00d 100644
--- a/app/views/poll/_edit_single.html.erb
+++ b/app/views/poll/_edit_single.html.erb
@@ -16,8 +16,12 @@
必答
diff --git a/app/views/poll/_new_MC.html.erb b/app/views/poll/_new_MC.html.erb
index a7f9e441b..b4624bbb5 100644
--- a/app/views/poll/_new_MC.html.erb
+++ b/app/views/poll/_new_MC.html.erb
@@ -34,8 +34,12 @@
diff --git a/app/views/poll/_new_MCQ.html.erb b/app/views/poll/_new_MCQ.html.erb
index 027a1c1f6..9cf6170c0 100644
--- a/app/views/poll/_new_MCQ.html.erb
+++ b/app/views/poll/_new_MCQ.html.erb
@@ -33,8 +33,12 @@
diff --git a/app/views/poll/_new_mulit.html.erb b/app/views/poll/_new_mulit.html.erb
index 02f7a71a7..48122bad0 100644
--- a/app/views/poll/_new_mulit.html.erb
+++ b/app/views/poll/_new_mulit.html.erb
@@ -13,8 +13,12 @@
diff --git a/app/views/poll/_new_single.html.erb b/app/views/poll/_new_single.html.erb
index ffc525546..f2137b348 100644
--- a/app/views/poll/_new_single.html.erb
+++ b/app/views/poll/_new_single.html.erb
@@ -8,8 +8,12 @@
必答
diff --git a/app/views/poll/_poll.html.erb b/app/views/poll/_poll.html.erb
index 1bf6b3716..644b678b8 100644
--- a/app/views/poll/_poll.html.erb
+++ b/app/views/poll/_poll.html.erb
@@ -22,47 +22,70 @@
<% end %>
<%if @is_teacher%>
- <% if poll.polls_status == 1 %>
+ <% if poll.polls_status == 1%>
统计结果
- <% elsif poll.polls_status == 2%>
+ <% elsif poll.polls_status == 2 || poll.polls_status == 3 %>
<%= link_to l(:label_statistical_results), statistics_result_poll_path(poll.id), :class => "pollsbtn fl ml10"%>
<% end%>
<% end%>
-
- <%if @is_teacher %>
+
+<%if @is_teacher %>
<% if poll.polls_status == 1 %>
- 发布问卷
+
+
+ 发布问卷
+
+
<% elsif poll.polls_status == 2%>
- 取消发布
+
+
+ 取消发布
+
+
+ <% else%>
+
+ 发布问卷
+
<% end%>
- <% end%>
-
+<% end%>
+
<% if @is_teacher %>
<%= link_to(l(:button_delete), poll,
- method: :delete, :confirm => l(:text_are_you_sure), :remote => true, :class => "polls_de fr ml20 mr10") %>
+ method: :delete, :confirm => l(:text_are_you_sure), :remote => true, :class => "polls_de fr ml15 mr10") %>
<% end%>
-
- <% if @is_teacher%>
- <% if poll.polls_status == 1 %>
- <%= link_to l(:button_edit), edit_poll_path(poll.id), :class => "polls_de fr ml20"%>
- <% elsif poll.polls_status == 2%>
- 编辑
- <% end%>
+
+<% if @is_teacher%>
+ <% if poll.polls_status == 1 %>
+
+ <%= link_to l(:button_edit), edit_poll_path(poll.id), :class => "polls_de fr ml15"%>
+
+ <% else%>
+
+ 编辑
+
<% end%>
-
-
-
-
-
-
-
-
+<% end%>
+
+<% if @is_teacher%>
+ <% if poll.polls_status == 2 %>
+
+ 关闭
+
+ <% else %>
+
+ 关闭
+
+ <% end%>
+
+<% end %>
+
+
<%= format_time poll.created_at%>
\ No newline at end of file
diff --git a/app/views/poll/_poll_form.html.erb b/app/views/poll/_poll_form.html.erb
index 1d0dee837..658d8a9b7 100644
--- a/app/views/poll/_poll_form.html.erb
+++ b/app/views/poll/_poll_form.html.erb
@@ -23,6 +23,20 @@
$("#new_poll_question").html("<%= escape_javascript(render :partial => 'new_mulit') %>");
$("#poll_questions_title").focus();
}
+
+ //添加标题时确定按钮
+ function add_poll_question(doc)
+ {
+ var title = $.trim($("#poll_questions_title").val());
+ if(title.length == 0){alert("标题不能为空");}else{doc.parent().parent().parent().submit();}
+ }
+ //修改标题时确定按钮
+ function edit_poll_question(doc,id)
+ {
+ var title = $.trim($("#poll_questions_title_" + id).val());
+ if(title.length == 0){alert("标题不能为空");}else{doc.parent().parent().parent().submit();}
+ }
+
//问卷头
function pollsCancel(){$("#polls_head_edit").hide();$("#polls_head_show").show();}
function pollsSubmit(doc){
@@ -69,7 +83,7 @@
else{
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'poll_submit', locals: { :poll => @poll,:is_remote => false}) %>');
showModal('ajax-modal', '310px');
- $('#ajax-modal').css('height','115px');
+ $('#ajax-modal').css('height','120px');
$('#ajax-modal').siblings().remove();
$('#ajax-modal').before("" +
" ");
diff --git a/app/views/poll/_poll_list.html.erb b/app/views/poll/_poll_list.html.erb
new file mode 100644
index 000000000..f57a4a5ff
--- /dev/null
+++ b/app/views/poll/_poll_list.html.erb
@@ -0,0 +1,22 @@
+
+
所有问卷
+ (<%= @obj_count%>)
+
+ <% if @is_teacher%>
+ <%= link_to l(:label_new_poll), new_poll_path(:polls_type => "Course",:polls_group_id => @course.id), :class => "newbtn" %>
+ <% end%>
+
+
+
+ <% @polls.each do |poll|%>
+
+ <%= render :partial => 'poll', :locals => {:poll => poll} %>
+
+
+ <% end%>
+
+
+ <%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%>
+
+
+
\ No newline at end of file
diff --git a/app/views/poll/close_poll.js.erb b/app/views/poll/close_poll.js.erb
new file mode 100644
index 000000000..222ea7976
--- /dev/null
+++ b/app/views/poll/close_poll.js.erb
@@ -0,0 +1,2 @@
+$("#polls_<%= @poll.id %>").html("<%= escape_javascript(render :partial => 'poll',:locals => {:poll => @poll}) %>");
+alert("关闭成功");
\ No newline at end of file
diff --git a/app/views/poll/destroy.js.erb b/app/views/poll/destroy.js.erb
index cf94b5661..8bb67f20a 100644
--- a/app/views/poll/destroy.js.erb
+++ b/app/views/poll/destroy.js.erb
@@ -1,4 +1 @@
-<% if @poll%>
- $("#polls_<%= @poll.id%>").remove();
-<%else%>
-<% end %>
\ No newline at end of file
+$("#polls").html("<%= escape_javascript(render :partial => 'poll_list') %>");
\ No newline at end of file
diff --git a/app/views/poll/index.html.erb b/app/views/poll/index.html.erb
index 3962768da..0b780aa9e 100644
--- a/app/views/poll/index.html.erb
+++ b/app/views/poll/index.html.erb
@@ -15,7 +15,7 @@
"" +
"");
showModal('ajax-modal', '310px');
- $('#ajax-modal').css('height','115px');
+ $('#ajax-modal').css('height','120px');
$('#ajax-modal').siblings().remove();
$('#ajax-modal').before("" +
" ");
@@ -47,7 +47,7 @@
"" +
"");
showModal('ajax-modal', '310px');
- $('#ajax-modal').css('height','115px');
+ $('#ajax-modal').css('height','120px');
$('#ajax-modal').siblings().remove();
$('#ajax-modal').before("" +
" ");
@@ -56,29 +56,31 @@
$('#ajax-modal').parent().addClass("popbox_polls");
}
}
+
+ function close_poll(poll_id)
+ {
+ $('#ajax-modal').html("" +
+ "
" +
+ "
" +
+ "
问卷关闭后学生将不能继续提交问卷, 是否确定关闭该问卷?
" +
+ "
" +
+ "
" +
+ "
" +
+ "
" +
+ "
");
+ showModal('ajax-modal', '310px');
+ $('#ajax-modal').css('height','120px');
+ $('#ajax-modal').siblings().remove();
+ $('#ajax-modal').before("" +
+ " ");
+ $('#ajax-modal').parent().removeClass("alert_praise");
+ $('#ajax-modal').parent().css("top","").css("left","");
+ $('#ajax-modal').parent().addClass("popbox_polls");
+ }
-
-
所有问卷
- (<%= @obj_count%>)
-
- <% if @is_teacher%>
- <%= link_to l(:label_new_poll), new_poll_path(:polls_type => "Course",:polls_group_id => @course.id), :class => "newbtn" %>
- <% end%>
-
-
-
- <% @polls.each do |poll|%>
-
- <%= render :partial => 'poll', :locals => {:poll => poll} %>
-
-
- <% end%>
-
-
- <%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%>
-
-
-
-
+ <%= render :partial => 'poll_list'%>
\ No newline at end of file
diff --git a/app/views/projects/_form.html.erb b/app/views/projects/_form.html.erb
index 512c2df82..636aadf43 100644
--- a/app/views/projects/_form.html.erb
+++ b/app/views/projects/_form.html.erb
@@ -8,7 +8,7 @@
<%= f.text_area :description, :rows => 8, :class => 'wiki-edit', :style => "font-size:small;width:490px;margin-left:10px;" %>
-
+<%= f.text_field :enterprise_name, :size => 60, :style => "width:490px;" %>
<%= f.text_field :identifier, :required => true, :size => 60, :style => "width:488px;", :disabled => @project.identifier_frozen?, :maxlength => Project::IDENTIFIER_MAX_LENGTH,
value:"#{User.current.id.to_s + '_' +Time.now.to_s.gsub(' ','_').gsub(':','').gsub('+','')}" %>
<% unless @project.identifier_frozen? %>
diff --git a/app/views/projects/_join_project.html.erb b/app/views/projects/_join_project.html.erb
index c7ce29dae..fdc60904d 100644
--- a/app/views/projects/_join_project.html.erb
+++ b/app/views/projects/_join_project.html.erb
@@ -1,4 +1,3 @@
-
@@ -34,7 +33,7 @@
{
hideModal(obj);
$("#new-watcher-form").submit();
- alert("申请成功");
+// alert("申请成功");
}
function hidden_join_course_form()
@@ -60,6 +59,7 @@
项 目 ID:
+
@@ -67,7 +67,7 @@
项目ID是所在项目网址中显示的序号
- <%= l(:label_new_join) %>
+ <%= l(:label_apply_project) %>
<%= l(:button_cancel)%>
diff --git a/app/views/projects/search.html.erb b/app/views/projects/search.html.erb
index 7a91082ca..5a44b3579 100644
--- a/app/views/projects/search.html.erb
+++ b/app/views/projects/search.html.erb
@@ -4,7 +4,7 @@
<%= auto_discovery_link_tag(:atom, {:action => 'index', :format => 'atom', :key => User.current.rss_key}) %>
<% end %>
- <%= form_tag(projects_search_path, :method => :get) do %>
+ <%= form_tag(projects_search_path, :method => :get, :id => "project_search_form") do %>
<% if params[:project_type] == "1" %>
@@ -33,24 +33,63 @@
<% else %>
- <%= l(:label_project_deposit) %>
- <%= l(:label_user_location) %> :
+
+ <%= l(:label_project_deposit) %>
+
+
+ <%= l(:label_user_location) %> :
+
- <% if User.current.logged? %>
- <%= link_to(l(:label_project_new), {:controller => 'projects', :action => 'new', :course => 0, :project_type => @project_type}, :class => 'icon icon-add') if User.current.allowed_to?(:add_project, nil, :global => true) %>
- <% end %>
+ <% if User.current.logged? %>
+ <%= link_to(l(:label_project_new), {:controller => 'projects', :action => 'new', :course => 0, :project_type => @project_type}, :class => 'icon icon-add') if User.current.allowed_to?(:add_project, nil, :global => true) %>
+ <% end %>
-
-
- <%= text_field_tag 'name', params[:name], :size => 30 %>
- <%= hidden_field_tag 'project_type', params[:project_type] %>
- <%= submit_tag l(:label_search), :class => "enterprise", :name => nil %>
-
+
+
+
+ <%= text_field_tag 'name', params[:name], :size => 20, :onkeyup => "regexName();", :style => "float:left" %>
+ <%= hidden_field_tag 'project_type', params[:project_type] %>
+ <%#= submit_tag l(:label_search), :class => "enterprise", :name => nil %>
+
+ <%= l(:label_search)%>
+
+
+
+
- <%= link_to request.host()+"/projects", :controller => 'projects', :action => 'index', :project_type => 0 %>
- <%=link_to l(:field_homepage), home_path %> > <%=link_to l(:label_project_deposit), :controller => 'projects', :action => 'index', :project_type => 0 %>
+
+
+ <%= link_to request.host()+"/projects", :controller => 'projects', :action => 'index', :project_type => 0 %>
+
+
+
+ <%=link_to l(:field_homepage), home_path %> >
+ <%=link_to l(:label_project_deposit), :controller => 'projects', :action => 'index', :project_type => 0 %>
+
<% end %>
@@ -67,7 +106,7 @@
diff --git a/app/views/projects/settings/_members.html.erb b/app/views/projects/settings/_members.html.erb
index 25f02da0d..9c9c64bd1 100644
--- a/app/views/projects/settings/_members.html.erb
+++ b/app/views/projects/settings/_members.html.erb
@@ -14,8 +14,12 @@
- <%= l(:label_user) %>
- <%= l(:label_role_plural) %>
+
+ <%= l(:label_user) %>
+
+
+ <%= l(:label_role_plural) %>
+
<%= call_hook(:view_projects_settings_members_table_header, :project => @project) %>
@@ -24,26 +28,30 @@
<% members.each do |member| %>
<% next if member.new_record? %>
- <%= link_to_user member.principal %>
+
+ <%= link_to_user member.principal %>
+
-
- <%= h member.roles.sort.collect(&:to_s).join(', ') %>
-
+
+ <%= h member.roles.sort.collect(&:to_s).join(', ') %>
+
<%= form_for(member, {:as => :membership, :remote => true, :url => membership_path(member),
:method => :put,
:html => {:id => "member-#{member.id}-roles-form", :class => 'hol'}}
) do |f| %>
-
<% roles.each do |role| %>
<%= check_box_tag 'membership[role_ids][]', role.id, member.roles.include?(role),
:disabled => member.member_roles.detect { |mr| mr.role_id == role.id && !mr.inherited_from.nil? } %> <%= h role %>
- <% end %>
+ <% end %>
+
<%= hidden_field_tag 'membership[role_ids][]', '' %>
- <%= submit_tag l(:button_change), :class => "small" %>
+
+ <%= submit_tag l(:button_change), :class => "small" %>
<%= link_to_function l(:button_cancel),
"$('#member-#{member.id}-roles').show(); $('#member-#{member.id}-roles-form').hide(); return false;"
- %>
+ %>
+
<% end %>
@@ -77,7 +85,9 @@
<% else %>
- <%= l(:label_no_data) %>
+
+ <%= l(:label_no_data) %>
+
<% end %>
@@ -87,20 +97,25 @@
<%= form_for(@applied_members, {:as => :membership, :url => project_memberships_path(@project), :remote => true, :method => :post}) do |f| %>
- <%= l(:label_apply_project) %>
-
+
+ <%= l(:label_apply_project) %>
+
<%= render_principals_for_applied_members(@project) %>
- <%= l(:label_role_plural) %>:
+
+ <%= l(:label_role_plural) %>:
<% roles.each do |role| %>
-
- <%= check_box_tag 'membership[role_ids][]', role.id %> <%= h role %>
- <% end %>
-
- <%= submit_tag l(:label_approve), :id => 'member-add-submit' %>
+
+ <%= check_box_tag 'membership[role_ids][]', role.id %>
+ <%= h role %>
+
+ <% end %>
+
+
+ <%= submit_tag l(:label_approve), :id => 'member-add-submit' %>
<%= submit_tag l(:label_refusal), :name => "refusal_button", :id => 'member-refusal-submit' %>
@@ -110,9 +125,13 @@
<%= form_for(@member, {:as => :membership, :url => project_memberships_path(@project), :remote => true, :method => :post}) do |f| %>
- <%= l(:label_member_new) %>
-
- <%= label_tag "principal_search", l(:label_principal_search) %><%= text_field_tag 'principal_search', nil %>
+
+ <%= l(:label_member_new) %>
+
+
+ <%= label_tag "principal_search", l(:label_principal_search) %>
+ <%= text_field_tag 'principal_search', nil %>
+
<%= javascript_tag "observeSearchfield('principal_search', null, '#{ escape_javascript autocomplete_project_memberships_path(@project, :format => 'js') }')" %>
@@ -120,13 +139,18 @@
- <%= l(:label_role_plural) %>:
+
+ <%= l(:label_role_plural) %>:
<% roles.each do |role| %>
-
- <%= check_box_tag 'membership[role_ids][]', role.id %> <%= h role %>
- <% end %>
-
- <%= submit_tag l(:button_add), :id => 'member-add-submit' %>
+
+ <%= check_box_tag 'membership[role_ids][]', role.id %>
+ <%= h role %>
+
+ <% end %>
+
+
+ <%= submit_tag l(:button_add), :id => 'member-add-submit' %>
+
<% end %>
<% end %>
diff --git a/app/views/system_log/access_analysis.html.erb b/app/views/system_log/access_analysis.html.erb
new file mode 100644
index 000000000..371c2bc33
--- /dev/null
+++ b/app/views/system_log/access_analysis.html.erb
@@ -0,0 +1,49 @@
+<% @nav_dispaly_home_path_label = 1
+ @nav_dispaly_main_course_label = 1
+ @nav_dispaly_main_project_label = 1
+ @nav_dispaly_main_contest_label = 1 %>
+<% @nav_dispaly_forum_label = 1%>
+
+
+
+
+
+ <%= l(:label_log_access_analysis)%>
+ <%= l(:label_log_access_controller_action)%>
+ <%= l(:label_log_access_count)%>
+ <% unless @access_module.nil? %>
+<% @access_module.each do |k, v| %>
+ <% unless k.blank? %>
+ <%= raw k %>
+ <%= raw v %>
+ <% end %>
+<%end %>
+ <%end %>
+
diff --git a/app/views/system_log/index.html.erb b/app/views/system_log/index.html.erb
new file mode 100644
index 000000000..041fecb0c
--- /dev/null
+++ b/app/views/system_log/index.html.erb
@@ -0,0 +1,58 @@
+<% @nav_dispaly_home_path_label = 1
+ @nav_dispaly_main_course_label = 1
+ @nav_dispaly_main_project_label = 1
+ @nav_dispaly_main_contest_label = 1 %>
+<% @nav_dispaly_forum_label = 1%>
+
+
+
+
+<%= paginate @logs unless @logs.empty? %>
+
+ <% unless @logs.empty? %>
+
+ <%=l(:label_log_detail)%>
+<% @logs.each do |log| %>
+ <% unless log.blank? %>
+ <%= raw log %>
+ <% end %>
+<%end %>
+
+ <%end %>
+<%= paginate @logs unless @logs.empty? %>
+
\ No newline at end of file
diff --git a/app/views/system_log/time_analysis.html.erb b/app/views/system_log/time_analysis.html.erb
new file mode 100644
index 000000000..96c207b07
--- /dev/null
+++ b/app/views/system_log/time_analysis.html.erb
@@ -0,0 +1,63 @@
+<% @nav_dispaly_home_path_label = 1
+ @nav_dispaly_main_course_label = 1
+ @nav_dispaly_main_project_label = 1
+ @nav_dispaly_main_contest_label = 1 %>
+<% @nav_dispaly_forum_label = 1%>
+
+
+
+<%= paginate @log_result unless @log_result.empty? %>
+
+ <%= l(:label_log_time_analysis) %>
+ <%= l(:label_log_url) %>
+ <%= l(:label_log_ip) %>
+ <%= l(:label_log_access_time) %>
+ <%= l(:label_log_access_controller_action) %>
+ <%= l(:label_log_response_time) %>
+ <%= l(:label_log_views_time) %>
+ <%= l(:label_log_views_time_percent) %>
+ <%= l(:label_log_active_record_time) %>
+ <%= l(:label_log_active_record_time_percent) %>
+ <% unless @log_result.nil? %>
+<% @log_result.each do |r| %>
+ <% unless r.blank? %>
+
+ <%= raw r[0].length>50?r[0].truncate(20) : r[0] unless r[0].nil? %>
+ <%= raw r[1] %>
+ <%= raw r[2] %>
+ <%= raw r[3] %>
+ <%= raw r[4] %>
+ <%= raw r[5] %>
+ <%= raw r[6] %>
+ <%= raw r[7] %>
+ <%= raw r[8] %>
+ <% end %>
+<%end %>
+ <%end %>
+
+<%= paginate @log_result unless @log_result.empty? %>
\ No newline at end of file
diff --git a/app/views/welcome/_hot_projects_list.html.erb b/app/views/welcome/_hot_projects_list.html.erb
new file mode 100644
index 000000000..9b941f420
--- /dev/null
+++ b/app/views/welcome/_hot_projects_list.html.erb
@@ -0,0 +1,23 @@
+
+
+ <%= image_tag(get_project_avatar(project), :class => "avatar-4") %>
+
+
+
+ <% unless project.is_public %>
+ <%= l(:label_private) %>
+ <% end %>
+ <%= link_to( project.name, project_path(project.id), :class => "d-g-blue d-p-project-name",:title => "#{project.name}" )%>
+ (<%= link_to "#{projectCount(project)}人", project_member_path(project) ,:course =>'0' %>)
+
+
+ <%=project.description.truncate(90, omission: '...')%>
+
+
+ <%= content_tag "span", l(:label_project_score)+ ":" + red_project_scores(project).to_i.to_s,
+ :style => "cursor: pointer; display: inline-block; float: right; color: #ec6300;",
+ :title => "项目得分,综合考虑了项目的各项活动,反映了该项目的活跃程度",
+ :class => "tooltip",
+ :id => "tooltip-#{project.id}" %>
+
+
\ No newline at end of file
diff --git a/app/views/welcome/_no_course_title.html.erb b/app/views/welcome/_no_course_title.html.erb
index f16b91dba..3b3849e4e 100644
--- a/app/views/welcome/_no_course_title.html.erb
+++ b/app/views/welcome/_no_course_title.html.erb
@@ -1,5 +1,5 @@
- <%= course_title%>
+ <%= course_title %>
\ No newline at end of file
diff --git a/app/views/welcome/_search_course.html.erb b/app/views/welcome/_search_course.html.erb
index 895f696fb..79088a757 100644
--- a/app/views/welcome/_search_course.html.erb
+++ b/app/views/welcome/_search_course.html.erb
@@ -1,8 +1,8 @@
<%
select_option = []
- (select_option << ['项目', 'projects']) if project_type == Project::ProjectType_project
- (select_option << ['课程', 'courses']) if project_type == Project::ProjectType_course
- select_option << ['用户', 'users']
+ (select_option << [l(:label_select_project), 'projects']) if project_type == Project::ProjectType_project
+ (select_option << [l(:label_select_course), 'courses']) if project_type == Project::ProjectType_course
+ select_option << [l(:label_select_user), 'users']
#select_option << ['教师', 'users_teacher'],
#select_option << ['学生', 'users_student']
%>
@@ -49,7 +49,7 @@ form #search_type{
<%= form_tag({controller: :welcome, action: :search }, method: :get) do %>
- <%= text_field_tag :q, nil, placeholder:'请输入要搜索的关键字', :size => 27, style: "float:left" %>
+ <%= text_field_tag :q, nil, :placeholder => l(:label_search_information), :size => 27, style: "float:left" %>
<%= select_tag(:search_type, options_for_select(select_option), :style => "float:right" ) %>
<%#= hidden_field_tag 'project_type', project_type %>
diff --git a/app/views/welcome/_search_project.html.erb b/app/views/welcome/_search_project.html.erb
index 6a77861b9..6a92a594b 100644
--- a/app/views/welcome/_search_project.html.erb
+++ b/app/views/welcome/_search_project.html.erb
@@ -1,8 +1,8 @@
<%
select_option = []
- (select_option << ['项目', 'projects']) if project_type == Project::ProjectType_project
- (select_option << ['课程', 'courses']) if project_type == Project::ProjectType_course
- select_option << ['用户', 'users']
+ (select_option << [l(:label_select_project), 'projects']) if project_type == Project::ProjectType_project
+ (select_option << [l(:label_select_course), 'courses']) if project_type == Project::ProjectType_course
+ select_option << [l(:label_select_user), 'users']
%>
";
+
+ var now;
+ if (typeof(arguments[0])=="string"){
+ selectDate = arguments[0].split("-");
+ var year = selectDate[0];
+ var month = parseInt(selectDate[1])-1+"";
+ var date = selectDate[2];
+ now = new Date(year,month,date);
+ }else if (typeof(arguments[0])=="object"){
+ now = arguments[0];
+ }
+ var lastMonthEndDate = HS_DateAdd("d","-1",now.getFullYear()+"-"+now.getMonth()+"-01").getDate();
+ var lastMonthDate = WeekDay(now.getFullYear()+"-"+now.getMonth()+"-01");
+ var thisMonthLastDate = HS_DateAdd("d","-1",now.getFullYear()+"-"+(parseInt(now.getMonth())+1).toString()+"-01");
+ var thisMonthEndDate = thisMonthLastDate.getDate();
+ var thisMonthEndDay = thisMonthLastDate.getDay();
+ var todayObj = new Date();
+ today = todayObj.getFullYear()+"-"+todayObj.getMonth()+"-"+todayObj.getDate();
+
+ for (i=0; i
" + lis;
+ lastMonthEndDate--;
+ }
+ for (i=1; i<=thisMonthEndDate; i++){ // Current Month's Date
+
+ if(today == now.getFullYear()+"-"+now.getMonth()+"-"+i){
+ var todayString = now.getFullYear()+"-"+(parseInt(now.getMonth())+1).toString()+"-"+i;
+ lis += ""+i+" ";
+ }else{
+ lis += ""+i+" ";
+ }
+
+ }
+ var j=1;
+ for (i=thisMonthEndDay; i<6; i++){ // Next Month's Date
+ lis += ""+j+" ";
+ j++;
+ }
+ lis += style;
+
+ var CalenderTitle = "» ";
+ CalenderTitle += "« ";
+ CalenderTitle += ""+now.getFullYear()+" 年"+(parseInt(now.getMonth())+1).toString()+" 月";
+
+ if (arguments.length>1){
+ arguments[1].parentNode.parentNode.getElementsByTagName("ul")[1].innerHTML = lis;
+ arguments[1].parentNode.innerHTML = CalenderTitle;
+
+ }else{
+ var CalenderBox = style+"";
+ return CalenderBox;
+ }
+}
+function _selectThisDay(d){
+ var boxObj = d.parentNode.parentNode.parentNode.parentNode.parentNode;
+ boxObj.targetObj.value = d.title;
+ boxObj.parentNode.removeChild(boxObj);
+}
+function closeCalender(d){
+ var boxObj = d.parentNode.parentNode.parentNode;
+ boxObj.parentNode.removeChild(boxObj);
+}
+
+function CalenderselectYear(obj){
+ var opt = "";
+ var thisYear = obj.innerHTML;
+ for (i=1970; i<=2020; i++){
+ if (i==thisYear){
+ opt += ""+i+" ";
+ }else{
+ opt += ""+i+" ";
+ }
+ }
+ opt = ""+opt+" ";
+ obj.parentNode.innerHTML = opt;
+}
+
+function selectThisYear(obj){
+ HS_calender(obj.value+"-"+obj.parentNode.parentNode.getElementsByTagName("span")[1].getElementsByTagName("a")[0].innerHTML+"-1",obj.parentNode);
+}
+
+function CalenderselectMonth(obj){
+ var opt = "";
+ var thisMonth = obj.innerHTML;
+ for (i=1; i<=12; i++){
+ if (i==thisMonth){
+ opt += ""+i+" ";
+ }else{
+ opt += ""+i+" ";
+ }
+ }
+ opt = ""+opt+" ";
+ obj.parentNode.innerHTML = opt;
+}
+function selectThisMonth(obj){
+ HS_calender(obj.parentNode.parentNode.getElementsByTagName("span")[0].getElementsByTagName("a")[0].innerHTML+"-"+obj.value+"-1",obj.parentNode);
+}
+function HS_setDate(inputObj){
+ var calenderObj = document.createElement("span");
+ calenderObj.innerHTML = HS_calender(new Date());
+ calenderObj.style.position = "absolute";
+ calenderObj.targetObj = inputObj;
+ inputObj.parentNode.insertBefore(calenderObj,inputObj.nextSibling);
+}
+//lizanle 刷新函数
+function redo() {
+ window.location.reload()
+}
diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css
index 54e2a17aa..fb2b451fa 100644
--- a/public/stylesheets/application.css
+++ b/public/stylesheets/application.css
@@ -9,6 +9,9 @@ h4, .wiki h3 {font-size: 13px;}
h4 {border-bottom: 1px dotted #bbb;}
/*huang*/
/*current position*/
+.enterprise_all{
+ padding-left: 20px;
+}
.course_ad{
position:absolute;
visibility:visible;
@@ -2916,4 +2919,35 @@ input[class~='m3p10'], .m3p10 {
height: 20px;
display: inline-block;
color: #ffffff;
+ cursor:pointer;
+}
+
+/*lizanle 日誌搜索結果樣式*/
+.search_results {
+ color: red;
+}
+/*lizanle 分页样式*/
+.pagination ul li a, .pagination ul li span{
+ background-color: #FFFFFF;
+ border-color: #DDDDDD;
+ border-image: none;
+ border-style: solid;
+ border-width: 1px 1px 1px 1px;
+ float: left;
+ line-height: 20px;
+ padding: 4px 12px;
+ text-decoration: none;
+}
+.pagination ul a {
+ color: #9B9B9B;
+}
+.pagination ul li a:hover, .pagination ul li a:focus, .pagination ul .active a, .pagination ul .active span{
+ background-color: #ffc02f;
+ border: 1px solid #ffc02f;
+}
+.pagination ul li{
+ float: left;
+ margin-right: 3px;
+ list-style: none outside none;
+
}
\ No newline at end of file
diff --git a/public/stylesheets/css.css b/public/stylesheets/css.css
index 444d0d383..ffb9da644 100644
--- a/public/stylesheets/css.css
+++ b/public/stylesheets/css.css
@@ -1,5 +1,6 @@
/* CSS Document */
-body{ font-size:12px !important; font-family:"微软雅黑","宋体" !important; line-height:1.9; background:#fff; font-style:normal;}
+#content{ font-size:12px !important; font-family:"微软雅黑","宋体" !important; line-height:1.9; background:#fff; font-style:normal;}
+#popbox{ font-size:12px !important; font-family:"微软雅黑","宋体" !important; line-height:1.9; background:#fff; font-style:normal;}
div,html,img,ul,li,p,body,h1,h2,h3,h4,p,a,table,tr,td,fieldset,input,span,textarea{ margin:0; padding:0;}
div,img,tr,td,textarea{ border:0;}
table,tr,td{border:0; cellspacing:0; cellpadding:0;}
@@ -79,7 +80,7 @@ a.wzan_visited{background:url(images/pic_zan.png) 0 0 no-repeat;}
.ping_con h2{ font-size:14px; color:#444443; margin-bottom:10px; }
.ping_con p{ color:#777777; font-size:12px; border-bottom:1px dashed #CCC; padding-bottom:5px;}
.ping_con p span a{ color:#777777;}
-.ping_star{ width:160px; color:#333; font-weight:bold; margin-bottom:5px;}
+.ping_star{ width:165px; color:#333; font-weight:bold; margin-bottom:5px;}
.ping_star span a{ float:right; width:20px; height:20px; background:url(images/star.png);background-repeat: no-repeat; margin-right:3px;}
.ping_con textarea{ height:76px; border:1px solid #15bccf; margin-bottom:5px; color:#666; font-size:12px;}
a.ping_sub{ float:right; height:22px; width:60px; margin-right:20px; background:#15bccf; color:#fff; text-align:center;}
diff --git a/public/stylesheets/polls.css b/public/stylesheets/polls.css
index 370a3c515..f0d670a1d 100644
--- a/public/stylesheets/polls.css
+++ b/public/stylesheets/polls.css
@@ -31,7 +31,7 @@ a.polls_title{ font-weight:bold; color:#3e6d8e;max-width: 300px;white-space: now
a.pollsbtn{ display:block; width:66px; height:22px; text-align:center; border:1px solid #64bdd9; color:#64bdd9;}
a:hover.pollsbtn{ background:#64bdd9; color:#fff; text-decoration:none;}
.polls_date{ color:#666666;}
-.polls_de{ color:#6883b6;}
+.polls_de{ color:#6883b6;padding-left: 5px;}
/****翻页***/
ul.wlist{ float:right; border-bottom:none; height:30px; margin-top:20px; }
ul.wlist li{float: left;}
@@ -143,5 +143,5 @@ a.btn_pu{ border:1px solid #3cb761; color:#3cb761; }
a:hover.btn_pu{ background:#3cb761;}
.pollsbtn_grey{ border:1px solid #b1b1b1; color:#b1b1b1; padding:0px 9px; }
.polls_title_w { width:330px; overflow: hidden;white-space: nowrap;text-overflow: ellipsis;}
-.polls_de_grey{ color:#b1b1b1;}
+.polls_de_grey{ color:#b1b1b1;padding-left: 5px;}
.ml5{ margin-left:5px;}
diff --git a/spec/controllers/enterprises_controller_spec.rb b/spec/controllers/enterprises_controller_spec.rb
new file mode 100644
index 000000000..49ca325bf
--- /dev/null
+++ b/spec/controllers/enterprises_controller_spec.rb
@@ -0,0 +1,12 @@
+require 'spec_helper'
+
+describe EnterprisesController do
+
+ describe "GET 'index'" do
+ it "returns http success" do
+ get 'index'
+ response.should be_success
+ end
+ end
+
+end
diff --git a/spec/factories/users.rb b/spec/factories/users.rb
new file mode 100644
index 000000000..369e60f48
--- /dev/null
+++ b/spec/factories/users.rb
@@ -0,0 +1,10 @@
+require 'faker'
+
+FactoryGirl.define do
+ factory :user do
+ login "ExampleUser"
+ mail "user@example.com"
+ password "foobar"
+ password_confirmation "foobar"
+ end
+end
\ No newline at end of file
diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb
new file mode 100644
index 000000000..d400dae80
--- /dev/null
+++ b/spec/models/user_spec.rb
@@ -0,0 +1,144 @@
+require 'spec_helper'
+describe User do
+ # 测试数据验证
+ # 此处采用预构件的方式生成数据
+ # it "has a valid facrtory" do
+ # expect(FactoryGirl.create(:user)).not_to be_valid
+ # end
+
+ before :each do
+ @user = User.new(login: 'ExampleUser',firstname: 'sanfeng',lastname: 'zhang' ,mail: 'user@example.com',
+ password: 'foobar',password_confirmation: 'foobar' )
+ end
+
+ # 指定@user为测试对象
+ subject { @user }
+ # 属性存在性的测试
+ it { should respond_to(:login) }
+ it { should respond_to(:mail) }
+
+
+ # 用户名唯一性的测试
+ describe "when login is already taken" do
+ before do
+ user_with_same_login=@user.dup
+ user_with_same_login.save
+ end
+ it{should_not be_valid}
+ # it "should be valid" do
+ # expect(@user).to be_valid
+ # end
+ end
+
+ # 邮箱唯一性测试
+ describe "when mail address is already taken " do
+ before do
+ #dup method copy mail
+ user_with_same_mail=@user.dup
+ user_with_same_mail.mail=@user.mail.upcase
+ user_with_same_mail.save
+ end
+ it{should_not be_valid}
+ end
+ #邮箱唯一性测试2
+ # describe " is invalid with a same email address" do
+ # User.create(login:'peter',mail:'test@qq.com')#先保存一个合法的对象
+ # user1=User.new(login:'jim',mail:'testqq@.com')#再创建user1作为测试的对比对象
+ # # expect(user1).to have(1).errors_on(:mail)
+ # it{should_not be_valid}
+ # end
+
+ #login长度测试(login最大25字符)
+ describe "when the login is too long " do
+ before{@user.login='a'*26}
+ it{should_not be_valid}
+ end
+ # 姓和名的长度测试
+ describe "when the first name is too long " do
+ before{@user.firstname='a'*30}
+ it{should_not be_valid}
+ end
+ describe "when the last name is too long " do
+ before{@user.lastname='a'*30}
+ it{should_not be_valid}
+ end
+
+ # login合法性的测试(符合正则表达式规则的用户名:数字英文)
+ describe "when login format is invalid" do
+ it"should be invalid" do
+ username=%w[aa!3 aaa%$&*! 1111==!]
+ username.each do |valid_username|
+ @user.login=valid_username
+ expect(@user).not_to be_valid
+ end
+ end
+ end
+
+ describe "when login format is valid" do
+ it"should be valid" do
+ username = %w[jim123 123456 aaaaaa]
+ username.each do |valid_username|
+ @user.login=valid_username
+ expect(@user).to be_valid
+ end
+ end
+ end
+
+ # 邮箱合法性测试,在模型user中邮箱使用了正则表达式
+ describe "is the mail valid" do
+ context "when mail format is invalid" do
+ it"should be invalid" do
+ address=%w[user@foo,com user_at_foo.org example.user@foo.foo@bar_baz.com foo@bar+baz.com]
+ address.each do |valid_address|
+ @user.mail=valid_address
+ expect(@user).not_to be_valid
+ end
+ end
+ end
+
+ context "when mail format is valid" do
+ it"should be valid" do
+ addresses = %w[user@foo.COM A_US-ER@f.b.org frst.lst@foo.jp a+b@baz.cn]
+ addresses.each do |valid_address|
+ @user.mail=valid_address
+ expect(@user).not_to be_valid
+ end
+ end
+ end
+ end
+ # 邮箱长度验证的测试
+ describe "when the mail is too long" do
+ before{@user.mail='a'*60}
+ it{should_not be_valid}
+ end
+
+ # 验证两次输入的密码是否一致的测试
+ describe "when the password does not match confirmation" do
+ before{@user.password_confirmation="admin123"}
+ it{should_not be_valid}
+ end
+
+ # 选择项目成员时显示的用户信息文字userInfo方法的测试
+ # describe "when choice the peoject number show the user info" do
+ # before{ @userwd = User.new(login: 'wudang',firstname: 'sanfeng',lastname: 'zhang' ,mail: 'user@example.com',
+ # password: 'foobar',password_confirmation: 'foobar' )}
+ # it "when the firstname and lastname is nil " do
+ # expect(@userwd.userInfo).to eq 'wudang (zhang sanfeng)'
+ # end
+ #
+ # end
+ # 返回用户全名的测试
+ it "return full user's name" do
+ expect(@user.show_name).to eq 'zhangsanfeng'
+ end
+
+ # 返回匿名用户方法的测试
+ # User调用其类方法anonymous,返回一个AnonymousUser的实例对象@anonymoususer
+ # 该对象的lastname属性被赋值为"Anonymous",最后对比其值是否相等
+ it "return the anonymous user" do
+ @anonymoususer=AnonymousUser.new
+ @anonymoususer=User.anonymous
+ expect(@anonymoususer.lastname).to eq 'Anonymous'
+ end
+
+end
\ No newline at end of file
diff --git a/test/functional/system_log_controller_test.rb b/test/functional/system_log_controller_test.rb
new file mode 100644
index 000000000..0d8f6a181
--- /dev/null
+++ b/test/functional/system_log_controller_test.rb
@@ -0,0 +1,7 @@
+require 'test_helper'
+
+class SystemLogControllerTest < ActionController::TestCase
+ # test "the truth" do
+ # assert true
+ # end
+end
diff --git a/test/mobile/auth_test.rb b/test/mobile/auth_test.rb
new file mode 100644
index 000000000..afc5719e8
--- /dev/null
+++ b/test/mobile/auth_test.rb
@@ -0,0 +1,24 @@
+require File.expand_path('../../test_helper.rb',__FILE__)
+
+class AuthTest < ActionDispatch::IntegrationTest
+ def setup
+ ApiKey.delete_all
+ end
+
+ test "login success when use correct password" do
+ post('/api/v1/auth/login.json', {login: 'guange', password: '123456'})
+ o = ActiveSupport::JSON.decode response.body
+ puts o
+ puts o["token"]
+ assert_not_nil o["token"]
+ end
+
+ test "login failure when incorrect password" do
+ post('/api/v1/auth/login.json', {login: 'guange', password: 'wrongpass'})
+ o = ActiveSupport::JSON.decode response.body
+ assert_nil o["token"]
+ assert_equal o["error"], 'Unauthorized.'
+ end
+end
+
+
diff --git a/test/mobile/users_test.rb b/test/mobile/users_test.rb
new file mode 100644
index 000000000..48b8010b4
--- /dev/null
+++ b/test/mobile/users_test.rb
@@ -0,0 +1,12 @@
+require File.expand_path('../../test_helper.rb',__FILE__)
+
+class UsersTest < ActionDispatch::IntegrationTest
+ test "register a user" do
+ end
+ test "get all users" do
+ get '/api/v1/users.json'
+ assert_response :success
+ end
+end
+
+
diff --git a/test/unit/helpers/expire_helper_test.rb b/test/unit/helpers/expire_helper_test.rb
new file mode 100644
index 000000000..318e451cc
--- /dev/null
+++ b/test/unit/helpers/expire_helper_test.rb
@@ -0,0 +1,4 @@
+require 'test_helper'
+
+class ExpireHelperTest < ActionView::TestCase
+end
diff --git a/test/unit/helpers/system_log_helper_test.rb b/test/unit/helpers/system_log_helper_test.rb
new file mode 100644
index 000000000..7cf025d9d
--- /dev/null
+++ b/test/unit/helpers/system_log_helper_test.rb
@@ -0,0 +1,4 @@
+require 'test_helper'
+
+class SystemLogHelperTest < ActionView::TestCase
+end
diff --git a/tmp/plugins/README b/tmp/plugins/README
deleted file mode 100644
index edef25679..000000000
--- a/tmp/plugins/README
+++ /dev/null
@@ -1 +0,0 @@
-Put your Redmine plugins here.