summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMrYummy <elemental428@gmail.com>2017-06-13 02:06:58 +0200
committerMrYummy <elemental428@gmail.com>2017-06-13 02:08:13 +0200
commit4d42fdfeb41ce57134a7574e41650f56897303e5 (patch)
tree09ba023a9a753b8f04330aa5a4897906ba59313b
parentdd63941657149a6b173c9d335158d12c3198e50b (diff)
Moved messages index link to users/show.html.erb, added 'message this user' button
-rw-r--r--app/assets/stylesheets/style.css.scss1
-rw-r--r--app/views/blogposts/index.html.erb3
-rw-r--r--app/views/messages/new.html.erb4
-rw-r--r--app/views/statics/home.html.erb2
-rw-r--r--app/views/users/show.html.erb19
5 files changed, 16 insertions, 13 deletions
diff --git a/app/assets/stylesheets/style.css.scss b/app/assets/stylesheets/style.css.scss
index 2682f91..9f8947a 100644
--- a/app/assets/stylesheets/style.css.scss
+++ b/app/assets/stylesheets/style.css.scss
@@ -650,6 +650,7 @@ tr.spacer {
}
.profile-action {
+ font-size: 0;
float: right;
}
diff --git a/app/views/blogposts/index.html.erb b/app/views/blogposts/index.html.erb
index e838de4..c622d29 100644
--- a/app/views/blogposts/index.html.erb
+++ b/app/views/blogposts/index.html.erb
@@ -1,7 +1,4 @@
<% title "News" %>
-<% if current_user %>
- <%= link_to "Private Messages (#{Message.where(user_target: current_user).count})", messages_path, class: "btn right blue" %>
-<% end %>
<h1>News</h1>
<%= link_to 'Make new Post', new_blogpost_path, class: "btn blue" if mod? %>
<div id="posts">
diff --git a/app/views/messages/new.html.erb b/app/views/messages/new.html.erb
index e40eb35..656f3c6 100644
--- a/app/views/messages/new.html.erb
+++ b/app/views/messages/new.html.erb
@@ -3,13 +3,13 @@
</table>
<tr>
<td>
- <%= render partial: "md_editor_user", locals: {name: "message[user_target]", content: @message.user_target} %>
+ <%= render partial: "md_editor_user", locals: {name: "message[user_target]", content: params[:user_target]} %>
</td>
</tr>
<br>
<tr>
<td>
- <%= render partial: "md_editor", locals: {name: "message[text]", content: @message.text} %>
+ <%= render partial: "md_editor", locals: {name: "message[text]", content: params[:text]} %>
</td>
</tr>
</table>
diff --git a/app/views/statics/home.html.erb b/app/views/statics/home.html.erb
index a5f3242..6a51abd 100644
--- a/app/views/statics/home.html.erb
+++ b/app/views/statics/home.html.erb
@@ -30,4 +30,4 @@
<span>for those who just want to mine some ore</span>
<span>and we have a freebuild world for large projects.</span>
</p>
-<p>Join us now!</p> \ No newline at end of file
+<p>Join us now!</p>
diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb
index e371a09..d9eb123 100644
--- a/app/views/users/show.html.erb
+++ b/app/views/users/show.html.erb
@@ -1,14 +1,19 @@
<% title @user.name %>
<div id="user-info">
- <% if @user.is?(current_user) || (mod? && current_user.role >= @user.role) %>
- <div class="profile-action" ><%= link_to "edit profile", edit_user_path(@user), :class => "btn blue" %></div>
- <% end %>
- <div class="profile-action" >
- <% if !session[:original_user_id] && admin? %>
- <%= link_to "become this user", become_path(user: @user), :class => "btn blue" %>
- <% elsif session[:original_user_id] %>
+ <div class="profile-action">
+ <% if session[:original_user_id] %>
<%= link_to "revert", revert_path, :class => "btn blue" %>
+ <% elsif admin? %>
+ <%= link_to "become this user", become_path(user: @user), :class => "btn blue" %>
+ <% end %>
+ <% if @user.is?(current_user) || (mod? && current_user.role >= @user.role) %>
+ <%= link_to "edit profile", edit_user_path(@user), :class => "btn blue" %>
+ <% end %>
+ <% if @user.is?(current_user) %>
+ <%= link_to "Private Messages (#{Message.where(user_target: current_user).count})", messages_path, :class => "btn blue" %>
+ <% else %>
+ <%= link_to "Send this user a message", new_message_path(user_target: @user.ign), :class => "btn blue" %>
<% end %>
</div>