Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Tags

  • Loading branch information...
commit f7dd2bd7d07311e4f8d9b1b452cbca4876cbbf0f 1 parent c514eb7
@Vikko authored
View
58 app/assets/stylesheets/main.css.scss
@@ -42,7 +42,7 @@ div#footer {
table {
width: 100%;
}
- width: 490px;
+ width: 470px;
margin-left: 20px;
margin-right: 0px;;
}
@@ -83,6 +83,15 @@ div#leftcontent {
padding: 10px;
}
+div.links {
+ p {
+ margin-left: 10px;
+ }
+ div#line {
+ border-bottom: solid 1px;
+ }
+}
+
H2 {
font-family: Interstatelight !important;
font-size:160%;
@@ -106,7 +115,7 @@ H3 {
}
div#midcol {
- width: 490px;
+ width: 470px;
float: left;
margin-top: 15px;
margin-left: 10px;
@@ -118,7 +127,7 @@ div#navigation {
width:100%;
float:left;
text-align:center;
- font-family:Interstatelight, Verdana, monospace;
+ font-family: Interstatelight, Verdana, monospace;
font-size:120%;
}
@@ -135,7 +144,6 @@ table.navmenu {
}
}
-
div a.navlink {
text-decoration: none;
font-family: Interstatelight, Verdana, monospace;
@@ -155,7 +163,8 @@ td.navlink {
div table#contact {
float: right;
margin-top: -12px;
- margin-right: -203px;
+ margin-right: -223px;
+ letter-spacing: 0.1em;
}
div#content {
@@ -164,7 +173,12 @@ div#content {
padding-top: 5px;
padding-left: 15px;
padding-right: 15px;
- padding-bottom: 10px;}
+ padding-bottom: 10px;
+ p img {
+ margin-top: 2px;
+ margin-right: 10px;
+ }
+}
div.actions {
text-align:right;
@@ -188,7 +202,7 @@ div#rightcol {
margin-left: 10px;
margin-bottom: 10px;
margin-right: 0px;
- width: 180px;
+ width: 200px;
float: right;
input {
width: 160px;
@@ -199,7 +213,7 @@ div#search input#search_content_contains {
width: 154px;
}
-div#login, div#search, div#events {
+div#login, div#search, div#events, div.related {
background-color: #FFFFFF;
color: #000000;
font-family: Interstatelight, Verdana, Geneva;
@@ -213,16 +227,29 @@ div#login, div#search, div#events {
}
}
-td.eventtitle {
- a {
- text-decoration: none;
- }
-}
-
td.eventmonth {
+ padding-top: 15px;
text-transform: uppercase;
}
+
+div#events {
+ img {
+ width: 145px !important;
+ height: auto !important;
+ }
+ img.readmore {
+ width: 7px !important;
+ }
+ table {
+ width: 145px;
+ p {
+ margin-top: 0px;
+ margin-bottom: 0px;
+ }
+ }
+}
+
div.backgroundtitle {
background-color:#2e3192;
color: #FFFFFF;
@@ -235,6 +262,9 @@ div.backgroundtitle {
color: #FFF;
text-decoration: none;
}
+ h4 {
+ font-weight: normal;
+ }
}
div.field {
View
4 app/controllers/abouts_controller.rb
@@ -1,3 +1,7 @@
class AboutsController < InheritedResources::Base
load_and_authorize_resource
+ def show
+ @agenda = Event.find(:all, :order => "date ASC", :limit => 3)
+ show!
+ end
end
View
24 app/controllers/blogpages_controller.rb
@@ -7,6 +7,30 @@ def index
def show
@blogpage = Blogpage.find(params[:id])
@comments = @blogpage.comments
+ search = []
+ if @blogpage.tags
+ search = @blogpage.tags.split(", ")
+ end
+ pages = []
+ profiles = []
+ search.each do |s|
+ pages << Page.where("tags LIKE ?", '%'+s+'%')
+ profiles << Profile.where("tags LIKE ?", '%'+s+'%')
+ end
+ @relatedpages = []
+ @relatedprofiles = []
+ pages.each do |pa|
+ pa.each do |page|
+ @relatedpages << page
+ end
+ end
+ profiles.each do |pr|
+ pr.each do |profile|
+ @relatedprofiles << profile
+ end
+ end
+ @relatedpages.uniq!
+ @relatedprofiles.uniq!
end
def create
View
8 app/controllers/cases_controller.rb
@@ -2,7 +2,13 @@ class CasesController < InheritedResources::Base
load_and_authorize_resource
def index
- @blogpages = Blogpage.order("created_at DESC")
+ @cases = Case.order("created_at DESC")
+ @agenda = Event.find(:all, :order => "date ASC", :limit => 3)
+ end
+
+ def show
+ @agenda = Event.find(:all, :order => "date ASC", :limit => 3)
+ show!
end
def new
View
2  app/controllers/home_controller.rb
@@ -3,6 +3,6 @@ def index
@sidetext = About.find(6)
@cases = Case.where(:published => true).order("created_at DESC").limit(3)
@blogpages = Blogpage.where(:published => true).order("created_at DESC").limit(3)
- @agenda = Event.find(:all, :order => "date ASC", :limit => 4)
+ @agenda = Event.find(:all, :order => "date ASC", :limit => 3)
end
end
View
2  app/controllers/pages_controller.rb
@@ -2,6 +2,6 @@ class PagesController < ApplicationController
load_and_authorize_resource
def index
@search = Page.search(params[:search])
- @pages = @search#.where("published=?", true) # or @search.relation to lazy load in view
+ @pages = @search
end
end
View
26 app/models/profile.rb
@@ -1,2 +1,26 @@
class Profile < ActiveRecord::Base
-end
+
+ def shortname
+ name = ""
+ unless self.prefix.blank?
+ name += self.prefix.strip + " "
+ end
+ name += self.firstname.strip + " "
+ unless self.middlename.blank?
+ name += self.middlename.strip + " "
+ end
+ name += self.lastname.strip + " "
+ unless self.suffix.blank?
+ name += self.suffix.strip
+ end
+ return name
+ end
+
+ def fullname
+ name = self.shortname
+ unless self.firstnamefull.blank?
+ name += " (" + self.firstnamefull.strip + ")"
+ end
+ return name
+ end
+end
View
6 app/views/abouts/_form.html.erb
@@ -19,14 +19,18 @@
<%= f.cktext_area :content, :toolbar => 'Easy' %>
</div>
<div class="field">
- <%= f.label :published %>
<%= f.check_box :published %>
+ <%= f.label :published %>
</div>
<% if (current_user.role == "editor") %>
<div class="field">
<%= f.label :author %>
<%= f.text_field :author %>
</div>
+ <div class="field">
+ <%= f.label :tags %>
+ <%= f.text_field :tags %>
+ </div>
<% end %>
<div class="actions">
<%= f.submit "Save" %>
View
14 app/views/abouts/show.html.erb
@@ -1,10 +1,11 @@
<% content_for :leftcol do %>
- <div class='links'><h4>design united /
+ <div id='leftcontent'>
+ <div class='links'><h4>design united /</h4>
<% if @about.id == 1 %>
<b>about /</b>
<% else%>
<%= link_to "about /", aboutdu_path %>
- <% end %></h4><p>
+ <% end %><p>
<% if @about.id == 2 %>
<b>introduction /</b>
<% else%>
@@ -24,8 +25,8 @@
<b>contact /</b>
<% else%>
<%= link_to "contact /", contact_path %>
- <% end %></p></div>
- </p>
+ <% end %></p><div id="line"></div></div>
+ </div>
<% end %>
<div><h2><%= @about.title %></h2></div>
<div class="actions">
@@ -33,4 +34,7 @@
<%= link_to "Edit", edit_about_path(@about) %>
<% end %>
</div>
-<%= raw @about.content %>
+<%= raw @about.content %>
+<% content_for :rightcol do %>
+ <%= render :partial => "events" %>
+<% end %>
View
19 app/views/application/_events.html.erb
@@ -7,20 +7,21 @@
<tr><td class="eventmonth" colspan=2><%= l(event.date, :format => "%B") %></td></tr>
<% end %>
<tr><td><%= l(event.date, :format => "%d") %></td>
- <td class="eventtitle"><b>
- <% if event.external_link %>
- <%= link_to event.title, event.external_link %>
- <% else %>
+ <td class="eventtitle">
+ <% if event.external_link.blank? %>
<%= link_to event.title, event %>
- <% end %></b>
+ <% else %>
+ <%= link_to event.title, event.external_link %>
+ <% end %>
</td></tr>
<tr><td/>
- <td> <%= strip_tags(event.content) %><br/>
+ <td> <%= truncate_html(event.content, :length => 80, :omission => "..") %>
<% if event.external_link %>
- <%= link_to "read more", event.external_link, :class => "readmore" %> <img src='/images/color_slash.gif'>
+ <%= link_to "read more", event.external_link, :class => "readmore" %> <img class="readmore" src='/images/color_slash.gif'>
<% else %>
- <%= link_to "read more", event, :class => "readmore" %> <img src='/images/color_slash.gif'>
+ <%= link_to "read more", event, :class => "readmore" %> <img class="readmore" src='/images/color_slash.gif'>
<% end %></td>
</tr>
<% end %>
-</table>
+</table><p>
+<%= link_to "more events", events_path, :class => "readmore" %> <img class="readmore" src='/images/color_slash.gif'></p>
View
2  app/views/application/_search.html.erb
@@ -1,5 +1,5 @@
<% @search = Page.search(params[:search]) %>
<%= form_for @search do |f| %>
- <%= f.text_field :content_contains, :size => '30' %>
+ <%= f.text_field :content_contains %>
<%= f.submit "Search" %>
<% end %>
View
4 app/views/blogpages/_form.html.erb
@@ -28,6 +28,10 @@
<%= f.label :author %>
<%= f.text_field :author %>
</div>
+ <div class="field">
+ <%= f.label :tags %>
+ <%= f.text_field :tags %>
+ </div>
<% end %>
<div class="actions">
<%= f.submit "Save" %>
View
5 app/views/blogpages/show.html.erb
@@ -25,4 +25,7 @@
<% if @comments.blank? %>
<p>No comments were found.</p>
<% end %>
-<%= link_to "Add comment", new_blogpage_comment_path(@blogpage, Comment.new) %>
+<%= link_to "Add comment", new_blogpage_comment_path(@blogpage, Comment.new) %>
+<% content_for :rightcol do %>
+ <%= render :partial => "related" %>
+<% end %>
View
4 app/views/cases/_form.html.erb
@@ -28,6 +28,10 @@
<%= f.label :author %>
<%= f.text_field :author %>
</div>
+ <div class="field">
+ <%= f.label :tags %>
+ <%= f.text_field :tags %>
+ </div>
<% end %>
<div class="actions">
<%= f.submit "Save" %>
View
3  app/views/cases/index.html.erb
@@ -15,4 +15,7 @@
</div>
<%= truncate_html(page.content, :length => 400, :omission => '...') %>
<%= link_to "read more", page, :class => "readmore" %> <img src='/images/color_slash.gif'>
+<% end %>
+<% content_for :rightcol do %>
+ <%= render :partial => "events" %>
<% end %>
View
5 app/views/cases/show.html.erb
@@ -7,4 +7,7 @@
<%= link_to "Delete", @case, :confirm => "Are you sure you want to delete "+@case.title+"?\nThis action cannot be undone!", :method => :delete %>
<% end %>
</div>
-<%= raw @case.content %>
+<%= raw @case.content %>
+<% content_for :rightcol do %>
+ <%= render :partial => "events" %>
+<% end %>
View
4 app/views/events/_form.html.erb
@@ -37,6 +37,10 @@
<%= f.label :external_link %>
<%= f.text_field :external_link %>
</div>
+ <div class="field">
+ <%= f.label :tags %>
+ <%= f.text_field :tags %>
+ </div>
<div class="actions">
<%= f.submit "Save" %>
</div>
View
7 app/views/events/index.html.erb
@@ -10,6 +10,11 @@
<% else %>
<%= link_to event.title, event.external_link %>
<% end %>
- </h3><p><i>on: <%= l(event.date, :format => "%d-%b-%Y") %></i></p><br/>
+ </h3>
+ <div class="actions">
+ <% if can? :update, event %>
+ <%= link_to "Edit", edit_event_path(event) %>
+ <% end %></div>
+ <p><i>on: <%= l(event.date, :format => "%d-%b-%Y") %></i></p><br/>
<%= truncate_html(event.content, :length => 400, :omission => '...') %>
<% end %>
View
2  app/views/pages/index.html.erb
@@ -1,7 +1,7 @@
<h2>search results</h2>
<% @pages.each do |page| %>
<% if can? :read, page %>
- <p><%= link_to page.title, page %></br><hr><%= truncate_html(page.content, :length => 50, :omission => "...") %></p>
+ <p><%= link_to page.title, page %></br><hr><%= truncate_html(page.content, :length => 400, :omission => "...") %></p>
<% end %>
<% end %>
View
5 app/views/profiles/_form.html.erb
@@ -47,7 +47,10 @@
<%= f.label "Department" %>:
<%= f.text_field :department %>
</div>
-
+ <div class="field">
+ <%= f.label :tags %>
+ <%= f.text_field :tags %>
+ </div>
<div class="actions">
<%= f.submit %>
</div>
View
24 app/views/profiles/index.html.erb
@@ -4,32 +4,18 @@
<% end %>
</div>
<% @profiles.each do |profile| %>
- <p><% name = "" %>
- <% unless profile.prefix.blank? %>
- <% name += profile.prefix.strip + " " %>
- <% end %>
- <% name += profile.firstname.strip + " " %>
- <% unless profile.middlename.blank? %>
- <% name += profile.middlename.strip + " " %>
- <% end %>
- <% name += profile.lastname.strip + " " %>
- <% unless profile.suffix.blank? %>
- <% name += profile.suffix.strip + " " %>
- <% end %>
- <% unless profile.firstnamefull.blank? %>
- <% name += "(" + profile.firstnamefull.strip + ")" %>
- <% end %>
+ <p>
<% unless profile.external_link.blank? %>
- <%= link_to name, profile.external_link %>
+ <%= link_to profile.fullname, profile.external_link %>
<% else%>
- <%= name %>
+ <%= profile.fullname %>
<% end %>
- (<%=profile.university%><% unless profile.department.blank? %> - <%=profile.department%><% end %>)
+ (<%=profile.university%><% unless profile.department.blank? %> - <%= profile.department %><% end %>)
<% if can? :update, profile %>
| <%= link_to "Edit", edit_profile_path(profile) %>
<% end %>
<% if can? :destroy, profile %>
- | <%= link_to "Delete", profile, :confirm => "Are you sure to delete "+name+"?\nThis action cannot be undone!", :method => :delete %>
+ | <%= link_to "Delete", profile, :confirm => "Are you sure to delete "+profile.fullname+"?\nThis action cannot be undone!", :method => :delete %>
<% end %>
</p>
<% end %>
View
4 db/schema.rb
@@ -11,7 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.
-ActiveRecord::Schema.define(:version => 20111014150759) do
+ActiveRecord::Schema.define(:version => 20111019142819) do
create_table "ckeditor_assets", :force => true do |t|
t.string "data_file_name", :null => false
@@ -51,6 +51,7 @@
t.string "type"
t.string "external_link"
t.datetime "date"
+ t.string "tags"
end
create_table "profiles", :force => true do |t|
@@ -65,6 +66,7 @@
t.string "middlename"
t.string "firstnamefull"
t.string "department"
+ t.string "tags"
end
create_table "users", :force => true do |t|
Please sign in to comment.
Something went wrong with that request. Please try again.