Sha256: 566d2396969bc622445f066b8cef29cd79bba274057cc1f3f7aee17fa4f054a9

Contents?: true

Size: 1.81 KB

Versions: 1

Compression:

Stored size: 1.81 KB

Contents

<%
  if _get["choice"] == "dosave"
    _site.user.update(
      :passwd => _post["passwd_md5"]
    )
    _hb.redirect("/?show=user_profile")
  end
  
  print _site.header(_("Your profile"))
%>

<form method="post" action="/?show=user_profile&amp;choice=dosave" onsubmit="return on_profile_save()">
<%=Knj::Web.hiddens([["passwd_md5", nil]])%>

<%=_site.boxt(_("Enter details"), 350)%>
  <table class="form">
    <%
      print _hb.inputs({
        :title => _("Password"),
        :name => "texpasswd",
        :type => :password,
        :descr => _("You can enter a new password to change it.")
      })
    %>
    <tr>
      <td colspan="2" class="buttons">
        <input type="submit" value="<%=_"Save"%>" />
      </td>
    </tr>
  </table>
<%=_site.boxb%>

</form>

<script>
  $(document).ready(function(){
    $("#texpasswd").val("")
    $("#texpasswd").focus()
  })
  
  function on_profile_save(){
    $("input[name=passwd_md5]").val($.md5($("#texpasswd").val()))
    $("#texpasswd").val("")
    return true
  }
</script>

<br />

<%=_site.boxt(_("Task-list"), 350)%>
  <table class="list">
    <thead>
      <tr>
        <th><%=_"Task"%></th>
      </tr>
    </thead>
    <tbody>
      <%
        count = 0
        
        _ob.list(:Task, {
          [:User_task_list_link, "user"] => _site.user,
          "orderby" => "name"
        }) do |task|
          next if !task.has_access?
          count += 1
          
          %>
            <tr>
              <td>
                <%=task.html%>
              </td>
            </tr>
          <%
        end
        
        if count <= 0
          %>
            <tr>
              <td colspan="1" class="error">
                <%=_"No tasks has been added to your list."%>
              </td>
            </tr>
          <%
        end
      %>
    </tbody>
  </table>
<%=_site.boxb%>

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
knjtasks-0.0.3 pages/user_profile.rhtml