public this repo is viewable by everyone
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
Added 'about' preference and link
Michael Hartl (author)
6 days ago
commit  3044ee9172c5fa0402d97bda8a09d39223378402
tree    7b6df12845477ec807fd4799dea81f4b9f976ef3
parent  ca931746525b469a2384bb1414adc6a0186ab9bc
...
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 @@ module ApplicationHelper
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>
...
 
0
...
1
2
0
@@ -0,0 +1 @@
0
+<%= display global_prefs.about %>
0
\ No newline at end of file
...
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">
...
41
42
43
 
44
45
46
...
41
42
43
44
45
46
47
0
@@ -41,6 +41,7 @@ ActionController::Routing::Routes.draw do |map|
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
@@ -0,0 +1,9 @@
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.