diff --git a/app/controllers/contests_controller.rb b/app/controllers/contests_controller.rb index 627e1945b..af532cd87 100644 --- a/app/controllers/contests_controller.rb +++ b/app/controllers/contests_controller.rb @@ -188,10 +188,10 @@ class ContestsController < ApplicationController # Added by Longjun def destroy_contest @contest = Contest.find(params[:id]) - if @contest.author_id == User.current.id + if @contest.author_id == User.current.id || User.current.admin? @contest.destroy - redirect_to action: 'index' + redirect_to welcome_contest_url else render_403 :message => :notice_not_contest_delete_authorized end diff --git a/app/controllers/school_controller.rb b/app/controllers/school_controller.rb index a7bf1edb8..008fe00fc 100644 --- a/app/controllers/school_controller.rb +++ b/app/controllers/school_controller.rb @@ -58,7 +58,7 @@ class SchoolController < ApplicationController options_s = "" school.each do |s| - options_s << "
  • #{s.name}
  • " + options_s << "
  • #{s.name}
  • " end res = Hash.new @@ -78,7 +78,7 @@ class SchoolController < ApplicationController @school.each do |s| #options << "" - options << "
  • #{s.name}
  • " + options << "
  • #{s.name}
  • " end @@ -91,7 +91,7 @@ class SchoolController < ApplicationController options = "" @school.each do |s| - options << "
  • #{s.name}
  • " + options << "
  • #{s.name}
  • " end render :text => options @@ -105,7 +105,7 @@ class SchoolController < ApplicationController options = "" @school.each do |s| - options << "
  • #{s.name}
  • " + options << "
  • #{s.name}
  • " end options = "
    #{l(:label_school_not_fount)}
    " if options.blank? diff --git a/app/controllers/words_controller.rb b/app/controllers/words_controller.rb index 4e7768785..89fa0e1dc 100644 --- a/app/controllers/words_controller.rb +++ b/app/controllers/words_controller.rb @@ -47,7 +47,6 @@ class WordsController < ApplicationController # 删除留言功能要调用destroy,也记得在destroy.js中修改 # deny api. api useless - @show_real_name = params[:show_real_name] || false parent_id = params[:reference_id] author_id = User.current.id reply_user_id = params[:reference_user_id] diff --git a/app/controllers/zipdown_controller.rb b/app/controllers/zipdown_controller.rb index 6cbe0dd95..cee26ae32 100644 --- a/app/controllers/zipdown_controller.rb +++ b/app/controllers/zipdown_controller.rb @@ -44,7 +44,7 @@ class ZipdownController < ApplicationController if homework != nil unless homework.attachments.empty? zipfile = zip_homework_by_user homework - send_file zipfile, :filename => homework.name+".zip", :type => detect_content_type(zipfile) if(zipfile) + send_file zipfile, :filename => homework.user.user_extensions.student_id + "_" + homework.user.lastname + homework.user.firstname + "_" + homework.name+".zip", :type => detect_content_type(zipfile) if(zipfile) else render file: 'public/no_file_found.html' end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 9c5d8c9b5..8c2542aa2 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -251,7 +251,7 @@ module ApplicationHelper end def toggle_link(name, id, options={}) - onclick = "$('##{id}').toggle(); " + onclick = "$('##{id}').slideToggle(); " onclick << (options[:focus] ? "$('##{options[:focus]}').focus(); " : "this.blur(); ") onclick << "return false;" link_to(name, "#", :onclick => onclick) diff --git a/app/helpers/courses_helper.rb b/app/helpers/courses_helper.rb index 04b5ad89d..d06bf7d38 100644 --- a/app/helpers/courses_helper.rb +++ b/app/helpers/courses_helper.rb @@ -450,9 +450,9 @@ module CoursesHelper end #课程实践年份下拉框 - def course_time_option + def course_time_option year type = [] - now_year = Time.now.year + now_year = year.nil? ? Time.now.year : (Time.now.year <= year ? Time.now.year : year) for i in (now_year..now_year + 10) option = [] option << i diff --git a/app/views/bids/_homework_list.html.erb b/app/views/bids/_homework_list.html.erb index 23f7070b2..202a2ee91 100644 --- a/app/views/bids/_homework_list.html.erb +++ b/app/views/bids/_homework_list.html.erb @@ -22,7 +22,7 @@ <%= link_to "留言", get_homework_jours_homework_attach_index_path(:bid_id => @bid.id), {:remote => true}%> (<%= @jours_count %>) -
  • +
  • <%= link_to "作品打包下载", zipdown_assort_path(obj_class: @bid.class, obj_id: @bid), class: "tb_all" unless @bid.homeworks.empty? %>
  • diff --git a/app/views/bids/contest.html.erb b/app/views/bids/contest.html.erb index bd069c8c8..a5dcf8041 100644 --- a/app/views/bids/contest.html.erb +++ b/app/views/bids/contest.html.erb @@ -2,8 +2,14 @@ <%= form_tag(:controller => 'bids', :action => 'contest', :method => :get) do %> - - + + - - +
    <%= l(:label_contest_innovate) %><%= l(:label_user_location) %> : + + <%=l(:label_contest_innovate_community)%> + + + <%= l(:label_user_location) %> : + <% if User.current.logged? %> <% unless User.current.user_extensions.identity == 1 %> @@ -20,8 +26,10 @@
    <%= link_to request.host()+"/contest", :controller => 'bids', :action => 'index' %> <%=link_to l(:field_homepage), home_path %> > <%=link_to l(:label_contest_innovate), :controller => 'bids', :action => 'contest' %> + <%=link_to l(:field_homepage), home_path %> > + <%= l(:label_contest_innovate) %> +
    <% end %> diff --git a/app/views/boards/_course_show.html.erb b/app/views/boards/_course_show.html.erb index cde2019a1..7514b48f6 100644 --- a/app/views/boards/_course_show.html.erb +++ b/app/views/boards/_course_show.html.erb @@ -20,7 +20,7 @@ <%= render :partial => 'messages/form', :locals => {:f => f} %>

    - <%= l(:button_submit)%> + <%= l(:button_submit)%> <%= link_to l(:button_cancel), "#", :onclick => '$("#add-message").hide(); return false;' ,:class => 'ButtonColor m3p10' %>

    <% end %> diff --git a/app/views/contests/index.html.erb b/app/views/contests/index.html.erb index 0c6b0e109..f966f149d 100644 --- a/app/views/contests/index.html.erb +++ b/app/views/contests/index.html.erb @@ -2,8 +2,14 @@ <%= form_tag({:controller => 'contests', :action => 'index'}, :method => :get) do %> - - + + diff --git a/app/views/courses/_course_form.html.erb b/app/views/courses/_course_form.html.erb index b722956e8..c48d24935 100644 --- a/app/views/courses/_course_form.html.erb +++ b/app/views/courses/_course_form.html.erb @@ -38,12 +38,13 @@
    <%= l(:label_contest_innovate) %><%= l(:label_user_location) %> : + + <%=l(:label_contest_innovate_community)%> + + + <%= l(:label_user_location) %> : + <% if User.current.logged? %> <% unless User.current.user_extensions.identity == 1 %> @@ -29,7 +35,7 @@ <%=link_to l(:field_homepage), home_path %> > - <%=link_to l(:label_contest_innovate), :controller => 'contests', :action => 'index' %> + <%= l(:label_contest_innovate) %>
    + +
    - <%= l(:label_class_period) %> - *   + + <%= l(:label_class_period) %> + *   + <%= text_field_tag :class_period, @course.class_period, :placeholder => "#{l(:lable_input_class)}", :maxlength => 5 %> -  <%= l(:label_class_hour) %>   <%= l(:label_class_hour) %> @@ -98,7 +99,7 @@ - <%= select_tag :time,options_for_select(course_time_option,@course.time), {} %> + <%= select_tag :time,options_for_select(course_time_option(@course.time),@course.time), {} %> <%= select_tag :term,options_for_select(course_term_option,@course.term || cur_course_term),{} %> diff --git a/app/views/homework_attach/_app_link.html.erb b/app/views/homework_attach/_app_link.html.erb index 1c089dbe0..97c2e2f37 100644 --- a/app/views/homework_attach/_app_link.html.erb +++ b/app/views/homework_attach/_app_link.html.erb @@ -1,6 +1,6 @@ <% for attachment in attachments %> <% if attachments.count > 1 && attachment != attachments.first%> -
                     +
                 <% end %> <%= link_to_short_attachment attachment, :class => 'icon icon-attachment', :download => true -%> <% if attachment.is_text? %> diff --git a/app/views/homework_attach/_homework.html.erb b/app/views/homework_attach/_homework.html.erb index d11ea3333..e14475f9f 100644 --- a/app/views/homework_attach/_homework.html.erb +++ b/app/views/homework_attach/_homework.html.erb @@ -1,4 +1,4 @@ -
  • +
  • <% if is_student_batch_homework %> <%= image_tag(url_to_avatar("匿名"), :width => "40", :height => "40")%> @@ -19,6 +19,10 @@ <% homework_filename = homework.name %> <% end %> <%= link_to homework_filename , homework_attach_path(homework,:cur_page => @cur_page,:cur_type => @cur_type), :title => homework_filename, :remote => true%> + + 提交时间: + <%= format_time homework.created_at%> +
  • <%= link_to "(#{homework.attachments.count.to_s}个附件)", zipdown_download_user_homework_path(:homework => homework)%> @@ -51,7 +55,7 @@ <% if is_my_homework %> <% if @bid.comment_status == 0 || @bid.open_anonymous_evaluation == 0 %> -
  • +
  • <%= link_to l(:button_edit), edit_homework_attach_path(homework) %> <% if homework.user == User.current || User.current.admin? %> diff --git a/app/views/homework_attach/_jour.html.erb b/app/views/homework_attach/_jour.html.erb index 055e1a015..fe2eca8dc 100644 --- a/app/views/homework_attach/_jour.html.erb +++ b/app/views/homework_attach/_jour.html.erb @@ -46,7 +46,7 @@
    - <%= render :partial => "words/journal_reply", :locals => {:journal => jour,:show_name=> show_name, :show_real_name => true } %> + <%= render :partial => "words/journal_reply", :locals => {:journal => jour,:show_name=> show_name} %>
    diff --git a/app/views/homework_attach/_journal_reply_items.html.erb b/app/views/homework_attach/_journal_reply_items.html.erb index dd09bd84f..ac60709ad 100644 --- a/app/views/homework_attach/_journal_reply_items.html.erb +++ b/app/views/homework_attach/_journal_reply_items.html.erb @@ -1,4 +1,3 @@ -<% show_real_name ||= false %> <% reply_allow = JournalsForMessage.create_by_user? User.current %> <% ids_r = 'reply_respond_form_'+ reply.id.to_s %>
    @@ -15,11 +14,7 @@ 回复 <% parent_jour = JournalsForMessage.find reply.m_reply_id %> <% if show_name && parent_jour %> - <% if show_real_name%> - <%= link_to parent_jour.user.lastname+parent_jour.user.firstname, user_path(parent_jour.user) %> - <% else %> - <%= link_to parent_jour.user.name, user_path(parent_jour.user) %> - <% end %> + <%= link_to parent_jour.user.name, user_path(parent_jour.user) %> <% else %> <%= l(:label_anonymous) %> <% end %> diff --git a/app/views/homework_attach/_show.html.erb b/app/views/homework_attach/_show.html.erb index bce3e4d03..bf797e441 100644 --- a/app/views/homework_attach/_show.html.erb +++ b/app/views/homework_attach/_show.html.erb @@ -61,16 +61,24 @@
  • -
  • <%= l(:label_activity_time) %>:<%=format_time @homework.created_at %>
  • +
  • + <%= l(:label_activity_time) %>: + + <%=format_time @homework.created_at %> + +
  • <% if @homework.users.count > 0 %> -
    <%= l(:label_participation_person) %>: +
    + <%= l(:label_participation_person) %>: <% if @is_anonymous_comments && @is_comprehensive_evaluation != 1 %> <%= l(:label_anonymous) %> <%else%> <% @homework.users.each do |homework_user| %> - <%= link_to homework_user, user_path(homework_user)%> + + <%= link_to homework_user, user_path(homework_user)%> + <% if @homework.users.count > 1 && homework_user != @homework.users.last %> 、                 <% end %> @@ -84,15 +92,23 @@ <%= @homework.description %> <% else %>
    - <%= l(:label_homework_without_description) %> + + <%= l(:label_homework_without_description) %> +
    <% end %>

    -

    <%= l(:label_attachment) %>: +

    + + <%= l(:label_attachment) %>: - <% options = {:author => true } %> - <%= render :partial => 'app_link', :locals => {:attachments => @homework.attachments, :options => options} %> + <% if @homework.attachments.empty?%> + 尚未提交附件 + <% else%> + <% options = {:author => true } %> + <%= render :partial => 'app_link', :locals => {:attachments => @homework.attachments, :options => options} %> + <% end%>

    diff --git a/app/views/homework_attach/add_jour_reply.js.erb b/app/views/homework_attach/add_jour_reply.js.erb index 34cec1cca..564229d81 100644 --- a/app/views/homework_attach/add_jour_reply.js.erb +++ b/app/views/homework_attach/add_jour_reply.js.erb @@ -1,7 +1,7 @@ <% if @save_succ %> var pre_append = $('<%= j( render :partial => "journal_reply_items", - :locals => {:reply => @jfm, :journal => @jfm.parent, :m_reply_id => @jfm, :show_real_name => true} + :locals => {:reply => @jfm, :journal => @jfm.parent, :m_reply_id => @jfm} ) %>').hide(); $('#journal_reply_ul_<%=@jfm.m_parent_id%>').append(pre_append); pre_append.fadeIn(600); diff --git a/app/views/homework_attach/edit.html.erb b/app/views/homework_attach/edit.html.erb index cfe4bf097..d88285385 100644 --- a/app/views/homework_attach/edit.html.erb +++ b/app/views/homework_attach/edit.html.erb @@ -41,13 +41,13 @@
      -
    • +
    • 修改作业
    • 成员
    • -
    • +
    • <%= link_to(l(:label_project_new), {:controller => 'projects', :action => 'new', :course => 0, @@ -60,22 +60,26 @@
      <%= form_for(@homework) do |f|%>

      - + <%= f.text_field :name, :required => true, :name => "homework_name", :class => "w430 bo", :maxlength => 254, :placeholder => "作品名称", :onblur => "regexName();"%>

      -

      - - <%#= render :partial => 'attachments/form' %> + <% unless @homework.attachments.empty?%>

      <% options = {:author => true, :deletable => attach_delete(@homework)} %> diff --git a/app/views/homework_attach/new.html.erb b/app/views/homework_attach/new.html.erb index c843482a9..877cb6d18 100644 --- a/app/views/homework_attach/new.html.erb +++ b/app/views/homework_attach/new.html.erb @@ -41,10 +41,10 @@

        -
      • +
      • 创建作品
      • -
      • +
      • <%= link_to(l(:label_project_new), {:controller => 'projects', :action => 'new', :course => 0, @@ -72,19 +72,20 @@

        -

        - - <%#= render :partial => 'attachments/form' %> +

        <%= render :partial => 'attachments/form' %>

        diff --git a/app/views/layouts/_base_softapplication_index_top_content.html.erb b/app/views/layouts/_base_softapplication_index_top_content.html.erb index ff897a866..f5daa020e 100644 --- a/app/views/layouts/_base_softapplication_index_top_content.html.erb +++ b/app/views/layouts/_base_softapplication_index_top_content.html.erb @@ -13,8 +13,14 @@
        - - + + - -
        <%=l(:label_contest_innovate_community)%><%= l(:label_user_location) %> : + + <%=l(:label_contest_innovate_community)%> + + + <%= l(:label_user_location) %> : +
        <%=link_to request.host()+"/softapplications", :controller=>'softapplications', :action=>'index' %><%=link_to l(:field_homepage), home_path %> > - <%=link_to l(:label_contest_work), :controller=>'softapplications', :action=>'index' %> + + <%=link_to l(:field_homepage), home_path %> > + <%=link_to l(:label_contest_work), :controller=>'softapplications', :action=>'index' %>
        diff --git a/app/views/layouts/_base_softapplication_top_content.html.erb b/app/views/layouts/_base_softapplication_top_content.html.erb index 71c708d63..afa2e1d29 100644 --- a/app/views/layouts/_base_softapplication_top_content.html.erb +++ b/app/views/layouts/_base_softapplication_top_content.html.erb @@ -1,18 +1,24 @@
        - - + + - - diff --git a/app/views/layouts/_tag.html.erb b/app/views/layouts/_tag.html.erb index e0e2b49fd..898d9b580 100644 --- a/app/views/layouts/_tag.html.erb +++ b/app/views/layouts/_tag.html.erb @@ -11,12 +11,12 @@ @@ -29,12 +29,12 @@ diff --git a/app/views/layouts/base_bids.html.erb b/app/views/layouts/base_bids.html.erb index d7d9e3924..e04889d2a 100644 --- a/app/views/layouts/base_bids.html.erb +++ b/app/views/layouts/base_bids.html.erb @@ -34,27 +34,42 @@
        -
        <%=l(:label_contest_innovate_community)%><%= l(:label_user_location) %> : + + <%=l(:label_contest_innovate_community)%> + + + <%= l(:label_user_location) %> : +
        <%=link_to request.host()+"/contests", :controller=>'contests', :action=>'index' %><%=link_to l(:field_homepage), home_path %> > - <%=link_to l(:label_contest_innovate), :controller=>'contests', :action=>'index' %> > - - <% contest = @softapplication.contests.first %><%= contest ? link_to(contest.name, show_contest_contest_path(contest)) : '尚未加入竞赛'%> - + + <%=link_to l(:field_homepage), home_path %> > + <%= l(:label_contest_innovate) %> + + <% contest = @softapplication.contests.first %><%= contest ? link_to(contest.name, show_contest_contest_path(contest)) : '尚未加入竞赛'%> +
        - - - - - - - - - -
        企业众包社区<%= l(:label_user_location) %> : - -
        <%= link_to request.host()+"/calls", :controller => 'bids', :action => 'index' %> <%=link_to l(:field_homepage), home_path %> > <%=link_to l(:label_requirement_enterprise), :controller => 'bids', :action => 'index' %> > - <%=link_to @bid.name ,bid_path %>
        + + + + + + + + + + +
        + 企业众包社区 + + + <%= l(:label_user_location) %> : + + +
        + + + + + <%=link_to l(:field_homepage), home_path %> > + <%=link_to l(:label_requirement_enterprise), :controller => 'bids', :action => 'index' %> > + + <%=link_to @bid.name ,bid_path %> + +
        @@ -66,50 +81,98 @@
    <%= image_tag(url_to_avatar(@user), :class => "avatar2") %> - - - - - - <% if User.current.login? %> - - - - - - - <% end %> -
    <%= link_to @bid.name,bid_path %>
    <%= link_to(l(:label_fork_homework_new), fork_path(@bid)) %>
    <%= watcher_link(@bid, User.current) %>
    + + + + <% if User.current.login? %> + + + + + + + <% end %> +
    + <%= link_to @bid.name,bid_path %> +
    + <%= link_to(l(:label_fork_homework_new), fork_path(@bid)) %> +
    + + + <%= watcher_link(@bid, User.current) %> + +
    + - + <% if @bid.reward_type.nil? or @bid.reward_type == 1%> - + <% elsif @bid.reward_type == 2%> - - <% else %> - + + <% else %> + <% end %> - + - + - - - + + + +
    <%= l(:label_investor) %><%= link_to(@user, user_path(@user))%> + <%= l(:label_investor) %> + <%= link_to(@user, user_path(@user))%> +
    <%= l(:label_bids_reward_method) %><%= l(:label_call_bonus) %> <%= l(:label_RMB_sign) %><%= @bid.budget%> + <%= l(:label_bids_reward_method) %> + + <%= l(:label_call_bonus) %>  + <%= l(:label_RMB_sign) %> + <%= @bid.budget%> + + <%= l(:label_bids_reward_method) %><%= @bid.budget%><%= l(:label_bids_reward_method) %><%= l(:label_bids_credit) %> <%= @bid.budget%> <%= l(:label_bids_credit_number) %> + <%= l(:label_bids_reward_method) %> + <%= @bid.budget%> + + <%= l(:label_bids_reward_method) %> + <%= l(:label_bids_credit) %>  + <%= @bid.budget%>  + <%= l(:label_bids_credit_number) %> +
    <%= l(:label_investment_time_limit) %><%= @bid.deadline%> + <%= l(:label_investment_time_limit) %> + <%= @bid.deadline%> +
    被 <%= link_to(Bid.where('parent_id = ?', @bid.id).count, show_course_path(@bid)) %>  - 个高校课程引用为作业!
    +
    被  + + <%= link_to(Bid.where('parent_id = ?', @bid.id).count, show_course_path(@bid)) %> +   + 个高校课程引用为作业! +
    +
    有 <%= link_to(count_bid_project, show_bid_project_path(@bid)) %>  - 个项目正在实现该需求!
    有 <%= link_to(count_bid_user, show_bid_user_path(@bid)) %>  - 个高校用户正在努力完成此需求!
    +
    + 有  + <%= link_to(count_bid_project, show_bid_project_path(@bid)) %>  + 个项目正在实现该需求! +
    +
    +
    + 有  + <%= link_to(count_bid_user, show_bid_user_path(@bid)) %>  + 个高校用户正在努力完成此需求! +
    +
    <%= link_to l(:label_x_followers, :count => @bid.watcher_users.count)+"("+@bid.watcher_users.count.to_s+")", respond_path(@bid) %>   @@ -121,10 +184,12 @@
    - <%= l(:label_tag) %> + + <%= l(:label_tag) %> +
    - +
    @@ -177,10 +243,7 @@
    <%= render :partial => 'tags/tag', :locals => {:obj => @bid, :object_flag => "4"}%> @@ -144,11 +209,12 @@ <% if @bid.watcher_users.size>0 %> <% for user in @bid.watcher_users%> - <%= link_to image_tag(url_to_avatar(user), :class => "avatar", :title => user.name ),user_path(user) %> <% end %> <% else %> -

    <%= l(:label_project_no_follow) %>

    +

    + <%= l(:label_project_no_follow) %> +

    <% end%>
    - - - @@ -190,7 +253,6 @@ <%= render_menu :bid_menu %> <% end %> - <%= yield %> <%= call_hook :view_layouts_base_content %>
    @@ -199,12 +261,10 @@ - - <%= call_hook :view_layouts_base_body_bottom %> diff --git a/app/views/layouts/base_contest.html.erb b/app/views/layouts/base_contest.html.erb index cf8b7d475..6e980957b 100644 --- a/app/views/layouts/base_contest.html.erb +++ b/app/views/layouts/base_contest.html.erb @@ -29,8 +29,16 @@
    - - + + - - +
    <%=l(:label_contest_innovate_community)%><%= l(:label_user_location) %> : + + <%=l(:label_contest_innovate_community)%> + + + + <%= l(:label_user_location) %> : + +
    <%=link_to request.host()+"/contest", :controller => 'bids', :action => 'contest' %><%=link_to l(:field_homepage), home_path %> > <%=link_to l(:label_contest_innovate), :controller => 'bids', :action => 'contest' %> > - <%= link_to @bid.name, bid_path %> + <%=link_to l(:field_homepage), home_path %> > + <%= l(:label_contest_innovate)%> > + + <%= link_to @bid.name, bid_path %> + +
    @@ -58,27 +70,29 @@ <%= image_tag(url_to_avatar(@user), :class => "avatar2") %> - + - - - - - <% if User.current.login? %> - - + <% if User.current.login? %> + + + + <% end %> +
    <%= h @bid.name %>
    - - <%= join_in_contest(@bid, User.current)%> - - - - <%= watcher_link(@bid, User.current) %> - + + + - - <% end %> -
    + <%= h @bid.name %>
    - +
    + + <%= join_in_contest(@bid, User.current)%> + + + + <%= watcher_link(@bid, User.current) %> + +
    + <% if User.current.logged? %> <% if @bid.author.id == User.current.id %> <%= link_to l(:label_contest_modify_settings), {:controller => 'bids', :action => 'settings', :id => @bid} %> @@ -100,8 +114,12 @@ :action => 'show_project' %> - <%= l(:label_participator) %> - <%= l(:label_bidding_project) %> + + <%= l(:label_participator) %> + + + <%= l(:label_bidding_project) %> +
    @@ -110,14 +128,22 @@
    - - - - - + - + + + +
    <%= l(:lable_contest_user) %><%= link_to(@user.name, user_path(@user))%>
    <%= l(:label_bids_reward_method) %><%= @bid.budget%> + <%= l(:lable_contest_user) %> + <%= link_to(@user.name, user_path(@user))%> +
    <%= l(:label_limit_time) %> : <%= @bid.deadline%> + <%= l(:label_bids_reward_method) %> + <%= @bid.budget%> +
    + <%= l(:label_limit_time) %> : + <%= @bid.deadline%> +
    @@ -130,7 +156,6 @@
    <% if @bid.description.size>0 %>
    - <%= textilizable @bid.description %>
    <% else %> @@ -139,7 +164,10 @@
    <% end %>
    - <%= l(:label_create_time) %>:<%= format_time(@bid.created_on) %> + + <%= l(:label_create_time) %>: + + <%= format_time(@bid.created_on) %>
    @@ -158,9 +186,13 @@
    - <%= l(:label_x_followers, :count => @bid.watcher_users.count) %> + + <%= l(:label_x_followers, :count => @bid.watcher_users.count) %> + <% if show_more_fans?(@bid) %> - <%= link_to l(:label_more), :controller => 'bids', :action => 'show_bid_user'%> + + <%= link_to l(:label_more), :controller => 'bids', :action => 'show_bid_user'%> + <% end %>
    @@ -177,9 +209,13 @@
    - <%= l(:label_bidding_project) %> + + <%= l(:label_bidding_project) %> + <% if show_more_bid_project?(@bid) %> - <%= link_to l(:label_more), :controller => 'bids', :action => 'show_project'%> + + <%= link_to l(:label_more), :controller => 'bids', :action => 'show_project'%> + <% end %>
    @@ -200,7 +236,9 @@
    - <%= l(:label_x_join_in_contest, :count => @bid.join_in_contests.count) %> + + <%= l(:label_x_join_in_contest, :count => @bid.join_in_contests.count) %> + <% if show_more_participate?(@bid) %> <%= link_to l(:label_more), :controller => "bids", :action => "show_participator"%> @@ -210,7 +248,9 @@
    - +
    <%= show_participate_picture(@bid) %> + <%= show_participate_picture(@bid) %> +
    @@ -234,7 +274,9 @@
    diff --git a/app/views/layouts/base_courses.html.erb b/app/views/layouts/base_courses.html.erb index 6de46d2fe..beb3291d0 100644 --- a/app/views/layouts/base_courses.html.erb +++ b/app/views/layouts/base_courses.html.erb @@ -34,7 +34,11 @@
    - + - + diff --git a/app/views/layouts/base_homework.html.erb b/app/views/layouts/base_homework.html.erb index 9e615eaec..9ce2a6edf 100644 --- a/app/views/layouts/base_homework.html.erb +++ b/app/views/layouts/base_homework.html.erb @@ -29,7 +29,8 @@ background: #15bccf; color: #fff; text-align: center; - padding: 5px !important; + padding-left: 5px !important; + padding-right: 5px !important; } .span_wping a:hover{ background-color:#03a1b3;} @@ -46,15 +47,16 @@
    高校课程实践社区 + + 高校课程实践社区 + + <%= l(:label_user_location) %> : @@ -50,14 +54,16 @@
    - <%= link_to request.host()+"/course", :controller => 'courses', :action => 'index' %> -

    <%= link_to "主页", home_path %> - > <%=l(:label_courses_management_platform)%> - > <%= link_to @course.name, nil %> + > + + <%=l(:label_courses_management_platform)%> + + > + <%= link_to @course.name, nil %>

    - + - - + + <% elsif @user.user_extensions.identity == 3 %> - + + <% elsif @user.user_extensions.identity == 2 %> - + <% end %> - + + <% if @user.user_extensions.identity == 0 %> @@ -307,7 +328,9 @@
    - <%= l(:label_user_watcher) %> + + <%= l(:label_user_watcher) %> + <% if show_more_watchers?(@user) %>
    <%= link_to l(:label_more), :controller => "users", :action => "user_watchlist"%> @@ -318,7 +341,9 @@
    高校课程实践社区 + + 高校课程实践社区 + + <%= l(:label_user_location) %> :
    - <%= link_to request.host()+"/courses", :controller => 'courses', :action => 'index' %> -

    <%= link_to "主页", home_path %> > diff --git a/app/views/layouts/base_newcontest.html.erb b/app/views/layouts/base_newcontest.html.erb index 381a6a61d..c118078d0 100644 --- a/app/views/layouts/base_newcontest.html.erb +++ b/app/views/layouts/base_newcontest.html.erb @@ -27,8 +27,10 @@

    - -
    - <%=l(:label_contest_innovate_community)%> + + + <%=l(:label_contest_innovate_community)%> + <%= l(:label_user_location) %> : @@ -44,11 +46,8 @@
    - <%=link_to request.host()+"/contests", :controller=>'contests', :action=>'index' %> - <%=link_to l(:field_homepage), home_path %> > - <%=link_to l(:label_contest_innovate), :controller=>'contests', :action=>'index' %> > + <%= l(:label_contest_innovate) %> > <%= link_to h(truncate(@contest.name, length: 20, omission: '...')), show_contest_contest_path(@contest) %> diff --git a/app/views/layouts/base_projects.html.erb b/app/views/layouts/base_projects.html.erb index ee490c653..b6620b141 100644 --- a/app/views/layouts/base_projects.html.erb +++ b/app/views/layouts/base_projects.html.erb @@ -30,8 +30,14 @@
    - - + + - - +
    软件项目托管社区<%= l(:label_user_location) %> : + + 软件项目托管社区 + + + <%= l(:label_user_location) %> : +
    <%= link_to request.host()+"/projects", :controller => 'projects', :action => 'index', :project_type => 0 %>

    <%=link_to l(:label_home),home_path %> > <%=link_to @project, project_path(@project) %>

    +

    + <%=link_to l(:label_home),home_path %> > + <%=link_to @project, project_path(@project) %> +

    +
    @@ -54,7 +64,9 @@ <% @project = Project.find_by_id(@project.id)%> - + - - - + + + - - - + + +
    <%= image_tag(url_to_avatar(@project), :class => 'avatar2') %> + <%= image_tag(url_to_avatar(@project), :class => 'avatar2') %> +
    <%= link_to @project.name, project_path(@project)%> @@ -86,15 +98,26 @@ <% @project.versions.each do |version| %> <% files_count += version.attachments.count %> <% end %> -
    <%=link_to "#{@project.members.count}", project_member_path(@project) %><%=link_to @project.watcher_users.count, :controller=>"projects", :action=>"watcherlist", :id => @project %><%=link_to "#{@project.issues.count}", project_issues_path(@project) %> + <%=link_to "#{@project.members.count}", project_member_path(@project) %> + + <%=link_to @project.watcher_users.count, :controller=>"projects", :action=>"watcherlist", :id => @project %> + + <%=link_to "#{@project.issues.count}", project_issues_path(@project) %> +
    <%= l(:label_member) %><%= l(:label_user_watchered) %> <%= l(:label_project_issues) %> + <%= l(:label_member) %> + + <%= l(:label_user_watchered) %> + + <%= l(:label_project_issues) %> +
    @@ -109,7 +132,10 @@ <%= textilizable @project.description %>
    - <%= l(:label_create_time) %>:<%= format_time(@project.created_on) %> + + <%= l(:label_create_time) %>: + + <%= format_time(@project.created_on) %>
    diff --git a/app/views/layouts/base_users.html.erb b/app/views/layouts/base_users.html.erb index f3bbe0098..186166dc8 100644 --- a/app/views/layouts/base_users.html.erb +++ b/app/views/layouts/base_users.html.erb @@ -101,8 +101,12 @@
    - - + + -
    <%= l(:label_user_home) %><%= l(:label_user_location) %> : + <%= l(:label_user_home) %> + + <%= l(:label_user_location) %> : +
    - <%=link_to request.host()+"/users" ,:controller => 'users', :action => 'index' %> - <%=link_to "主页", home_path %> > - <%=link_to @user.name, user_path %> + + <%=link_to @user.name, user_path %> +
    @@ -131,23 +134,28 @@
    - + +
    <%= image_tag(url_to_avatar(@user), :class => 'avatar2') %> + <%= image_tag(url_to_avatar(@user), :class => 'avatar2') %> + - + - + - - -
    <%= link_to h (@user.name) %> - <%= image_tag(gender_avatar_uri(@user), weight:"25px", height:"25px") if (@user.user_extensions && (@user.user_extensions.identity != 2) )%> + <%= link_to h (@user.name) %> + <%= image_tag(gender_avatar_uri(@user), weight:"25px", height:"25px") if (@user.user_extensions && (@user.user_extensions.identity != 2) )%> +
    <% unless User.current == @user %> - <%= watcher_link(@user, User.current) %> - <% else %> - <%= link_to(l(:label_user_edit), my_account_path(@user)) if User.current %> - <% end %> + <% unless User.current == @user %> + <%= watcher_link(@user, User.current) %> + <% else %> + <%= link_to(l(:label_user_edit), my_account_path(@user)) if User.current %> + <% end %> +
    @@ -156,8 +164,8 @@
    +
    @@ -228,29 +236,42 @@ <% unless @user.user_extensions.nil? %> <% if @user.user_extensions.identity == 0 || @user.user_extensions.identity == 1 %>
    <%= l(:field_occupation) %>: + + <%= l(:field_occupation) %>: + <% unless @user.user_extensions.school.nil? %> <%= @user.user_extensions.school.name %> <% end %> -
    <%= l(:field_occupation) %>: + <%= l(:field_occupation) %>: + <%= @user.user_extensions.occupation %> -
    <%= l(:label_company_name) %>: + <%= l(:label_company_name) %>: + <%= @user.firstname %>
    <%= l(:label_location) %>:<%= @user.user_extensions.location %><%= @user.user_extensions.location_city %> + <%= l(:label_location) %>: + + <%= @user.user_extensions.location %> + <%= @user.user_extensions.location_city %> +
    - +
    <%= show_watcher_profile(@user) %> + <%= show_watcher_profile(@user) %> +
    @@ -327,7 +352,9 @@
    - <%= l(:label_x_user_fans, :count => User.current.watcher_users(User.current.id).count) %> + + <%= l(:label_x_user_fans, :count => User.current.watcher_users(User.current.id).count) %> + <% if show_more_fans?(@user) %>
    <%= link_to l(:label_more), :controller => "users", :action => "user_fanslist"%> @@ -337,7 +364,9 @@
    - +
    <%= show_fans_picture(@user) %> + <%= show_fans_picture(@user) %> +
    diff --git a/app/views/tags/_tag.html.erb b/app/views/tags/_tag.html.erb index 3efd0cfab..06680d373 100644 --- a/app/views/tags/_tag.html.erb +++ b/app/views/tags/_tag.html.erb @@ -44,7 +44,7 @@ <%= link_to (image_tag "/images/sidebar/add.png"), 'javascript:void(0);', :class => "tags_icona", - :onclick=>"$('#put-tag-form-#{obj.class}-#{obj.id}').toggle(); readmore(this);" if User.current.logged? %> + :onclick=>"$('#put-tag-form-#{obj.class}-#{obj.id}').slideToggle(); 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? %>    @@ -72,7 +72,7 @@ <% end %> diff --git a/app/views/welcome/_course_list.html.erb b/app/views/welcome/_course_list.html.erb index 8d0d6c40d..da6c0fbf0 100644 --- a/app/views/welcome/_course_list.html.erb +++ b/app/views/welcome/_course_list.html.erb @@ -25,8 +25,10 @@ <%= link_to course.school.name.try(:gsub, /(.+)$/, '\1'), options={:action => 'course', :school_id => course.school.id}, html_options={:method => 'get'} %> <% end %> (<%= course.members.count %>人) - <%# files_count = course.attachments.count.to_s %> - (<%= link_to "#{course.attachments.count.to_s}份", course_files_path(course) %>资料) + <% files_count = course.attachments.count %> + <% if files_count > 0%> + (<%= link_to "#{files_count.to_s}份", course_files_path(course) %>资料) + <% end %>
    <% end %> diff --git a/app/views/words/_journal_reply.html.erb b/app/views/words/_journal_reply.html.erb index 2f823ebf6..39321394c 100644 --- a/app/views/words/_journal_reply.html.erb +++ b/app/views/words/_journal_reply.html.erb @@ -1,8 +1,7 @@ <% id = "journal_reply_ul_" + journal.id.to_s%> -<% show_real_name ||= false%>
    <% fetch_user_leaveWord_reply(journal).each do |reply|%> - <%= render :partial => "words/journal_reply_items", :locals => {:reply => reply, :journal => journal, :m_reply_id => reply,:show_name=> show_name, :show_real_name => show_real_name} %> + <%= render :partial => "words/journal_reply_items", :locals => {:reply => reply, :journal => journal, :m_reply_id => reply,:show_name=> show_name} %> <% end %>
    diff --git a/app/views/words/_journal_reply_items.html.erb b/app/views/words/_journal_reply_items.html.erb index 76359794c..1b20ce45b 100644 --- a/app/views/words/_journal_reply_items.html.erb +++ b/app/views/words/_journal_reply_items.html.erb @@ -1,4 +1,3 @@ -<% show_real_name ||= false %> <% reply_allow = JournalsForMessage.create_by_user? User.current %> <% ids_r = 'reply_respond_form_'+ reply.id.to_s %>
    @@ -11,19 +10,11 @@
    <% id = 'project_respond_form_'+ reply.id.to_s %> - <% if show_real_name%> - <%= link_to reply.user.lastname+reply.user.firstname, user_path(reply.user) %> - <% else %> - <%= link_to reply.user.name, user_path(reply.user) %> - <% end %> + <%= link_to reply.user.name, user_path(reply.user) %> 回复 <% parent_jour = JournalsForMessage.find reply.m_reply_id %> <% if show_name && parent_jour %> - <% if show_real_name%> - <%= link_to parent_jour.user.lastname+parent_jour.user.firstname, user_path(parent_jour.user) %> - <% else %> - <%= link_to parent_jour.user.name, user_path(parent_jour.user) %> - <% end %> + <%= link_to parent_jour.user.name, user_path(parent_jour.user) %> <% else %> <%= l(:label_anonymous) %> <% end %> @@ -51,7 +42,7 @@
    <% if reply_allow %> - <%= render :partial => "words/new_respond", :locals => {:journal => journal, :m_reply_id => m_reply_id,:show_name => show_name, :show_real_name => show_real_name} %> + <%= render :partial => "words/new_respond", :locals => {:journal => journal, :m_reply_id => m_reply_id,:show_name => show_name} %> <% end %>
    diff --git a/app/views/words/_new_respond.html.erb b/app/views/words/_new_respond.html.erb index a4cad1a38..edb313bb5 100644 --- a/app/views/words/_new_respond.html.erb +++ b/app/views/words/_new_respond.html.erb @@ -1,5 +1,4 @@ -<% show_real_name ||= false%> -<%= form_tag(words_create_reply_path(:show_real_name=>show_real_name), :remote => true) do %> +<%= form_tag(words_create_reply_path, :remote => true) do %> <%= text_area_tag 'user_notes', "", :class => 'noline', :style => "resize: none;", :rows => 4, :placeholder => l(:label_projects_feedback_respond_content), diff --git a/app/views/words/create_reply.js.erb b/app/views/words/create_reply.js.erb index 04cbee26e..eeb4e3ef6 100644 --- a/app/views/words/create_reply.js.erb +++ b/app/views/words/create_reply.js.erb @@ -1,7 +1,7 @@ <% if @save_succ %> var pre_append = $('<%= j( render :partial => "words/journal_reply_items", - :locals => {:reply => @jfm, :journal => @jfm.parent, :m_reply_id => @jfm,:show_name => @show_name, :show_real_name=>@show_real_name} + :locals => {:reply => @jfm, :journal => @jfm.parent, :m_reply_id => @jfm,:show_name => @show_name} ) %>').hide(); $('#journal_reply_ul_<%=@jfm.m_parent_id%>').append(pre_append); pre_append.fadeIn(600); diff --git a/db/migrate/20141127072548_update_student_score.rb b/db/migrate/20141127072548_update_student_score.rb new file mode 100644 index 000000000..615e33541 --- /dev/null +++ b/db/migrate/20141127072548_update_student_score.rb @@ -0,0 +1,9 @@ +class UpdateStudentScore < ActiveRecord::Migration + def up + sql = ActiveRecord::Base.connection() + sql.update_sql("update seems_rateable_rates set stars = 5 where stars > 5") + end + + def down + end +end diff --git a/db/schema.rb b/db/schema.rb index 973e2afbe..4baec2343 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20141120091234) do +ActiveRecord::Schema.define(:version => 20141127072548) do create_table "activities", :force => true do |t| t.integer "act_id", :null => false diff --git a/public/stylesheets/css.css b/public/stylesheets/css.css index e49f2651f..17316c095 100644 --- a/public/stylesheets/css.css +++ b/public/stylesheets/css.css @@ -1,5 +1,5 @@ /* CSS Document */ -body{ font-size:12px !important; font-family:"微软雅黑","宋体" !important; background:#fff; font-style:normal;} +body{ font-size:12px !important; font-family:"微软雅黑","宋体" !important; line-height:1.9; background:#fff; font-style:normal;} div,html,img,ul,li,p,body,h1,h2,h3,h4,p,a,table,tr,td,fieldset,input,span,textarea{ margin:0; padding:0;} div,img,tr,td,textarea{ border:0;} table,tr,td{border:0; cellspacing:0; cellpadding:0;} @@ -15,7 +15,7 @@ a:hover{ text-decoration:underline;} /* TAB 切换效果 */ .tb_{ background-color: #eaeaea; height:40px; } .tb_ ul{height:40px; } -.tb_ li{float:left;height:30px;width: 90px;cursor:pointer; font-size:14px; padding-top:10px; text-align:center; } +.tb_ li{float:left;height:35px;width: 90px;cursor:pointer; font-size:14px; padding-top:5px; text-align:center; } a.tb_all{ margin-left:235px; font-size:12px; display:block; height:23px; padding-top:4px; width:90px; color:#7a7a7a; border:1px solid #cbcbcb; background:#fff; text-align: center;} a:hover.tb_all{ background:#eaeaea; text-decoration:none;} @@ -38,13 +38,13 @@ a:hover.tb_all{ background:#eaeaea; text-decoration:none;} .pic_head a{ text-align:center; width:42px; overflow:hidden;text-overflow:ellipsis; white-space:nowrap;} .pic_head img{ border:1px solid #fff;} .pic_head img:hover{border:1px solid #15bccf;} -.dis ul li.wname a{ width:260px; font-size:14px; color:#595959; padding:25px 0 0 15px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;} -.dis ul li.wdown a{padding-top:25px; color:#3d7ec2; margin-right:35px;} -.wscore{ padding-top:25px; color:#888888; width:96px;} +.dis ul li.wname a{ width:260px; font-size:14px; color:#595959; padding:15px 0 0 0px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;} +.dis ul li.wdown a{padding-top:22px; color:#3d7ec2; margin-right:35px;} +.wscore{ padding-top:22px; color:#888888; width:96px;} .dis ul li.wping{margin-left:12px; } -.dis ul li.wping a{ margin-top:18px; margin-bottom:3px; width:43px; height:23px; background:#15bccf; color:#fff; text-align:center; padding-top:8px;} +.dis ul li.wping a{ margin-top:18px; margin-bottom:3px; width:43px; height:23px; background:#15bccf; color:#fff; text-align:center; padding-top:3px;} .dis ul li.wping a:hover{ background-color:#03a1b3;} -ul.wlist{ float:right; border-bottom:none; height:30px; margin-top:20px;line-height: 1.9; } +ul.wlist{ float:right; border-bottom:none; height:30px; margin-top:20px; } .wlist span{ border:1px solid #15bccf; padding:0 5px; margin-left:3px;} .wlist a{ border:1px solid #15bccf; padding:0 5px; margin-left:3px;} .wlist a:hover{ background:#15bccf; color:#fff; text-decoration:none;} @@ -55,7 +55,7 @@ ul.wlist{ float:right; border-bottom:none; height:30px; margin-top:20px;line-hei .c_grey{ color:#999; font-weight:normal;} .dis ul li.wname02 a{ width:200px; font-size:14px; color:#595959; padding:20px 0 0 15px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;} .dis ul li.wmine{ margin:12px 0 0 10px;} -.dis ul li.wmine a{ color:#3d7ec2; text-align:center; width:50px; font-weight: bold;line-height: 1.9;} +.dis ul li.wmine a{ color:#3d7ec2; text-align:center; width:50px; font-weight: bold;} .wzan{ margin:15px 0 0 25px; width:32px; height:44px;} .wzan a{ display: block;text-align: center;} a.wzan_img{background:url(images/pic_zan.png) 0 -59px no-repeat; display:block; height:31px; width:30px; color:#fff;} @@ -83,8 +83,8 @@ a.wzan_visited{background:url(images/pic_zan.png) 0 0 no-repeat;} .ping_star span a{ float:right; width:20px; height:20px; background:url(images/star.png) -2px 0 no-repeat; margin-right:3px;} .ping_star span a:hover{background:url(images/star.png) -24px 0 no-repeat;} .ping_con textarea{ height:76px; border:1px solid #15bccf; margin-bottom:5px; color:#666; font-size:12px;} -a.ping_sub{ float:right; height:22px; width:60px; margin-right:20px; background:#15bccf; color:#fff; text-align:center;padding-top: 5px;} -a.ping_sub1{ float:right; height:22px; width:60px; background:#15bccf; color:#fff; text-align:center;line-height: 1.9;} +a.ping_sub{ float:right; height:22px; width:60px; margin-right:20px; background:#15bccf; color:#fff; text-align:center;} +a.ping_sub1{ float:right; height:22px; width:60px; background:#15bccf; color:#fff; text-align:center;} a:hover.ping_sub{ background:#14a8b9;} .recall{ border-top:1px solid #CCC; padding:5px 0;} .recall_head{ float:left;} @@ -128,9 +128,9 @@ a:hover.ping_sub{ background:#14a8b9;} .w430{ width:430px;} .w350{ width:350px;} -.w620{ width:580px; height:160px; border:1px solid #CCC !important; padding-left: 3px !important;} +.w620{ width:580px; height:160px; border:1px solid #CCC;} .bo{height:26px; border:1px solid #CCC !important; padding: 0 !important;} -a.tijiao{ height:28px !important; display:block !important; width:80px !important; color:#fff !important; background:#15bccf !important; text-align:center !important; padding-top:4px !important; float:left !important; margin-right:10px !important;line-height: 1.9;} +a.tijiao{ height:28px !important; display:block !important; width:80px !important; color:#fff !important; background:#15bccf !important; text-align:center !important; padding-top:4px !important; float:left !important; margin-right:10px !important;} a:hover.tijiao{ background:#0f99a9 !important;} .members_left{ float:left; width:570px; margin-right:20px;} .members_left{}