AutoCommit Mit Sep 2 21:03:01 CEST 2015
This commit is contained in:
@@ -1,3 +1,77 @@
|
|||||||
<div> please remove this from blue2 theme</div>
|
<%= content_for :header do %>
|
||||||
|
<title>FET - <%= @fetprofile.name %></title>
|
||||||
|
<% unless @fetprofile.picture.url.nil?
|
||||||
|
picture_url=URI(root_url)
|
||||||
|
picture_url.path=@fetprofile.picture.portrait.url
|
||||||
|
end
|
||||||
|
%>
|
||||||
|
|
||||||
|
<% set_meta_tags :og => {
|
||||||
|
:image => picture_url.to_s,
|
||||||
|
:title => @fetprofile.name.to_s ,
|
||||||
|
:type => "profile",
|
||||||
|
:url=>fetprofile_url(@fetprofile,:theme=>nil),
|
||||||
|
:profile=> {
|
||||||
|
:first_name=>@fetprofile.vorname,
|
||||||
|
:last_name=>@fetprofile.nachname
|
||||||
|
}
|
||||||
|
}
|
||||||
|
%>
|
||||||
|
<% set_meta_tags :og=>{:article=> {:published_time=>I18n.l(@neuigkeit.try(:datum).try(:to_date)) }} unless @neuigkeit.try(:datum).try(:to_date).nil? %>
|
||||||
|
|
||||||
|
<%= display_meta_tags %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
|
||||||
|
<%= render 'fetprofiles/tabs' %>
|
||||||
|
|
||||||
|
<div class="content-wrap content-column">
|
||||||
|
|
||||||
|
<p id="notice"><%= notice %></p>
|
||||||
|
<div style="max-width:70em" itemtype="http://schema.org/Person" itemscope>
|
||||||
|
<meta itemprop="sameAs" content="<%= fetprofile_path(@fetprofile, theme: nil) %>"/>
|
||||||
|
<meta itemprop="url" content="<%= fetprofile_path(@fetprofile, theme: nil) %>"/>
|
||||||
|
<div class="media">
|
||||||
|
<span class="pull-left" itemprop="image" itemscope itemtype="http://schema.org/ImageObject">
|
||||||
|
<span itemprop="thumbnail" itemscope itemtype="http://schema.org/ImageObject">
|
||||||
|
<%= image_tag @fetprofile.picture.portrait.url %>
|
||||||
|
<meta itemprop="url" content="<%= @fetprofile.picture.portrait.url%>" />
|
||||||
|
</span>
|
||||||
|
<meta itemprop="url" content="<%= @fetprofile.picture.url%>" />
|
||||||
|
<meta itemprop="representativeOfPage" content="true" />
|
||||||
|
</span>
|
||||||
|
<div class="media-body">
|
||||||
|
<h2><span itemprop="givenName"><%= @fetprofile.vorname %></span><span itemprop="familyName"> <%= @fetprofile.nachname %></span><% unless @fetprofile.short.empty? %><span itemprop=""> <%= @fetprofile.short %> </span><% end %></h2>
|
||||||
|
<meta itemprop="name" content="<%= @fetprofile.name %>" />
|
||||||
|
|
||||||
|
<p itemprop="email">
|
||||||
|
<%= @fetprofile.fetmail %>
|
||||||
|
</p>
|
||||||
|
<p itemprop="description">
|
||||||
|
<%= @fetprofile.desc %>
|
||||||
|
</p>
|
||||||
<%= render partial: "interninfo", object: @fetprofile if can?(:seeintern, @fetprofile) %>
|
<%= render partial: "interninfo", object: @fetprofile if can?(:seeintern, @fetprofile) %>
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
<% @memberships.each do |m| %>
|
||||||
|
<li>
|
||||||
|
<%= link_to m.gremium do %> <%= render m %><% end %>
|
||||||
|
<%= link_to I18n.t('common.edit'), edit_fetprofile_membership_path(@fetprofile,m) if params["verwalten"] && can?(:edit, m)%>
|
||||||
|
<%= link_to I18n.t('common.delete'), [@fetprofile, m], method: :delete, data: {confirm: I18n.t('common.sure_del')} if params["verwalten"] && can?(:delete, m ) %>
|
||||||
|
</li>
|
||||||
|
<% end %>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<% if can?(:edit, @fetprofile) %>
|
||||||
|
<div>
|
||||||
|
<span class="btn-group">
|
||||||
|
<%= link_to ff_icon("icon-pencil")+I18n.t('common.edit'), edit_fetprofile_path(@fetprofile) if can?(:edit, @fetprofile) %>
|
||||||
|
<%= link_to fa_icon("trash")+I18n.t('common.delete'), fetprofile_path(@fetprofile),method: :delete, data: { confirm: "Are you sure?" } if can?(:delete, @fetprofile) %>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
<%#= render 'layouts/pretty_toolbar' %>
|
||||||
|
</div>
|
||||||
|
|||||||
@@ -11,5 +11,12 @@ FactoryGirl.define do
|
|||||||
active false
|
active false
|
||||||
birth_month 4
|
birth_month 4
|
||||||
birth_day 2
|
birth_day 2
|
||||||
|
factory :fetprofile_withadress do
|
||||||
|
street "some street"
|
||||||
|
plz "1231"
|
||||||
|
city "vienna"
|
||||||
|
telnr "sdf tel nummer"
|
||||||
|
hdynr "sdf hdy nummer"
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -3,13 +3,15 @@ require 'spec_helper'
|
|||||||
# ActionView.any_instance.stub!(:view_paths).and_return([ 'app/views/themes/blue2'])
|
# ActionView.any_instance.stub!(:view_paths).and_return([ 'app/views/themes/blue2'])
|
||||||
|
|
||||||
describe "fetprofiles/show", :type => :view do
|
describe "fetprofiles/show", :type => :view do
|
||||||
["blue1", "blue2","2003"].each do |theme|
|
["blue2"].each do |theme|
|
||||||
describe "theme #{theme}" do
|
describe "theme #{theme}" do
|
||||||
|
|
||||||
before(:each) do
|
before(:each) do
|
||||||
view.view_paths=[ "app/views/themes/#{theme}", "app/views"]
|
view.view_paths=[ "app/views/themes/#{theme}", "app/views"]
|
||||||
|
end
|
||||||
|
before(:each) do
|
||||||
default_url_options[:locale] = :de
|
default_url_options[:locale] = :de
|
||||||
@fetprofile = FactoryGirl.create(:fetprofile,:street => "secret adress")
|
@fetprofile = FactoryGirl.create(:fetprofile_withadress)
|
||||||
assign(:fetprofile,@fetprofile)
|
assign(:fetprofile,@fetprofile)
|
||||||
assign(:memberships, [])
|
assign(:memberships, [])
|
||||||
assign(:gremientabs, [])
|
assign(:gremientabs, [])
|
||||||
@@ -71,21 +73,29 @@ end
|
|||||||
|
|
||||||
# rendered.should match(/false/)
|
# rendered.should match(/false/)
|
||||||
end
|
end
|
||||||
it "doesn't render secrets" do
|
it "doesn't render address" do
|
||||||
render
|
render
|
||||||
expect(rendered).not_to match(/#{@fetprofile.street}/)
|
expect(rendered).not_to match(/#{@fetprofile.street}/)
|
||||||
|
expect(rendered).not_to match(/#{@fetprofile.city}/)
|
||||||
|
expect(rendered).not_to match(/#{@fetprofile.hdynr}/)
|
||||||
|
expect(rendered).not_to match(/#{@fetprofile.telnr}/)
|
||||||
|
expect(rendered).not_to match(/#{@fetprofile.plz}/)
|
||||||
|
|
||||||
end
|
end
|
||||||
describe "with fet user" do
|
describe "with fet user" do
|
||||||
login_fet_user
|
login_fet_user
|
||||||
|
|
||||||
let(:current_ability) {@ability}
|
# let(:current_ability) {@ability}
|
||||||
it "renders address" do
|
it "renders address" do
|
||||||
render
|
render
|
||||||
expect(rendered).to match(/#{@fetprofile.street}/)
|
expect(rendered).to match(/#{@fetprofile.street}/)
|
||||||
expect(rendered).to match(/#{@fetprofile.plz}/)
|
expect(rendered).to match(/#{@fetprofile.plz}/)
|
||||||
|
expect(rendered).to match(/#{@fetprofile.city}/)
|
||||||
|
expect(rendered).to match(/#{@fetprofile.hdynr}/)
|
||||||
|
expect(rendered).to match(/#{@fetprofile.telnr}/)
|
||||||
|
|
||||||
end
|
end
|
||||||
pending "renders edit path" do
|
it "renders edit path" do
|
||||||
render
|
render
|
||||||
expect(rendered).to match(/#{edit_fetprofile_path(@fetprofile)}/)
|
expect(rendered).to match(/#{edit_fetprofile_path(@fetprofile)}/)
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user