This commit is contained in:
alan 2014-09-22 17:33:02 +08:00
commit 143defd384
11 changed files with 73 additions and 134 deletions

View File

@ -89,10 +89,9 @@ class MemosController < ApplicationController
offset(@reply_pages.offset).
all
if @memo.new_record?
format.html { redirect_to back_url, error: "#{l :label_memo_create_fail}: #{@memo.errors.full_messages[0]}" }
format.html { render :new,:layout=>'base'}
else
format.html { render action: :show }#, error: "#{l :label_memo_create_fail}: #{@memo.errors.full_messages[0]}" }
# format.html { redirect_to back_memo_or_forum_url}#, error: "#{l :label_memo_create_fail}: #{@memo.errors.full_messages[0]}" }
format.html { render action: :show }
format.json { render json: @memo.errors, status: :unprocessable_entity }
end

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

@ -12,7 +12,7 @@
:filename => attachment.filename%>
<% end %>
<span title="<%= attachment.description%>">
<%= h(truncate(" - #{attachment.description}", length: 20, omission: '...')) unless attachment.description.blank? %>
<%= h(truncate(" - #{attachment.description}", length: 15, omission: '...')) unless attachment.description.blank? %>
</span>
<span class="size">(<%= number_to_human_size attachment.filesize %>)</span>
<% if options[:deletable] %>
@ -34,7 +34,10 @@
<% end %>
<% if options[:author] %>
<!-- modified by zjc author添加超链接 -->
<span class="author"><%= link_to h(attachment.author),user_path(attachment.author) %>, <%= format_time(attachment.created_on) %></span>
<span class="author" title="attachment.author">
<%= link_to h(truncate(attachment.author.name, length: 10, omission: '...')),user_path(attachment.author) %>,
<%= format_time(attachment.created_on) %>
</span>
<% end %>
</p>
<% end %>

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

@ -56,7 +56,7 @@
<div class="sidebar-forums">
<div class="forums-line">
<div class="forums-title"><%= @forum.name %></div>
<div class="forums-description"><%= textilizable @forum.description %></div>
<div class="forums-description"><%= textAreailizable @forum.description %></div>
</div>
<!--informations-->
<div class="formus-first-title" >创建人信息</div>

View File

@ -1,15 +1,5 @@
<%= labelled_form_for(@memo, :url => forum_memos_path) do |f| %>
<% if @memo.errors.any? %>
<div id="error_explanation">
<h2><%= pluralize(@memo.errors.count, "error") %> prohibited this memo from being saved:</h2>
<ul>
<% @memo.errors.full_messages.each do |msg| %>
<li><%= msg %></li>
<% end %>
</ul>
</div>
<% end %>
<div class="actions" style="max-width:680px">
<p><%= f.text_field :subject, :required => true, :size => 95 %></p>
<p style="max-width:680px"><%= f.text_area :content, :required => true, :id => 'editor01' %></p>
@ -20,6 +10,6 @@
<%= l(:label_attachment_plural) %><br />
<%= render :partial => 'attachments/form', :locals => {:container => @memo} %>
</p>
<%= f.submit :value => l(:label_memo_create) %>
<%= f.submit :value => l(:label_memo_create) %> <%= link_to l(:button_back), forum_path(@forum) %>
</div>
<% end %>

View File

@ -27,5 +27,5 @@
<%= render :partial => 'memos/topic_form' %>
</div>
<%= link_to l(:button_back), forum_path(@forum) %>
</div>

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>

View File

@ -0,0 +1,13 @@
class Change225BidData < ActiveRecord::Migration
def up
bid = Bid.find 225
bid.proportion = 60
bid.save
end
def down
bid = Bid.find 225
bid.proportion = 60
bid.save
end
end

View File

@ -11,7 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.
ActiveRecord::Schema.define(:version => 20140916005319) do
ActiveRecord::Schema.define(:version => 20140922032830) do
create_table "activities", :force => true do |t|
t.integer "act_id", :null => false