public
Description: The open source social networking platform in Ruby on Rails from the author of RailsSpace
Homepage: http://insoshi.com
Clone URL: git://github.com/insoshi/insoshi.git
Search Repo:
Merge branch 'dev'
Michael Hartl (author)
Fri May 09 10:48:27 -0700 2008
commit  2838ad9b69f465d313c496f2a9a3f38328f6e762
tree    893d5808367714b6c112efa597673d10045831f9
parent  7cd47c9b7ebc130b0a8d394f22578b37a7753640 parent  39a30c4b375eb8356345f91be34ec409d15d8481
...
19
20
21
22
 
23
24
25
26
27
28
29
 
30
31
 
 
 
 
 
 
32
33
34
...
19
20
21
 
22
23
24
25
26
27
28
 
29
30
 
31
32
33
34
35
36
37
38
39
0
@@ -19,16 +19,21 @@
0
       photos = menu_element("Photos", photos_path)
0
       contacts = menu_element("Contacts",
0
                               person_connections_path(current_person))
0
- [home, profile, contacts, messages, blog, people, forum, resources]
0
+ links = [home, profile, contacts, messages, blog, people, forum]
0
     elsif logged_in? and admin_view?
0
       home = menu_element("Home", home_path)
0
       people = menu_element("People", admin_people_path)
0
       forums = menu_element(inflect("Forum", Forum.count),
0
                              admin_forums_path)
0
       preferences = menu_element("Prefs", admin_preferences_path)
0
- [home, people, forums, preferences]
0
+ links = [home, people, forums, preferences]
0
     else
0
- [home, people, forum, resources]
0
+ links = [home, people]
0
+ end
0
+ if global_prefs.about.blank?
0
+ links
0
+ else
0
+ links.push(menu_element("About", about_url))
0
     end
0
   end
0
   
...
17
18
19
20
 
 
21
22
23
...
17
18
19
 
20
21
22
23
24
0
@@ -17,7 +17,8 @@
0
 
0
 class Preference < ActiveRecord::Base
0
   attr_accessible :app_name, :server_name, :domain, :smtp_server,
0
- :email_notifications, :email_verifications, :analytics
0
+ :email_notifications, :email_verifications, :analytics,
0
+ :about
0
 
0
   validates_presence_of :domain, :if => :using_email?
0
   validates_presence_of :smtp_server, :if => :using_email?
...
46
47
48
 
 
 
 
 
 
 
 
 
 
49
50
51
...
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
0
@@ -46,6 +46,16 @@
0
     <br />
0
 
0
     <div class="form_row">
0
+ <label for="about">About</label>
0
+ <br />
0
+ <p><%= formatting_note %></p>
0
+
0
+ <%= f.text_area :about, :rows => 10 %>
0
+ </div>
0
+
0
+ <br />
0
+
0
+ <div class="form_row">
0
       <label for="analytics">Analytics (will be inserted
0
          just before the <%= h("</body>") %> tag)</label>
0
       <%= f.text_area :analytics, :rows => 10 %>
...
31
32
33
 
 
 
 
 
 
34
35
36
...
31
32
33
34
35
36
37
38
39
40
41
42
0
@@ -31,6 +31,12 @@
0
 </p>
0
 
0
 <p>
0
+ <b>About text (nonblank text will lead to an 'about' link):</b>
0
+</p>
0
+<%= display @preferences.about %>
0
+
0
+
0
+<p>
0
   <b>Analytics (will be inserted
0
      just before the <%= h("</body>") %> tag):</b>
0
 </p>
...
 
...
1
0
@@ -1 +1,2 @@
0
+<%= display global_prefs.about %>
...
12
13
14
15
 
16
17
18
...
12
13
14
 
15
16
17
18
0
@@ -12,7 +12,7 @@
0
       <div id="header">
0
         <h1>
0
           <a href="/" title="Return to Insoshi homepage">
0
- <img src="/images/logo-insoshi.png" alt="Insoshi - Social Software" />
0
+ <%= image_tag "logo-insoshi.png" %>
0
           </a>
0
         </h1>
0
         <ul id="nav">
...
2
3
4
5
6
7
8
 
 
 
 
 
 
 
 
 
 
 
 
9
10
11
...
2
3
4
 
 
 
 
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
0
@@ -2,10 +2,18 @@
0
   <div class="profile vcard">
0
     <h2>Profile: <span class="fn n"><%= h @person.name %></span></h2>
0
     <%- if current_person?(@person) -%>
0
- <div class="notice">
0
- You are viewing your own profile.
0
- <%= link_to "Click here to edit it", edit_person_path(@person) %>
0
- </div>
0
+ <%- if current_person.description.blank? -%>
0
+ <div class="error">
0
+ Your description is blank.
0
+ <%= link_to "Click here to add a description",
0
+ edit_person_path(@person) %>
0
+ </div>
0
+ <%- else -%>
0
+ <div class="notice">
0
+ You are viewing your own profile.
0
+ <%= link_to "Click here to edit it", edit_person_path(@person) %>
0
+ </div>
0
+ <%- end -%>
0
     <%- end -%>
0
     <div class="toolbox">
0
       <%= image_tag @person.main_photo, :class => "profile-image photo",
...
41
42
43
 
44
45
46
...
41
42
43
44
45
46
47
0
@@ -41,6 +41,7 @@
0
   map.login '/login', :controller => 'sessions', :action => 'new'
0
   map.logout '/logout', :controller => 'sessions', :action => 'destroy'
0
   map.home '/', :controller => 'home'
0
+ map.about '/about', :controller => 'home', :action => 'about'
0
   map.admin_home '/admin/home', :controller => 'home'
0
 
0
   # The priority is based upon order of creation: first created -> highest priority.
...
 
 
 
 
 
 
 
 
 
...
1
2
3
4
5
6
7
8
9
0
@@ -1 +1,10 @@
0
+class AddAboutToPreferences < ActiveRecord::Migration
0
+ def self.up
0
+ add_column :preferences, :about, :text
0
+ end
0
+
0
+ def self.down
0
+ remove_column :preferences, :about
0
+ end
0
+end

Comments

    No one has commented yet.