This commit is contained in:
z9hang 2014-09-19 15:44:32 +08:00
commit cc73b5e9d7
6 changed files with 54 additions and 120 deletions

View File

@ -127,7 +127,7 @@ module ApplicationHelper
# * :text - Link text (default to attachment filename)
# * :download - Force download (default: false)
def link_to_short_attachment(attachment, options={})
text = h(truncate(options.delete(:text) || attachment.filename, length: 25, omission: '...'))
text = h(truncate(options.delete(:text) || attachment.filename, length: 23, omission: '...'))
route_method = options.delete(:download) ? :download_named_attachment_path : :named_attachment_path
html_options = options.slice!(:only_path)
url = send(route_method, attachment, attachment.filename, options)

View File

@ -57,19 +57,19 @@
var workDescription = $("#softapplication_application_developers").val();
if(workDescription.length ==0)
{
$("#span_softapplication_application_developers").text(<%= l(:label_no_softapplication_developers) %>);
$("#span_softapplication_application_developers").text("<%= l(:label_no_softapplication_developers) %>");
$("#span_softapplication_application_developers").css('color','#ff0000');
return false;
}
if(workDescription.length <= 125)
{
$("#span_softapplication_application_developers").text(<%= l(:label_field_correct) %>);
$("#span_softapplication_application_developers").text("<%= l(:label_field_correct) %>");
$("#span_softapplication_application_developers").css('color','#008000');
return true;
}
else
{
$("#span_softapplication_application_developers").text(<%= l(:label_softapplication_developers_condition) %>);
$("#span_softapplication_application_developers").text("<%= l(:label_softapplication_developers_condition) %>");
$("#span_softapplication_application_developers").css('color','#ff0000');
return false;
}

View File

@ -22,60 +22,21 @@
}
}
</script>
<% object = [] %>
<% object << 'course' %>
<%= error_messages_for object %>
<!--[form:course]-->
<% unless @course.new_record? %>
<p><%= render :partial => "avatar/avatar_form", :locals => {source: @course} %></p>
<% end %>
<!-- <p><%#= f.text_field :name, :required => true, :size => 60, :style => "width:490px;" %></p> -->
<p><label for="course_name" style="font-size: 13px;"><%= l(:label_tags_course_name) %><span class="required">
*&nbsp;&nbsp;</span></label><input id="course_name" type="text" value="<%= @course.name %>" style="width:490px;" size="60" name="course[name]">
<p>
<label for="course_name" style="font-size: 13px;">
<%= l(:label_tags_course_name) %>
<span class="required">*&nbsp;&nbsp;</span>
</label>
<input id="course_name" type="text" value="<%= @course.name %>" style="width:490px;size:60;" name = "course[name]" maxlength="100">
</p>
<!-- <p><%#= f.text_field :extra, :required => true, :size => 60, :style => "width:488px;", :disabled => @course.extra_frozen?, :maxlength => Project::IDENTIFIER_MAX_LENGTH %>
<%# unless @course.extra_frozen? %>
<em class="info"><%#= l(:text_length_between, :min => 1, :max => Project::IDENTIFIER_MAX_LENGTH) %> <%#= l(:text_course_identifier_info).html_safe %></em>
<%# end %></p> -->
<!-- added by bai 新增开课时间、结课时间、课时 -->
<%= f.fields_for @course do |m| %>
<!-- added by bai 新增开课时间、结课时间、课时 -->
<!--
<%# unless @course.nil?%>
<p><table><tr><td><span class="info" align="right" style="width: 90px; font-weight: bold ;margin-left:20px"><%#= l(:label_setup_time) %><span class="required"> *&nbsp;&nbsp;</span></span>
<span class="info" style="width: 10px"><%#= text_field_tag :setup_time, @course.setup_time, :placeholder => "在此选择开课日期" %></span>
<span><%#= calendar_for('setup_time')%></span>
</td></tr></table></p>
<%# else %>
<p><table><tr><td><span class="info" align="right" style="width: 90px; font-weight: bold ;margin-left:20px"><%#= l(:label_setup_time) %><span class="required"> *&nbsp;&nbsp;</span></span>
<span class="info" style="width: 10px"><%#= text_field_tag :setup_time, nil, :placeholder => "在此选择开课日期" %></span>
<span><%#= calendar_for('setup_time')%></span>
</td></tr></table></p>
<%# end %>
<%# unless @course.nil?%>
<p><table><tr><td><span class="info" align="right" style="width: 90px; font-weight: bold ;margin-left:20px"><%#= l(:label_endup_time) %><span class="required"> *&nbsp;&nbsp;</span></span>
<span class="info" style="width: 10px"><%#= text_field_tag :endup_time, @course.endup_time, :placeholder => "在此选择结课日期" %></span>
<span><%#= calendar_for('endup_time')%></span>
</td></tr></table></p>
<%# else %>
<p><table><tr><td><span class="info" align="right" style="width: 90px; font-weight: bold ;margin-left:20px"><%#= l(:label_endup_time) %><span class="required"> *&nbsp;&nbsp;</span></span>
<span class="info" style="width: 10px"><%#= text_field_tag :endup_time, nil, :placeholder => "在此选择结课日期" %></span>
<span><%#= calendar_for('endup_time')%></span>
</td></tr></table></p>
<%# end %>
-->
<% unless @course.nil? %>
<p>
<table>
@ -98,12 +59,9 @@
<span class="info" style="width: 10px;"><%= text_field_tag :class_period, nil, :placeholder => "在此输入课时", :maxlength => 5 %></span><strong><%= l(:label_class_hour) %></strong>
</td>
</tr>
</table></p>
</table>
</p>
<% end %>
<!-- end -->
<!-- added by bai 增加了“年度”和“学期” -->
<p>
<table>
<tr>
@ -127,16 +85,6 @@
</tr>
</table>
</p>
<!-- end -->
<!--added by Wen -->
<!-- end -->
<!-- <p style="margin-left:-10px;"><%#= m.text_field :password, :required => true, :size => 60, :style => "width:488px;margin-left: 10px;" %></p> -->
<p style="margin-left:-10px;">
<label for="course[course]_password" style="font-size: 13px;"><%= l(:label_new_course_password) %>
<span class="required">
@ -144,8 +92,6 @@
</p>
<em class="info" style="margin-left:95px;"><%= l(:text_command) %></em>
<% end %>
<!-- <p style="margin-left:-10px;padding-right: 20px;"><%#= f.text_area :description, :rows => 8, :class => 'wiki-edit', :style => "font-size:small;width:490px;margin-left:10px;" %></p> -->
<p style="padding-right: 20px;">
<label for="course_description" style="font-size: 13px;">
<%= l(:label_new_course_description) %>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
@ -156,23 +102,15 @@
</textarea>
</span>
</p>
<p style="margin-left:-10px;">
<em style="color: #888888;display: block;font-size: 90%;font-style: normal;"><%= f.check_box :is_public, :style => "margin-left:10px;" %><%= l(:label_course_public_info) %></em>
</p><!-- modified by bai -->
<p style="display:none;"><%= f.text_field :course_type, :value => 1 %></p>
<%= wikitoolbar_for 'course_description' %>
<% @course.custom_field_values.each do |value| %>
<p><%= custom_field_tag_with_label :course, value %></p>
<% end %>
<%= call_hook(:view_courses_form, :course => @course, :form => f) %>
<!--[eoform:course]-->
<% unless @course.extra_frozen? %>

View File

@ -1,8 +1,6 @@
<% if @events_by_day != nil && @events_by_day.size >0 %>
<div class="content-title-top-avtive">
<!-- <h3><%#= @author.nil? ? l(:label_activity) : l(:label_user_activity, link_to_user(@author)).html_safe %></h3> -->
<p class="subtitle">
<%#= l(:label_date_from_to, :start => format_date(@date_from), :end => format_date(@date_to - 1)) %>
</p>
<% @events_by_day.keys.sort.reverse.each do |day| %>
@ -13,23 +11,21 @@
<tr>
<td colspan="2" valign="top" width="50"><%= image_tag(url_to_avatar(e.event_author), :class => "avatar") %></td>
<td>
<table width="580px" border="0">
<table width="580px" border="0" style="width: 100%;table-layout: fixed">
<tr>
<td colspan="2" valign="top">
<td colspan="2" valign="top" style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;">
<strong> <%= h(e.event_title) if @course.nil? || (e.course != nil && @course.id != e.course.id) %></strong>
<span class="font_lighter">
<% if @canShowRealName %>
<%= link_to_user(e.event_author) if e.respond_to?(:event_author) %>
(<%= link_to_user(e.event_author, @canShowRealName) if e.respond_to?(:event_author) %>
)
<% else %>
<%= link_to_user(e.event_author) if e.respond_to?(:event_author) %>
<% end %>
<%= l(:label_new_activity) %> </span>
<%= link_to "#{eventToLanguageCourse(e.event_type, @course)}: "<< format_activity_title(e.event_title), (e.event_type.eql?("attachment")&&e.container.kind_of?(Course)) ? course_files_path(e.container) : e.event_url,:style => "word-break:break-all;word-wrap: break-word;" %>
<span class="font_lighter">
<% if @canShowRealName %>
<%= link_to_user(e.event_author) if e.respond_to?(:event_author) %>
(<%= link_to_user(e.event_author, @canShowRealName) if e.respond_to?(:event_author) %>
)
<% else %>
<%= link_to_user(e.event_author) if e.respond_to?(:event_author) %>
<% end %>
<%= l(:label_new_activity) %>
</span>
<%= link_to "#{eventToLanguageCourse(e.event_type, @course)}: "<< format_activity_title(e.event_title), (e.event_type.eql?("attachment")&&e.container.kind_of?(Course)) ? course_files_path(e.container) : e.event_url%>
</td>
</tr>
<tr>
@ -53,7 +49,6 @@
</tr>
</table>
</div>
<% end %>
</div>

View File

@ -54,7 +54,7 @@
<ul class="course_sub_menu">
<% User.current.courses.each do |course| %>
<% if !course_endTime_timeout?(course) %>
<li><%= link_to course.name.truncate(10, omission: '...'), {:controller => 'courses',:action => 'show',id:course.id} %></li>
<li style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;" title="<%=course.name%>"><%= link_to course.name, {:controller => 'courses',:action => 'show',id:course.id} %></li>
<% end %>
<% end %>
</ul>
@ -73,7 +73,7 @@
<ul class="project_sub_menu" style="top: 0px">
<% end %>
<% User.current.projects.each do |project| %>
<li><%= link_to project.name.truncate(10, omission: '...'), {:controller => 'projects', :action => 'show',id: project.id, host: Setting.project_domain } %></li>
<li style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;" title="<%=project.name%>"><%= link_to project.name, {:controller => 'projects', :action => 'show',id: project.id, host: Setting.project_domain } %></li>
<% end %>
</ul>
</li>

View File

@ -39,30 +39,31 @@
</div>
<div class="course welcome_left" id="welcome_left">
<span class="font_welcome_school"> <% if @school_id.nil? and (User.current.user_extensions.nil? || User.current.user_extensions.school.nil?) %>
<span class="font_welcome_school"> <% if @school_id.nil? and (User.current.user_extensions.nil? || User.current.user_extensions.school.nil?) %>
<% else %>
<% if @school_id == "0" %>
<% else %>
<% if @school_id == "0" %>
<% else %>
<% if @school_id.nil? %>
<%= link_to School.find(User.current.user_extensions.school.id).name, options={:action => 'course', :school_id => User.current.user_extensions.school.id}, html_options={:class => 'font_welcome_school', :method => 'get'} %>
<br/>
<% else %>
<%= link_to School.find(@school_id).name, options={:action => 'course', :school_id => @school_id}, html_options={:class => 'font_welcome_school', :method => 'get'} %>
<br/>
<% end %>
<% end %>
<% end %> </span>
<% if @school_id.nil? %>
<%= link_to School.find(User.current.user_extensions.school.id).name, options={:action => 'course', :school_id => User.current.user_extensions.school.id}, html_options={:class => 'font_welcome_school', :method => 'get'} %>
<br/>
<% else %>
<%= link_to School.find(@school_id).name, options={:action => 'course', :school_id => @school_id}, html_options={:class => 'font_welcome_school', :method => 'get'} %>
<br/>
<% end %>
<% end %>
<% end %>
</span>
<% unless @course_page.nil? %>
<span class="font_welcome_trustie"><%= @course_page.title %> </span>
<span class="font_welcome_trustie"><%= @course_page.title %> </span>
<% if @school_id.nil? and (User.current.user_extensions.nil? || User.current.user_extensions.school.nil?) %>
<span class="font_welcome_tdescription">, <%= @course_page.description %></span>
<% else %>
<% if @school_id == "0" %>
<% if @school_id.nil? and (User.current.user_extensions.nil? || User.current.user_extensions.school.nil?) %>
<span class="font_welcome_tdescription">, <%= @course_page.description %></span>
<% else %>
<% if @school_id == "0" %>
<span class="font_welcome_tdescription">, <%= @course_page.description %></span>
<% end %>
<% end %>
<% end %>
<% end %>
</div>
<div class="search-bar" id="search-bar">
<%= render :partial => "search_course", :locals => {:project_type => Project::ProjectType_course} %>
@ -98,7 +99,7 @@
</ul>
</div>
<% else %>
<% if school_course.count < 10 %>
<% if school_course.count < 9 %>
<span>
<%= render :partial => 'more_course', :locals => {:school_id => nil}%>
</span>
@ -110,7 +111,7 @@
<div class="d-p-projectlist-box">
<ul class="d-p-projectlist">
<%= render :partial => 'course_list', :locals => {:course_list => school_course} %>
<% if school_course.count < 10 %>
<% if school_course.count < 9 %>
<li>
<%= render :partial => 'no_course_title', :locals => {:course_title => l(:label_school_less_course)} %>
</li>
@ -123,9 +124,9 @@
<div id="J_Slide" class="d-p-index-box d-p-index-hotproject" style="float: right;">
<h3 style="padding-bottom:0px ;margin-left: 5px; color: #e8770d;">
<strong>问题和反馈动态</strong>
<%= link_to "我要提问", newbie_send_path, {:class => 'orangeButton idea_btn', :style => "color: #EEEEEE"} %>
<%= link_to "我要反馈", suggestion_send_path, {:class => 'orangeButton idea_btn', :style => "color: #EEEEEE"} %>
<strong><%= l(:label_issue_feedback_activities)%></strong>
<%= link_to l(:label_my_question), newbie_send_path, {:class => 'orangeButton idea_btn', :style => "color: #EEEEEE"} %>
<%= link_to l(:label_my_feedback), suggestion_send_path, {:class => 'orangeButton idea_btn', :style => "color: #EEEEEE"} %>
</h3>
<span style="margin-top: -20px;float: right; display: block;"><%= link_to "更多>>", forums_path %></span>
@ -143,13 +144,13 @@
<%= "#{l(:label_updated_time, value: time_tag_welcome(topic_last_time topic))}".html_safe %>
</span>
<span class="memo_author">
楼主 <%= link_to topic.author.login.truncate(10, omission: '...'),user_path(topic.author),title: topic.author.login %>
<%= l(:label_question_sponsor)%> <%= link_to topic.author.login.truncate(10, omission: '...'),user_path(topic.author),title: topic.author.login %>
</span>
<span class="memo_last_person">
最后回复<% unless (topic.last_reply.nil? || topic.last_reply.author.nil?) %><%=link_to topic.last_reply.author.login.truncate(10, omission: '...'),user_path(topic.last_reply.author),title: topic.last_reply.author.login%><% end %>
<%= l(:label_final_reply)%><% unless (topic.last_reply.nil? || topic.last_reply.author.nil?) %><%=link_to topic.last_reply.author.login.truncate(10, omission: '...'),user_path(topic.last_reply.author),title: topic.last_reply.author.login%><% end %>
</span>
<span class="memo_reply">
回复(<%= link_to topic.try(:replies_count), topic.event_url %>)
<%= l(:label_reply)%>(<%= link_to topic.try(:replies_count), topic.event_url %>)
</span>
</div>
</div>