diff --git a/app/models/memo.rb b/app/models/memo.rb index efe521f1c..09a562bb4 100644 --- a/app/models/memo.rb +++ b/app/models/memo.rb @@ -19,4 +19,15 @@ class Memo < ActiveRecord::Base def replies Memo.where("parent_id = ?", id) end + def locked? + self.lock + end + + def editable_by? user + !self.lock + end + + def destroyable_by? user + + end end diff --git a/app/views/layouts/base_memos.html.erb b/app/views/layouts/base_memos.html.erb new file mode 100644 index 000000000..f97b69351 --- /dev/null +++ b/app/views/layouts/base_memos.html.erb @@ -0,0 +1,59 @@ + + +
+ +<%= l(:label_homeworks_form_new_description) %>
+ +<%= f.text_field :content, :required => true, :size => 60, :style => "width:150px;" %>
+<%= hidden_field_tag 'subject', ||=@memo.subject %> \ No newline at end of file diff --git a/app/views/memos/show.html.erb b/app/views/memos/show.html.erb index e0fc7cbbd..05da1db1a 100644 --- a/app/views/memos/show.html.erb +++ b/app/views/memos/show.html.erb @@ -1,36 +1,90 @@ -
- <%= notice %> -
-- <%= %> -
-- <%= %> -
-subject | -content | -author | -
---|---|---|
<%= link_to @memo.subject, forum_memo_path(@memo) %> | -<%= @memo.content %> | -<%= @memo.author %> | -
subject | -content | -author | -
---|---|---|
<%= link_to reply.subject, forum_memo_path(reply) %> | -<%= reply.content %> | -<%= reply.author %> | -
+ <%= link_to image_tag(url_to_avatar(reply.author), :class => "avatar"), user_path(reply.author) %> | +
+ <%= textilizable reply, :content %>
+
+ |
+
<%= authoring reply.created_at, reply.author %> | +