Skip to content

Commit

Permalink
Merge branch 'master' of github.com:ging/social_stream
Browse files Browse the repository at this point in the history
  • Loading branch information
adiezbal committed Feb 25, 2011
2 parents 89140b2 + c2f006d commit 4c4f456
Show file tree
Hide file tree
Showing 27 changed files with 3,912 additions and 1,264 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -3,5 +3,6 @@ pkg/*gem
**.tmp_*
Gemfile.lock
.idea
nbproject
.loadpath
.project
11 changes: 11 additions & 0 deletions app/controllers/groups_controller.rb
@@ -1,4 +1,15 @@
class GroupsController < InheritedResources::Base
def index
if params[:search]
@groups = Group.find_by_sql("SELECT * FROM groups,actors WHERE groups.actor_id=actors.id AND actors.name LIKE '%"+params[:search]+"%'").paginate(:per_page => 10, :page => params[:page])
else
if params[:letter] && params[:letter]!="undefined"
@groups = Group.find_by_sql("SELECT * FROM groups,actors WHERE groups.actor_id=actors.id AND actors.name LIKE '"+params[:letter]+"%'").paginate(:per_page => 10, :page => params[:page])
else
@groups = Group.alphabetic.paginate(:per_page => 10, :page => params[:page])
end
end
end
protected

# Overwrite resource method to support permalink
Expand Down
11 changes: 11 additions & 0 deletions app/controllers/users_controller.rb
@@ -1,4 +1,15 @@
class UsersController < ApplicationController
def index
if params[:search]
@users = User.find_by_sql("SELECT * FROM users,actors WHERE users.actor_id=actors.id AND actors.name LIKE '%"+params[:search]+"%'").paginate(:per_page => 10, :page => params[:page])
else
if params[:letter] && params[:letter]!="undefined"
@users = User.find_by_sql("SELECT * FROM users,actors WHERE users.actor_id=actors.id AND actors.name LIKE '"+params[:letter]+"%'").paginate(:per_page => 10, :page => params[:page])
else
@users = User.alphabetic.paginate(:per_page => 10, :page => params[:page])
end
end
end

def show
@user = User.find_by_permalink!(params[:id])
Expand Down
6 changes: 2 additions & 4 deletions app/views/groups/_index.html.erb
@@ -1,8 +1,6 @@
<% groups = Group.alphabetic.paginate(:page => params[:page]) %>
<% cont=0; %>
<% groups.each do |group| %>
<% @groups.each do |group| %>
<% if (cont%2) == 0
cont+=1; %>
Expand Down Expand Up @@ -33,4 +31,4 @@
</div>
<% end %>
<%= will_paginate(groups) %>
<%= will_paginate @groups %>
74 changes: 74 additions & 0 deletions app/views/groups/_middle_index.html.erb
@@ -0,0 +1,74 @@
<% content_for :head, stylesheet_link_tag("jqcloud") %>

<div class="space_center">
</div>
<div class="middle_box">
<div class="middle_box_header">
<%= image_tag('btn/btn_tag.png', :class => "middle_box_picture_icon") %>
<div class="middle_box_text_header"><%= t 'group.cloud' %></div>
<div class="title_righ">
</div>
</div>

<div id="wordcloud"></div>

</div>

<% if user_signed_in? %>
<div class="space_center"></div>
<%= render :partial => "ties/suggestions" %>
<div class="space_center"></div>
<%= render :partial => 'ties/pendings' %>
<%= javascript_include_tag "jqcloud-0.1.3.min.js" %>
<% end %>

<script type="text/javascript">
var word_list = new Array(
{text: "Lorem", weight: 13, url: "https://github.com/DukeLeNoir/jQCloud"},
{text: "Ipsum", weight: 10.5, url: "http://jquery.com/"},
{text: "Dolor", weight: 9.4},
{text: "Sit", weight: 8},
{text: "Amet", weight: 6.2},
{text: "Consectetur", weight: 5},
{text: "Adipiscing", weight: 5},
{text: "Elit", weight: 5},
{text: "Nam et", weight: 5},
{text: "Leo", weight: 4},
{text: "Sapien", weight: 4, url: "http://www.lucaongaro.eu/"},
{text: "Pellentesque", weight: 3},
{text: "habitant", weight: 3},
{text: "morbi", weight: 3},
{text: "tristisque", weight: 3},
{text: "senectus", weight: 3},
{text: "et netus", weight: 3},
{text: "et malesuada", weight: 3},
{text: "fames", weight: 2},
{text: "ac turpis", weight: 2},
{text: "egestas", weight: 2},
{text: "Aenean", weight: 2},
{text: "vestibulum", weight: 2},
{text: "elit", weight: 2},
{text: "sit amet", weight: 2},
{text: "metus", weight: 2},
{text: "adipiscing", weight: 2},
{text: "ut ultrices", weight: 2},
{text: "justo", weight: 1},
{text: "dictum", weight: 1},
{text: "Ut et leo", weight: 1},
{text: "metus", weight: 1},
{text: "at molestie", weight: 1},
{text: "purus", weight: 1},
{text: "Curabitur", weight: 1},
{text: "diam", weight: 1},
{text: "dui", weight: 1},
{text: "ullamcorper", weight: 1},
{text: "id vuluptate ut", weight: 1},
{text: "mattis", weight: 1},
{text: "et nulla", weight: 1},
{text: "Sed", weight: 1}
);
$(document).ready(function() {
$("#wordcloud").jQCloud(word_list);
});
</script>
19 changes: 19 additions & 0 deletions app/views/groups/_right_index.html.erb
@@ -0,0 +1,19 @@
<% if user_signed_in? %>
<div id="logo">
<b><%= link_to(current_subject.name, current_subject)%></b><br/>
<%= link_to(image_tag(current_subject.logo.url(:profile) , :alt => current_subject.name ), current_subject ) %>
</div>
<div class="space_center">
</div>
<div class="menu_header"><b><%=t('menu.options')%></b>
</div>
<div id="menu_lateral">
<%= render :partial => "home/options" %>
</div>
<div class="space_center">
</div>
<div class="space_center">
</div>
<div class="space_center">
</div>
<% end %>
6 changes: 3 additions & 3 deletions app/views/groups/_right_show.html.erb
Expand Up @@ -2,7 +2,7 @@
<%= render :partial => 'logo' %>
<%= render :partial => 'tabs' %>
<div class="space_center">
</div>
<div class="space_center">
</div>

<%= render :partial => 'subjects/contacts', :locals => { :subject => @group } %>
<%= render :partial => 'subjects/contacts', :locals => { :subject => @group } %>
66 changes: 15 additions & 51 deletions app/views/groups/index.html.erb
@@ -1,3 +1,5 @@
<% content_for :head, stylesheet_link_tag("users") %>
<% content_for :middle do %>
<%= render :partial => "groups/middle_index" %>
<% end %>
Expand All @@ -8,22 +10,18 @@


<div id="map_location" class="content_size">
Your are here ><img src="images/btn/btn_browse.png" class="btn_config"%> <%=t('browse')%>: <span id="name_group"><%= t('group.other')%></span>
Your are here ><img src="images/btn/btn_browse.png" class="btn_config"%> <%=t('browse')%>: <span id="name_group"><%= t('group.all')%></span>
</div>
<div id="by_options" class="content_size"><%= link_to(t('user.by'), users_path) %> </div>
<br class="clearfloat" />
<div class="space_center">
</div>


<div class="space_center">
</div>

<div id="my_conferences">
<div id="tabconference_browse" class="widget content_size">
<ul class="tabconference_browse">
<li>
<a href="#spaces"> <%= t('group.other')%> (<%=Group.count%>) </a>
<a href="/groups">All <%= t('group.other')%> (<%=Group.count%>) </a>
</li>
<li>
<a href="#most_popular"> <%= t('group.popular.most')%></a>
Expand All @@ -35,62 +33,28 @@
<div id="spaces" class="tabconference_browse">
<div class="space_center">
</div>
<div class="letters" class="content_size">
<a href="#">A</a>
<a href="#">B</a>
<a href="#">C</a>
<a href="#">D</a>
<a href="#">E</a>
<a href="#">F</a>
<a href="#">G</a>
<a href="#">H</a>
<a href="#">I</a>
<a href="#">J</a>
<a href="#">K</a>
<a href="#">L</a>
<a href="#">M</a>
<a href="#">N</a>
<a href="#">O</a>
<a href="#">P</a>
<a href="#">Q</a>
<a href="#">R</a>
<a href="#">S</a>
<a href="#">T</a>
<a href="#">U</a>
<a href="#">V</a>
<a href="#">W</a>
<a href="#">X</a>
<a href="#">Y</a>
<a href="#">Z</a>
<div><input type="text" value="Search by name" id="search_field" class="search_input" /><%= image_tag("btn/search.png",:size=>"20x20",:id=>"search_button") %></div>
<div class="space_center">
</div>
<div class="letters" class="content_size">
<% for char in 'A'..'Z' %>
<%= link_to char,{:letter => char,:page => 1},:class => "user_letter_link" %>
<% end %>
</div>
<div class="space_center" class="content_size">

</div>
<%= render :partial => "groups/index"%>
<div id="list_users_ajax">
<%= render :partial => "groups/index"%>
</div>
<div class="space_center">
</div>
</div>

<div id="most_popular" class="tabconference_browse">
<div class="space_center">
</div>

<div class="space_center">
Most popular groups
</div>
</div>
<div id="most_voted" class="tabconference_browse">
<div class="space_center">
</div>

<div class="space_center">
Most voted groups
</div>
</div>
</div>
</div>


<br class="clearfloat" />
<div class="space_center">
</div>
<%= javascript_include_tag "ajax.paginate" %>
1 change: 1 addition & 0 deletions app/views/groups/index.js.erb
@@ -0,0 +1 @@
$('#list_users_ajax').html("<%= escape_javascript(render :partial => "groups/index") %>");
2 changes: 1 addition & 1 deletion app/views/layouts/application.html.erb
Expand Up @@ -24,7 +24,7 @@
<%= javascript_include_tag :defaults %>
<%= javascript_include_tag 'jquery', 'jquery-ui.min', 'jquery.livequery',
'jquery.boxy', 'menu','ui.dropdownchecklist','jquery.form', 'jquery.validate' %>
'jquery.boxy', 'menu','ui.dropdownchecklist','jquery.form', 'jquery.validate', 'jquery.ba-url' %>
<% if protect_against_forgery? %>
Expand Down
6 changes: 2 additions & 4 deletions app/views/users/_index.html.erb
@@ -1,8 +1,6 @@
<% users = User.alphabetic.paginate(:page => params[:page]) %>
<% cont=0; %>
<% users.each do |user| %>
<% @users.each do |user| %>
<% if (cont%2) == 0
cont+=1; %>
Expand Down Expand Up @@ -30,4 +28,4 @@
</div>
<% end %>
<%= will_paginate(users) %>
<%= will_paginate @users %>
6 changes: 6 additions & 0 deletions app/views/users/_middle_index.html.erb
@@ -0,0 +1,6 @@
<% if user_signed_in? %>
<div class="space_center"></div>
<%= render :partial => "ties/suggestions" %>
<div class="space_center"></div>
<%= render :partial => 'ties/pendings' %>
<% end %>
19 changes: 19 additions & 0 deletions app/views/users/_right_index.html.erb
@@ -0,0 +1,19 @@
<% if user_signed_in? %>
<div id="logo">
<b><%= link_to(current_subject.name, current_subject)%></b><br/>
<%= link_to(image_tag(current_subject.logo.url(:profile) , :alt => current_subject.name ), current_subject ) %>
</div>
<div class="space_center">
</div>
<div class="menu_header"><b><%=t('menu.options')%></b>
</div>
<div id="menu_lateral">
<%= render :partial => "home/options" %>
</div>
<div class="space_center">
</div>
<div class="space_center">
</div>
<div class="space_center">
</div>
<% end %>

0 comments on commit 4c4f456

Please sign in to comment.