Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 20 Aug 2012 02:23:03 +0000
From:      tzabal@FreeBSD.org
To:        svn-soc-all@FreeBSD.org
Subject:   socsvn commit: r240548 - in soc2012/tzabal/server-side/akcrs-website/akcrs: . templates
Message-ID:  <20120820022303.0376B106566B@hub.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: tzabal
Date: Mon Aug 20 02:23:02 2012
New Revision: 240548
URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=240548

Log:
  Update for the website.

Modified:
  soc2012/tzabal/server-side/akcrs-website/akcrs/__init__.py
  soc2012/tzabal/server-side/akcrs-website/akcrs/templates/base.mako
  soc2012/tzabal/server-side/akcrs-website/akcrs/templates/bug.mako
  soc2012/tzabal/server-side/akcrs-website/akcrs/templates/bugs.mako
  soc2012/tzabal/server-side/akcrs-website/akcrs/templates/edit_report.mako
  soc2012/tzabal/server-side/akcrs-website/akcrs/templates/index.mako
  soc2012/tzabal/server-side/akcrs-website/akcrs/templates/login.mako
  soc2012/tzabal/server-side/akcrs-website/akcrs/templates/report.mako
  soc2012/tzabal/server-side/akcrs-website/akcrs/templates/reports.mako
  soc2012/tzabal/server-side/akcrs-website/akcrs/views.py

Modified: soc2012/tzabal/server-side/akcrs-website/akcrs/__init__.py
==============================================================================
--- soc2012/tzabal/server-side/akcrs-website/akcrs/__init__.py	Sun Aug 19 21:31:47 2012	(r240547)
+++ soc2012/tzabal/server-side/akcrs-website/akcrs/__init__.py	Mon Aug 20 02:23:02 2012	(r240548)
@@ -19,13 +19,16 @@
     config.add_static_view('static', 'static', cache_max_age=3600)
     # Routes
     config.add_route('index', '/')
+    config.add_route('login', '/login')
+    config.add_route('logout', '/logout')
+    config.add_route('account', '/account')
+    config.add_route('change_password', '/change_password')
     config.add_route('reports', '/reports')
-    config.add_route('report', '/report/{id}')
+    config.add_route('report', '/reports/{id}')
     config.add_route('edit_report', '/report/{id}/edit_report')
+    config.add_route('delete_report', '/report/{id}/delete_report')
     config.add_route('bugs', '/bugs')
-    config.add_route('bug', '/bug/{id}')
-    config.add_route('login', '/login')
-    config.add_route('logout', '/logout')
+    config.add_route('bug', '/bugs/{id}')
     # Scan
     config.scan()
     return config.make_wsgi_app()
\ No newline at end of file

Modified: soc2012/tzabal/server-side/akcrs-website/akcrs/templates/base.mako
==============================================================================
--- soc2012/tzabal/server-side/akcrs-website/akcrs/templates/base.mako	Sun Aug 19 21:31:47 2012	(r240547)
+++ soc2012/tzabal/server-side/akcrs-website/akcrs/templates/base.mako	Mon Aug 20 02:23:02 2012	(r240548)
@@ -3,25 +3,24 @@
     <head>
         <meta charset="UTF-8">
         <title>Automated Kernel Crash Reporting System</title>
+        <link rel="stylesheet" type="text/css" href="/static/style.css" />
     </head>
     <body>
-        <div id="header">
-            <h1><%block name="header"/></h1>
+        <div id="container">
+            <div id="header">
+                <div id="header-left">
+                    <h1><%block name="headerleft"/></h1>
+                </div>
+                <div id="header-right">
+                    <%include file="checkforuser.mako"/>
+                </div>
+            </div>
+            <div id="menu">
+                <%include file="menu.html"/>
+            </div>
+            <div id="content">
+                ${next.body()}
+            </div>
         </div>
-        
-        <div id="menu">
-            <ul>
-                <li><a href="/">Home</a></li>
-                <li><a href="/reports">Reports</a></li>
-                <li><a href="/bugs">Bugs</a></li>
-                % if logged_in:
-                <li><a href="/logout">Logout</a></li>
-                % else:
-                <li><a href="/login">Login</a></li>
-                % endif
-            </ul>
-        </div>
-        
-        ${next.body()}
     </body>
-</html>
\ No newline at end of file
+</html>

Modified: soc2012/tzabal/server-side/akcrs-website/akcrs/templates/bug.mako
==============================================================================
--- soc2012/tzabal/server-side/akcrs-website/akcrs/templates/bug.mako	Sun Aug 19 21:31:47 2012	(r240547)
+++ soc2012/tzabal/server-side/akcrs-website/akcrs/templates/bug.mako	Mon Aug 20 02:23:02 2012	(r240548)
@@ -1,22 +1,20 @@
-<%inherit file='base.mako'/>
-<%block name="header">
-    Details of Bug with ID ${request.matchdict['id']}
+<%inherit file="base.mako"/>
+
+<%block name="headerleft">
+Details for the Kernel Bug with ID ${request.matchdict['id']}
 </%block>
-<p>All the data of the requested bug.</p>
-<table border="1">
-    <tr>
-        <th>State</th>
-        <th>Reported</th>
-    </tr>
-    <tr>
-        <td>${bug.state}</td>
-        <td>${bug.reported}</td>
-    </tr>
-</table>
-<p>This bug has been reported ${bug.reported} times. The crash reports that refers to it are:
-<ul>
-    % for report in reports:
-    <li><a href="http://0.0.0.0:6543/report/${report.id}">Report</a></li>;
-    %endfor
-</ul>
-</p>
\ No newline at end of file
+
+<p>
+    The state of the bug ${request.matchdict['id']} is marked as <strong>${bug.state}</strong>.<br />
+    % if bug.reported == 1:
+    This bug has been reported only <strong>${bug.reported}</strong> time. The crash report that refers to it is:<br />
+    <ul><li><a href="/reports/${reports[0].id}">Report</a></li></ul>
+    % else:
+    This bug has been reported <strong>${bug.reported}</strong> times. The crash reports that refer to it are:
+    <ul>
+        % for report in reports:
+    <li><a href="http://0.0.0.0:6543/reports/${report.id}">Report</a></li>;
+        %endfor
+    </ul>
+    % endif
+</p>

Modified: soc2012/tzabal/server-side/akcrs-website/akcrs/templates/bugs.mako
==============================================================================
--- soc2012/tzabal/server-side/akcrs-website/akcrs/templates/bugs.mako	Sun Aug 19 21:31:47 2012	(r240547)
+++ soc2012/tzabal/server-side/akcrs-website/akcrs/templates/bugs.mako	Mon Aug 20 02:23:02 2012	(r240548)
@@ -1,20 +1,25 @@
-<%inherit file='base.mako'/>
-<%block name="header">
-    Kernel Crash Bugs
+<%inherit file="base.mako"/>
+
+<%block name="headerleft">
+Kernel Bugs
 </%block>
 
 <p>A list that contains all the bugs that we have identified.</p>
-<table border="1">
-    <tr>
-        <th>State</th>
-        <th>Reported</th>
-        <th>More Details</th>
-    </tr>
+<table id="reports-bugs-tables">
+    <thead>
+        <tr>
+            <th>State</th>
+            <th>Reported</th>
+            <th>Details</th>
+        </tr>
+    </thead>
+    <tbody>
     % for bug in bugs:
-    <tr>
-        <td>${bug.state}</td>
-        <td>${bug.reported}</td>
-        <td><a href="http://0.0.0.0:6543/bug/${bug.id}">Bug</a></td>;
-    </tr>
+        <tr>
+            <td>${bug.state}</td>
+            <td>${bug.reported}</td>
+            <td><a href="/bugs/${bug.id}">Bug</a></td>
+        </tr>
     % endfor
-</table>
\ No newline at end of file
+    </tbody>
+</table>

Modified: soc2012/tzabal/server-side/akcrs-website/akcrs/templates/edit_report.mako
==============================================================================
--- soc2012/tzabal/server-side/akcrs-website/akcrs/templates/edit_report.mako	Sun Aug 19 21:31:47 2012	(r240547)
+++ soc2012/tzabal/server-side/akcrs-website/akcrs/templates/edit_report.mako	Mon Aug 20 02:23:02 2012	(r240548)
@@ -1,4 +1,5 @@
-<%inherit file='base.mako'/>
-<%block name="header">
+<%inherit file="base.mako"/>
+
+<%block name="headerleft">
     Edit the Crash Report with ID ${request.matchdict['id']}
-</%block>
\ No newline at end of file
+</%block>

Modified: soc2012/tzabal/server-side/akcrs-website/akcrs/templates/index.mako
==============================================================================
--- soc2012/tzabal/server-side/akcrs-website/akcrs/templates/index.mako	Sun Aug 19 21:31:47 2012	(r240547)
+++ soc2012/tzabal/server-side/akcrs-website/akcrs/templates/index.mako	Mon Aug 20 02:23:02 2012	(r240548)
@@ -1,4 +1,16 @@
-<%inherit file='base.mako'/>
-<%block name="header">
-    Welcome to AKCRS!
-</%block>
\ No newline at end of file
+<%inherit file="base.mako"/>
+
+<%block name="headerleft">
+Welcome to AKCRS!
+</%block>
+
+<p>Please remember the following facts:
+<ul>
+    <li>One report refers to exactly one bug</li>
+    <li>One bug may be referred from more than one reports</li>
+</ul>
+</p>
+<p>A crash report (or problem report or ticket etc) is an indication of a problem.
+Because we deal with software, and specifically kernel crashes, we call them bugs.
+Our goal is to fix the bugs. The reports are the information that we have for those bugs.
+We these things in mind, have a happy browsing :)</p>

Modified: soc2012/tzabal/server-side/akcrs-website/akcrs/templates/login.mako
==============================================================================
--- soc2012/tzabal/server-side/akcrs-website/akcrs/templates/login.mako	Sun Aug 19 21:31:47 2012	(r240547)
+++ soc2012/tzabal/server-side/akcrs-website/akcrs/templates/login.mako	Mon Aug 20 02:23:02 2012	(r240548)
@@ -1,12 +1,15 @@
-<%inherit file='base.mako'/>
-<%block name="header">
-    Login
+<%inherit file="base.mako"/>
+
+<%block name="headerleft">
+Login
 </%block>
 
 % if failed_attempt:
 <p><font color="red">Invalid credentials, try again.</font></p>
 % endif
 
+<p>There is no registration. In order to log in into the system, you use the email address that you have provided in the crashreport program, and the password that has been sent to you via email.</p>
+
 <form method="POST" action="${request.path}">
     <p>
         <label for="email">Email</label><br />
@@ -16,5 +19,5 @@
         <label for="password">Password</label><br />
         <input type="password" id="password" name="password" />
     </p>
-    <input type="submit" name="submit" value="Submit" />
+    <input type="submit" name="submit" value="Log in" />
 </form>
\ No newline at end of file

Modified: soc2012/tzabal/server-side/akcrs-website/akcrs/templates/report.mako
==============================================================================
--- soc2012/tzabal/server-side/akcrs-website/akcrs/templates/report.mako	Sun Aug 19 21:31:47 2012	(r240547)
+++ soc2012/tzabal/server-side/akcrs-website/akcrs/templates/report.mako	Mon Aug 20 02:23:02 2012	(r240548)
@@ -1,28 +1,190 @@
-<%inherit file='base.mako'/>
-<%block name="header">
-    Details of Crash Report with ID ${request.matchdict['id']}
+<%inherit file="base.mako"/>
+
+<%block name="headerleft">
+Details for the Kernel Crash Report with ID ${request.matchdict['id']}
 </%block>
-<p>All the crash data of the requested report.</p>
-<table border="1">
+
+<p>All the data of the requested crash report.</p>
+
+<table id="report-contents-table">
     <tr>
-        <th>Crash Date</th>
-        <th>Operating System</th>
-        <th>Release</th>
-        <th>Architecture</th>
+        <td><a href="#crashtype">Crash type</a></td>
+        <td><a href="#crashdate">Crash date</a></td>
+        <td><a href="#hostname">Hostname</a></td>
     </tr>
     <tr>
-        <td>${report.crashdate}</td>
-        <td>${report.ostype}</td>
-        <td>${report.osrelease}</td>
-        <td>${report.machine}</td>
+        <td><a href="#ostype">Operating System</a></td>
+        <td><a href="#osrelease">Release</a></td>
+        <td><a href="#version">Version</a></td>
+    </tr>
+    <tr>
+        <td><a href="#machine">Platform</a></td>
+        <td><a href="#panic">Panic Message</a></td>
+        <td><a href="#backtrace">Backtrace</a></td>
+    </tr>
+    <tr>
+        <td><a href="#ps_axl">ps -axl</a></td>
+        <td><a href="#vmstat_s">vmstat -s</a></td>
+        <td><a href="#vmstat_m">vmstat -m</a></td>
+    </tr>
+    <tr>
+        <td><a href="#vmstat_z">vmstat -z</a></td>
+        <td><a href="#vmstat_i">vmstat -i</a></td>
+        <td><a href="#pstat_t">pstat -t</a></td>
+    </tr>
+    <tr>
+        <td><a href="#pstat_s">pstat -s</a></td>
+        <td><a href="#iostat">iostat</a></td>
+        <td><a href="#ipcs_a">ipcs -a</a></td>
+    </tr>
+    <tr>
+        <td><a href="#ipcs_t">ipcs -t</a></td>
+        <td><a href="#nfsstat">nfsstat</a></td>
+        <td><a href="#netstat_s">netstat -s</a></td>
+    </tr>
+    <tr>
+        <td><a href="#netstat_m">netstat -m</a></td>
+        <td><a href="#netstat_id">netstat -id</a></td>
+        <td><a href="#netstat_anr">netstat -anr</a></td>
+    </tr>
+    <tr>
+        <td><a href="#netstat_ana">netstat -ana</a></td>
+        <td><a href="#netstat_al">netstat -al</a></td>
+        <td><a href="#fstat">fstat</a></td>
+    </tr>
+    <tr>
+        <td><a href="#dmesg">dmesg</a></td>
+        <td><a href="#kernelconfig">Kernel config</a></td>
     </tr>
 </table>
+
+<div class="report-data">
+    <a id="crashtype">Crash type</a><br />
+    <textarea wrap="off">${report.crashtype}</textarea><br />
+</div>
+<div class="report-data">
+    <a id="crashdate">Crash date</a><br />
+    <textarea wrap="off">${report.crashdate}</textarea><br />
+</div>
+</div>
+<div class="report-data">
+    <a id="hostname">Hostname</a><br />
+    <textarea wrap="off">${report.hostname}</textarea><br />
+</div>
+<div class="report-data">
+    <a id="ostype">Operating System</a><br />
+    <textarea wrap="off">${report.ostype}</textarea><br />
+</div>
+<div class="report-data">
+    <a id="osrelease">Release</a><br />
+    <textarea wrap="off">${report.osrelease}</textarea><br />
+</div>
+<div class="report-data">
+    <a id="version">Version</a><br />
+    <textarea wrap="off">${report.version}</textarea><br />
+</div>
+<div class="report-data">
+    <a id="machine">Platform</a><br />
+    <textarea wrap="off">${report.machine}</textarea><br />
+</div>
+<div class="report-data">
+    <a id="panic">Panic Message</a><br />
+    <textarea wrap="off">${report.panic}</textarea><br />
+</div>
+<div class="report-data">
+    <a id="backtrace">Backtrace</a><br />
+    <textarea wrap="off">${report.backtrace}</textarea><br />
+</div>
+<div class="report-data">
+    <a id="ps_axl">ps -axl</a><br />
+    <textarea wrap="off">${report.ps_axl}</textarea><br />
+</div>
+<div class="report-data">
+    <a id="vmstat_s">vmstat -s</a><br />
+    <textarea wrap="off">${report.vmstat_s}</textarea><br />
+</div>
+<div class="report-data">
+    <a id="vmstat_m">vmstat -m</a><br />
+    <textarea wrap="off">${report.vmstat_m}</textarea><br />
+</div>
+<div class="report-data">
+    <a id="vmstat_z">vmstat -z</a><br />
+    <textarea wrap="off">${report.vmstat_z}</textarea><br />
+</div>
+<div class="report-data">
+    <a id="vmstat_i">vmstat -i</a><br />
+    <textarea wrap="off">${report.vmstat_i}</textarea><br />
+</div>
+<div class="report-data">
+    <a id="pstat_t">pstat -t</a><br />
+    <textarea wrap="off">${report.pstat_t}</textarea><br />
+</div>
+<div class="report-data">
+    <a id="pstat_s">pstat -s</a><br />
+    <textarea wrap="off">${report.pstat_s}</textarea><br />
+</div>
+<div class="report-data">
+    <a id="iostat">iostat</a><br />
+    <textarea wrap="off">${report.iostat}</textarea><br />
+</div>
+<div class="report-data">
+    <a id="ipcs_a">ipcs -a</a><br />
+    <textarea wrap="off">${report.ipcs_a}</textarea><br />
+</div>
+<div class="report-data">
+    <a id="ipcs_t">ipcs -t</a><br />
+    <textarea wrap="off">${report.ipcs_t}</textarea><br />
+</div>
+<div class="report-data">
+    <a id="nfsstat">nfsstat</a><br />
+    <textarea wrap="off">${report.nfsstat}</textarea><br />
+</div>
+<div class="report-data">
+    <a id="netstat_s">netstat -s</a><br />
+    <textarea wrap="off">${report.netstat_s}</textarea><br />
+</div>
+<div class="report-data">
+    <a id="netstat_m">netstat -m</a><br />
+    <textarea wrap="off">${report.netstat_m}</textarea><br />
+</div>
+<div class="report-data">
+    <a id="netstat_id">netstat -id</a><br />
+    <textarea wrap="off">${report.netstat_id}</textarea><br />
+</div>
+<div class="report-data">
+    <a id="netstat_anr">netstat -anr</a><br />
+    <textarea wrap="off">${report.netstat_anr}</textarea><br />
+</div>
+<div class="report-data">
+    <a id="netstat_ana">netstat -ana</a><br />
+    <textarea wrap="off">${report.netstat_ana}</textarea><br />
+</div>
+<div class="report-data">
+    <a id="netstat_al">netstat -al</a><br />
+    <textarea wrap="off">${report.netstat_al}</textarea><br />
+</div>
+<div class="report-data">
+    <a id="fstat">fstat</a><br />
+    <textarea wrap="off">${report.fstat}</textarea><br />
+</div>
+<div class="report-data">
+    <a id="dmesg">dmesg</a><br />
+    <textarea wrap="off">${report.dmesg}</textarea><br />
+</div>
+<div class="report-data">
+    <a id="kernelconfig">Kernel config</a><br />
+    <textarea wrap="off">${report.kernelconfig}</textarea><br />
+</div>
+
 % if is_developer:
 <p>
     As a developer you can perform the following actions:
     <ul>
         <li><a href="http://0.0.0.0:6543/report/${request.matchdict['id']}/edit_report">Edit Report</a></li>
+        <li><a href="http://0.0.0.0:6543/report/${request.matchdict['id']}/delete_report">Delete Report</a></li>
     </ul>
-Do you think that this report refers correctly to the bug?
+Do you think that this report refers correctly to the bug with ID ${report.bug_id}?
+Yes
+No
 <p>
 % endif
\ No newline at end of file

Modified: soc2012/tzabal/server-side/akcrs-website/akcrs/templates/reports.mako
==============================================================================
--- soc2012/tzabal/server-side/akcrs-website/akcrs/templates/reports.mako	Sun Aug 19 21:31:47 2012	(r240547)
+++ soc2012/tzabal/server-side/akcrs-website/akcrs/templates/reports.mako	Mon Aug 20 02:23:02 2012	(r240548)
@@ -1,24 +1,29 @@
 <%inherit file="base.mako"/>
-<%block name="header">
-    Kernel Crash Reports
+
+<%block name="headerleft">
+Kernel Crash Reports
 </%block>
 
 <p>A list that contains all the crash reports that we have collected.</p>
-<table border="1">
-    <tr>
-        <th>Release</th>
-        <th>Architecture</th>
-        <th>Panic Message</th>
-        <th>More Details</th>
-        <th>Refers to</th>
-    </tr>
+<table id="reports-bugs-tables">
+    <thead>
+        <tr>
+            <th>Received</th>
+            <th>Release</th>
+            <th>Platform</th>
+            <th>Details</th>
+            <th>Refers to</th>
+        </tr>
+    </thead>
+    <tbody>
     % for report in reports:
-    <tr>
-        <td>${report.osrelease}</td>
-        <td>${report.machine}</td>
-        <td>${report.panic}</td>
-        <td><a href="http://0.0.0.0:6543/report/${report.id}">Report</a></td>;
-        <td><a href="http://0.0.0.0:6543/bug/${report.bug_id}">Bug</a></td>;
-    </tr>
+        <tr>
+            <td>${str(report.received_datetime)[:10]}</td>
+            <td>${report.osrelease}</td>
+            <td>${report.machine}</td>
+            <td><a href="/reports/${report.id}">Report</a></td>
+            <td><a href="/bugs/${report.bug_id}">Bug</a></td>
+        </tr>
     % endfor
-</table>
\ No newline at end of file
+    </tbody>
+</table>

Modified: soc2012/tzabal/server-side/akcrs-website/akcrs/views.py
==============================================================================
--- soc2012/tzabal/server-side/akcrs-website/akcrs/views.py	Sun Aug 19 21:31:47 2012	(r240547)
+++ soc2012/tzabal/server-side/akcrs-website/akcrs/views.py	Mon Aug 20 02:23:02 2012	(r240548)
@@ -52,13 +52,50 @@
 @view_config(route_name='logout')
 def logout(request):
     logged_in = authenticated_userid(request)
+    goto = request.route_url('index')
     if not logged_in:
-        goto = request.route_url('index')
         return HTTPFound(location=goto)
     headers = forget(request)
-    goto = request.route_url('index')
     return HTTPFound(location=goto, headers=headers)
+
+
+@view_config(route_name='account', renderer='account.mako')
+def account(request):
+    logged_in = authenticated_userid(request)
+    return {'logged_in': logged_in}
+
+@view_config(route_name='change_password', renderer='change_password.mako')
+def change_password(request):
+    logged_in = authenticated_userid(request)
+    goto = request.route_url('index')
+    if not logged_in:
+        # change it to HTTPForbidden
+        return HTTPFound(location=goto)
+    
+    result = False
+    if request.method == 'POST':
+        curr = request.POST.get('current_password')
+        new1 = request.POST.get('new_password_1')
+        new2 = request.POST.get('new_password_2')
+        
+        if curr and new1 and new2:
+            if new1 == new2:
+                query = DBSession.query(User).filter(User.email == logged_in)
+                try:
+                    user = query.one()
+                except:
+                    pass # either no such email in db or more than 2 times in db!
+                else:
+                    hashcurr = hashlib.sha256()
+                    hashcurr.update(curr)
+                    if user.password == hashcurr.hexdigest():
+                        hashnew = hashlib.sha256()
+                        hashnew.update(new1)
+                        user.password = hashnew.hexdigest()
+                        DBSession.flush()
+                        result = True
     
+    return {'result': result, 'logged_in': logged_in}
 
 
 @view_config(route_name='reports', renderer='reports.mako')
@@ -87,6 +124,11 @@
     return {}
 
 
+@view_config(route_name='delete_report', renderer='delete_report.mako')
+def delete_report(request):
+    return {}
+
+
 @view_config(route_name='bugs', renderer='bugs.mako')
 def bugs(request):
     logged_in = authenticated_userid(request)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120820022303.0376B106566B>