Commits

Andreas Stenius committed f82d1ab

Working on zmr model for repo logs

  • Participants
  • Parent commits 5b13309

Comments (0)

Files changed (5)

 %    process_flag(trap_exit, true),
 %    {context, Context} = proplists:lookup(context, Args),
     z_datamodel:manage(?MODULE, datamodel(), Context),
+    z_path:files_subdir_ensure("zmr_repos", Context),
 %    {ok, #state{context = z_context:new(Context)}}.
     ok.
 

File models/m_zmr.erl

 			    undefined
 		    end
 	    end
-    end.
+    end;
 
-%m_find_value(_, _, _) -> undefined.
+m_find_value(log, #m{value={repo, Id}}=M, _Context) ->
+    M#m{value={repo_log, ["example data", "should retreive this", "from the source repo", "in a suitable format"]}}.
+
+%m_find_value(exist, #m{value={repo, Id}}=M, Context) ->
+    
+
+
+
+m_to_list(#m{value={repo_log, Log}}, _Context) ->
+    Log;
 
 m_to_list(_, _) ->
     undefined.
 
-m_value(_, _) ->
-    undefined.
 
+m_value(#m{value={repo, Id}}, _Context) ->
+    Id.
 
 
 
+

File templates/_admin_edit_content.zmr_release.tpl

 
 {% with m.rsc[id] as r %}
 <div class="item-wrapper">
-<h3 class="above-item clearfix">
-<span class="title">{_ ZMR Release _}</span>
-</h3>
+	<h3 class="above-item clearfix">
+		<span class="title">{_ ZMR Release _}</span>
+	</h3>
 
-<div class="item">
-<fieldset class="admin-form">
+	<div class="item">
+		<fieldset class="admin-form">
+		<div class="form-item clearfix">
+			<label for="zmr_branch">{_ Branch/Revision/Changeset _}</label>
+			<input id="zmr_branch" type="text" name="zmr_branch" value="{{ r.zmr_branch }}" />
+			
+			{% button 
+				text=_"Show log" 
+				action={dialog_open 
+					title="Select branch from log" 
+					template="_zmr_select_branch.tpl" 
+					repo=r.zmr_module_release|first 
+					target="zmr_branch"
+				} 
+			%}
 
-<div class="form-item clearfix">
-<label for="zmr_branch">{_ Branch/Revision/Changeset _}</label>
-<input id="zmr_branch" type="text" name="zmr_branch" value="{{ r.zmr_branch }}" style="width: 80%" />
-<br />
-{% button text=_"Show log" action={dialog_open title="Select branch from log" template="_zmr_select_branch.tpl" target="zmr_branch"} %}
-</div>
+			
+			{% include "_admin_save_buttons.tpl" %}
 
-
-</fieldset>
-</div>
-
+		</div>
+		</fieldset>
+	</div>
 </div>
 {% endwith %}

File templates/_zmr_log_entry.tpl

+Log: <a id={{#entry}} href="javascript:void(0)">{{entry}}</a><br />
+{% wire id=#entry
+	type="click" 
+	action={set_value target=target value=entry} 
+	action={dialog_close} 
+%}

File templates/_zmr_select_branch.tpl

-select branch, target: {{ target }}
+{% for entry in m.zmr.repo[repo].log %}
+	{% include "_zmr_log_entry.tpl" entry=entry target=target %}
+{% empty %}
+	No history.
+{% endfor %}
 
-{% print m.zmr.repo.zmr_repository %}