Changeset 1083
- Timestamp:
- 12/21/09 14:03:40 (2 years ago)
- Location:
- trunk
- Files:
-
- 12 edited
-
common/common.php (modified) (1 diff)
-
common/tags.php (modified) (1 diff)
-
www/controllers/task.php (modified) (1 diff)
-
www/controllers/task_tags.php (modified) (2 diffs)
-
www/index.php (modified) (1 diff)
-
www/static/css/screen.css (modified) (2 diffs)
-
www/static/css/wick.css (modified) (1 diff)
-
www/static/js/inline_form.js (modified) (1 diff)
-
www/url.php (modified) (1 diff)
-
www/views/tags_header.php (modified) (5 diffs)
-
www/views/task_edit.php (modified) (1 diff)
-
www/views/task_tags.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/common/common.php
r1079 r1083 47 47 define("IA_RE_ROUND_ID", '[a-z0-9][a-z0-9_\-\.]*'); 48 48 define("IA_RE_TASK_ID", '(?-i:[a-z0-9][a-z0-9_\-\.]*)'); 49 define("IA_RE_TAG_NAME", '[a-z0-9\-\.\ \@ ]+');49 define("IA_RE_TAG_NAME", '[a-z0-9\-\.\ \@\(\)]+'); 50 50 define("IA_RE_SCORE_NAME", '[a-z0-9][a-z0-9_\-\.]*'); 51 51 define("IA_RE_USER_NAME", '[_@a-z0-9][a-z0-9_\-\.\@]*'); -
trunk/common/tags.php
r1081 r1083 62 62 foreach ($parent_tags as $key => $tag) { 63 63 $parent_tags[$key]['sub_tags'] = Array(); 64 $parent_tags_key[ $tag['tag_id']] = $key;64 $parent_tags_key[$tag['tag_id']] = $key; 65 65 } 66 66 67 67 foreach ($sub_tags as $tag) { 68 log_assert(isset($parent_tags_key[ $tag['tag_parent']]), "Child tag doesn't have a parent");69 $parent_tag_key = $parent_tags_key[ $tag['tag_parent']];70 $parent_tags[ $parent_tag_key]['sub_tags'][] = $tag;68 log_assert(isset($parent_tags_key[$tag['tag_parent']]), "Child tag doesn't have a parent"); 69 $parent_tag_key = $parent_tags_key[$tag['tag_parent']]; 70 $parent_tags[$parent_tag_key]['sub_tags'][] = $tag; 71 71 } 72 72 -
trunk/www/controllers/task.php
r1082 r1083 66 66 // Tag data 67 67 $tag_types = Array('author', 'contest', 'year', 'round', 'age_group'); 68 $tag_parents = Array('year' => 'contest', 'round' => 'year' , 'age_group' => 'contest');68 $tag_parents = Array('year' => 'contest', 'round' => 'year'); 69 69 70 70 // FIXME: tags that have children such as contest, year or round should have only one tag -
trunk/www/controllers/task_tags.php
r1080 r1083 12 12 $category["sub_tags"] = tag_get_all(array("algorithm"), 13 13 $category["id"]); 14 foreach ($category["sub_tags"] as &$tag) { 15 $tag["task_count"] = tag_count_objects("task", array($tag["id"])); 16 } 14 17 } 15 18 … … 69 72 } 70 73 74 // Do not delete tags if they have been added to tasks. 75 if ($tag["type"] == "algorithm") { 76 $task_count = tag_count_objects("task", array($tag_id)); 77 } else if ($tag["type"] == "method") { 78 $task_count = 0; 79 $sub_tags = tag_get_all(array("algorithm"), $tag_id); 80 foreach ($sub_tags as $sub_tag) { 81 $task_count += tag_count_objects("task", array($sub_tag["id"])); 82 } 83 } 84 if ($task_count != 0) { 85 flash_error("Nu poti sterge un tag care a fost asociat deja unei probleme."); 86 redirect(url_task_tags()); 87 } 88 71 89 tag_delete_by_id($tag_id); 72 90 flash("Tag-ul a fost sters."); -
trunk/www/index.php
r1081 r1083 96 96 97 97 // Task algorithm tags 98 else if ($page == 'admin/task _tags') {98 else if ($page == 'admin/task-tags') { 99 99 require_once(IA_ROOT_DIR.'www/controllers/task_tags.php'); 100 100 if (request("action") == "add") { -
trunk/www/static/css/screen.css
r1082 r1083 552 552 553 553 input[type='text'], input[type='password'], select { 554 width: 150px;554 width: 250px; 555 555 } 556 556 … … 1524 1524 1525 1525 /* Task algorithm tags page */ 1526 .task _tag_actions {1526 .task-tag-actions { 1527 1527 margin: 0.5em; 1528 1528 } 1529 ul.task _tag_actions li {1529 ul.task-tag-actions li { 1530 1530 display: inline; 1531 1531 } 1532 1533 .tag-table .tag-task-count { 1534 width: 20%; 1535 } 1536 .tag-table .tag-operations { 1537 width: 25%; 1538 } -
trunk/www/static/css/wick.css
r852 r1083 28 28 color:black; 29 29 padding: 0; 30 width: 257px; 30 31 } 31 32 -
trunk/www/static/js/inline_form.js
r1080 r1083 6 6 var initialText = toggleElement.innerHTML; 7 7 formElement.style.display = "none"; 8 connect(toggleElement, "onclick", function() { 8 connect(toggleElement, "onclick", function(e) { 9 e.preventDefault(); 9 10 if (formElement.style.display == "none") { 10 11 // Display inline form and replace toggleElement with "Anuleaza" -
trunk/www/url.php
r1081 r1083 272 272 273 273 function url_task_tags() { 274 return url_complex("admin/task _tags");274 return url_complex("admin/task-tags"); 275 275 } 276 276 277 277 function url_task_tags_add() { 278 return url_complex("admin/task _tags", array("action" => "add"));278 return url_complex("admin/task-tags", array("action" => "add")); 279 279 } 280 280 281 281 function url_task_tags_delete() { 282 return url_complex("admin/task _tags", array("action" => "delete"));282 return url_complex("admin/task-tags", array("action" => "delete")); 283 283 } 284 284 285 285 function url_task_tags_rename() { 286 return url_complex("admin/task _tags", array("action" => "rename"));286 return url_complex("admin/task-tags", array("action" => "rename")); 287 287 } 288 288 -
trunk/www/views/tags_header.php
r1078 r1083 9 9 // Format a tag input box 10 10 // FIXME: Width parameter does not work, I hate CSS 11 function tag_format_input_box($field, $value = null, $width = "50", $name = "tags" , $autocomplete = true) {11 function tag_format_input_box($field, $value = null, $width = "50", $name = "tags") { 12 12 $esc_name = html_escape($field['name']); 13 13 $esc_width = html_escape($width); … … 16 16 $output = '<li><label for="form_'.$esc_name.'">'.$field['label'].'</label>'; 17 17 $output .= ferr_span($name); 18 $output .= '<input class="wickEnabled " type="text" name="'.$esc_name.18 $output .= '<input class="wickEnabled:wick_'.$name.'" type="text" name="'.$esc_name. 19 19 '" id="form_'.$esc_name.'"'; 20 20 if (!is_null($width)) { … … 24 24 $output .= ' value="'.$value.'"'; 25 25 } 26 $output .= ' />'; 27 $output .= '<script type="text/javascript" language="JavaScript" src="'. 28 html_escape(url_static("js/wick.js")).'"></script>'; 26 $output .= ' autocomplete="off" />'; 27 $output .= '<table id="wick_'.$name.'" class="floater"><tr><td><div class="wick_content"></div></td></tr></table>'; 29 28 $output .= "</li>"; 30 29 return $output; … … 34 33 <link rel="stylesheet" type="text/css" href="<?= html_escape(url_static("css/wick.css")) ?> " /> 35 34 <script type="text/javascript" language="JavaScript"> 35 /* <![CDATA[ */ 36 36 function checkForm() { 37 37 answer = true; … … 49 49 echo "];\n"; 50 50 ?> 51 /* ]]> */ 51 52 </script> 53 <script type="text/javascript" language="JavaScript" src="<?php echo html_escape(url_static("js/wick.js")) ?>"></script> -
trunk/www/views/task_edit.php
r1081 r1083 146 146 <?php 147 147 foreach (array_keys($tag_fields) as $tag) { 148 echo tag_format_input_box($tag_fields[$tag], fval('tag_'.$tag), 50, 'tag_'.$tag , false);148 echo tag_format_input_box($tag_fields[$tag], fval('tag_'.$tag), 50, 'tag_'.$tag); 149 149 } 150 150 ?> -
trunk/www/views/task_tags.php
r1082 r1083 46 46 array( 47 47 'title' => 'Tag', 48 'rowform' => 'format_tag_name' 48 'rowform' => 'format_tag_name', 49 'css_class' => 'tag-name', 50 ), 51 array( 52 'title' => 'Numar probleme', 53 'key' => 'task_count', 54 'css_class' => 'tag-task-count', 49 55 ), 50 56 array( 51 57 'title' => 'Operatii', 52 58 'rowform' => 'format_operations', 59 'css_class' => 'tag-operations', 53 60 ), 54 61 ); … … 57 64 58 65 <h1>Editare taguri algoritmi</h1> 59 <div id="add_category" class="task _tag_actions">66 <div id="add_category" class="task-tag-actions"> 60 67 [<a href="#">Adauga categorie noua</a><?php 61 68 echo inline_post_form(url_task_tags_add(), array("type" => "method"), "", "Adauga"); … … 66 73 ?> 67 74 <h2><?php echo html_escape($category["name"]); ?></h2> 68 <ul class="task _tag_actions">75 <ul class="task-tag-actions"> 69 76 <li class="algorithm_tag_add">[<a class="toggle_add" href="#">Adauga tag nou</a><?php 70 77 echo inline_post_form(url_task_tags_add(), … … 82 89 <?php 83 90 echo format_table($category["sub_tags"], $column_infos, 84 array('css_class' => 'category fill-screen '));91 array('css_class' => 'category fill-screen tag-table')); 85 92 ?> 86 93 <?php
Note: See TracChangeset
for help on using the changeset viewer.
![[infoarena] development](/chrome/site/logo.png)