1.修复点击作业左边工作单位会跳入正式版该学校课程列表的BUG

2.格式化页面代码
This commit is contained in:
sw 2014-10-21 14:00:45 +08:00
parent a001f85502
commit 09f6adbd8d
4 changed files with 135 additions and 60 deletions

View File

@ -23,12 +23,16 @@
<%= error_messages_for 'bid' %>
<p>
<%= f.text_field :name, :required => true, :size => 60, :style => "width:490px;", :maxlength => Bid::NAME_LENGTH_LIMIT, :onblur => "regexName();" %>
</p>
<p><span id="bid_name_span"></span></p>
<p>
<span id="bid_name_span"></span>
</p>
<p><%= f.text_area :description, :rows => 8, :class => 'wiki-edit', :style => "font-size:small;width:490px;", :maxlength => Bid::DESCRIPTION_LENGTH_LIMIT %></p>
<p><%= f.text_field(:deadline, :required => true, :size => 60, :style => "width:150px;", :readonly => true, :onchange => "regexDeadLine();") %>
<p>
<%= f.text_area :description, :rows => 8, :class => 'wiki-edit', :style => "font-size:small;width:490px;", :maxlength => Bid::DESCRIPTION_LENGTH_LIMIT %>
</p>
<p>
<%= f.text_field(:deadline, :required => true, :size => 60, :style => "width:150px;", :readonly => true, :onchange => "regexDeadLine();") %>
<%= calendar_for('bid_deadline')%>
<span id="bid_deadline_span">
</span>
@ -43,6 +47,10 @@
<%= hidden_field_tag 'course_id', @course.id %>
</p>
<fieldset>
<legend><%= l(:label_attachment_plural) %></legend>
<p><%= render :partial => 'attachments/form', :locals => {:container => @bid} %></p>
<legend>
<%= l(:label_attachment_plural) %>
</legend>
<p>
<%= render :partial => 'attachments/form', :locals => {:container => @bid} %>
</p>
</fieldset>

View File

@ -22,28 +22,39 @@
<%= error_messages_for 'bid' %>
<p>
<%= f.text_field :name, :required => true, :size => 60, :style => "width:490px;", :maxlength => Bid::NAME_LENGTH_LIMIT, :onblur => "regexName();" %>
<%= f.text_field :name, :required => true, :size => 60, :style => "width:490px;",
:maxlength => Bid::NAME_LENGTH_LIMIT,
:onblur => "regexName();" %>
</p>
<p><span id="bid_name_span"></span></p>
<p>
<span id="bid_name_span"></span>
</p>
<p><%= f.text_area :description, :rows => 8, :class => 'wiki-edit', :style => "font-size:small;width:490px;", :maxlength => Bid::DESCRIPTION_LENGTH_LIMIT %></p>
<!-- <p><%#= select_tag 'bid_reward_type', "<option value = '0'>#{l(:label_choose_reward)}</option><option value = '1'>#{l(:label_money)}</option><option value = '3'>#{l(:label_bids_credit)}</option><option value = '2'>#{l(:label_reward_1)}</option>".html_safe,
:onChange => "show('bid_reward_type', 'bid_budget', '"+l(:label_bids_reward_what)+"','"+l(:label_bids_new_money)+"','"+l(:label_bids_new_credit)+"','"+l(:label_bids_new_content)+"')" %>
<%#= f.text_field :budget, :required => true, :size => 60, :style => "width:350px;", :placeholder => l(:label_bids_reward_what) %>
</p> -->
<p>
<%= f.text_area :description, :rows => 8, :class => 'wiki-edit', :style => "font-size:small;width:490px;",
:maxlength => Bid::DESCRIPTION_LENGTH_LIMIT %>
</p>
<% time = (Time.now + 3600 * 24).strftime('%Y-%m-%d') %>
<p><%= f.text_field(:deadline, :required => true, :size => 60, :style => "width:150px;",:value => "#{time}", :onchange => "regexDeadLine();", :readonly => true) %>
<%= calendar_for('bid_deadline')%>
<span id="bid_deadline_span">
</span>
</p>
<p><%= f.select :is_evaluation, is_evaluation_option %>
<p>
<%= f.select :is_evaluation, is_evaluation_option %>
</p>
<p><%= f.select :proportion, proportion_option %>
<p>
<%= f.select :proportion, proportion_option %>
</p>
<p><%= hidden_field_tag 'course_id', @course.id %>
<p>
<%= hidden_field_tag 'course_id', @course.id %>
</p>
<fieldset><legend><%= l(:label_attachment_plural) %></legend>
<p><%= render :partial => 'attachments/form', :locals => {:container => @homework} %></p>
<fieldset>
<legend>
<%= l(:label_attachment_plural) %>
</legend>
<p>
<%= render :partial => 'attachments/form', :locals => {:container => @homework} %>
</p>
</fieldset>

View File

@ -6,7 +6,9 @@
<html lang="en">
<head>
<meta charset="utf-8">
<title><%= h html_title %></title>
<title>
<%= h html_title %>
</title>
<meta name="description" content="<%= Redmine::Info.app_name %>"/>
<meta name="keywords" content="issue,bug,tracker"/>
<%= csrf_meta_tag %>
@ -32,7 +34,11 @@
<table>
<tr>
<td class="info_font" style="width: 240px; color: #15bccf">高校课程实践社区</td>
<td style="color: #15bccf"><strong><%= l(:label_user_location) %> : </strong></td>
<td style="color: #15bccf">
<strong>
<%= l(:label_user_location) %> :
</strong>
</td>
<td rowspan="2" width="250px">
<div class="top-content-search">
<%= form_tag(:controller => 'courses', :action => 'search', :method => :get) do %>
@ -43,10 +49,16 @@
</td>
</tr>
<tr>
<td style="padding-left: 8px"><%= link_to request.host()+"/course", :controller => 'courses', :action => 'index' %></td>
<td><p class="top-content-list"><%= link_to "主页", home_path %>
> <%= link_to l(:label_course_all), :controller => 'courses', :action => 'index' %>
> <%= link_to @course.name, nil %></p></td>
<td style="padding-left: 8px">
<%= link_to request.host()+"/course", :controller => 'courses', :action => 'index' %>
</td>
<td>
<p class="top-content-list">
<%= link_to "主页", home_path %>
> <%= link_to l(:label_course_all), :controller => 'courses', :action => 'index' %>
> <%= link_to @course.name, nil %>
</p>
</td>
</tr>
</table>
</div>
@ -67,7 +79,9 @@
<td>
<table>
<tr>
<td class="info-course"><%= link_to @course.name,course_path(@course) %></td>
<td class="info-course">
<%= link_to @course.name,course_path(@course) %>
</td>
</tr>
<tr>
<td align="center">
@ -101,17 +115,23 @@
<% if User.current.member_of_course?(@course) %>
<%= link_to "#{teacherCount(@course)}", course_member_path(@course, :role => 1), :course => '1' %>
<% else %>
<span><%= teacherCount(@course)%></span> <!--<%= link_to "#{teacherCount(@course)}", "javascript:void(0)", :course => '1' %>-->
<span>
<%= teacherCount(@course)%>
</span>
<% end%>
</td>
<td class="font_index">
<% if User.current.member_of_course?(@course) %>
<%= link_to "#{studentCount(@course)}", course_member_path(@course, :role => 2), :course => '1' %>
<% else %>
<span><%= studentCount(@course)%></span>
<span>
<%= studentCount(@course)%>
</span>
<% end %>
</td>
<td class="font_index"><%= link_to files_count, course_files_path(@course) %></td>
<td class="font_index">
<%= link_to files_count, course_files_path(@course) %>
</td>
<tr class="font_aram">
<td align="center" width="80px" id="teacherCount">
<%= l(:label_x_base_courses_teacher, :count => teacherCount(@course)) %>
@ -122,7 +142,6 @@
<td align="center" width="80px">
<%= l(:label_x_course_data, :count => files_count) %>
</td>
</tr>
</table>
<div class="user_underline"></div>
@ -134,45 +153,74 @@
<!-- addedby bai 教师姓名加超链接、加入开课时间、结课时间与课时 -->
<tr>
<td valign="top" style="padding-left: 8px; width:60px"><%= l(:label_main_teacher) %> :</td>
<td class="font_lighter_sidebar"><%= link_to(@course.teacher.lastname+@course.teacher.firstname, user_path(@course.teacher)) %></td>
<td valign="top" style="padding-left: 8px; width:60px">
<%= l(:label_main_teacher) %> :
</td>
<td class="font_lighter_sidebar">
<%= link_to(@course.teacher.lastname+@course.teacher.firstname, user_path(@course.teacher)) %>
</td>
</tr>
<tr class="hidden">
<td valign="top" style="padding-left: 8px;">
<%= l(:label_setup_time) %> :
</td>
<td class="font_lighter_sidebar">
<%= @course.setup_time %>
</td>
</tr>
<tr class="hidden">
<td valign="top" style="padding-left: 8px;"><%= l(:label_setup_time) %> :</td>
<td class="font_lighter_sidebar"><%= @course.setup_time %></td>
</tr>
<tr class="hidden">
<td valign="top" style="padding-left: 8px;"><%= l(:label_endup_time) %> :</td>
<td class="font_lighter_sidebar"><%= @course.endup_time %></td>
<td valign="top" style="padding-left: 8px;">
<%= l(:label_endup_time) %> :
</td>
<td class="font_lighter_sidebar">
<%= @course.endup_time %>
</td>
</tr>
<tr>
<td valign="top" style="padding-left: 8px;"><%= l(:label_class_period) %> :</td>
<td class="font_lighter_sidebar"><%= @course.class_period %>&nbsp;<%= l(:label_class_hour) %></td>
<td valign="top" style="padding-left: 8px;">
<%= l(:label_class_period) %> :
</td>
<td class="font_lighter_sidebar">
<%= @course.class_period %>&nbsp;
<%= l(:label_class_hour) %>
</td>
</tr>
<tr>
<td valign="top" style="padding-left: 8px;"><%= l(:label_main_term) %> :</td>
<td class="font_lighter_sidebar"><%= @course.time %> <%= @course.term %></td>
<td valign="top" style="padding-left: 8px;">
<%= l(:label_main_term) %> :
</td>
<td class="font_lighter_sidebar">
<%= @course.time %>
<%= @course.term %>
</td>
</tr>
<!-- end -->
<% unless @course.teacher.user_extensions.nil? || @course.teacher.user_extensions.school.nil? %>
<tr>
<td valign="top" style="padding-left: 8px;"><%= l(:label_teacher_work_unit) %> :</td>
<td class="font_lighter_sidebar"><a href="http://course.trustie.net/?school_id=<%= @course.teacher.user_extensions.school.id%>"><%= @course.teacher.user_extensions.school %></a></td>
<td valign="top" style="padding-left: 8px;">
<%= l(:label_teacher_work_unit) %> :
</td>
<td class="font_lighter_sidebar">
<a href="http://<%= Setting.host_course%>/?school_id=<%= @course.teacher.user_extensions.school.id%>">
<%= @course.teacher.user_extensions.school %>
</a>
</td>
</tr>
<% else %>
<tr>
<td valign="top" style="padding-left: 8px;"><%= l(:label_teacher_work_unit) %> :</td>
<td class="font_lighter_sidebar"><%= l(:field_course_un) %></td>
<td valign="top" style="padding-left: 8px;">
<%= l(:label_teacher_work_unit) %> :
</td>
<td class="font_lighter_sidebar">
<%= l(:field_course_un) %>
</td>
</tr>
<% end %>
</table>
</div>
<div class="user_underline"></div>
<!--description-->
@ -180,11 +228,9 @@
<div class="font_title_left">
<%= l(:label_new_course_description) %>
</div>
<div style="padding-bottom: 8px">
<% if @course.description && !@course.description.blank? %>
<div class="font_lighter_sidebar" style="word-break:break-all; word-wrap:break-word;">
<%= textilizable @course.description %>
</div>
<% else %>
@ -193,7 +239,10 @@
</div>
<% end %>
<div class="created_on_course">
<strong style="color: #068d9c"><%= l(:label_create_time) %></strong><%= format_time(@course.created_at) %>
<strong style="color: #068d9c">
<%= l(:label_create_time) %>
</strong>
<%= format_time(@course.created_at) %>
</div>
</div>
<div class="user_underline"></div>
@ -233,10 +282,6 @@
<li>
<%= link_to l(:label_course_feedback), course_feedback_path(@course), :class => link_class(:feedback) %>
</li>
<!-- <li><%= link_to(l(:label_course_repository), {:controller => 'repositories', :action => 'show', :id => @course, :repository_id => nil, :path => nil, :rev => nil, :course => 1}) %></li> -->
<% if User.current.logged? && (User.current.admin? || (!Member.where('user_id = ? and course_id = ?', User.current.id, @course.id).first.nil? && (Member.where('user_id = ? and course_id = ?', User.current.id, @course.id).first.roles&Role.where('id = ? or id = ?', 7, 9)).size >0)) %>
<% end %>
</ul>
</div>
<%= render_flash_messages %>
@ -250,7 +295,9 @@
<%= render :partial => 'layouts/base_footer' %>
</div>
<div id="ajax-indicator" style="display:none;">
<span><%= l(:label_loading) %></span>
<span>
<%= l(:label_loading) %>
</span>
</div>
<div id="ajax-modal" style="display:none;"></div>
</div>

View File

@ -8,7 +8,9 @@
<meta charset="utf-8" />
<meta name="description" content="<%= Redmine::Info.app_name %>" />
<meta name="keywords" content="issue,bug,tracker" />
<title><%=h html_title %></title>
<title>
<%=h html_title %>
</title>
<%= csrf_meta_tag %>
<%= favicon %>
@ -124,7 +126,9 @@
</tr>
<tr>
<td valign="top" style="padding-left: 8px; width:60px"><%= l(:lable_course_teacher) %> :</td>
<td valign="top" style="padding-left: 8px; width:60px">
<%= l(:lable_course_teacher) %> :
</td>
<td class="font_lighter_sidebar">
<%= link_to(course.teacher.lastname+course.teacher.firstname, user_path(course.teacher)) %>
</td>
@ -141,8 +145,13 @@
</tr>
<tr>
<td valign="top" style="padding-left: 8px;"><%= l(:label_main_term) %> :</td>
<td class="font_lighter_sidebar"><%= course.time.to_s %> <%= course.term %></td>
<td valign="top" style="padding-left: 8px;">
<%= l(:label_main_term) %> :
</td>
<td class="font_lighter_sidebar">
<%= course.time.to_s %>
<%= course.term %>
</td>
</tr>
<tr>