Author/speakers can link to member page

If author/speaker is a member's name (or short name, or alias),
a link to the members' page will be set.
This commit is contained in:
Stefan Schlott 2019-10-28 18:26:34 +01:00 committed by Stefan Schlott
parent f85edcc5f0
commit 306155b571
10 changed files with 39 additions and 9 deletions

View file

@ -9,7 +9,7 @@
<p>
<ul class="unstyled inline">
<li><i class="fas fa-calendar-alt" title="Datum"></i> <time itemprop="dateCreated" datetime="<%= @item[:created_at].strftime("%Y-%m-%d") %>"><%= @item[:created_at].strftime("%d.%m.%Y") %></time></li>
<% if @item[:author] %><li><i class="fas fa-pencil-alt" title="Autor"></i> <%= @item[:author] %></li><% end %>
<% if @item[:author] %><li><i class="fas fa-pencil-alt" title="Autor"></i> <%= member_link(@item[:author], false) %></li><% end %>
<% if @item[:refers_to] %><li><i class="fas fa-cogs" title="Zugehöriges Projekt"></i> <a href="<%= @items[sanitize_path(@item[:refers_to])].path() %>"><%= @items[sanitize_path(@item[:refers_to])][:title] %></a></li><% end %>
<li><i class="fas fa-bookmark" title="Permalink"></i> <a itemprop="url" href="<%= item.path() %>">Permalink</a></li>
</ul>

View file

@ -21,7 +21,7 @@
<ul>
<% @item[:speakers].each do |speaker| %>
<li itemprop="performer" itemscope itemtype="http://schema.org/Person">
<span itemprop="name"><%= speaker[:name] %></span><% if speaker[:affiliation]%> (<%= speaker[:affiliation] %>)<% end %>
<span itemprop="name"><%= member_link(speaker[:name], false) %></span><% if speaker[:affiliation]%> (<%= speaker[:affiliation] %>)<% end %>
</li>
<% end %>
</ul>

View file

@ -8,7 +8,7 @@
<p>
<ul class="unstyled inline">
<li><i class="fas fa-calendar-alt"></i> <time itemprop="dateCreated" datetime="<%= @item[:created_at].strftime("%Y-%m-%d") %>"><%= @item[:created_at].strftime("%d.%m.%Y") %></time></li>
<% if @item[:author] %><li><i class="fas fa-pencil-alt"></i> <%= @item[:author] %></li><% end %>
<% if @item[:author] %><li><i class="fas fa-pencil-alt"></i> <%= member_link(@item[:author]) %></li><% end %>
<% if @item[:refers_to] %><li><i class="fas fa-cogs"></i> <a href="<%= @items[sanitize_path(@item[:refers_to])].path() %>"><%= @items[sanitize_path(@item[:refers_to])][:title] %></a></li><% end %>
<li><i class="fas fa-bookmark"></i> <a itemprop="url" href="<%= item.path() %>">Permalink</a></li>
</ul>