diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb index 215df8e10..c511b5ace 100644 --- a/app/controllers/attachments_controller.rb +++ b/app/controllers/attachments_controller.rb @@ -195,6 +195,8 @@ class AttachmentsController < ApplicationController end elsif !@attachment.container.nil? && @attachment.container.is_a?(Softapplication) format.html { redirect_to_referer_or softapplications_path(@attachment.container) } + elsif !@attachment.container.nil? && @attachment.container.is_a?(Bid) + format.html { redirect_to_referer_or respond_path(@attachment.container) } else if @project.nil? format.html { redirect_to_referer_or forum_memo_path(@attachment.container.forum, @attachment.container) } diff --git a/app/controllers/bids_controller.rb b/app/controllers/bids_controller.rb index 047f7103e..0cf8ea45d 100644 --- a/app/controllers/bids_controller.rb +++ b/app/controllers/bids_controller.rb @@ -496,11 +496,18 @@ class BidsController < ApplicationController #@homework_list = @bid.homeworks #增加作业按评分排序, #@homework_list = @bid.homeworks.eager_load(:rate_averages, :user, :attachments).order('seems_rateable_cached_ratings.avg DESC').order("#{HomeworkAttach.table_name}.created_at ASC") - @homework_list = HomeworkAttach.eager_load(:attachments,:user,:rate_averages).find_by_sql("SELECT homework_attaches.*, + all_homework_list = HomeworkAttach.eager_load(:attachments,:user,:rate_averages).find_by_sql("SELECT homework_attaches.*, (SELECT AVG(stars) FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND rater_id = #{@bid.author_id}) AS t_score, (SELECT AVG(stars) FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND rater_id <> #{@bid.author_id}) AS s_score FROM homework_attaches WHERE bid_id = #{@bid.id} ORDER BY (CASE WHEN t_score IS NULL THEN 0 ELSE t_score * #{teacher_proportion} END + CASE WHEN s_score IS NULL THEN 0 ELSE s_score * #{1 - teacher_proportion} END) DESC,created_at ASC") + + limit = 10 + feedback_count = all_homework_list.count + @feedback_pages = Paginator.new feedback_count, limit, params['page'] + offset ||= @feedback_pages.offset + @homework_list = all_homework_list[offset, limit] + if params[:student_id].present? @temp = [] @homework_list.each do |pro| @@ -832,15 +839,25 @@ class BidsController < ApplicationController } end else - render 403 + render_403 end end def update @bid = Bid.find(params[:id]) @course = @bid.courses.first#Project.find(params[:course_id]) + @bid.name = params[:bid][:name] + @bid.description = params[:bid][:description] + @bid.is_evaluation = params[:bid][:is_evaluation] + @bid.proportion = params[:bid][:proportion] + @bid.reward_type = 3 + @bid.deadline = params[:bid][:deadline] + @bid.budget = 0 + @bid.author_id = User.current.id + @bid.commit = 0 + @bid.homework_type = 1 @bid.save_attachments(params[:attachments] || (params[:bid] && params[:bid][:uploads])) - if @bid.update_attributes(params[:bid]) && @bid.save + if @bid.save flash[:notice] = l(:label_update_homework_succeed) redirect_to course_homework_path(@course) else diff --git a/app/controllers/contests_controller.rb b/app/controllers/contests_controller.rb index 1b7791ac4..71edfe835 100644 --- a/app/controllers/contests_controller.rb +++ b/app/controllers/contests_controller.rb @@ -258,7 +258,7 @@ class ContestsController < ApplicationController contests.each do |contest| contest.projects.each do |project| - @uers += project.users + @users += project.users end end # end diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index 9ae57db3d..945b8c514 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -175,7 +175,7 @@ class CoursesController < ApplicationController ## 有角色参数的才是课程,没有的就是项目 @render_file = 'member_list' @teachers= searchTeacherAndAssistant(@course) - @canShowCode = isCourseTeacher(User.current.id,@course) + @canShowCode = isCourseTeacher(User.current.id,@course) && params[:role] != '1' case params[:role] when '1' @subPage_title = l :label_teacher_list @@ -216,10 +216,15 @@ class CoursesController < ApplicationController end def settings - @issue_custom_fields = IssueCustomField.sorted.all - @issue_category ||= IssueCategory.new - @member ||= @course.members.new - @trackers = Tracker.sorted.all + if User.current.allowed_to?(:as_teacher,@course) + @issue_custom_fields = IssueCustomField.sorted.all + @issue_category ||= IssueCategory.new + @member ||= @course.members.new + @trackers = Tracker.sorted.all + else + render_403 + end + end def create @@ -470,23 +475,27 @@ class CoursesController < ApplicationController end def homework - @offset, @limit = api_offset_and_limit({:limit => 10}) - @bids = @course.homeworks.order('deadline DESC') - @bids = @bids.like(params[:name]) if params[:name].present? - @bid_count = @bids.count - @bid_pages = Paginator.new @bid_count, @limit, params['page'] - - @offset ||= @bid_pages.reverse_offset - unless @offset == 0 - @bids = @bids.offset(@offset).limit(@limit).all.reverse - else - limit = @bid_count % @limit - if limit == 0 - limit = 10 + if @course.is_public != 0 || User.current.member_of_course?(@course) + @offset, @limit = api_offset_and_limit({:limit => 10}) + @bids = @course.homeworks.order('deadline DESC') + @bids = @bids.like(params[:name]) if params[:name].present? + @bid_count = @bids.count + @bid_pages = Paginator.new @bid_count, @limit, params['page'] + + @offset ||= @bid_pages.reverse_offset + unless @offset == 0 + @bids = @bids.offset(@offset).limit(@limit).all.reverse + else + limit = @bid_count % @limit + if limit == 0 + limit = 10 + end + @bids = @bids.offset(@offset).limit(limit).all.reverse end - @bids = @bids.offset(@offset).limit(limit).all.reverse + render :layout => 'base_courses' + else + render_403 end - render :layout => 'base_courses' end # 新建作业 diff --git a/app/controllers/memos_controller.rb b/app/controllers/memos_controller.rb index 9f261c78a..b980331df 100644 --- a/app/controllers/memos_controller.rb +++ b/app/controllers/memos_controller.rb @@ -148,6 +148,7 @@ class MemosController < ApplicationController @memo.update_column(:sticky, params[:memo][:sticky]) && @memo.update_column(:lock, params[:memo][:lock])) @memo.save_attachments(params[:attachments] || (params[:memo] && params[:memo][:uploads])) + @memo.save # @memo.root.update_attribute(:updated_at, @memo.updated_at) format.html {redirect_to back_memo_url, notice: "#{l :label_memo_create_succ}"} else diff --git a/app/helpers/watchers_helper.rb b/app/helpers/watchers_helper.rb index 56b2ec0f4..155485b4c 100644 --- a/app/helpers/watchers_helper.rb +++ b/app/helpers/watchers_helper.rb @@ -97,7 +97,7 @@ module WatchersHelper return '' unless user && user.logged? # modify by nwb # 主讲教师不允许退出课程 - return '' if user.id == course.tea_id + return '' if user.id == course.tea_id || course.is_public == 0 joined = user.member_of_course?(course) text = joined ? l(:label_exit_course) : l(:label_join_course) url_t = join_path(:object_id => course.id) diff --git a/app/helpers/welcome_helper.rb b/app/helpers/welcome_helper.rb index 4964e6cd2..26d61f94e 100644 --- a/app/helpers/welcome_helper.rb +++ b/app/helpers/welcome_helper.rb @@ -137,7 +137,7 @@ module WelcomeHelper #获取课程列表 # add by nwb def find_miracle_course(sum=10, max_rate=7, school_id) - if User.current.user_extensions.school.nil? and school_id.nil? + if User.current.user_extensions.nil? && User.current.user_extensions.school.nil? and school_id.nil? Course.active.visible. joins(:memberships). group('members.course_id'). diff --git a/app/models/softapplication.rb b/app/models/softapplication.rb index 0234bc118..9e469d2ac 100644 --- a/app/models/softapplication.rb +++ b/app/models/softapplication.rb @@ -1,6 +1,6 @@ class Softapplication < ActiveRecord::Base attr_accessible :android_min_version_available, :app_type_id, :app_type_name, :description, :name, :user_id, :contest_id, :application_developers, :deposit_project_url, :deposit_project - acts_as_attachable + acts_as_attachable :view_permission => :view_files seems_rateable :allow_update => true, :dimensions => :quality diff --git a/app/views/attachments/_form.html.erb b/app/views/attachments/_form.html.erb index 5c22ff44c..16de21226 100644 --- a/app/views/attachments/_form.html.erb +++ b/app/views/attachments/_form.html.erb @@ -3,14 +3,17 @@ <% container.attachments.each_with_index do |attachment, i| %> <%= text_field_tag("attachments[p#{i}][filename]", attachment.filename, :class => 'filename readonly', :readonly=>'readonly')%> - <%= text_field_tag("attachments[p#{i}][description]", attachment.description, :maxlength => 255, :placeholder => l(:label_optional_description), :class => 'description', :style=>"display: inline-block;") + - if attachment.id.nil? - else + <%= text_field_tag("attachments[p#{i}][description]", attachment.description, :maxlength => 254, :placeholder => l(:label_optional_description), :class => 'description', :style=>"display: inline-block;") %> + <%= l(:field_is_public)%>: + <%= check_box_tag("attachments[p#{i}][is_public_checkbox]", attachment.is_public, :class => 'is_public')%> + <%= if attachment.id.nil? + #待补充代码 + else link_to(' '.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload') end %> <%#= render :partial => 'tags/tag', :locals => {:obj => attachment, :object_flag => "6"} %> - <%= check_box_tag("attachments[p#{i}][is_public_checkbox]", attachment.is_public, :class => 'is_public')%> + <%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %> <% end %> diff --git a/app/views/bids/_homework_form.html.erb b/app/views/bids/_homework_form.html.erb index 463b2b621..226eae650 100644 --- a/app/views/bids/_homework_form.html.erb +++ b/app/views/bids/_homework_form.html.erb @@ -1,44 +1,45 @@ <%= error_messages_for 'bid' %> -

<%= l(:label_homeworks_form_new_description) %>

-

<%= f.text_field :name, :required => true, :size => 60, :style => "width:490px;", :maxlength => Bid::NAME_LENGTH_LIMIT %>

+

+ <%= f.text_field :name, :required => true, :size => 60, :style => "width:490px;", :maxlength => Bid::NAME_LENGTH_LIMIT, :onblur => "regexName();" %> -

<%= f.text_area :description, :rows => 8, :class => 'wiki-edit', :style => "font-size:small;width:490px;margin-left:10px;", :maxlength => Bid::DESCRIPTION_LENGTH_LIMIT %>

- -

<%= f.text_field :deadline, :required => true, :size => 60, :style => "width:150px;" %><%= calendar_for('bid_deadline')%>

-

<%= f.select :is_evaluation, is_evaluation_option %> -

<%= hidden_field_tag 'course_id', @project_id %> +

+

<%= f.select :proportion, proportion_option %> +

+

<%= hidden_field_tag 'course_id', @course.id %>

<%= l(:label_attachment_plural) %> -
<%= render :partial => 'attachments/form', :locals => {:container => @bid} %>
+

<%= render :partial => 'attachments/form', :locals => {:container => @homework} %>

\ No newline at end of file diff --git a/app/views/bids/_homework_list.html.erb b/app/views/bids/_homework_list.html.erb index 9bf997cbe..3ed809fe0 100644 --- a/app/views/bids/_homework_list.html.erb +++ b/app/views/bids/_homework_list.html.erb @@ -136,7 +136,8 @@ 终评得分:  <%# totle_homework_score = score_for_homework(homework) %> - <% totle_homework_score = format("%.2f",(homework.t_score.nil? ? 0.00 : homework.t_score) * (@bid.proportion * 1.0 / 100) + (homework.s_score.nil? ? 0.00 : homework.s_score) * (1 - @bid.proportion * 1.0 / 100)) %> + <% totle_homework_score = format("%.2f",(homework.t_score.nil? ? 0.00 : homework.t_score) * ((@bid.proportion.nil? ? 60 : @bid.proportion) * 1.0 / 100) + + (homework.s_score.nil? ? 0.00 : homework.s_score) * (1 - (@bid.proportion.nil? ? 60 : @bid.proportion) * 1.0 / 100)) %> ;"> <% score = totle_homework_score == "0.00"? "N/A" : totle_homework_score %> <%= score %> @@ -152,4 +153,11 @@
-<% end %> \ No newline at end of file +<% end %> + + + \ No newline at end of file diff --git a/app/views/bids/edit.html.erb b/app/views/bids/edit.html.erb index 028a1a88e..fe92977ae 100644 --- a/app/views/bids/edit.html.erb +++ b/app/views/bids/edit.html.erb @@ -1,9 +1,60 @@ -

修改作业

+ + +

<%= l(:label_edit_homework) %>

<%= labelled_form_for @bid do |f| %>
- <%= render :partial => 'homework_form', :locals => { :f => f } %> - <%= submit_tag l(:button_create) %> - <%= javascript_tag "$('#bid_name').focus();" %> + <%#= render :partial => 'homework_form', :locals => { :f => f } %> + <%= render :partial => 'homework_form', :locals => { :f => f } %> + <% end %>
\ No newline at end of file diff --git a/app/views/bids/show.html.erb b/app/views/bids/show.html.erb index 3107d8bd6..5545a8c14 100644 --- a/app/views/bids/show.html.erb +++ b/app/views/bids/show.html.erb @@ -1,7 +1,7 @@ <% reply_allow = JournalsForMessage.create_by_user? User.current %>
<%= image_tag(url_to_avatar(@bid.author), :class => "avatar")%> - +

<%= link_to(@bid.author.lastname+@bid.author.firstname, user_path(@bid.author))%>:<%= link_to(@bid.name,respond_path(@bid)) %>

<% if @bid.reward_type.nil? or @bid.reward_type == 1%>

@@ -16,7 +16,7 @@

<%= textilizable(@bid, :description) %> <% if @bid.attachments.any?%> - <% options = {:author => true} %> + <% options = {:author => true,:deletable => (@bid.author.id == User.current.id || User.current.admin? ? true : false)} %> <%= render :partial => 'attachments/links', :locals => {:attachments => @bid.attachments, :options => options} %> <% end %>
diff --git a/app/views/courses/_course_form.html.erb b/app/views/courses/_course_form.html.erb index 7395c9845..1b1c86b64 100644 --- a/app/views/courses/_course_form.html.erb +++ b/app/views/courses/_course_form.html.erb @@ -40,7 +40,9 @@ <%= l(:label_class_period) %> *   - <%= text_field_tag :class_period, @course.class_period, :placeholder => "在此输入课时", :maxlength => 5 %> + + <%= text_field_tag :class_period, @course.class_period, :placeholder => "#{l(:lable_input_class)}", :maxlength => 5 %> +  <%= l(:label_class_hour) %> @@ -53,7 +55,10 @@ <%= l(:label_class_period) %> *   - <%= text_field_tag :class_period, nil, :placeholder => "在此输入课时", :maxlength => 5 %><%= l(:label_class_hour) %> + + <%= text_field_tag :class_period, nil, :placeholder => "#{l(:lable_input_class)}", :maxlength => 5 %> + + <%= l(:label_class_hour) %> diff --git a/app/views/courses/_homework_form.html.erb b/app/views/courses/_homework_form.html.erb index f93d57f90..4b63b8852 100644 --- a/app/views/courses/_homework_form.html.erb +++ b/app/views/courses/_homework_form.html.erb @@ -34,9 +34,9 @@ <%#= f.text_field :budget, :required => true, :size => 60, :style => "width:350px;", :placeholder => l(:label_bids_reward_what) %>

--> <% time = (Time.now + 3600 * 24).strftime('%Y-%m-%d') %> -

<%= f.text_field(:deadline, :required => true, :size => 60, :style => "width:150px;",:value => "#{time}", :onchange => "regexDeadLine();") %><%= calendar_for('bid_deadline')%> +

<%= f.text_field(:deadline, :required => true, :size => 60, :style => "width:150px;",:value => "#{time}", :onchange => "regexDeadLine();") %> + <%= calendar_for('bid_deadline')%> -

<%= f.select :is_evaluation, is_evaluation_option %> diff --git a/app/views/courses/_member_list.html.erb b/app/views/courses/_member_list.html.erb index edd04bc97..a6ee0b9b4 100644 --- a/app/views/courses/_member_list.html.erb +++ b/app/views/courses/_member_list.html.erb @@ -13,7 +13,7 @@ <% end %> - <%if @canShowCode%> + <% if @canShowCode %> <%= content_tag "p", "#{l(:label_bidding_user_studentcode)}#{' : '}#{member.user.user_extensions.student_id}", :class => "nomargin avatar_name" %> <% end %>

  diff --git a/app/views/layouts/_base_header.html.erb b/app/views/layouts/_base_header.html.erb index db275b90b..b0daf8c88 100644 --- a/app/views/layouts/_base_header.html.erb +++ b/app/views/layouts/_base_header.html.erb @@ -34,7 +34,7 @@
<%= render_menu :account_menu -%>
- <% if User.current.logged? -%> + <% if User.current.logged? -%>
  • diff --git a/app/views/layouts/base_courses.html.erb b/app/views/layouts/base_courses.html.erb index 4554b0466..e3c137fb4 100644 --- a/app/views/layouts/base_courses.html.erb +++ b/app/views/layouts/base_courses.html.erb @@ -74,11 +74,10 @@
    <% if User.current.logged? %> - <% if @course.teacher.id == User.current.id %> + <% if User.current.allowed_to?(:as_teacher,@course) %> <%= link_to l(:label_course_modify_settings), {:controller => 'courses', :action => 'settings', :id => @course} %> <%= render :partial => 'courses/set_course_time', :locals => {:course => @course} %> <% else %> - <%= join_in_course(@course, User.current) %> <% end %> <% unless User.current.member_of_course?(@course) %> diff --git a/app/views/layouts/base_newcontest.html.erb b/app/views/layouts/base_newcontest.html.erb index c8e78d7f5..adce80d24 100644 --- a/app/views/layouts/base_newcontest.html.erb +++ b/app/views/layouts/base_newcontest.html.erb @@ -179,9 +179,9 @@
    <%= l(:label_x_followers, :count => @contest.watcher_users.count) %> - + <% if show_more_fans?(@contest) %> + <%= link_to l(:label_more), show_contest_user_contest_path(@contest) %> + <% end %>
    diff --git a/app/views/layouts/base_users.html.erb b/app/views/layouts/base_users.html.erb index 380481fe2..1410e2277 100644 --- a/app/views/layouts/base_users.html.erb +++ b/app/views/layouts/base_users.html.erb @@ -24,17 +24,17 @@ @@ -48,24 +48,30 @@
    -
    - - - - - - - - - -
    <%= l(:label_user_home) %><%= l(:label_user_location) %> : - -
    <%=link_to request.host()+"/users" ,:controller => 'users', :action => 'index' %> <%=link_to "主页", home_path %> > <%=link_to "软件创客", :controller => 'users', :action => 'index' %> > <%=link_to @user.name, user_path %>
    + + + + + + + + + + +
    <%= l(:label_user_home) %><%= l(:label_user_location) %> : + +
    + <%=link_to request.host()+"/users" ,:controller => 'users', :action => 'index' %> + + <%=link_to "主页", home_path %> > + <%=link_to "软件创客", :controller => 'users', :action => 'index' %> > + <%=link_to @user.name, user_path %> +
    @@ -92,11 +98,12 @@ <% end %> - -
    - <%= render :partial => 'users/user_score', :locals => {:user => @user}%> -
    - + + +
    + <%= render :partial => 'users/user_score', :locals => {:user => @user}%> +
    + @@ -104,40 +111,45 @@
    - <%= link_to l(:label_user_watcher)+"("+User.watched_by(@user.id).count.to_s+")" ,:controller=>"users", :action=>"user_watchlist"%>   + + <%= link_to l(:label_user_watcher)+"("+User.watched_by(@user.id).count.to_s+")" ,:controller=>"users", :action=>"user_watchlist"%> +   - <%= link_to l(:label_x_user_fans, :count => User.current.watcher_users(User.current.id).count)+"("+@user.watcher_users.count.to_s+")", :controller=>"users", :action=>"user_fanslist" %>  - -   - + + <%= link_to l(:label_x_user_fans, :count => User.current.watcher_users(User.current.id).count)+"("+@user.watcher_users.count.to_s+")", :controller=>"users", :action=>"user_fanslist" %> +    <% if @user.id == User.current.id %>

    <%= toggle_link l(:label_brief_introduction), 'introduction', {:focus => 'new_form_user_introduction'} %>

    <% end %> <% unless @user.user_extensions.nil? %> -

    - <%= @user.user_extensions.brief_introduction %> -

    +

    + <%= @user.user_extensions.brief_introduction %> +

    <% end %> @@ -148,55 +160,64 @@
    - - - - + + - - - - - <% unless @user.user_extensions.nil? %> - <% unless @user.user_extensions.identity == 2 %> - - - - <% end %> + <% unless @user.user_extensions.identity == 2 %> + + + + <% end %> <% if @user.user_extensions.identity == 0 %> - + + <% end %> <% if( (@user.user_extensions.identity == 1) && (is_watching?(@user) ) )%> - - - + + + + <% end %> <% else%> - - - - - - + + + + + + <% end %>
    <%= l(:label_user_joinin) %>:<%= format_time(@user.created_on) %>
    <%= l(:label_user_login) %>:<%= format_time(@user.last_login_on) %> + <%= l(:label_user_joinin) %>: + + <%= format_time(@user.created_on) %> +
    <%= l(:field_occupation) %>: - <% unless @user.user_extensions.school.nil? %> - <%= @user.user_extensions.school.name %> - <% end %> -
    <%= l(:field_occupation) %>: + <% unless @user.user_extensions.school.nil? %> + <%= @user.user_extensions.school.name %> + <% end %> +
    <%= l(:label_location) %>:<%= @user.user_extensions.location %><%= @user.user_extensions.location_city %>
    - <%= l(:label_technical_title) %>:<%= @user.user_extensions.technical_title %> + <%= l(:label_technical_title) %>: + + <%= @user.user_extensions.technical_title %> +
    <%= l(:label_bidding_user_studentcode)%>:<%= @user.user_extensions.student_id %>
    + <%= l(:label_bidding_user_studentcode)%>: + + <%= @user.user_extensions.student_id %> +
    <%= l(:field_occupation) %>:
    <%= l(:label_location) %>:
    <%= l(:field_occupation) %>:
    <%= l(:label_location) %>:
    -
    @@ -251,9 +272,9 @@
    <% if @user.user_extensions.identity == 2 %> - <%= render_menu :user_enterprise_menu %> + <%= render_menu :user_enterprise_menu %> <% else %> - <%= render_menu :user_menu %> + <%= render_menu :user_menu %> <% end %>
    diff --git a/app/views/memos/edit.html.erb b/app/views/memos/edit.html.erb index 04d95ae86..ded3a1b12 100644 --- a/app/views/memos/edit.html.erb +++ b/app/views/memos/edit.html.erb @@ -26,8 +26,11 @@

    <%= f.text_area :content, :required => true, :size => 80, id: 'editor01' %>

    +

    + <%= l(:label_attachment_plural) %>
    + <%= render :partial => 'attachments/form', :locals => {:container => @memo} %> +


    <%= f.submit :value => l(:button_change) %>  <%= link_to l(:button_back), back_url ,:class => "button-canel",:style => "color: #ffffff;"%>
    <% end %> -
    diff --git a/app/views/messages/_project_show.html.erb b/app/views/messages/_project_show.html.erb index ad55e9be7..028be4b83 100644 --- a/app/views/messages/_project_show.html.erb +++ b/app/views/messages/_project_show.html.erb @@ -96,11 +96,11 @@

    -
    +
    <% if @project %> - <%= label_tag l(:field_subject) %>: <%= link_to @topic.subject.truncate(29, omission: '...'), project_boards_path(@topic.project),title: @topic.subject.to_s %> + <%= label_tag l(:field_subject) %>: <%= link_to @topic.subject, project_boards_path(@topic.project),title: @topic.subject.to_s %> <% elsif @course %> - <%= label_tag l(:field_subject) %>: <%= link_to @topic.subject.truncate(29,omission:'...'), course_boards_path(@topic.course),title: @topic.subject.to_s %> + <%= label_tag l(:field_subject) %>: <%= link_to @topic.subject, course_boards_path(@topic.course),title: @topic.subject.to_s %> <% end %>
    diff --git a/app/views/news/_course_news.html.erb b/app/views/news/_course_news.html.erb index c49e46799..f8bd9c638 100644 --- a/app/views/news/_course_news.html.erb +++ b/app/views/news/_course_news.html.erb @@ -64,12 +64,12 @@ <%= label_tips %> -<%= link_to(btn_tips, - new_course_news_path(@course), - :class => 'icon icon-add', - :onclick => 'showAndScrollTo("add-news", "news_title"); return false;') %> <% if @course && User.current.allowed_to?(:manage_news, @course) %> + <%= link_to(btn_tips, new_course_news_path(@course), + :class => 'icon icon-add', + :onclick => 'showAndScrollTo("add-news", "news_title"); return false;') %> +