This commit is contained in:
alan 2014-12-18 18:25:02 +08:00
commit c560ca617b
19 changed files with 247 additions and 215 deletions

View File

@ -348,7 +348,7 @@ class HomeworkAttachController < ApplicationController
else else
end end
else else
render_403 :message => :notice_not_authorized render_403
end end
end end

View File

@ -48,7 +48,7 @@ class SoftapplicationsController < ApplicationController
def show def show
@softapplication = Softapplication.find(params[:id]) @softapplication = Softapplication.find(params[:id])
@project = @softapplication.project #@project = @softapplication.project
# 打分统计 # 打分统计
stars_reates = @softapplication. stars_reates = @softapplication.
rates(:quality) rates(:quality)

View File

@ -36,7 +36,7 @@ class Course < ActiveRecord::Base
acts_as_attachable :view_permission => :view_course_files, acts_as_attachable :view_permission => :view_course_files,
:delete_permission => :manage_files :delete_permission => :manage_files
validates_presence_of :password, :term,:name,:description validates_presence_of :password, :term,:name
validates_format_of :class_period, :with =>/^[1-9]\d*$/ validates_format_of :class_period, :with =>/^[1-9]\d*$/
validates_format_of :name,:with =>/^[a-zA-Z0-9_\u4e00-\u9fa5]+$/ validates_format_of :name,:with =>/^[a-zA-Z0-9_\u4e00-\u9fa5]+$/
validates_length_of :description, :maximum => 10000 validates_length_of :description, :maximum => 10000

View File

@ -50,7 +50,7 @@
<h2>开启匿评功能</h2> <h2>开启匿评功能</h2>
<p> <p>
开启匿评后学生将不能对作业进行 开启匿评后学生将不能对作业进行
<span class="c_blue">提交、修改、删除</span> <span class="c_blue">修改、删除</span>
等操作,目前有 等操作,目前有
<span class="c_pink"><%= totle_size%>个</span> <span class="c_pink"><%= totle_size%>个</span>
学生,共提交了 学生,共提交了

View File

@ -124,14 +124,6 @@
</strong>) </strong>)
<% end %> <% end %>
</span> </span>
<span class="font_lighter">
<%= l(:label_students_responses) %>
(
<strong>
<%= bid.commit.nil? ? 0 : bid.commit %>
</strong>
)
</span>
</td> </td>
</tr> </tr>
<tr> <tr>

View File

@ -1,10 +1,7 @@
<script type="text/javascript"> <script type="text/javascript">
function submitCoursesBoard() function submitCoursesBoard()
{ {
if(regexSubject()&&regexContent()) if(regexSubject()&&regexContent()){$("#message-form").submit();}
{
$("#message-form").submit();
}
} }
</script> </script>
<div id="add-message" class="add_frame" style="display:none;"> <div id="add-message" class="add_frame" style="display:none;">

View File

@ -1,5 +1,5 @@
<div class="top-content"> <div class="top-content">
<%= form_tag({:controller => 'contests', :action => 'index'}, :method => :get) do %> <%= form_tag({:controller => 'contests', :action => 'index'}, :method => :get, :id => 'contests_serch') do %>
<table width="940px"> <table width="940px">
<tr> <tr>
<td class="info_font" style="width: 220px; color: #15bccf" rowspan="2"> <td class="info_font" style="width: 220px; color: #15bccf" rowspan="2">
@ -20,19 +20,41 @@
</td> </td>
<td rowspan="2" > <td rowspan="2" >
<div class="project-search" style="float: right"> <div class="project-search" style="float: right">
<%= text_field_tag 'name', params[:name], :size => 30 %> <script type="text/javascript">
function regexName()
{
var name = $.trim($("#name").val());
if(name.length == 0)
{
$("#contest_name_span").text("<%= l(:label_search_conditions_not_null) %>");
$("#contest_name_span").css('color','#ff0000');
$("#contest_name_span").focus();
return false;
}
else
{
$("#contest_name_span").text("");
return true;
}
}
function submitSerch()
{
if(regexName()){$("#contests_serch").submit();}
}
</script>
<%= text_field_tag 'name', params[:name], :size => 30, :onblur => 'regexName();' %>
<%= hidden_field_tag 'project_type', params[:project_type] %> <%= hidden_field_tag 'project_type', params[:project_type] %>
<%= submit_tag l(:label_search), :class => "enterprise", :name => "contests_search" %> <%#= submit_tag l(:label_search), :class => "enterprise", :name => "contests_search" %>
<a href="#" onclick="submitSerch();" class="ButtonColor m3p10">
<%= l(:label_search)%>
</a>
<br />
<span id="contest_name_span"></span>
</div> </div>
</td> </td>
</tr> </tr>
<tr> <tr>
<td style="padding-left: 8px">
<a>
<%= link_to request.host()+"/contests", contests_path %>
<!-- end longjun -->
</a>
</td>
<td > <td >
<%=link_to l(:field_homepage), home_path %> > <%=link_to l(:field_homepage), home_path %> >
<a><%= l(:label_contest_innovate) %></a> <a><%= l(:label_contest_innovate) %></a>
@ -43,14 +65,14 @@
<% end %> <% end %>
</div> </div>
<% if @contests.size > 0%> <% if @contests.size > 0%>
<%= sort_contest(@s_state)%> <%#= sort_contest(@s_state)%>
<div id="bid-show" class="projects-index"> <div id="bid-show" class="projects-index">
<%= render :partial => 'contest_list', :locals => {:contests => @contests, :contest_pages => @contest_pages} %> <%= render :partial => 'contest_list', :locals => {:contests => @contests, :contest_pages => @contest_pages} %>
</div> </div>
<% elsif @is_search%> <% elsif @is_search%>
<%= render :partial => "layouts/no_content"%> <%= render :partial => "layouts/no_content"%>
<% else %> <% else %>
<%= sort_contest(@s_state)%> <%#= sort_contest(@s_state)%>
<div id="bid-show" class="projects-index"> <div id="bid-show" class="projects-index">
<%= render :partial => 'contest_list', :locals => {:contests => @contests, :contest_pages => @contest_pages} %> <%= render :partial => 'contest_list', :locals => {:contests => @contests, :contest_pages => @contest_pages} %>
</div> </div>

View File

@ -2,22 +2,21 @@
<% attachmenttypes = @project.attachmenttypes %> <% attachmenttypes = @project.attachmenttypes %>
<% sufixtypes = @project.contenttypes %> <% sufixtypes = @project.contenttypes %>
<span class="borad-title"><%= (@project.project_type == 1) ? t(:label_user_course) : t(:label_project) %>资源共享区</span> <span class="borad-title">
<%= (@project.project_type == 1) ? t(:label_user_course) : t(:label_project) %>
资源共享区
</span>
<div class="content-title-top"> <div class="content-title-top">
<%#= link_to(l(:label_attachment_new), 'javascript:void(0);', :onclick=>"$('#file_buttons').slideToggle();", :class => 'icon icon-add') if User.current.allowed_to?(:manage_files, @project) %> <%#= link_to(l(:label_attachment_new), 'javascript:void(0);', :onclick=>"$('#file_buttons').slideToggle();", :class => 'icon icon-add') if User.current.allowed_to?(:manage_files, @project) %>
<div class="clearfix"></div> <div class="clearfix"></div>
<div id="file_buttons" class="nhidden"> <div id="file_buttons" class="nhidden">
<%= link_to(l(:label_upload_files), 'javascript:void(0);', :class => 'icon m5p5 button_submit', :onclick => "$('#relation_file_div').slideUp();$('#upload_file_div').slideToggle('slow');") if User.current.allowed_to?(:manage_files, @project) %> <%= link_to(l(:label_upload_files), 'javascript:void(0);', :class => 'icon m5p5 button_submit', :onclick => "$('#relation_file_div').slideUp();$('#upload_file_div').slideToggle('slow');") if User.current.allowed_to?(:manage_files, @project) %>
<%= link_to(l(:label_relation_files), 'javascript:void(0);', :onclick => "$('#upload_file_div').slideUp();$('#relation_file_div').slideToggle();", :class => 'icon m5p5 button_submit') if User.current.allowed_to?(:manage_files, @project) %> <%= link_to(l(:label_relation_files), 'javascript:void(0);', :onclick => "$('#upload_file_div').slideUp();$('#relation_file_div').slideToggle();", :class => 'icon m5p5 button_submit') if User.current.allowed_to?(:manage_files, @project) %>
<p></p> <p></p>
<div id="upload_file_div" class="relation_file_div hidden"> <div id="upload_file_div" class="relation_file_div hidden">
<%= render :partial => 'new', locals: {project: @project} %> <%= render :partial => 'new', locals: {project: @project} %>
</div> </div>
<div id="relation_file_div" class="relation_file_div hidden"> <div id="relation_file_div" class="relation_file_div hidden">
<fieldset> <fieldset>
<legend>搜索</legend> <legend>搜索</legend>
@ -48,16 +47,23 @@
</div> </div>
<div class="box" id="files-box"> <div class="box" id="files-box">
<label for="files-box" style="font-weight:bold;">&nbsp;&nbsp;<%= l(:label_files_filter) %></label> <label for="files-box" style="font-weight:bold;">
&nbsp;&nbsp;
<%= l(:label_files_filter) %>
</label>
<% if attachmenttypes.any? %> <% if attachmenttypes.any? %>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
<label for="attachment_browse_label"><%= l(:attachment_browse) %></label> <label for="attachment_browse_label">
<%= select_tag "attachment_browse", content_tag(:option, l(:attachment_all), :value => '0') +options_from_collection_for_select(attachmenttypes, "id", "typeName",params[:type]), <%= l(:attachment_browse) %>
</label>
<%= select_tag "attachment_browse", content_tag(:option, l(:attachment_all), :value => '0') +options_from_collection_for_select(attachmenttypes, "id", "typeName",params[:type]),
:onchange => "attachmenttypes_searchex(this.value)" %> :onchange => "attachmenttypes_searchex(this.value)" %>
<% end %> <% end %>
<% if sufixtypes.any? %> <% if sufixtypes.any? %>
&nbsp; &nbsp;
<label for="attach_sufix_browse_label"><%= l(:attachment_sufix_browse) %></label> <label for="attach_sufix_browse_label">
<%= l(:attachment_sufix_browse) %>
</label>
<%= select_tag "attach_sufix_browse", content_tag(:option, l(:attachment_all), :value => '0') +options_for_select(sufixtypes), <%= select_tag "attach_sufix_browse", content_tag(:option, l(:attachment_all), :value => '0') +options_for_select(sufixtypes),
:onchange => "attachment_contenttypes_searchex(this.value)" %> :onchange => "attachment_contenttypes_searchex(this.value)" %>
<% end %> <% end %>
@ -65,20 +71,14 @@
</div> </div>
<%= javascript_tag "observeSearchfield('attach_search', null, '#{ escape_javascript attachments_autocomplete_path(:project_id => @project.id, :format => 'js') }')" %> <%= javascript_tag "observeSearchfield('attach_search', null, '#{ escape_javascript attachments_autocomplete_path(:project_id => @project.id, :format => 'js') }')" %>
<% delete_allowed = User.current.allowed_to?(:manage_files, @project) %> <% delete_allowed = User.current.allowed_to?(:manage_files, @project) %>
<div id="all_browse_div" class="all_browse_div"> <div id="all_browse_div" class="all_browse_div">
<%#= render :partial => 'show_all_attachment' %> <%#= render :partial => 'show_all_attachment' %>
<% if (@attachtype==0 && @contenttype=='0') || (@attachtype.nil? && @contenttype.nil?) %> <% if (@attachtype==0 && @contenttype=='0') || (@attachtype.nil? && @contenttype.nil?) %>
<%= render partial: "show_all_attachment"%>
<%= render partial: "show_all_attachment"%>
<%else%> <%else%>
<%= render partial: "sort_by_attachtypel"%>
<%= render partial: "sort_by_attachtypel"%>
<%end%> <%end%>
</div> </div>

View File

@ -1,67 +1,69 @@
<div class="autoscroll"> <div class="autoscroll">
<ul> <ul>
<% issue_list(issues) do |issue, level| -%> <% issue_list(issues) do |issue, level| -%>
<% if @query.grouped? && (group = @query.group_by_column.value(issue)) != previous_group %> <% if @query.grouped? && (group = @query.group_by_column.value(issue)) != previous_group %>
<% reset_cycle %> <% reset_cycle %>
<% previous_group = group %> <% previous_group = group %>
<% end %> <% end %>
<div style=""> <div style="">
<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)}"}) %>
<% if issue.tracker_id == 1 %>
<%= image_tag("/images/task.png", :class => "img-tag-issues") %>
<% end %>
<% if issue.tracker_id == 2 %>
<%= image_tag("/images/feature.png", :class => "img-tag-issues") %>
<% end %>
<% if issue.tracker_id == 3 %>
<%= image_tag("/images/support.png", :class => "img-tag-issues") %>
<% end %>
<% if issue.tracker_id == 4 %>
<%= image_tag("/images/issues.png", :class => "img-tag-issues") %>
<% end %>
<!-- 在这里添加赞和踩--> <ul class="issue_list">
<span id="praise_tread" style="float: right"> <% unless issue.author.nil? || issue.author.name == "Anonymous" %>
<%= render :partial => "/praise_tread/praise_tread",:locals => <ul class="list-group-item-meta" style="word-break: break-all;word-wrap: break-word;width: 100%;">
{:obj => issue,:show_flag => true,:user_id =>User.current.id,:horizontal => false}%> <!-- 在这里添加赞和踩-->
</span> <span id="praise_tread" style="float: right">
<%= render :partial => "/praise_tread/praise_tread",:locals =>
{:obj => issue,:show_flag => true,:user_id =>User.current.id,:horizontal => false}%>
</span>
<span>
<%= link_to issue.author.name, user_path(issue.author), :class => "bid_user_u" %>
</span>
<%= l(:label_post_on)%>
<% a = [] %>
<% a << column_content[1] %>
<%# a << "##{column_content[0]}" << "(#{raw column_content[2]}):" << column_content[4] %>
<% a << "#{issue.source_from}" << "(#{raw column_content[2]}):" << column_content[4] %>
<%= link_to a.join(' '), issue_path(issue.id), :class => "issue-link" , :target =>"_blank"%>
<% if issue.tracker_id == 1 %> <ul class="list-group-item-meta">
<%= image_tag("/images/task.png", :class => "img-tag-issues") %> <div class="wiki" style="width: 100%;word-break: break-all;word-wrap: break-word;">
<% end %> <%= textilizable issue, :description %>
<% if issue.tracker_id == 2 %> </div>
<%= image_tag("/images/feature.png", :class => "img-tag-issues") %> </ul>
<% end %> </ul>
<% if issue.tracker_id == 3 %> <ul class="list-group-item-meta" style="margin-top: -15px;">
<%= image_tag("/images/support.png", :class => "img-tag-issues") %> <% unless issue.assigned_to_id.nil? %>
<% end %> <span>
<% if issue.tracker_id == 4 %> <%= l(:field_assigned_to)%>&nbsp;
<%= image_tag("/images/issues.png", :class => "img-tag-issues") %> </span>
<% end %>
<ul class="issue_list">
<% unless issue.author.nil? || issue.author.name == "Anonymous" %>
<ul class="list-group-item-meta" style="word-break: break-all;word-wrap: break-word;">
<span> <%= link_to issue.author.name, user_path(issue.author), :class => "bid_user_u" %></span>
<%= l(:label_post_on)%> <% a = [] %>
<% a << column_content[1] %>
<%# a << "##{column_content[0]}" << "(#{raw column_content[2]}):" << column_content[4] %>
<% a << "#{issue.source_from}" << "(#{raw column_content[2]}):" << column_content[4] %>
<%= link_to a.join(' '), issue_path(issue.id), :class => "issue-link" , :target =>"_blank"%>
</ul>
<% end -%>
<ul class="list-group-item-meta">
<div class="wiki" style="width: 100%;word-break: break-all;word-wrap: break-word;">
<%= textilizable issue, :description %>
</div>
</ul>
<ul class="list-group-item-meta">
<% unless issue.assigned_to_id.nil? %>
<span>
<%= l(:field_assigned_to)%>&nbsp;
</span>
<%= raw column_content[5] %>&nbsp; <%= raw column_content[5] %>&nbsp;
<% end %> <% end %>
<%= 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"> <div class="find-comment-class">
<span> <span>
<%= link_to l(:label_find_all_comments), issue_path(issue.id) %> <%= link_to l(:label_find_all_comments), issue_path(issue.id) %>
</span> </span>
<%= l(:label_comments_count, :count => issue.journals.all.count) %> <%= l(:label_comments_count, :count => issue.journals.all.count) %>
</div> </div>
</ul> </ul>
</ul> <% end -%>
</li> </ul>
</div> </li>
<% end -%> </div>
</ul> <% end -%>
</ul>
</div> </div>

View File

@ -17,7 +17,8 @@
<%=link_to l(:field_homepage), home_path %> > <%=link_to l(:field_homepage), home_path %> >
<a><%= l(:label_contest_innovate) %></a> <a><%= l(:label_contest_innovate) %></a>
<span> <span>
<% contest = @softapplication.contests.first %><%= contest ? link_to(contest.name, show_contest_contest_path(contest)) : '尚未加入竞赛'%> <% contest = @softapplication.contests.first %>
<%= contest ? link_to(">" + contest.name, show_contest_contest_path(contest)) : '尚未加入竞赛'%>
</span> </span>
</td> </td>

View File

@ -15,7 +15,7 @@
} do |f| %> } do |f| %>
<%= render :partial => 'form', <%= render :partial => 'form',
:locals => {:f => f, :replying => !@message.parent.nil?} %> :locals => {:f => f, :replying => !@message.parent.nil?} %>
<a href="#" onclick="$('#message-form').submit();" class="ButtonColor m3p10"> <a href="#" onclick="if(regexSubject()&&regexContent()){$('#message-form').submit();}" class="ButtonColor m3p10">
<%= l(:button_save) %> <%= l(:button_save) %>
</a> </a>
<%= link_to l(:button_cancel), board_message_url(@message.board, @message.root, :r => (@message.parent_id && @message.id)), :class => "ButtonColor m3p10" %> <%= link_to l(:button_cancel), board_message_url(@message.board, @message.root, :r => (@message.parent_id && @message.id)), :class => "ButtonColor m3p10" %>

View File

@ -1,7 +1,15 @@
<% if @project %> <% if @project %>
<h3><%= link_to h(@board.name), :controller => 'boards', :action => 'show', :project_id => @project, :id => @board %> &#187; <%= l(:label_message_new) %></h3> <h3>
<%= link_to h(@board.name), :controller => 'boards', :action => 'show', :project_id => @project, :id => @board %>
&#187;
<%= l(:label_message_new) %>
</h3>
<% elsif @course %> <% elsif @course %>
<h3><%= link_to h(@board.name), :controller => 'boards', :action => 'show', :course_id => @course, :id => @board %> &#187; <%= l(:label_message_new) %></h3> <h3>
<%= link_to h(@board.name), :controller => 'boards', :action => 'show', :course_id => @course, :id => @board %>
&#187;
<%= l(:label_message_new) %>
</h3>
<% end %> <% end %>
<%= form_for @message, :url => {:action => 'new'}, :html => {:multipart => true, :id => 'message-form'} do |f| %> <%= form_for @message, :url => {:action => 'new'}, :html => {:multipart => true, :id => 'message-form'} do |f| %>

View File

@ -1,4 +1,5 @@
<%= render :partial => 'layouts/base_softapplication_top_content' %> <%= render :partial => 'layouts/base_softapplication_top_content' %>
<% html_title(@softapplication.name) -%>
<div style="height: auto; padding-bottom: 10px" class="softapplications-div"> <div style="height: auto; padding-bottom: 10px" class="softapplications-div">
<tr> <tr>
<td colspan="2" valign="top" width="320"> <td colspan="2" valign="top" width="320">
@ -47,8 +48,9 @@
</tr> </tr>
<tr> <tr>
<td style="padding-left: 40px"> <td style="padding-left: 40px">
<% if @project %> <% if @softapplication.project %>
<%=l(:label_attendingcontestwork_deposit_project)%><%= link_to "#@project", project_path(@project) %> <%=l(:label_attendingcontestwork_deposit_project)%>
<%= link_to "#{@softapplication.project}", project_path(@softapplication.project) %>
<% end %> <% end %>
</td> </td>
</tr> </tr>

View File

@ -1,6 +1,6 @@
<div id="tags"> <div id="tags">
<%#begin <%#begin
1 代表是user类型 1 代表是user类型
2 代表是project类型 2 代表是project类型
3 代表是issue类型 3 代表是issue类型
4 代表是bid类型 4 代表是bid类型
@ -44,14 +44,14 @@
<span> <span>
<%= link_to (image_tag "/images/sidebar/add.png"), 'javascript:void(0);', <%= link_to (image_tag "/images/sidebar/add.png"), 'javascript:void(0);',
:class => "tags_icona", :class => "tags_icona",
:onclick=>"$('#put-tag-form-#{obj.class}-#{obj.id}').slideToggle(); readmore(this);" if User.current.logged? %> :onclick=>"$('#put-tag-form-#{obj.class}-#{obj.id}').toggle(); readmore(this);" if User.current.logged? %>
<%#= toggle_link (image_tag "/images/sidebar/add.png"), "put-tag-form-#{obj.class}-#{obj.id}", {:focus => "put-tag-form-#{obj.class}-#{obj.id} #name"} if User.current.logged? %> <%#= toggle_link (image_tag "/images/sidebar/add.png"), "put-tag-form-#{obj.class}-#{obj.id}", {:focus => "put-tag-form-#{obj.class}-#{obj.id} #name"} if User.current.logged? %>
</span> </span>
&nbsp;&nbsp; &nbsp;&nbsp;
<div id="tags_show-<%=obj.class%>-<%=obj.id%>" style="display:inline; "> <div id="tags_show-<%=obj.class%>-<%=obj.id%>" style="display:inline; ">
<%= render :partial => "tags/tag_name",:locals => {:obj => obj,:non_list_all => false ,:object_flag => object_flag} %> <%= render :partial => "tags/tag_name",:locals => {:obj => obj,:non_list_all => false ,:object_flag => object_flag} %>
</div> </div>
<div id="put-tag-form-<%=obj.class%>-<%=obj.id%>" style="display: none;height: 100px;"> <div id="put-tag-form-<%=obj.class%>-<%=obj.id%>" style="display: none;">
<%= render :partial => "courses/course_resources_html", :locals => {:obj => obj ,:object_flag => object_flag } %> <%= render :partial => "courses/course_resources_html", :locals => {:obj => obj ,:object_flag => object_flag } %>
</div> </div>
<% else %> <% else %>

View File

@ -9,108 +9,103 @@
</script> </script>
<!-- 1代表是user类型 2代表是project类型 3代表是issue类型 4代表需求 7代表竞赛 9代表课程--> <!-- 1代表是user类型 2代表是project类型 3代表是issue类型 4代表需求 7代表竞赛 9代表课程-->
<% @tags = obj.reload.tag_list %> <% @tags = obj.reload.tag_list %>
<% if non_list_all and (@tags.size > 0) %> <% if non_list_all and (@tags.size > 0) %>
<!-- 这里是显示的非主页的tag 所以当tag数量较多时 不必全部显示 用“更多”代替 --> <!-- 这里是显示的非主页的tag 所以当tag数量较多时 不必全部显示 用“更多”代替 -->
<% if @tags.size > Setting.show_tags_length.to_i then %> <% if @tags.size > Setting.show_tags_length.to_i then %>
<% i = 0 %> <% i = 0 %>
<% until i>Setting.show_tags_length.to_i do %> <% until i>Setting.show_tags_length.to_i do %>
<div id="tag"> <div id="tag">
<%= link_to @tags[i], :controller => "tags", :action => "index", :q => @tags[i], :object_flag => object_flag, :obj_id => obj.id %> <%= link_to @tags[i], :controller => "tags", :action => "index", :q => @tags[i], :object_flag => object_flag, :obj_id => obj.id %>
</div> </div>
<% i += 1 %> <% i += 1 %>
<% end %> <% end %>
<%= more_tags(obj.id,object_flag)%> <%= more_tags(obj.id,object_flag)%>
<% else %> <% else %>
<% @tags.each do |tag| %> <% @tags.each do |tag| %>
<div id="tag"> <div id="tag">
<%= link_to tag, :controller => "tags", :action => "index", :q => tag, :object_flag => object_flag, :obj_id => obj.id %> <%= link_to tag, :controller => "tags", :action => "index", :q => tag, :object_flag => object_flag, :obj_id => obj.id %>
</div> </div>
<% end %> <% end %>
<% end %> <% end %>
<% else %> <% else %>
<!-- 用来显示三大对象的主页中的tag 故是全部显示 --> <!-- 用来显示三大对象的主页中的tag 故是全部显示 -->
<% if @tags.size > 0 %> <% if @tags.size > 0 %>
<% @tags.each do |tag| %> <% @tags.each do |tag| %>
<div id="tag"> <div id="tag">
<span class="tag_show"> <%= link_to tag, :controller => "tags", :action => "index", :q => tag, :object_flag => object_flag, :obj_id => obj.id %> <span class="tag_show">
<!-- 对用户主页 是本人 ,对项目,需求,问题是管理员 --> <%= link_to tag, :controller => "tags", :action => "index", :q => tag, :object_flag => object_flag, :obj_id => obj.id %>
<% case object_flag %> <!-- 对用户主页 是本人 ,对项目,需求,问题是管理员 -->
<% when '1' %> <% case object_flag %>
<% when '1' %>
<% if User.current.eql?(obj) %> <% if User.current.eql?(obj) %>
<span class='del'> <%= link_to 'x', :controller => "tags", :action => "remove_tag", :remote => true, :tag_name => tag, <span class='del'>
:taggable_id => obj.id, :taggable_type => object_flag %> </span> <%= link_to 'x', :controller => "tags", :action => "remove_tag", :remote => true, :tag_name => tag,
<% end %> :taggable_id => obj.id, :taggable_type => object_flag %>
</span>
<% when '2' %> <% end %>
<% when '2' %>
<% if (ProjectInfo.find_by_project_id(obj.id)).try(:user_id) == User.current.id %> <% if (ProjectInfo.find_by_project_id(obj.id)).try(:user_id) == User.current.id %>
<span class='del'> <%= link_to 'x', :controller => "tags", :action => "remove_tag", :remote => true, :tag_name => tag, <span class='del'>
:taggable_id => obj.id, :taggable_type => object_flag %> </span> <%= link_to 'x', :controller => "tags", :action => "remove_tag", :remote => true, :tag_name => tag,
<% end %> :taggable_id => obj.id, :taggable_type => object_flag %>
</span>
<% when '3' %> <% end %>
<% when '3' %>
<% if (ProjectInfo.find_by_project_id(obj.project_id)).try(:user_id) == User.current.id %> <% if (ProjectInfo.find_by_project_id(obj.project_id)).try(:user_id) == User.current.id %>
<span class='del'> <%= link_to 'x', :controller => "tags", :action => "remove_tag", :remote => true, :tag_name => tag, <span class='del'>
:taggable_id => obj.id, :taggable_type => object_flag %> </span> <%= link_to 'x', :controller => "tags", :action => "remove_tag", :remote => true, :tag_name => tag,
<% end %> :taggable_id => obj.id, :taggable_type => object_flag %>
</span>
<% when '4' %> <% end %>
<% if obj.author_id == User.current.id %> <% when '4' %>
<% if obj.author_id == User.current.id %>
<span class='del'> <%= link_to 'x', :controller => "tags", :action => "remove_tag", :remote => true, :tag_name => tag, <span class='del'>
:taggable_id => obj.id, :taggable_type => object_flag %> </span> <%= link_to 'x', :controller => "tags", :action => "remove_tag", :remote => true, :tag_name => tag,
:taggable_id => obj.id, :taggable_type => object_flag %>
<% end %> </span>
<% when '5' %> <% end %>
<% test = Forum.find(obj.id) %> <% when '5' %>
<% if test && test.creator_id == User.current.id %> <% test = Forum.find(obj.id) %>
<span class='del'> <%= link_to 'x', :controller => "tags", :action => "remove_tag", :remote => true, :tag_name => tag, <% if test && test.creator_id == User.current.id %>
:taggable_id => obj.id, :taggable_type => object_flag %> </span> <span class='del'>
<%= link_to 'x', :controller => "tags", :action => "remove_tag", :remote => true, :tag_name => tag,
<% end %> :taggable_id => obj.id, :taggable_type => object_flag %>
<% when '6' %> </span>
<%# if (User.current.logged? && <% end %>
User.current.admin? <% when '6' %>
# && (@project && User.current.member_of?(@project)) <%# if (User.current.logged? &&
) User.current.admin?
%> # && (@project && User.current.member_of?(@project))
<% if obj.author_id == User.current.id || User.current.admin?%> )
<span class='del'> <%= link_to 'x', :controller => "tags", :action => "remove_tag", :remote => true, :tag_name => tag, %>
:taggable_id => obj.id, :taggable_type => object_flag %> </span> <% if obj.author_id == User.current.id || User.current.admin?%>
<% end %> <span class='del'>
<% when '7' %> <%= link_to 'x', :controller => "tags", :action => "remove_tag", :remote => true, :tag_name => tag,
<% if obj.author_id == User.current.id %> :taggable_id => obj.id, :taggable_type => object_flag %>
</span>
<span class='del'> <%= link_to 'x', :controller => "tags", :action => "remove_tag", :remote => true, :tag_name => tag, <% end %>
:taggable_id => obj.id, :taggable_type => object_flag %> </span> <% when '7' %>
<% if obj.author_id == User.current.id %>
<% end %> <span class='del'>
<% when '9' %> <%= link_to 'x', :controller => "tags", :action => "remove_tag", :remote => true, :tag_name => tag,
:taggable_id => obj.id, :taggable_type => object_flag %>
<% if (CourseInfos.find_by_course_id(obj.id)).try(:user_id) == User.current.id %> </span>
<span class='del'> <%= link_to 'x', :controller => "tags", :action => "remove_tag", :remote => true, :tag_name => tag, <% end %>
:taggable_id => obj.id, :taggable_type => object_flag %> </span> <% when '9' %>
<% end %> <% if (CourseInfos.find_by_course_id(obj.id)).try(:user_id) == User.current.id %>
<% end %> <span class='del'>
<%= link_to 'x', :controller => "tags", :action => "remove_tag", :remote => true, :tag_name => tag,
:taggable_id => obj.id, :taggable_type => object_flag %>
</span> </span>
<% end %>
<% end %>
</span>
</div> </div>
<% end %> <% end %>
<% else %> <% else %>
<span style="color:#8c8a8a"> <span style="color:#8c8a8a">
&nbsp;&nbsp;&nbsp;<%= l(:label_tags_no) %> &nbsp;&nbsp;&nbsp;
</span> <%= l(:label_tags_no) %>
</span>
<% end %> <% end %>
<% end %> <% end %>

View File

@ -4,31 +4,40 @@
<li> <li>
<table width="660" border="0" align="center" style="border-bottom: 1px dashed rgb(204, 204, 204); margin-bottom: 10px;font-size:14px;"> <table width="660" border="0" align="center" style="border-bottom: 1px dashed rgb(204, 204, 204); margin-bottom: 10px;font-size:14px;">
<tr> <tr>
<td colspan="2" valign="top" width="50"><%= image_tag(url_to_avatar(membership.course), :class => 'avatar') %></td> <td colspan="2" valign="top" width="50">
<%= image_tag(url_to_avatar(membership.course), :class => 'avatar') %>
</td>
<td> <td>
<table width="580" border="0"> <table width="580" border="0">
<tr> <tr>
<td colspan="2" valign="top"> <td colspan="2" valign="top">
<span><%= link_to_course(membership.course) %></span> <span>
<%= link_to_course(membership.course) %>
</span>
<span style="float: right"> <span style="float: right">
<%= render :partial => 'courses/set_course_time', :locals => {:course => membership.course} %> <%= render :partial => 'courses/set_course_time', :locals => {:course => membership.course} %>
<% if User.current == @user %> <% if (User.current == @user && (!@user.allowed_to?(:as_teacher,membership.course)))%>
<% (membership.roles).each do |role| %> <%= join_in_course(membership.course, User.current) %>
<% unless (role == Role.find(9) || role == Role.find(3)) %>
<%= join_in_course(membership.course, User.current) %>
<% end %>
<% end %>
<% else %>
<% end %> <% end %>
&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;
<%= l(:label_x_base_courses_member, :count => membership.course.members.count) %> <%= l(:label_x_base_courses_member, :count => membership.course.members.count) %>
(<%= "#{membership.course.members.count}" %>)&nbsp;&nbsp; (<%= "#{membership.course.members.count}" %>)
&nbsp;&nbsp;
<%= l(:label_homework) %> <%= l(:label_homework) %>
(<span class=""><%= link_to (membership.course.homeworks.count), {:controller => 'courses', :action => 'homework', :id => membership.course.id} %></span>) (
<span class="">
<%= link_to (membership.course.homeworks.count), {:controller => 'courses', :action => 'homework', :id => membership.course.id} %>
</span>
)
&nbsp;&nbsp; &nbsp;&nbsp;
<%= l(:label_course_news) %> <%= l(:label_course_news) %>
(<span style="color: #ed8924"><%= link_to (membership.course.news.count), {:controller => 'news', :action => 'index', :course_id => membership.course.id} %></span>) (
</span></td> <span style="color: #ed8924">
<%= link_to (membership.course.news.count), {:controller => 'news', :action => 'index', :course_id => membership.course.id} %>
</span>)
</span>
</td>
</tr> </tr>
<tr> <tr>
<td colspan="2" width="580" style="word-break:break-all;word-wrap: break-word;"> <td colspan="2" width="580" style="word-break:break-all;word-wrap: break-word;">
@ -42,10 +51,14 @@
<% @course = Course.find_by_extra(membership.course.extra) %> <% @course = Course.find_by_extra(membership.course.extra) %>
<% unless (@course.nil? || @course.teacher.nil? || @course.teacher.name.nil?) %> <% unless (@course.nil? || @course.teacher.nil? || @course.teacher.name.nil?) %>
<span class="font-lighter" style="float: left"><%= l(:label_main_teacher) %> <span class="font-lighter" style="float: left">
: <%= link_to(@course.teacher.realname, user_path(@course.teacher)) %></span> <%= l(:label_main_teacher) %>
<span style="float: right; padding-left: 8px"><%= l(:label_course_term) %> : <%= link_to(@course.teacher.realname, user_path(@course.teacher)) %>
: <%= @course.time %><%= @course.term %></span> </span>
<span style="float: right; padding-left: 8px">
<%= l(:label_course_term) %>
: <%= @course.time %><%= @course.term %>
</span>
<% end %> <% end %>
</td> </td>
</tr> </tr>

View File

@ -1,15 +1,15 @@
<div class="content-title-top"> <div class="content-title-top">
<% if @memberships.empty? %> <% if @memberships.empty? %>
<% if @user != User.current %> <% if @user != User.current %>
<p class="font_description"> <p class="font_description">
<%= l(:label_project_course_un) %> <%= l(:label_project_course_un) %>
</p> </p>
<% else %> <% else %>
<p class="font_description"> <p class="font_description">
<%= l(:label_project_cousre_studentun) %>
<%= l(:label_project_cousre_studentun) %><%= link_to"#{l(:label_course_join_student)}",{:controller=>'courses',:action=>'index'}, :class => 'icon icon-add' %> <%= link_to"#{l(:label_course_join_student)}",{:controller=>'courses',:action=>'index'}, :class => 'icon icon-add' %>
<%= link_to "#{l(:label_course_new)}", {:controller => 'courses', :action => 'new'}, :class => 'icon icon-add' %> <%= link_to "#{l(:label_course_new)}", {:controller => 'courses', :action => 'new'}, :class => 'icon icon-add' %>
</p> </p>
<% end %> <% end %>
<% else %> <% else %>
<div class="user_course_list menu-div"> <div class="user_course_list menu-div">

View File

@ -9,7 +9,6 @@
$("content-title-top p:first").find("a").attr("target", "_blank"); $("content-title-top p:first").find("a").attr("target", "_blank");
$("#content .content_frame [color=#666666]").find("a").removeAttr("target"); $("#content .content_frame [color=#666666]").find("a").removeAttr("target");
$('#content .content-title-top table[width=580] td:first span:eq(1)').find("a:first").removeAttr("target"); $('#content .content-title-top table[width=580] td:first span:eq(1)').find("a:first").removeAttr("target");
}); });
</script> </script>

View File

@ -856,10 +856,10 @@ table.content-text-list tbody tr td.locked, div.memo-section .locked {
*******************************************************************************/ *******************************************************************************/
.line_block { .line_block {
display: inline-block; display: inline-block;
width: 49%; width: 47%;
margin: 10px auto; /*margin: 10px auto;*/
vertical-align: top; vertical-align: top;
padding: 0px 2%; padding: 0px 1%;
-webkit-box-sizing: border-box; -webkit-box-sizing: border-box;
-moz-box-sizing: border-box; -moz-box-sizing: border-box;
-box-sizing: border-box; -box-sizing: border-box;
@ -869,6 +869,7 @@ table.content-text-list tbody tr td.locked, div.memo-section .locked {
.resource_sum { .resource_sum {
height: auto; height: auto;
width: 100%;
} }
.line_block p { .line_block p {