diff --git a/app/api/mobile/entities/user.rb b/app/api/mobile/entities/user.rb index 9112e7ec5..6b0064036 100644 --- a/app/api/mobile/entities/user.rb +++ b/app/api/mobile/entities/user.rb @@ -34,6 +34,8 @@ module Mobile user_expose :img_url #昵称 expose :nickname + #真名 + expose :realname #性别 user_expose :gender #我的二维码 diff --git a/app/services/courses_service.rb b/app/services/courses_service.rb index 6f207d76d..e91883bee 100644 --- a/app/services/courses_service.rb +++ b/app/services/courses_service.rb @@ -40,9 +40,9 @@ class CoursesService end @courses = courses_all.visible(current_user) if params[:name].present? - @courses_all = @courses.like(params[:name]) + @courses_all = @courses.like(params[:name]).order("created_at desc") else - @courses_all = @courses; + @courses_all = @courses.order("created_at desc"); end @courses_all course_list = [] diff --git a/app/services/users_service.rb b/app/services/users_service.rb index 63dd725cd..c1f716fd1 100644 --- a/app/services/users_service.rb +++ b/app/services/users_service.rb @@ -77,7 +77,7 @@ class UsersService gender = @user.user_extensions.gender.nil? ? 0 : @user.user_extensions.gender work_unit = get_user_work_unit @user location = get_user_location @user - {:id => @user.id, :img_url => img_url, :nickname => @user.login, :gender => gender, :work_unit => work_unit, :mail => @user.mail, :location => location, :brief_introduction => @user.user_extensions.brief_introduction} + {:id => @user.id, :img_url => img_url,:realname => @user.realname, :nickname => @user.login, :gender => gender, :work_unit => work_unit, :mail => @user.mail, :location => location, :brief_introduction => @user.user_extensions.brief_introduction} end #忘记密码 diff --git a/app/views/courses/_course.html.erb b/app/views/courses/_course.html.erb index abcbbfe5b..8974c3089 100644 --- a/app/views/courses/_course.html.erb +++ b/app/views/courses/_course.html.erb @@ -33,6 +33,15 @@ <% end %>

+

+ <%= content_tag "span","#{l(:label_duration_time)}:", :class => "course-font"%> + <%= get_course_term @course %> +

+

+ <%= content_tag "span", "#{l(:label_course_brief_introduction)}:", :class => "course-font" %> + <%= content_tag "div", course.short_description, :class => "brief_introduction", :title => course.short_description %> +

+
@@ -71,15 +80,13 @@
-
- <%= content_tag "span","#{l(:label_duration_time)}:", :class => "course-font"%> - <%= get_course_term @course %> -
+ <%= content_tag "span","#{l(:label_duration_time)}:", :class => "course-font"%> + <%= get_course_term @course %>
- <%= content_tag "span", "#{l(:label_course_brief_introduction)}:", :class => "course-font" %> - <%= content_tag "div", course.short_description, :class => "brief_introduction", :title => course.short_description %> + <%= content_tag "span", "#{l(:label_course_brief_introduction)}:", :class => "course-font" %> + <%= content_tag "div", course.short_description, :class => "brief_introduction", :title => course.short_description %>
diff --git a/app/views/courses/show.html.erb b/app/views/courses/show.html.erb index 1cc117dd6..1d2c42457 100644 --- a/app/views/courses/show.html.erb +++ b/app/views/courses/show.html.erb @@ -40,7 +40,7 @@


- <%= l :label_create_time %>: : <%= format_time(@course.created_at) %> + <%= l :label_create_time %> : <%= format_time(@course.created_at) %>

diff --git a/app/views/files/_course_list.html.erb b/app/views/files/_course_list.html.erb index 42f51e07a..888910ac1 100644 --- a/app/views/files/_course_list.html.erb +++ b/app/views/files/_course_list.html.erb @@ -25,27 +25,27 @@ <% if file.is_public? || User.current.member_of_course?(course) %>
- <%= link_to_attachment file, :download => true,:text => truncate(file.filename,length: 35, omission: '...'), :title => file.filename+"\n"+file.description.to_s, :style => "overflow: hidden; white-space: nowrap;text-overflow: ellipsis;",:class => "c_dblue f_14 f_b f_l" %> + <%= link_to_attachment file, :download => true,:text => truncate(file.filename,length: 35, omission: '...'), :title => file.filename+"\n"+file.description.to_s,:class => "c_dblue f_14 f_b f_l hiddent" %> <% if User.current.logged? %> <% if (is_course_teacher(User.current,@course) || file.author_id == User.current.id) && course_contains_attachment?(@course,file) %> - <%= link_to("选入我的其他课程",quote_resource_show_course_file_path(@course,file),:class => "f_l re_select",:remote => true) if has_course?(User.current,file) %> + <%= link_to("选入我的其他课程",quote_resource_show_course_file_path(@course,file),:class => "f_l re_select c_lorange",:remote => true) if has_course?(User.current,file) %> <% if delete_allowed && file.container_id == @course.id && file.container_type == "Course" %> - <%= link_to (file.is_public? ? "公开":"私有"), update_file_dense_attachments_path(:attachmentid=>file.id,:newtype=>(file.is_public? ? 0:1)),:remote=>true,:class=>"f_l re_open",:method => :post %> + <%= link_to (file.is_public? ? "公开":"私有"), update_file_dense_attachments_path(:attachmentid=>file.id,:newtype=>(file.is_public? ? 0:1)),:remote=>true,:class=>"f_l re_open c_blue",:method => :post %> <% else %> <% end %> <% else %> - <%= link_to("选入我的课程",quote_resource_show_course_file_path(@course,file),:class => "f_l re_select",:remote => true) if has_course?(User.current,file) %> + <%= link_to("选入我的课程",quote_resource_show_course_file_path(@course,file),:class => "f_l re_select c_lorange",:remote => true) if has_course?(User.current,file) %> <% end %> <% else %> <% end %>
-

文件大小:<%= number_to_human_size(file.filesize) %>

+

文件大小:<%= number_to_human_size(file.filesize) %>

<%= link_to( l(:button_delete), attachment_path(file), :data => {:confirm => l(:text_are_you_sure)}, :method => :delete,:class => "f_r re_de") if delete_allowed && file.container_id == @course.id && file.container_type == "Course"%>

<%= time_tag(file.created_on).html_safe %><%= l(:label_bids_published_ago) %>  |  下载<%= file.downloads %>  |  引用<%= file.quotes.nil? ? 0:file.quotes %>

diff --git a/app/views/files/_tag_yun.html.erb b/app/views/files/_tag_yun.html.erb index c9ac1999f..9db34ece4 100644 --- a/app/views/files/_tag_yun.html.erb +++ b/app/views/files/_tag_yun.html.erb @@ -1,9 +1,9 @@ <% unless tag_list.nil?%> <% tag_list.each do |k,v|%> <% if tag_name && tag_name == k%> - <%= k%>(<%= v%> + <%= k%>×<%= v%> <% else%> - <%= k%>(<%= v%> + <%= k%>×<%= v%> <% end%> <% end%> <% end%> \ No newline at end of file diff --git a/app/views/layouts/base_courses.html.erb b/app/views/layouts/base_courses.html.erb index dec4a5f4d..dc384834c 100644 --- a/app/views/layouts/base_courses.html.erb +++ b/app/views/layouts/base_courses.html.erb @@ -35,7 +35,7 @@ <%= l(:label_courses_community)%> -

+

<%= l(:label_user_location) %> : <%= link_to l(:field_homepage), home_path %> > @@ -80,7 +80,7 @@

- + <%= @course.name %> <% if @course.is_public == 0%> diff --git a/app/views/welcome/course.html.erb b/app/views/welcome/course.html.erb index a764c6eb8..5c57a5ba1 100644 --- a/app/views/welcome/course.html.erb +++ b/app/views/welcome/course.html.erb @@ -39,21 +39,12 @@
+ <% if User.current.login? %> - <% if @school_id.nil? and (User.current.user_extensions.nil? || User.current.user_extensions.school.nil?) %> - , - - <%= l(:label_welcome_trustie_course_description) %> - - <% else %> - <% if @school_id == "0" %> - + <% 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.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'} %>
@@ -61,10 +52,20 @@ <%= link_to School.find(@school_id).name, options={:action => 'course', :school_id => @school_id}, html_options={:class => 'font_welcome_school', :method => 'get'} %>
<% end %> + <% end %> <% end %> - <% end %>
- <% unless @course_page.nil? %> + + + <%= l(:label_welcome_trustie_course) %> + + <% else %> + <% unless @course_page.nil? %> <%= l(:label_welcome_trustie_course) %> - + , + + <%= l(:label_welcome_trustie_course_description) %> + + <% end %> <% end %> +