~acesuares/qspell/trunk

« back to all changes in this revision

Viewing changes to app/views/word/index.rhtml

  • Committer: Ace Suares
  • Date: 2009-10-07 06:16:20 UTC
  • Revision ID: ace@suares.an-20091007061620-j39st30s42edy61t
 * voting with vote_fu

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
    <div class="logo">
13
13
      <img src="/images/logo-760x150-papiamentu.info.png" alt="logo papiamentu.info"/>
14
14
    </div>
15
 
<%= fb_connect_javascript_tag %>
16
 
<%= init_fb_connect "XFBML"%>
 
15
    <%= fb_connect_javascript_tag %>
 
16
    <%= init_fb_connect "XFBML"%>
17
17
 
18
18
    <% if logged_in? %>
19
 
      <div class="header">Welcome, <%= current_user.name %>. <%= link_to "Log out", logout_path, { :title => "Log out" }    %>
20
 
        <div class="settings"></div>
21
 
      <% if current_user.administrator %>
22
 
        <%= link_to 'Edit Users', users_path %><br />
23
 
        <%= link_to 'QwAds Admin', '/rads/admin' %>
24
 
      <% end %>
25
 
     <% if current_user.facebook_user? %>
26
 
      <fb:profile-pic uid="<%= current_user.fb_user_id%>" facebook-logo="true" size="thumb" ></fb:profile-pic>
27
 
      <p><a href="#" onclick='FB.Connect.logoutAndRedirect("/logout")'>Logout</a></p>
28
 
      <% end %>
29
 
 
30
 
 
 
19
      <div class="header">
 
20
        Bon bini, <%= h current_user.name %>.
 
21
        <div class="settings">
 
22
        </div>
 
23
        <% if current_user.administrator %>
 
24
          <%= link_to 'Edit Users', users_path %><br />
 
25
          <%= link_to 'QwAds Admin', '/rads/admin' %><br />
 
26
        <% end %>
 
27
        <% if current_user.facebook_user? %>
 
28
          <p><a href="#" onclick='FB.Connect.logoutAndRedirect("/logout")'>Logout</a></p>
 
29
        <% else %>
 
30
          <%= link_to "Log out", logout_path, { :title => "Log out" } %>
 
31
        <% end %>
31
32
      </div>
32
33
    <% else %>
33
34
      <div id="Welcome_area">
37
38
      </div>
38
39
      <div id="Login_area" style="display:none">
39
40
        <table cellspacing="0" cellpadding="0" border="0">
40
 
          <tr>
41
 
            <td><%= render( :partial => "partials/login_form" ) %></td>
42
 
            <td><%= render( :partial => "partials/fb_login_form" ) %></td>
43
 
          </tr>
 
41
        <tr>
 
42
          <td><%= render( :partial => "partials/login_form" ) %></td>
 
43
          <td><%= render( :partial => "partials/fb_login_form" ) %></td>
 
44
        </tr>
44
45
        </table>
45
46
      </div>
46
 
      <div id="Signup_area" 
47
 
      <%=  'style="display:none"' if not flash[:user] -%>
48
 
      <%  @user = flash[:user] if flash[:user] -%>
49
 
      >
 
47
      <div id="Signup_area"
 
48
        <%=  'style="display:none"' if not flash[:user] -%>
 
49
        <%  @user = flash[:user] if flash[:user] -%>
 
50
        >
50
51
        <div>
51
 
          <%= render( :partial => "partials/signup_form" ) %>
 
52
        <%= render( :partial => "partials/signup_form" ) %>
52
53
        </div>
53
54
      </div>
54
55
    <% end %>
86
87
            <div id="Word_area">
87
88
              <h1><%= h(@word.word) %></h1>
88
89
              <%= h(@word.pap_description) if not @word.pap_description.empty? %>
89
 
              <%= '<br />English: ' + h(@word.english) if not @word.english.empty? %>
 
90
              <%= '<!-- <br />English: ' + h(@word.english) + ' -->' if not @word.english.empty? %>
 
91
              <% if logged_in? %>
 
92
              <p>
 
93
                Ami ta pensa e palabra "<%= h @word.word %>" ta korrekto:
 
94
                <span id="votes<%= @word.id %>">
 
95
                  <%= render :partial => 'partials/votes' %>
 
96
                </span>
 
97
              </p>
 
98
              <%  end %>
90
99
            </div>
91
100
            <div id="Status_area">
92
101
              <%= 'This word is <strong>approved</strong> by ' + @word.judged_by.name + nice_date(@word.judged_at) if @word.approved? %>
241
250
      </div>
242
251
 
243
252
 
244
 
      <div id="right_content_area" style="display: none;">
245
 
        <div id="FindWord_area">
246
 
          <h1>Word Count</h1>
247
 
          <ul>
248
 
            <li><%= Word.count_approved %> approved words</li>
249
 
            <li><%= Word.count_undecided %> undecided</li>
250
 
          <li style="list-style: none">our goal is 15.000 approved<br />words by september 2009</li>
251
 
          </ul>
252
 
        </div>
253
 
 
254
 
        <div id="FindWord_area">
255
 
          <h1>Find a Word</h1>
256
 
          <% form_tag "/word/find_word" do -%>
257
 
            <% if flash[:too_many_words] %>
258
 
              <%= text_field_with_auto_complete :word, :word, { :value => params[:word][:word], :size => 25 }, :method => 'get',  :skip_style => true -%>
259
 
            <% else %>
260
 
              <%= text_field_with_auto_complete :word, :word, { :value => '', :size => 25 }, :method => 'get',  :skip_style => true -%>
261
 
            <% end %>
262
 
            <%= submit_tag 'Find' %>
263
 
          <% end %>
264
 
        </div>
265
 
        <% if logged_in? %>
266
 
          <div class="recent_stuff">
267
 
            <%  if (list = Word.recently_updated) and not list.empty? %>
268
 
              <h1>Recently Updated:</h1>
269
 
              <ul>
270
 
                <% list.each do |w| %>
271
 
                  <li><%= link_to h(w.word), :action => w.word %><span class="nice_date"><%= nice_date(w.updated_at) %></span></li>
272
 
                <% end %>
273
 
              </ul>
274
 
            <% end %>
275
 
            <%  if list = Word.recently_added(:approved) and not list.empty? %>
276
 
              <h1>Recently Approved:</h1>
277
 
              <ul>
278
 
                <% list.each do |w| %>
279
 
                  <li><%= link_to h(w.word), :action => w.word %><span class="nice_date"><%= nice_date(w.judged_at) %></span></li>
280
 
                <% end %>
281
 
              </ul>
282
 
            <% end %>
283
 
            <%  if list = Word.recently_added(:undecided) and not list.empty? %>
284
 
              <h1>Recently Added:</h1>
285
 
              <ul>
286
 
                <% list.each do |w| %>
287
 
                  <li><%= link_to h(w.word), :action => w.word %><span class="nice_date"><%= nice_date(w.created_at) %></span></li>
288
 
                <% end %>
289
 
              </ul>
290
 
            <% end %>
291
 
            <%  if list = Word.recently_added(:deleted) and not list.empty? %>
292
 
              <h1>Recently Deleted:</h1>
293
 
              <ul>
294
 
                <% list.each do |w| %>
295
 
                  <li><%= link_to h(w.word), :action => w.word %><span class="nice_date"><%= nice_date(w.judged_at) %></span></li>
296
 
                <% end %>
297
 
              </ul>
298
 
            <% end %>
299
 
          </div>
300
 
        <% else %>
301
 
          <div class="recent_stuff">
302
 
            <%  if (list = Word.recently_updated) and not list.empty? %>
303
 
              <h1>Recently Updated:</h1>
304
 
              <ul>
305
 
                <% list.each do |w| %>
306
 
                  <li><%= link_to h(w.word), :action => w.word %></li>
307
 
                <% end %>
308
 
              </ul>
309
 
            <% end %>
310
 
            <%  if (list = Word.most_viewed) and not list.empty? %>
311
 
              <h1>Most Viewed Words:</h1>
312
 
              <ul>
313
 
                <% list.each do |w| %>
314
 
                  <li><%= w.views %> <%= link_to h(w.word), :action => w.word %></li>
315
 
                <% end %>
316
 
              </ul>
317
 
            <% end %>
318
 
          </div>
319
 
        <% end %>
320
 
 
321
 
        <div class="recent_stuff">
322
 
          <h1>New Users</h1>
323
 
          <ul>
324
 
            <% User.find(:all, :order => 'created_at DESC', :limit => 7).each do |u|-%>
325
 
              <li><%=link_to h(u.name), user_path(u) -%></li>
326
 
            <% end %>
327
 
          </ul>
328
 
        </div>
329
 
 
330
 
 
331
 
        <% if not logged_in? %>
332
 
          <div class="rads_skyscraper">
333
 
            <%=  show_rads_banner :skyscraper -%>
334
 
          </div>
335
 
 
336
 
          <div class="google_skyscraper">
337
 
            <script type="text/javascript"><!--
338
 
              google_ad_client = "pub-3451554630885019";
339
 
              google_ad_width = 160;
340
 
              google_ad_height = 600;
341
 
              google_ad_format = "160x600_as";
342
 
              google_ad_type = "text";
343
 
              google_ad_channel = "";
344
 
              google_color_border = "75470B";
345
 
              google_color_bg = "F5E1B0";
346
 
              google_color_link = "C53200";
347
 
              google_color_text = "221400";
348
 
              google_color_url = "D58C20";
349
 
              google_ui_features = "rc:6";
350
 
              //-->
351
 
            </script>
352
 
            <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
353
 
            </script>
354
 
          </div>
355
 
        <% end %>
356
 
      </div>
357
 
      <div style="clear: both;"></div>
358
253
    </div>
359
254
  </body>
360
255
</html>