nlinks fetprofile added
This commit is contained in:
@@ -27,7 +27,11 @@ validates :desc, :presence=>true
|
|||||||
scope :search, ->(query) {where("nachname like ? or vorname like ? or short like ?", "%#{query}%", "%#{query}%", "%#{query}%")}
|
scope :search, ->(query) {where("nachname like ? or vorname like ? or short like ?", "%#{query}%", "%#{query}%", "%#{query}%")}
|
||||||
|
|
||||||
accepts_nested_attributes_for :memberships, :reject_if=>lambda{|a| a[:typ].blank?|| a[:start].blank? ||a[:gremium_id].blank?}, :allow_destroy=>true
|
accepts_nested_attributes_for :memberships, :reject_if=>lambda{|a| a[:typ].blank?|| a[:start].blank? ||a[:gremium_id].blank?}, :allow_destroy=>true
|
||||||
|
has_many :nlinks, as: :link
|
||||||
|
|
||||||
|
def title
|
||||||
|
self.name
|
||||||
|
end
|
||||||
def name
|
def name
|
||||||
[vorname, nachname, ((short.empty?)? "": ["(",short,")"].join)].join(" ")
|
[vorname, nachname, ((short.empty?)? "": ["(",short,")"].join)].join(" ")
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ class Neuigkeit < ActiveRecord::Base
|
|||||||
scope :unpublished, -> {where("datum >= ? OR datum IS NULL", Date.today)}
|
scope :unpublished, -> {where("datum >= ? OR datum IS NULL", Date.today)}
|
||||||
scope :public, ->{includes(:rubrik).where("rubriken.public"=>:true)}
|
scope :public, ->{includes(:rubrik).where("rubriken.public"=>:true)}
|
||||||
scope :search, ->(query) {where("text like ? or title like ?", "%#{query}%", "%#{query}%")}
|
scope :search, ->(query) {where("text like ? or title like ?", "%#{query}%", "%#{query}%")}
|
||||||
LINKTYPES=["Thema", "Gallery", "Lva","Studium"]
|
LINKTYPES=["Thema", "Gallery", "Lva","Studium","Fetprofile"]
|
||||||
accepts_nested_attributes_for :calentries, :allow_destroy=>true , :reject_if=> lambda{|a| a[:start].blank?}
|
accepts_nested_attributes_for :calentries, :allow_destroy=>true , :reject_if=> lambda{|a| a[:start].blank?}
|
||||||
before_validation :sanitize
|
before_validation :sanitize
|
||||||
has_many :nlinks
|
has_many :nlinks
|
||||||
|
|||||||
1
app/views/fetprofiles/_nlink.html.erb
Normal file
1
app/views/fetprofiles/_nlink.html.erb
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<h2><%= nlink.title %></h2>
|
||||||
2
app/views/studien/_nlink.html.erb
Normal file
2
app/views/studien/_nlink.html.erb
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
<h2><%= nlink.name %></h2>
|
||||||
|
<p><%= nlink.desc_first_words %></p>
|
||||||
@@ -1 +1,2 @@
|
|||||||
<%= raw(strip_links(render :partial=> "themen/small", :object=>nlink)) %>
|
<h2><%= nlink.title %></h2>
|
||||||
|
<p><%= raw(nlink.text_first_words) %></p>
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
|
|
||||||
|
|
||||||
<a name="thema_<%=small.id%>" href="#<%=small.id%>">
|
<a name="thema_<%=small.id%>" href="#<%=small.id%>">
|
||||||
<h2><%= small.title %></h2>
|
<h2><%= small.title %></h2>
|
||||||
</a>
|
</a>
|
||||||
|
|||||||
Reference in New Issue
Block a user