diff --git a/app/assets/stylesheets/specific/wiki_pages.css.scss b/app/assets/stylesheets/specific/wiki_pages.css.scss
index 556342cc7..2caf69e51 100644
--- a/app/assets/stylesheets/specific/wiki_pages.css.scss
+++ b/app/assets/stylesheets/specific/wiki_pages.css.scss
@@ -20,8 +20,6 @@ div#c-wiki-pages {
}
}
- div#a-edit, div#a-new {
- div#preview {
- }
+ div#preview {
}
}
\ No newline at end of file
diff --git a/app/controllers/dmails_controller.rb b/app/controllers/dmails_controller.rb
index 585952abe..0a21da4cc 100644
--- a/app/controllers/dmails_controller.rb
+++ b/app/controllers/dmails_controller.rb
@@ -20,6 +20,11 @@ class DmailsController < ApplicationController
respond_with(@dmails)
end
+ def search
+ @search = Dmail.search(params[:search])
+ respond_with(@dmails)
+ end
+
def show
@dmail = Dmail.find(params[:id])
check_privilege(@dmail)
diff --git a/app/models/dmail.rb b/app/models/dmail.rb
index 503721a58..b0799519a 100644
--- a/app/models/dmail.rb
+++ b/app/models/dmail.rb
@@ -9,7 +9,7 @@ class Dmail < ActiveRecord::Base
belongs_to :from, :class_name => "User"
after_create :update_recipient
after_create :send_dmail
- attr_accessible :title, :body, :is_deleted, :to_id, :to
+ attr_accessible :title, :body, :is_deleted, :to_id, :to, :to_name
scope :for, lambda {|user| where(["owner_id = ?", user])}
scope :inbox, where("to_id = owner_id")
scope :sent, where("from_id = owner_id")
diff --git a/app/views/dmails/_form.html.erb b/app/views/dmails/_form.html.erb
index 87640fafc..1c9ab82e3 100644
--- a/app/views/dmails/_form.html.erb
+++ b/app/views/dmails/_form.html.erb
@@ -5,6 +5,6 @@
<%= f.input :to_name, :label => "To" %>
<%= f.input :title %>
<%= f.input :body, :html_options => {:size => "50x25"} %>
- <%= f.button :submit %>
- <%= submit_tag "Preview" %>
+ <%= f.button :submit, "Send" %>
+ <%= submit_tag "Preview", :id => "preview-button" %>
<% end %>
diff --git a/app/views/dmails/_received.html.erb b/app/views/dmails/_received.html.erb
index 8d0d97c42..4d43a899f 100644
--- a/app/views/dmails/_received.html.erb
+++ b/app/views/dmails/_received.html.erb
@@ -1,4 +1,5 @@
+ | <%= link_to dmail.to_name, user_path(dmail.to) %> |
<%= link_to dmail.from_name, user_path(dmail.from) %> |
<%= link_to dmail.title, dmail_path(dmail) %> |
<%= compact_time(dmail.created_at) %> |
diff --git a/app/views/dmails/_search.html.erb b/app/views/dmails/_search.html.erb
deleted file mode 100644
index ed6cf1589..000000000
--- a/app/views/dmails/_search.html.erb
+++ /dev/null
@@ -1,10 +0,0 @@
-
- <%= simple_form_for @search do |f| %>
- <%= hidden_field_tag :folder, params[:folder] %>
- <%= f.input :title_contains, :required => false %>
- <%= f.input :body_contains, :required => false %>
- <%= f.input :to_name_equals, :required => false %>
- <%= f.input :from_name_equals, :required => false %>
- <%= f.button :submit %>
- <% end %>
-
diff --git a/app/views/dmails/_secondary_links.html.erb b/app/views/dmails/_secondary_links.html.erb
index d19d5fe18..b8d59e209 100644
--- a/app/views/dmails/_secondary_links.html.erb
+++ b/app/views/dmails/_secondary_links.html.erb
@@ -3,5 +3,6 @@
<%= link_to "Received", dmails_path(:folder => "received") %>
<%= link_to "Sent", dmails_path(:folder => "sent") %>
<%= link_to "New", new_dmail_path %>
+ <%= link_to "Search", search_dmails_path %>
<% end %>
diff --git a/app/views/dmails/_sent.html.erb b/app/views/dmails/_sent.html.erb
index d897bba9a..4d43a899f 100644
--- a/app/views/dmails/_sent.html.erb
+++ b/app/views/dmails/_sent.html.erb
@@ -1,5 +1,6 @@
- | <%= link_to dmail.to_name, user_path(dmail.from) %> |
+ <%= link_to dmail.to_name, user_path(dmail.to) %> |
+ <%= link_to dmail.from_name, user_path(dmail.from) %> |
<%= link_to dmail.title, dmail_path(dmail) %> |
<%= compact_time(dmail.created_at) %> |
diff --git a/app/views/dmails/edit.html.erb b/app/views/dmails/edit.html.erb
index ecb810365..a13f6f761 100644
--- a/app/views/dmails/edit.html.erb
+++ b/app/views/dmails/edit.html.erb
@@ -5,3 +5,4 @@
+<%= render "secondary_links" %>
\ No newline at end of file
diff --git a/app/views/dmails/index.html.erb b/app/views/dmails/index.html.erb
index 084a8e3a6..e90e8218b 100644
--- a/app/views/dmails/index.html.erb
+++ b/app/views/dmails/index.html.erb
@@ -2,9 +2,15 @@
Messages
- <%= render "search" %>
-
-
+
+
+
+ | To |
+ From |
+ Subject |
+ Date |
+
+
<% @dmails.each do |dmail| %>
<% if params[:folder] == "sent" %>
@@ -17,3 +23,5 @@
+
+<%= render "secondary_links" %>
\ No newline at end of file
diff --git a/app/views/dmails/new.html.erb b/app/views/dmails/new.html.erb
index 2105c426e..e89966ae6 100644
--- a/app/views/dmails/new.html.erb
+++ b/app/views/dmails/new.html.erb
@@ -5,3 +5,4 @@
+<%= render "secondary_links" %>
\ No newline at end of file
diff --git a/app/views/dmails/show.html.erb b/app/views/dmails/show.html.erb
index 7fcf4306b..f7f2a3e63 100644
--- a/app/views/dmails/show.html.erb
+++ b/app/views/dmails/show.html.erb
@@ -1,7 +1,8 @@
-
<%= @dmail.title %>
+
Show Message
+
<%= @dmail.title %>
<%= format_text(@dmail.body) %>
@@ -11,3 +12,5 @@
+
+<%= render "secondary_links" %>
\ No newline at end of file
diff --git a/app/views/users/_secondary_links.html.erb b/app/views/users/_secondary_links.html.erb
index d5cb4a8b0..da6a714c7 100644
--- a/app/views/users/_secondary_links.html.erb
+++ b/app/views/users/_secondary_links.html.erb
@@ -2,9 +2,12 @@