Skip to content
Browse files

messaging are working now

  • Loading branch information...
1 parent da9ea17 commit 2cb024cf9979c193adef84fc54681c54cf0fbc29 @ahmdrefat ahmdrefat committed Apr 28, 2012
View
53 app/controllers/conversations_controller.rb
@@ -1,4 +1,57 @@
class ConversationsController < ApplicationController
before_filter :authenticate_user
+
+ def index
+ @conversations = Conversation.all
+ end
+
+ def new
+ @conversation = Conversation.new
+ @message = Message.new
+ #@friends_list = User.all.collect{ |f| [f.username.capitalize] }
+ params[:receiver] ="Islam"
+ end
+
+ def create
+
+ receiver = User.find_by_username params[:friends][:username].downcase
+
+ if params[:content] == ""
+ flash[:no_content] = "Cannot send empty message"
+ render "/conversations/new/"
+ else
+ @conversation = Conversation.create({ sender_id: @current_user.id, receiver_id: receiver.id, subject: params[:subject]})
+
+ @message = Message.create({conversation_id: @conversation.id, content: params[:content], person_id: @current_user.id})
+ redirect_to conversations_path
+ end
+
+ end
+
+ def show
+ @conversation = Conversation.find params[:id]
+ @messages = @conversation.messages
+ end
+
+ def edit
+
+ end
+
+ def update
+
+ end
+
+ def destroy
+ conversation_d = Conversation.find params[:id]
+
+ conversation_d.messages.each do |m|
+ m.destroy
+ end
+
+ conversation_d.destroy
+
+ redirect_to "/conversations/"
+ end
+
end
View
14 app/controllers/messages_controller.rb
@@ -1,3 +1,17 @@
class MessagesController < ApplicationController
before_filter :authenticate_user
+
+ def create
+ if params[:content] == ""
+ flash[:no_content] = "Cannot send empty message"
+ redirect_to "/conversations/" + params[:conversation_id]
+ else
+ @message = Message.create({conversation_id: params[:conversation_id], content: params[:content], person_id: @current_user.id})
+ redirect_to "/conversations/"+ params[:conversation_id]
+ end
+
+ end
+
+
+
end
View
2 app/views/comments/_new.html.erb
@@ -1,6 +1,6 @@
<div class="content-footer">
<div class="comments">
- <%post.comments.each do |comment| %>
+ <% post.comments.each do |comment| %>
<a href="#">
<i class="icon-remove"></i>
</a>
View
64 app/views/conversations/Messages_preview.html.erb
@@ -1,64 +0,0 @@
-
- <h1>Messages</h1>
-
- <div class="messages-list">
- <h2>Back to Work Again</h2>
-
- <div class="message-box row">
- <div class="span4">
- <a href="#">
- <img class="profile-pic" src="pic.png" alt=""></a>
- </div>
- <div class="span8">
- <p>
- <a href="#">Karim El Husseiny</a>
- </p>
- <p>at 7:30 pm Monday, 12th Feb 2012</p>
- <p>
- Hey Everyone, On the list of things guaranteed to happen from Google getting suing Google caught circumventing privacy settings on the iPhone‘s web browser, you can check off “lawsuit.” At least two people are separately suing Google, accusing the search giant suing Google of violating federal laws.
- <br/>
- See u Soon Byee ;)
- </p>
- </div>
- </div><!-- /messages-box-->
-
- <div class="message-box row">
- <div class="span4">
- <a href="#">
- <img class="profile-pic" src="pic.png" alt=""></a>
- </div>
- <div class="span8">
- <p>
- <a href="#">Ahmed El Husseiny</a>
- </p>
- <p>at 8:30 pm Monday, 12th Feb 2012</p>
- <p>
- Hey Karim,
- <br/>
- At least two people are separately suing Google, accusing the search giant suing Google of violating federal laws.
- </p>
- </div>
- </div><!-- /messages-box-->
-
- <div class="message-box row">
- <div class="span4">
- <a href="#">
- <img class="profile-pic" src="pic.png" alt=""></a>
- </div>
- <div class="span8">
- <p>
- <a href="#">Karim El Husseiny</a>
- </p>
- <p>at 7:30 pm Monday, 12th Feb 2012</p>
- <p>
- Hey Everyone, On the list of things guaranteed to happen from Google getting suing Google caught circumventing privacy settings on the iPhone‘s web browser, you can check off “lawsuit.” At least two people are separately suing Google, accusing the search giant suing Google of violating federal laws.
- <br/>
- See u Soon Byee ;)
- </p>
- </div>
- </div><!-- /messages-box-->
- <textarea class="text-area" placeholder="" rows="3"></textarea>
- <button class="btn btn-primary pull-right">Reply</button>
-
- </div><!-- /messages-list-->
-
View
125 app/views/conversations/index.erb
@@ -0,0 +1,125 @@
+<style type="text/css">
+ .message-box img{
+ height: 55px;
+ }
+ .btn{
+ float: none;
+ }
+ #delete-btn{
+ margin-left: -24px;
+ }
+ #unread{
+ background-image: -webkit-linear-gradient(white, #CCC);
+ }
+</style>
+
+<h1>Conversation</h1>
+
+<div class="messages-list">
+ <div class="messages-setting">
+
+ <a href="<%= new_conversation_path %>" class="btn pull-left">
+ <i class="icon-plus"></i> New Conversation
+ </a>
+
+
+ <input type="text" class="input-medium search-query pull-right">
+ <div class="btn-group pull-right">
+ <a class="btn btn-primary more-button dropdown-toggle" data-toggle="dropdown" href="#">All</i>
+ <span class="caret"></span>
+ </a>
+ <ul class="dropdown-menu ">
+ <li>
+ <a href="#">Unread</a>
+ </li>
+ <li>
+ <a href="#">Read</a>
+ </li>
+ <li>
+ <a href="#">Favorites</a>
+ </li>
+ <li>
+ <a href="#">Sent Messages</a>
+ </li>
+ </ul>
+ </div><!-- /btn-group--> </div><!-- /messages-setting-->
+
+
+<% @conversations.each do |conversation| %>
+<% if conversation == nil %>
+<h3>you have no messages</h3>
+<% else %>
+
+<% #if conversation.messages.last.unread == true %>
+<div id="unread" class="message-box row">
+<% #else %>
+<!--<div class="message-box row">-->
+<% #end %>
+ <div class="span4">
+ <a href="#">
+ <img class="profile-pic" src="/assets/pic.png" alt=""></a>
+ </div>
+ <div class="span8">
+ <p >
+ <a href="<%= conversation.id %>"><%= conversation.subject %></a>
+ </p>
+ <p>
+ <a href="#">by <%= @name = User.find_by_id(conversation.sender_id).username %></a>
+
+ <% date = (Time.now - conversation.created_at).to_i %>
+ <%case date%>
+ <% when 0..60 %>
+ <%= "#{date+3} Seconds ago"%>
+ <% when 60..3600 %>
+ <%= "#{pluralize(date/60, 'Minute')} ago"%>
+ <% when 3600..86400 %>
+ <%= "#{pluralize(date/3600, 'Hour')} ago"%>
+ <% when 86400..172800 %>
+ <%= "Yesterday"%>
+ <%else%>
+ <%=conversation.created_at.strftime("%B %e, %Y at %l:%M %p")%>
+ <% end%>
+
+ </p>
+ <p>
+
+ <%= conversation.messages[0].content[0..60] + "...."%>
+
+ </p>
+ </div>
+ <div class="span2">
+
+ <a href="/conversations/<%= conversation.id %>" id="delete-btn" rel="nofollow" data-method="delete" class="btn pull-left">
+ <i class="icon-trash"></i>
+ </a>
+
+ </div>
+</div><!-- /messages-box-->
+<% end %>
+<%end%>
+
+
+
+<div class="pagination pull-right">
+ <ul>
+ <li class="disabled">
+ <a href="#">«</a>
+ </li>
+ <li class="active">
+ <a href="#">1</a>
+ </li>
+ <li>
+ <a href="#">2</a>
+ </li>
+ <li>
+ <a href="#">3</a>
+ </li>
+ <li>
+ <a href="#">4</a>
+ </li>
+ <li>
+ <a href="#">»</a>
+ </li>
+ </ul>
+</div>
+</div><!-- /messages-list-->
View
200 app/views/conversations/messages.html.erb
@@ -1,200 +0,0 @@
-
- <h1>Messages</h1>
-
- <div class="messages-list">
- <div class="messages-setting">
- <button type="submit" class="btn pull-left">
- <i class="icon-plus"></i>
- </button>
- <button type="submit" class="btn pull-left">
- <i class="icon-trash"></i>
- </button>
- <button type="submit" class="btn pull-left">
- <i class="icon-star"></i>
- </button>
- <button type="submit" class="btn pull-left">
- <i class="icon-folder-open"></i>
- </button>
-
- <input type="text" class="input-medium search-query pull-right">
- <div class="btn-group pull-right">
- <a class="btn btn-primary more-button dropdown-toggle" data-toggle="dropdown" href="#">All</i>
- <span class="caret"></span>
- </a>
- <ul class="dropdown-menu ">
- <li>
- <a href="#">Unread</a>
- </li>
- <li>
- <a href="#">Read</a>
- </li>
- <li>
- <a href="#">Favorites</a>
- </li>
- <li>
- <a href="#">Sent Messages</a>
- </li>
- </ul>
- </div><!-- /btn-group--> </div><!-- /messages-setting-->
-
- <div class="message-box row">
- <div class="span4">
- <a href="#">
- <img class="profile-pic" src="pic.png" alt=""></a>
- </div>
- <div class="span8">
- <p >
- <a href="#">Back to work again!</a>
- </p>
- <p>
- <a href="#">by Karim El Husseiny</a>
- at 7:30 pm in 12th Feb 2012
- </p>
- <p>
- <a href="#">
- Hey Everyone, hope you're fine it's time now to work again....
- </a>
- </p>
- </div>
- <div class="span2">
- <input type="checkbox" id="optionsCheckbox" value="option1"></div>
- </div><!-- /messages-box-->
-
- <div class="message-box row">
- <div class="span4">
- <a href="#">
- <img class="profile-pic" src="pic.png" alt=""></a>
- </div>
- <div class="span8">
- <p >
- <a href="#">Back to work again!</a>
- </p>
- <p>
- <a href="#">by Karim El Husseiny</a>
- at 7:30 pm in 12th Feb 2012
- </p>
- <p>
- <a href="#">
- Hey Everyone, hope you're fine it's time now to work again....
- </a>
- </p>
- </div>
- <div class="span2">
- <input type="checkbox" id="optionsCheckbox" value="option1"></div>
- </div><!-- /messages-box-->
-
- <div class="message-box row">
- <div class="span4">
- <a href="#">
- <img class="profile-pic" src="pic.png" alt=""></a>
- </div>
- <div class="span8">
- <p >
- <a href="#">Back to work again!</a>
- </p>
- <p>
- <a href="#">by Karim El Husseiny</a>
- at 7:30 pm in 12th Feb 2012
- </p>
- <p>
- <a href="#">
- Hey Everyone, hope you're fine it's time now to work again....
- </a>
- </p>
- </div>
- <div class="span2">
- <input type="checkbox" id="optionsCheckbox" value="option1"></div>
- </div><!-- /messages-box-->
-
- <div class="message-box row">
- <div class="span4">
- <a href="#">
- <img class="profile-pic" src="pic.png" alt=""></a>
- </div>
- <div class="span8">
- <p >
- <a href="#">Back to work again!</a>
- </p>
- <p>
- <a href="#">by Karim El Husseiny</a>
- at 7:30 pm in 12th Feb 2012
- </p>
- <p>
- <a href="#">
- Hey Everyone, hope you're fine it's time now to work again....
- </a>
- </p>
- </div>
- <div class="span2">
- <input type="checkbox" id="optionsCheckbox" value="option1"></div>
- </div><!-- /messages-box-->
-
- <div class="message-box row ">
- <div class="span4">
- <a href="#">
- <img class="profile-pic" src="pic.png" alt=""></a>
- </div>
- <div class="span8">
- <p >
- <a href="#">Back to work again!</a>
- </p>
- <p>
- <a href="#">by Karim El Husseiny</a>
- at 7:30 pm in 12th Feb 2012
- </p>
- <p>
- <a href="#">
- Hey Everyone, hope you're fine it's time now to work again....
- </a>
- </p>
- </div>
- <div class="span2">
- <input type="checkbox" id="optionsCheckbox" value="option1"></div>
- </div><!-- /messages-box-->
-
- <div class="message-box row">
- <div class="span4">
- <a href="#">
- <img class="profile-pic" src="pic.png" alt=""></a>
- </div>
- <div class="span8">
- <p >
- <a href="#">Back to work again!</a>
- </p>
- <p>
- <a href="#">by Karim El Husseiny</a>
- at 7:30 pm in 12th Feb 2012
- </p>
- <p>
- <a href="#">
- Hey Everyone, hope you're fine it's time now to work again....
- </a>
- </p>
- </div>
- <div class="span2">
- <input type="checkbox" id="optionsCheckbox" value="option1"></div>
- </div><!-- /messages-box-->
-
- <div class="pagination pull-right">
- <ul>
- <li class="disabled">
- <a href="#">«</a>
- </li>
- <li class="active">
- <a href="#">1</a>
- </li>
- <li>
- <a href="#">2</a>
- </li>
- <li>
- <a href="#">3</a>
- </li>
- <li>
- <a href="#">4</a>
- </li>
- <li>
- <a href="#">»</a>
- </li>
- </ul>
- </div>
- </div><!-- /messages-list-->
View
66 app/views/conversations/new.erb
@@ -0,0 +1,66 @@
+ <style type="text/css">
+ .bio input{
+ margin: 9px;
+ width: 480px;
+ }
+ .bio textarea{
+ margin: 9px;
+ width: 480px;
+ height: 150px
+ }
+ #friends{
+ width: 235px;
+ }
+ #friends_username{
+ margin: 8px;
+
+ background: #EEE;
+ }
+ </style>
+ <%= form_tag conversations_path do%>
+
+ <!-- error messages -->
+
+
+ <h1>New Conversation</h1>
+ <hr>
+ <h2>Send to</h2>
+
+ <div id="friends" class="row well ">
+ <input id="receiver" type="hidden" value="<%= params[:receiver] %>">
+ <%= select "friends", "username" , User.all.collect{ |f| [f.username.capitalize] } %>
+ </div>
+
+ <h2>Subject</h2>
+ <div class="row well bio">
+ <%= text_field_tag :subject %>
+ </div>
+
+ <hr>
+
+ <h2>Body</h2>
+ <div class="row well bio">
+ <h3><%= flash[:no_content] %></h3>
+ <%= text_area_tag :content, "" %>
+ </div>
+
+ <div class="form-actions">
+ <%= submit_tag "Send", :class => "btn btn-primary" %>
+ <a href="/conversations/" class="btn">Cancel</a>
+ </div>
+
+ <% end %>
+
+
+<script type="text/javascript">
+ $(function (argument) {
+ var receiver = $("input[type=hidden]#receiver").attr("value");
+
+ if(receiver){
+ $("#friends_username").find("[value="+receiver+"]").attr("selected","selected");
+ }
+
+ })
+
+
+</script>
View
54 app/views/conversations/show.erb
@@ -0,0 +1,54 @@
+<style type="text/css">
+ .message-box img{
+ height: 55px;
+ }
+</style>
+<h1>Messages</h1>
+
+<div class="messages-list">
+ <h2>Back to Work Again</h2>
+
+ <% @messages.each do |message| %>
+ <% @name = User.find_by_id(message.person_id).username %>
+ <div class="message-box row">
+ <div class="span4">
+ <a href="/<%= @name %>">
+ <img class="profile-pic" src="/assets/pic.png" alt=""></a>
+ </div>
+ <div class="span8">
+ <p>
+ <a href="/<%= @name %>"><%= @name %></a>
+ </p>
+ <p>
+ <% date = (Time.now - message.created_at).to_i %>
+ <%case date%>
+ <% when 0..60 %>
+ <%= "#{date+3} Seconds ago"%>
+ <% when 60..3600 %>
+ <%= "#{pluralize(date/60, 'Minute')} ago"%>
+ <% when 3600..86400 %>
+ <%= "#{pluralize(date/3600, 'Hour')} ago"%>
+ <% when 86400..172800 %>
+ <%= "Yesterday"%>
+ <%else%>
+ <%=message.created_at.strftime("%B %e, %Y at %l:%M %p")%>
+ <% end%>
+ </p>
+ <p>
+ <%= message.content %>
+ </p>
+ </div>
+ </div><!-- /messages-box-->
+
+ <% end %>
+ <div>
+ <%= form_tag ({:controller => :messages, :action => :create}) do %>
+ <h3><%= flash[:no_content] %></h3>
+ <%= text_area_tag :content, "" %>
+ <%= submit_tag "Reply", class: "btn btn-primary" %>
+ <%= hidden_field_tag :conversation_id, @messages[0].conversation_id %>
+ <a href="/conversations/" class="btn">Back</a>
+ <%end%>
+ </div>
+</div><!-- /messages-list-->
+
View
474 app/views/layouts/application.html.erb
@@ -1,245 +1,245 @@
- <!DOCTYPE html>
- <html>
- <head>
- <title>Dinobot</title>
+<!DOCTYPE html>
+<html>
+<head>
+<title>Dinobot</title>
- <%= stylesheet_link_tag "bootstrap", "dinobot", :media => "all" %>
- <% if params[:controller] == 'profiles' %>
- <%= stylesheet_link_tag "profiles"%>
- <%end%>
- <%= javascript_include_tag "application" %>
- <%= csrf_meta_tags %>
- </head>
+<%= stylesheet_link_tag "bootstrap", "dinobot", :media => "all" %>
+<% if params[:controller] == 'profiles' %>
+<%= stylesheet_link_tag "profiles"%>
+<%end%>
+<%= javascript_include_tag "application" %>
+<%= csrf_meta_tags %>
+</head>
- <body>
+<body>
- <div class="navbar navbar-fixed-top">
- <div class="navbar-inner">
- <div class="container">
- <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
- <span class="i-bar"></span>
- <span class="i-bar"></span>
- <span class="i-bar"></span>
+<div class="navbar navbar-fixed-top">
+<div class="navbar-inner">
+<div class="container">
+<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
+<span class="i-bar"></span>
+<span class="i-bar"></span>
+<span class="i-bar"></span>
+</a>
+<img id="logo" src="/assets/blue_robot_sh.png">
+<a class="brand" href="/home">Dinobot</a>
+<!-- <form class="navbar-search pull-left" action="">
+<input type="text" class="search-query span2" placeholder="Search"></form> -->
+<form class="navbar-search pull-left" action="">
+<input type="text" class="search-query span2" placeholder="Search" style="margin: 0 auto;" data-provide="typeahead" data-items="4" data-source="[]">
+</form>
+<div class="nav-collapse">
+<div class="user pull-right">
+ <div class="btn-group">
+ <a class="btn" href="#">
+ <%= image_tag "pic.png", :class =>"pull-right" %>
</a>
- <img id="logo" src="/assets/blue_robot_sh.png">
- <a class="brand" href="/home">Dinobot</a>
- <!-- <form class="navbar-search pull-left" action="">
- <input type="text" class="search-query span2" placeholder="Search"></form> -->
- <form class="navbar-search pull-left" action="">
- <input type="text" class="search-query span2" placeholder="Search" style="margin: 0 auto;" data-provide="typeahead" data-items="4" data-source="[]">
- </form>
- <div class="nav-collapse">
- <div class="user pull-right">
- <div class="btn-group">
- <a class="btn" href="#">
- <%= image_tag "pic.png", :class =>"pull-right" %>
- </a>
- <a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
- <span class="caret"></span>
- </a>
- <ul class="dropdown-menu pull-right">
- <li>
- <a href="profiles/index">Profile</a>
- </li>
- <li>
- <a href="#">Setting</a>
- </li>
- <li>
- <a href="#">Help</a>
- </li>
- <li class="divider"></li>
- <li>
- <%= link_to("Logout", logout_path) %>
- </li>
- </ul>
- </div> <!-- btn-group -->
- </div> <!-- user pull-right -->
- <ul class="nav pull-right">
- <li>
- <a href="#"> <i class="icon-white icon-user"></i></a>
- </li>
- <li>
- <a href="#"> <i class="icon-white icon-envelope"></i></a>
- </li>
- <li>
- <a href="#"><i class="icon-white icon-flag"></i></a>
- </li>
- </ul>
- </div> <!--/ nav-collapse -->
- </div> <!--/ container -->
- </div> <!--navbar-inner-->
- </div> <!--navbar-->
+ <a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
+ <span class="caret"></span>
+ </a>
+ <ul class="dropdown-menu pull-right">
+ <li>
+ <%= link_to("Profile", "/#{@current_user.username}") %>
+ </li>
+ <li>
+ <a href="#">Setting</a>
+ </li>
+ <li>
+ <a href="#">Help</a>
+ </li>
+ <li class="divider"></li>
+ <li>
+ <%= link_to("Logout", logout_path) %>
+ </li>
+ </ul>
+ </div> <!-- btn-group -->
+</div> <!-- user pull-right -->
+<ul class="nav pull-right">
+ <li>
+ <a href="#"> <i class="icon-white icon-user"></i></a>
+ </li>
+ <li>
+ <a href="#"> <i class="icon-white icon-envelope"></i></a>
+ </li>
+ <li>
+ <a href="#"><i class="icon-white icon-flag"></i></a>
+ </li>
+</ul>
+</div> <!--/ nav-collapse -->
+</div> <!--/ container -->
+</div> <!--navbar-inner-->
+</div> <!--navbar-->
- <div id="main-container" class="container">
- <div class="row">
- <div class="span4 sides">
- <div class="profile-box">
- <div class="top-profile-box" >
- <div class="row-fluid">
- <div class="span4">
- <%= image_tag "pic.png" %>
- </div>
- <div class="span8">
- <a href="">
- <h4>
- <%=@current_user.username.capitalize + " "%>
- <i class="icon-ok-sign icon-white"></i>
- </h4>
- </a>
- <% if params[:action]== 'edit'%>
- <a href="">
- <h5>Change Avatar</h5>
- </a>
- <%else%>
- <% if params[:username] == @current_user.username%>
- <a href="<%= edit_profile_path(@current_user.username)%>">
- <h5>Edit my profile</h5>
- <%end%>
- </a>
- <%end%>
- </div> <!--span8-->
- </div> <!--row-fluid-->
- </div> <!--top-profile-box-->
- <div class="bottom-profile-box" >
- <div class="row-fluid">
- <div class="span4" id="part1">
- <i class="icon-heart icon-white"></i>
- <a href="#">
- <h5>Fans</h5>
- <h5>124</h5>
- </a>
- </div>
- <div class="span4" id="part2">
- <i class="icon-user icon-white"></i>
- <a href="#">
- <h5>Friends</h5>
- <h5>44</h5>
- </a>
- </div>
- <div class="span4" id="part3">
- <i class="icon-share icon-white"></i>
- <a href="#">
- <h5>Sharing</h5>
- <h5>12</h5>
- </a>
- </div>
- </div> <!--row-fluid-->
- </div> <!--bottom-profile-box-->
- </div> <!--profile-box-->
+<div id="main-container" class="container">
+<div class="row">
+<div class="span4 sides">
+<div class="profile-box">
+<div class="top-profile-box" >
+ <div class="row-fluid">
+ <div class="span4">
+ <%= image_tag "pic.png" %>
+ </div>
+ <div class="span8">
+ <a href="">
+ <h4>
+ <%=@current_user.username.capitalize + " "%>
+ <i class="icon-ok-sign icon-white"></i>
+ </h4>
+ </a>
+ <% if params[:action]== 'edit'%>
+ <a href="">
+ <h5>Change Avatar</h5>
+ </a>
+ <%else%>
+ <% if params[:username] == @current_user.username%>
+ <a href="<%= edit_profile_path(@current_user.username)%>">
+ <h5>Edit my profile</h5>
+ <%end%>
+ </a>
+ <%end%>
+ </div> <!--span8-->
+ </div> <!--row-fluid-->
+</div> <!--top-profile-box-->
+<div class="bottom-profile-box" >
+ <div class="row-fluid">
+ <div class="span4" id="part1">
+ <i class="icon-heart icon-white"></i>
+ <a href="#">
+ <h5>Fans</h5>
+ <h5>124</h5>
+ </a>
+ </div>
+ <div class="span4" id="part2">
+ <i class="icon-user icon-white"></i>
+ <a href="#">
+ <h5>Friends</h5>
+ <h5>44</h5>
+ </a>
+ </div>
+ <div class="span4" id="part3">
+ <i class="icon-share icon-white"></i>
+ <a href="#">
+ <h5>Sharing</h5>
+ <h5>12</h5>
+ </a>
+ </div>
+ </div> <!--row-fluid-->
+</div> <!--bottom-profile-box-->
+</div> <!--profile-box-->
- <div class="tabbable tabs-left">
- <ul class="nav nav-tabs" id="left-nav">
- <li >
- <a href="<%= home_path%>" data-toggle="tab">
- <span>
- <i class="icon-home"></i>
- Home&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
- </span>
- </a>
- </li>
- <li>
- <a href="<%= profile_path(@current_user.username)%>" data-toggle="tab" >
- <span>
- <i class="icon-user"></i>
- Profile&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
- </span>
- </a>
- </li>
- <li >
- <a href="messages.html" data-toggle="tab">
- <span>
- <i class="icon-envelope"></i>
- Messages
- </span>
- </a>
- </li>
- <li >
- <a href="groups.html" data-toggle="tab">
- <span>
- <i class="icon-th-list"></i>
- Groups
- </span>
- </a>
- </li>
- <li >
- <a href="friends.html" data-toggle="tab">
- <span>
- <i class="icon-user"></i>
- Friends&nbsp;&nbsp;&nbsp;&nbsp;
- </span>
- </a>
- </li>
- <li >
- <a href="album_preview.html" data-toggle="tab">
- <span>
- <i class="icon-picture"></i>
- Photos&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
- </span>
- </a>
- </li>
- <li >
- <a href="videos_preview.html" data-toggle="tab">
- <span>
- <i class="icon-film"></i>
- Videos&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
- </span>
- </a>
- </li>
- <li >
- <a href="setting.html" data-toggle="tab">
- <span>
- <i class="icon-cog"></i>
- Settings&nbsp;&nbsp;&nbsp;
- </span>
- </a>
- </li>
- <li >
- <a href="help.html" data-toggle="tab">
- <span>
- <i class="icon-flag"></i>
- Help&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
- </span>
- </a>
- </li>
- </ul>
- </div> <!--tabbable tabs-left-->
+<div class="tabbable tabs-left">
+<ul class="nav nav-tabs" id="left-nav">
+ <li >
+ <a href="<%= home_path%>" data-toggle="tab">
+ <span>
+ <i class="icon-home"></i>
+ Home&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ </span>
+ </a>
+ </li>
+ <li>
+ <a href="<%= profile_path(@current_user.username)%>" data-toggle="tab" >
+ <span>
+ <i class="icon-user"></i>
+ Profile&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ </span>
+ </a>
+ </li>
+ <li >
+ <a href="/conversations/" data-toggle="tab">
+ <span>
+ <i class="icon-envelope"></i>
+ Messages
+ </span>
+ </a>
+ </li>
+ <li >
+ <a href="groups.html" data-toggle="tab">
+ <span>
+ <i class="icon-th-list"></i>
+ Groups
+ </span>
+ </a>
+ </li>
+ <li >
+ <a href="friends.html" data-toggle="tab">
+ <span>
+ <i class="icon-user"></i>
+ Friends&nbsp;&nbsp;&nbsp;&nbsp;
+ </span>
+ </a>
+ </li>
+ <li >
+ <a href="album_preview.html" data-toggle="tab">
+ <span>
+ <i class="icon-picture"></i>
+ Photos&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ </span>
+ </a>
+ </li>
+ <li >
+ <a href="videos_preview.html" data-toggle="tab">
+ <span>
+ <i class="icon-film"></i>
+ Videos&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ </span>
+ </a>
+ </li>
+ <li >
+ <a href="/profiles/<%= @current_user.username %>/setting" data-toggle="tab">
+ <span>
+ <i class="icon-cog"></i>
+ Settings&nbsp;&nbsp;&nbsp;
+ </span>
+ </a>
+ </li>
+ <li >
+ <a href="help.html" data-toggle="tab">
+ <span>
+ <i class="icon-flag"></i>
+ Help&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ </span>
+ </a>
+ </li>
+</ul>
+</div> <!--tabbable tabs-left-->
- <div class="well footer">
- <div class="copyright">
- <p>&copy; Copyright 2012 Dinobot Social Engine</p>
- </div>
- <div class="footer-links">
- <a href="#">About •</a>
- <a href="#">Privacy •</a>
- <a href="#">Terms •</a>
- <a href="#">Advertising</a>
- <a href="#">Blog •</a>
- <a href="#">Contact •</a>
- <a href="#">Help •</a>
- <a href="#">English</a>
- </div>
- </div>
- </div> <!--span4 left-sidebar sides-->
- <div class="span8 middle">
- <%= yield %>
- </div> <!--span4 middle-->
- <div class="span4 right-sidebar sides">
- </div> <!--span4 right-sidebar sides-->
- </div> <!--row-->
- </div> <!--main container-->
+<div class="well footer">
+<div class="copyright">
+ <p>&copy; Copyright 2012 Dinobot Social Engine</p>
+</div>
+<div class="footer-links">
+ <a href="#">About •</a>
+ <a href="#">Privacy •</a>
+ <a href="#">Terms •</a>
+ <a href="#">Advertising</a>
+ <a href="#">Blog •</a>
+ <a href="#">Contact •</a>
+ <a href="#">Help •</a>
+ <a href="#">English</a>
+</div>
+</div>
+</div> <!--span4 left-sidebar sides-->
+<div class="span8 middle">
+<%= yield %>
+</div> <!--span4 middle-->
+<div class="span4 right-sidebar sides">
+</div> <!--span4 right-sidebar sides-->
+</div> <!--row-->
+</div> <!--main container-->
- <script src="jquery-1.7.1.js"></script>
- <script src="bootstrap-transition.js"></script>
- <script src="bootstrap-alert.js"></script>
- <script src="bootstrap-modal.js"></script>
- <script src="bootstrap-dropdown.js"></script>
- <script src="bootstrap-scrollspy.js"></script>
- <script src="bootstrap-tab.js"></script>
- <script src="bootstrap-tooltip.js"></script>
- <script src="bootstrap-popover.js"></script>
- <script src="bootstrap-button.js"></script>
- <script src="bootstrap-collapse.js"></script>
- <script src="bootstrap-carousel.js"></script>
- <script src="bootstrap-typeahead.js"></script>
- </body>
- </html>
+<script src="jquery-1.7.1.js"></script>
+<script src="bootstrap-transition.js"></script>
+<script src="bootstrap-alert.js"></script>
+<script src="bootstrap-modal.js"></script>
+<script src="bootstrap-dropdown.js"></script>
+<script src="bootstrap-scrollspy.js"></script>
+<script src="bootstrap-tab.js"></script>
+<script src="bootstrap-tooltip.js"></script>
+<script src="bootstrap-popover.js"></script>
+<script src="bootstrap-button.js"></script>
+<script src="bootstrap-collapse.js"></script>
+<script src="bootstrap-carousel.js"></script>
+<script src="bootstrap-typeahead.js"></script>
+</body>
+</html>
View
0 app/views/profiles/setting.html.erb → app/views/profiles/setting.erb
File renamed without changes.
View
1 app/views/sessions/new.erb
@@ -1,4 +1,3 @@
-
<!DOCTYPE html>
<html lang="en">
<head>
View
7 config/routes.rb
@@ -9,8 +9,13 @@
resources :users, :sessions, :posts, :comments, :actions
+ resources :conversations, :messages
# no need for show method since the next route exist
- resources :profiles, :except => "show"
+ resources :profiles, :except => "show" do
+ member do
+ get :setting
+ end
+ end
# cause bug with logout actin
match ':username' => "profiles#show", :as => 'profile'
View
3 db/migrate/20120428104342_correct_receiver_id_column_name.rb
@@ -0,0 +1,3 @@
+class CorrectReceiverIdColumnName < ActiveRecord::Migration
+ rename_column :conversations, :reciver_id, :receiver_id
+end
View
14 db/schema.rb
@@ -11,7 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.
-ActiveRecord::Schema.define(:version => 20120313222557) do
+ActiveRecord::Schema.define(:version => 20120428104342) do
create_table "action_items", :force => true do |t|
t.integer "action_id"
@@ -85,14 +85,14 @@
add_index "contacts", ["user_id"], :name => "index_contacts_on_user_id"
create_table "conversations", :force => true do |t|
- t.integer "reciver_id", :null => false
- t.integer "sender_id", :null => false
- t.string "subject", :default => "no subject", :null => false
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
+ t.integer "receiver_id", :null => false
+ t.integer "sender_id", :null => false
+ t.string "subject", :default => "no subject", :null => false
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
end
- add_index "conversations", ["reciver_id"], :name => "index_conversations_on_reciver_id"
+ add_index "conversations", ["receiver_id"], :name => "index_conversations_on_reciver_id"
add_index "conversations", ["sender_id"], :name => "index_conversations_on_sender_id"
create_table "group_admins", :force => true do |t|

0 comments on commit 2cb024c

Please sign in to comment.
Something went wrong with that request. Please try again.