/
application.html.erb
45 lines (38 loc) · 1.43 KB
/
application.html.erb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<!DOCTYPE html>
<html>
<head>
<title><%= @title || "Roomz" %></title>
<%= stylesheet_link_tag "application", :media => "all" %>
<%= javascript_include_tag "application" %>
<%= csrf_meta_tags %>
<%# 文字数カウント %>
<script type="text/javascript">
<!--
function str_count(str){
var hash_tag = document.getElementById('hash_tag').innerHTML
var val = str.replace(/\r\n/g, " ");
document.getElementById('str_length').innerText = hash_tag.length + val.length + 1 + "文字";
document.getElementById('str_length').textContent = hash_tag.length + val.length + 1 + "文字"; // Firefox用
}
//-->
</script>
</head>
<body>
<% if current_user %>
<%# ログイン済み %>
<%= link_to_unless( current_user.screen_name.blank?, image_tag( current_user.image, size: "20x20" ), "https://twitter.com/#!/#{current_user.screen_name}", target: "_blank" ) %>
<%= current_user.get_name %>
: <%= link_to "Rooms" , controller: "rooms" %>
| <%= link_to "Scheduler", controller: "tweets", action: "batch" %>
|| <%= link_to "Logout" , logout_path %>
<% else %>
<%# 未ログイン %>
<%= link_to "Login", "/auth/#{DEFAULT_PROVIDER}" %>
<% end %>
<br /><br />
<%# 通知/エラーメッセージ %>
<%= simple_format( flash[:notice], style: "color: green;" ) unless flash[:notice].blank? %>
<%= simple_format( flash[:alert], style: "color: red;" ) unless flash[:alert].blank? %>
<%= yield %>
</body>
</html>