diff --git a/app/controllers/memos_controller.rb b/app/controllers/memos_controller.rb index fdb400bd8..02e2fb41e 100644 --- a/app/controllers/memos_controller.rb +++ b/app/controllers/memos_controller.rb @@ -1,5 +1,5 @@ class MemosController < ApplicationController - layout "base_memos" + layout 'base_memos' def new @memo = Memo.new @@ -11,6 +11,7 @@ class MemosController < ApplicationController def show @memo = Memo.find_by_id(params[:id]) + @forum = Forum.find(params[:forum_id]) @replies = @memo.replies @mome_new = Memo.new diff --git a/app/views/layouts/base_memos.html.erb b/app/views/layouts/base_memos.html.erb index f97b69351..6f375f9b5 100644 --- a/app/views/layouts/base_memos.html.erb +++ b/app/views/layouts/base_memos.html.erb @@ -1,5 +1,5 @@ - + <%= h html_title %> @@ -7,7 +7,7 @@ <%= csrf_meta_tag %> <%= favicon %> - <%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', 'application', :media => 'all' %> + <%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', 'application', 'nyan', :media => 'all' %> <%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %> <%= javascript_heads %> <%= heads_for_theme %> @@ -15,45 +15,155 @@ <%= yield :header_tags -%> +
-
- <%= render :partial => 'layouts/base_header'%> -
-
- -
- <%= render_flash_messages %> - <%= yield %> - <%= call_hook :view_layouts_base_content %> -
- <%= render_flash_messages %> +
+ <%=render :partial => 'layouts/base_header'%> +
+ + +
+ + + + + + + + + + +
软件项目托管社区<%= l(:label_user_location) %> : + +
<%= link_to "forge.trustie.net/projects", :controller => 'projects', :action => 'index', :project_type => 0 %>

<%=link_to l(:label_home),home_path %> > <%=link_to '讨论区', :controller => 'forums', :action => 'index' %> > <%=link_to @forum.name, forum_path(@forum) %> > <%=link_to @memo.subject, forum_memo_path(@forum, @memo) %>

+
+ + -
-
- - - - - <%= debug(params) if Rails.env.development? %>
+ <%= call_hook :view_layouts_base_body_bottom %>
- <%= call_hook :view_layouts_base_body_bottom %> + - \ No newline at end of file diff --git a/app/views/memos/show.html.erb b/app/views/memos/show.html.erb index 71d8dc10b..b8abb9d91 100644 --- a/app/views/memos/show.html.erb +++ b/app/views/memos/show.html.erb @@ -1,90 +1,121 @@ - -
    - - -
    - - <%= link_to image_tag(url_to_avatar(@memo.author), :class => "avatar", :style => "width: 24px; height: 24px"), user_path(@memo.author) %> - <%=h @memo.subject %>
    -
    - <%= textilizable(@memo, :content) %> - <%= authoring @memo.created_at, @memo.author %> + +
    +
    +
    <%= link_to image_tag(url_to_avatar(@memo.author), :class => "avatar"), user_path(@memo.author) %>
    +

    <%=h @memo.author %>

    +
    +
    +
    <%= label_tag l(:field_subject) %>: <%=h @memo.subject %>
    +
    <%= textilizable(@memo, :content) %>
    +
    <%= authoring @memo.created_at, @memo.author %>

    - -
- -

<%= l(:label_reply_plural) %> (<%= @replies.nil? ? 0 : @replies.size %>)

+
+

<%= l(:label_reply_plural) %> (<%= @replies.nil? ? 0 : @replies.size %>)

+ <% reply_count = 0%> <% @replies.each do |reply| %> +

<%= reply_count += 1 %>L :

"> -
- <%= link_to( - image_tag('comment.png'), - {:action => 'quote', :id => reply}, - :remote => true, - :method => 'get', - :title => l(:button_quote)) if !@memo.locked? && authorize_for('messages', 'reply') %> - <%= link_to( - image_tag('edit.png'), - {:action => 'edit', :id => reply}, - :title => l(:button_edit) - ) if reply.destroyable_by?(User.current) %> - <%= link_to( - image_tag('delete.png'), - {:action => 'destroy', :id => reply}, - :method => :post, - :data => {:confirm => l(:text_are_you_sure)}, - :title => l(:button_delete) - ) if reply.destroyable_by?(User.current) %> -
- - - - - - - - - - -
- <%= link_to image_tag(url_to_avatar(reply.author), :class => "avatar"), user_path(reply.author) %> -
<%= textilizable reply, :content %>
- -
<%= authoring reply.created_at, reply.author %>
+
+ <%= link_to( + image_tag('comment.png'), + {:action => 'quote', :id => reply}, + :remote => true, + :method => 'get', + :title => l(:button_quote)) if !@memo.locked? && authorize_for('messages', 'reply') %> + <%= link_to( + image_tag('edit.png'), + {:action => 'edit', :id => reply}, + :title => l(:button_edit) + ) if reply.destroyable_by?(User.current) %> + <%= link_to( + image_tag('delete.png'), + {:action => 'destroy', :id => reply}, + :method => :post, + :data => {:confirm => l(:text_are_you_sure)}, + :title => l(:button_delete) + ) if reply.destroyable_by?(User.current) %> +
- + + + + + + + + +
+ <%= link_to image_tag(url_to_avatar(reply.author), :class => "avatar"), user_path(reply.author) %> + +
<%= textilizable reply, :content %>
+
<%= authoring reply.created_at, reply.author %>
+
<% end %>
-
- <%= labelled_form_for(@mome_new, url: forum_memos_path) do |f| %> - reply -
    - <%= f.hidden_field :subject, :required => true, value: @memo.subject %> - <%= f.hidden_field :forum_id, :required => true, value: @memo.forum_id %> - <%= f.hidden_field :parent_id, :required => true, value: @memo.id %> -
  • <%= f.text_field :content, :required => true, :size => 80 %>
  • -
- <%= f.submit %> +
+ <%= form_for(@mome_new, url: forum_memos_path) do |f| %> + <%= f.hidden_field :subject, :required => true, value: @memo.subject %> + <%= f.hidden_field :forum_id, :required => true, value: @memo.forum_id %> + <%= f.hidden_field :parent_id, :required => true, value: @memo.id %> + <%= label_tag(l(:label_reply_plural)) %>: +

<%= f.text_area :content, :required => true, :size => "75%", :resize => "none" %>

+ <%= f.submit value: l(:label_reply_plural), class: "replies" %> <% end %>
diff --git a/config/locales/en.yml b/config/locales/en.yml index 8a7bcc31b..b3c1b2bde 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1565,6 +1565,7 @@ en: field_hidden_repo: code protected label_newbie_faq: newbie FAQ label_hot_project: 'HOT Projects' + label_memo_create_succ: Memo was successfully created. diff --git a/config/locales/zh.yml b/config/locales/zh.yml index c7b016f6f..9f7dfcff4 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -1726,3 +1726,4 @@ zh: label_newbie_faq: '新手指引 & 问答' label_hot_project: '热门项目' + label_memo_create_succ: 回复成功