create.view 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. @Title{Projects}@
  2. @JavaScript{
  3. function HideUploadFields(){
  4. $("#fileDiv").hide();
  5. $("#linkDiv").hide();
  6. }
  7. $(function(){
  8. HideUploadFields();
  9. $("input[name=type]").change(function(e){
  10. var value=$(this).val();
  11. HideUploadFields();
  12. $("#"+value+"Div").show();
  13. });
  14. });
  15. }@
  16. @ButtonsRight{
  17. <button name="submitProject" value="yes" type="submit" form="projectForm">
  18. +
  19. </button>
  20. }@
  21. @Body{
  22. <h3>Title</h3>
  23. <form action="" method="post" id="projectForm">
  24. <input name="title" style="width:100%" value="<?=$project->ProjectTitle?>" />
  25. <h3>Description</h3>
  26. <textarea name="description" style="width:100%"><?=$project->ProjectDescription?></textarea>
  27. <h3>Logo/Icon</h3>
  28. <label for="icon">File: </label><input type="file" name="icon" id="icon" />
  29. <h3>Screenshots</h3>
  30. <label for="screenshot">File: </label><input type="file" name="screenshot" id="screenshot" />
  31. <h3>Project Type</h3>
  32. <input type="radio" name="type" id="typeDownload" value="file" /><label for="typeDownload">Download</label>
  33. <br/>
  34. <input type="radio" name="type" id="typeLink" value="link" /><label for="typeLink">Link</label>
  35. <div id="linkDiv">
  36. <label for="link">Link: </label>
  37. <input name="link" id="link"/>
  38. </div>
  39. <div id="fileDiv">
  40. <label for="file">File: </label>
  41. <input type="file" name="file" id="file" />
  42. </div>
  43. </form>
  44. }@