diff --git a/app/controllers/memos_controller.rb b/app/controllers/memos_controller.rb index aad575ee5..9f261c78a 100644 --- a/app/controllers/memos_controller.rb +++ b/app/controllers/memos_controller.rb @@ -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 diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index f976918d8..cdb71170d 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -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) diff --git a/app/views/attachments/_links.html.erb b/app/views/attachments/_links.html.erb index de43dce4c..698198120 100644 --- a/app/views/attachments/_links.html.erb +++ b/app/views/attachments/_links.html.erb @@ -12,7 +12,7 @@ :filename => attachment.filename%> <% end %> - <%= h(truncate(" - #{attachment.description}", length: 20, omission: '...')) unless attachment.description.blank? %> + <%= h(truncate(" - #{attachment.description}", length: 15, omission: '...')) unless attachment.description.blank? %> (<%= number_to_human_size attachment.filesize %>) <% if options[:deletable] %> @@ -34,7 +34,10 @@ <% end %> <% if options[:author] %> - + <% end %>
<% end %> diff --git a/app/views/courses/_course_form.html.erb b/app/views/courses/_course_form.html.erb index 63c196cef..5ba7b9e34 100644 --- a/app/views/courses/_course_form.html.erb +++ b/app/views/courses/_course_form.html.erb @@ -22,60 +22,21 @@ } } - - - <% object = [] %> <% object << 'course' %> <%= error_messages_for object %> - - - <% unless @course.new_record? %><%= render :partial => "avatar/avatar_form", :locals => {source: @course} %>
<% end %> - -+
+ +
- - - - <%= f.fields_for @course do |m| %> - - - - - <% unless @course.nil? %>
<%= l(:text_command) %> <% end %> - -
- -
<%= f.check_box :is_public, :style => "margin-left:10px;" %><%= l(:label_course_public_info) %>
- - <%= wikitoolbar_for 'course_description' %> - <% @course.custom_field_values.each do |value| %><%= custom_field_tag_with_label :course, value %>
<% end %> <%= call_hook(:view_courses_form, :course => @course, :form => f) %> - - - <% unless @course.extra_frozen? %> diff --git a/app/views/courses/show.html.erb b/app/views/courses/show.html.erb index ff0a3e6e1..a1feaf12a 100644 --- a/app/views/courses/show.html.erb +++ b/app/views/courses/show.html.erb @@ -1,8 +1,6 @@ <% if @events_by_day != nil && @events_by_day.size >0 %>- <%#= l(:label_date_from_to, :start => format_date(@date_from), :end => format_date(@date_to - 1)) %>
<% @events_by_day.keys.sort.reverse.each do |day| %> @@ -13,23 +11,21 @@+ | |