Puria Nafisi Azizi avatar Puria Nafisi Azizi committed a5ff4ff

Restyling of the application and added some missing info in the contest page

Comments (0)

Files changed (7)

fbcontest/controllers/root.py

     __hide_fields__ = ['uid', 'likes', 'contest_id', 'contest']
     __field_widget_types__ = {'image':FileField}
     __field_validator_types__ = {'image':FieldStorageUploadConverter}
-    __require_fields__ = ['image', 'contest', 'title', 'description']
+    __require_fields__ = ['name', 'image', 'contest', 'description']
+    __field_order__ =  ['name', 'image', 'contest', 'description']
+
 add_contest_item_form = AddContestItemForm(DBSession)
 
 class ContestsController(EasyCrudRestController):

fbcontest/public/css/style.css

     padding-left: 40px;
     background: url('/_pluggable/fbcontest/images/Upload.png') no-repeat;
     margin-bottom: 16px;
+    float: right;
 }
 
 #fbcontest_add_photo_btn a {
 
 .fbcontest_item {
     margin-bottom: 30px;
+    margin-top: 40px;
 }
 
 .fbcontest_item_img {
     min-height: 128px;
 }
 
+.fbcontest_item_description {
+    margin-top: 10px;
+    color: #666666;
+    font-size: 12px;
+}
+
 .fbcontest_clear {
     clear: left;
 }
 
 .fbcontest_item_title {
-    font-size: 24px;
+    font-weight: bolder;
+    font-size: 22px;
+    color: #333333;
+    margin-bottom: 10px;
 }
 
-.fbcontest_item_votes {
-    font-size: 16px;
-    font-style: italic;
-    margin-bottom: 16px;
-}
-
Add a comment to this file

fbcontest/public/images/Upload.png

Old
Old image
New
New image

fbcontest/templates/contest.html

         </div>
 
         <div py:for="item in contest.items" class="fbcontest_item">
+            <div class="fbcontest_votes_container">
+               <div class="fbcontest_votes">
+                   ${item.likes} votes
+               </div>
+            </div>
             <div class="fbcontest_item_img">
                 <img src="${item.image.thumb_url}" />
             </div>
             <div class="fbcontest_item_info">
                 <div class="fbcontest_item_title">${item.name}</div>
-                <div class="fbcontest_item_votes">${item.likes} Votes</div>
                 <div class="fbcontest_item_like">
                     <div class="fb-like" data-href="${request.host_url + h.plug_url('fbcontest', '/contest/%s#%s' %(item.contest.uid, item.uid))}" data-send="false" data-width="450" data-show-faces="false"></div>
                 </div>
+                <div class="fbcontest_item_description">${item.description}</div>
             </div>
             <div class="fbcontest_clear"></div>
         </div>

fbcontest/templates/newitem.html

 <xi:include href="master.html" />
 <head>
     <title>New Contest Photo</title>
+    <style>
+      #crud_content input, #crud_content textarea {
+        margin-left: 5px;
+        margin-bottom: 5px;
+        border: 1px solid #BBBBBB;
+        padding: 3px 10px;
+      }
+
+      #crud_content input[type="text"] {
+        background: none repeat scroll 0 0 #F4F4F4;
+        width: 160px;
+      }
+
+      #crud_content input[type="submit"] {
+        background: none repeat scroll 0 0 #545E7E;
+        color: white;
+      }
+    </style>
 </head>
 <body>
     <div id="crud_content">
         </div>
     </div>
 </body>
-</html>
+</html>

tgapp_fbcontest.egg-info/PKG-INFO

-Metadata-Version: 1.0
-Name: tgapp-fbcontest
-Version: 0.1
-Summary: UNKNOWN
-Home-page: UNKNOWN
-Author: UNKNOWN
-Author-email: UNKNOWN
-License: UNKNOWN
-Description: About fbcontest
-        -------------------------
-        
-        fbcontest is a Pluggable application for TurboGears2 to let people have photo contests 
-        and let them vote and rate by facebook likes
-        
-        Installing
-        -------------------------------
-        
-        fbcontest can be installed both from pypi or from bitbucket::
-        
-            easy_install fbcontest
-        
-        should just work for most of the users
-        
-        Plugging fbcontest
-        ----------------------------
-        
-        In your application *config/app_cfg.py* import **plug**::
-        
-            from tgext.pluggable import plug
-        
-        Then at the *end of the file* call plug with registration::
-        
-            plug(base_config, 'fbcontest')
-        
-        You will be able to access the registration process at
-        *http://localhost:8080/fbcontest*.
-        
-        Available Hooks
-        ----------------------
-        
-        fbcontest makes available a some hooks which will be
-        called during some actions to alter the default
-        behavior of the appplications:
-        
-        Exposed Partials
-        ----------------------
-        
-        fbcontest exposes a bunch of partials which can be used
-        to render pieces of the blogging system anywhere in your
-        application:
-        
-        Exposed Templates
-        --------------------
-        
-        The templates used by registration and that can be replaced with
-        *tgext.pluggable.replace_template* are:
-        
-        
-Keywords: turbogears2.application
-Platform: UNKNOWN

tgapp_fbcontest.egg-info/SOURCES.txt

-MANIFEST.in
-setup.py
-fbcontest/__init__.py
-fbcontest/bootstrap.py
-fbcontest/helpers.py
-fbcontest/partials.py
-fbcontest/controllers/__init__.py
-fbcontest/controllers/root.py
-fbcontest/lib/__init__.py
-fbcontest/model/__init__.py
-fbcontest/model/models.py
-fbcontest/public/__init__.py
-fbcontest/public/css/style.css
-fbcontest/public/images/contest.jpg
-fbcontest/public/images/star.png
-fbcontest/templates/__init__.py
-fbcontest/templates/contest.html
-fbcontest/templates/contests_partial.html
-fbcontest/templates/index.html
-fbcontest/templates/little_partial.html
-tgapp_fbcontest.egg-info/PKG-INFO
-tgapp_fbcontest.egg-info/SOURCES.txt
-tgapp_fbcontest.egg-info/dependency_links.txt
-tgapp_fbcontest.egg-info/entry_points.txt
-tgapp_fbcontest.egg-info/not-zip-safe
-tgapp_fbcontest.egg-info/paster_plugins.txt
-tgapp_fbcontest.egg-info/requires.txt
-tgapp_fbcontest.egg-info/top_level.txt
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.