forked from bofh/fetsite
etforum link
This commit is contained in:
@@ -40,7 +40,7 @@ class Lva < ActiveRecord::Base
|
|||||||
has_paper_trail :ignore=>[:desc, :pruefungsinformation]# Versionsverfolgung
|
has_paper_trail :ignore=>[:desc, :pruefungsinformation]# Versionsverfolgung
|
||||||
translates :desc,:pruefungsinformation, :fallbacks_for_empty_translations => true, :versioning=>true
|
translates :desc,:pruefungsinformation, :fallbacks_for_empty_translations => true, :versioning=>true
|
||||||
|
|
||||||
attr_accessible :desc, :ects, :lvanr, :name, :stunden, :modul_ids, :semester_ids, :pruefungsinformation, :lernaufwand, :typ, :lecturer_ids
|
attr_accessible :desc, :ects, :lvanr, :name, :stunden, :modul_ids, :semester_ids, :pruefungsinformation, :lernaufwand, :typ, :lecturer_ids, :forumlink
|
||||||
|
|
||||||
has_and_belongs_to_many :modul,:uniq=>true # Gehört zu einem Modul
|
has_and_belongs_to_many :modul,:uniq=>true # Gehört zu einem Modul
|
||||||
has_and_belongs_to_many :semester
|
has_and_belongs_to_many :semester
|
||||||
|
|||||||
@@ -23,10 +23,11 @@ include Rails.application.routes.url_helpers
|
|||||||
validates :text, :presence => true
|
validates :text, :presence => true
|
||||||
|
|
||||||
scope :search, ->(query) {where("text like ? or title like ?", "%#{query}%", "%#{query}%")}
|
scope :search, ->(query) {where("text like ? or title like ?", "%#{query}%", "%#{query}%")}
|
||||||
scope :outdated, -> {where("updated_at < ?", 2.month.ago)}
|
scope :outdated, -> {includes(:translations).where("thema_translations.updated_at<?",2.month.ago).where("thema_translations.locale"=>I18n.t.locale)
|
||||||
|
}
|
||||||
translates :title,:text, :versioning =>true, :fallbacks_for_empty_translations => true
|
translates :title,:text, :versioning =>true, :fallbacks_for_empty_translations => true
|
||||||
def is_outdated?
|
def is_outdated?
|
||||||
updated_at < 1.month.ago
|
translation.updated_at < 2.month.ago
|
||||||
end
|
end
|
||||||
def is_wiki?
|
def is_wiki?
|
||||||
!(wikiname.nil? || wikiname.empty?)
|
!(wikiname.nil? || wikiname.empty?)
|
||||||
|
|||||||
@@ -20,6 +20,10 @@
|
|||||||
<%= f.input :ects, :wrapper_html=>{:class=>'span4'} %>
|
<%= f.input :ects, :wrapper_html=>{:class=>'span4'} %>
|
||||||
<%= f.input :stunden, :wrapper_html=>{:class=>'span4'} %>
|
<%= f.input :stunden, :wrapper_html=>{:class=>'span4'} %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="row-fluid">
|
||||||
|
<%= f.input :forumlink, :wrapper_html=>{:class=>'span12'}%>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -28,7 +32,8 @@
|
|||||||
<%= f.input :desc , :as=>:tinymce_text %>
|
<%= f.input :desc , :as=>:tinymce_text %>
|
||||||
<%= f.input :pruefungsinformation %>
|
<%= f.input :pruefungsinformation %>
|
||||||
<%= f.input :lernaufwand %>
|
<%= f.input :lernaufwand %>
|
||||||
</div></div>
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="span3">
|
<div class="span3">
|
||||||
|
|||||||
@@ -4,6 +4,9 @@
|
|||||||
<div class="row-fluid">
|
<div class="row-fluid">
|
||||||
<div class="span8">
|
<div class="span8">
|
||||||
<h1><%= @lva.full_name %></h1>
|
<h1><%= @lva.full_name %></h1>
|
||||||
|
<ul class="linklist">
|
||||||
|
<li><%= link_to ffi1_icon("live2")+"ET-Forum",@lva.forumlink, class: :linkbox unless @lva.forumlink.nil? or @lva.forumlink.empty?%></li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
<h2>Prüfungsinformation</h2>
|
<h2>Prüfungsinformation</h2>
|
||||||
<div class="">
|
<div class="">
|
||||||
|
|||||||
5
db/migrate/20140709173026_add_forum_link_to_lvas.rb
Normal file
5
db/migrate/20140709173026_add_forum_link_to_lvas.rb
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
class AddForumLinkToLvas < ActiveRecord::Migration
|
||||||
|
def change
|
||||||
|
add_column :lvas, :forumlink, :string
|
||||||
|
end
|
||||||
|
end
|
||||||
Reference in New Issue
Block a user